-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: work in progress query command and add bp:telemetry command
- Loading branch information
Showing
6 changed files
with
95 additions
and
31 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
app/Console/Commands/BlueprintFramework/TelemetryCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Pterodactyl\Console\Commands\BlueprintFramework; | ||
|
||
use Illuminate\Console\Command; | ||
use Symfony\Component\VarDumper\VarDumper; | ||
use Pterodactyl\Services\Telemetry\BlueprintTelemetryCollectionService; | ||
|
||
|
||
class TelemetryCommand extends Command | ||
{ | ||
protected $description = 'Displays all the data that would be sent to the Blueprint Telemetry Service if telemetry collection is enabled'; | ||
protected $signature = 'bp:telemetry'; | ||
|
||
/** | ||
* TelemetryCommand constructor. | ||
*/ | ||
public function __construct( | ||
private BlueprintTelemetryCollectionService $blueprintTelemetryCollectionService, | ||
) { | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Handle execution of command. | ||
*/ | ||
public function handle() | ||
{ | ||
VarDumper::dump($this->blueprintTelemetryCollectionService->collect()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
Command() { | ||
if [[ $1 == "" ]]; then PRINT FATAL "Expected 1 argument but got 0.";exit 2;fi | ||
|
||
PRINT INFO "Searching and validating framework dependencies.." | ||
# Check if required programs and libraries are installed. | ||
depend | ||
|
||
PRINT INFO "Extracting extension.." | ||
dev=false | ||
n="$1" | ||
|
||
if [[ $n == *".blueprint" ]]; then n="${n::-10}";fi | ||
FILE="${n}.blueprint" | ||
|
||
if [[ ! -f "$FILE" ]]; then PRINT FATAL "$FILE could not be found or detected.";return 2;fi | ||
|
||
ZIP="${n}.zip" | ||
cp "$FILE" ".blueprint/tmp/$ZIP" | ||
cd ".blueprint/tmp" || cdhalt | ||
unzip -o -qq "$ZIP" | ||
rm "$ZIP" | ||
if [[ ! -f "$n/*" ]]; then | ||
cd ".." || cdhalt | ||
rm -R "tmp" | ||
mkdir -p "tmp" | ||
cd "tmp" || cdhalt | ||
|
||
mkdir -p "./$n" | ||
cp "../../$FILE" "./$n/$ZIP" | ||
cd "$n" || cdhalt | ||
unzip -o -qq "$ZIP" | ||
rm "$ZIP" | ||
cd ".." || cdhalt | ||
fi | ||
|
||
# Return to the Pterodactyl installation folder. | ||
cd "$FOLDER" || cdhalt | ||
|
||
# Get all strings from the conf.yml file and make them accessible as variables. | ||
if [[ ! -f ".blueprint/tmp/$n/conf.yml" ]]; then | ||
# Quit if the extension doesn't have a conf.yml file. | ||
rm -R ".blueprint/tmp/$n" | ||
PRINT FATAL "Extension configuration file not found or detected." | ||
return 1 | ||
fi | ||
|
||
eval "$(parse_yaml .blueprint/tmp/"${n}"/conf.yml conf_)" | ||
|
||
echo $conf__ | ||
|
||
echo -e \ | ||
"\x1b[37;1mnebula.blueprint\x1b[0m" | ||
|
||
rm -R ".blueprint/tmp/$n" | ||
|
||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters