Telemetry ID is now replaced with a Panel ID.

This ID contains a random string and the version of Blueprint and will be used for API calls and telemetry once that has been added.
This commit is contained in:
purple 2023-05-31 10:40:03 +02:00
parent 6594ac6815
commit 839b602b6c
6 changed files with 13 additions and 16 deletions

View file

@ -47,6 +47,8 @@ class BlueprintExtensionController extends Controller
$this->bplib->notify("Console command sent.");
$this->bp->dbSet('developer:log', shell_exec("cd /var/www/".$this->placeholderservice->folder().";".$this->bp->dbGet('developer:cmd')));
};
if ($this->settings->get('blueprint::panel:id') == "") { $this->settings->set('blueprint::panel:id', uniqid(rand())."@".$this->version()); };
return $this->view->make(
'admin.extensions.blueprint.index', [
'version' => $this->version,

View file

@ -18,8 +18,6 @@ class BlueprintSettingsFormRequest extends AdminFormRequest
'developer:cmd' => 'string',
'telemetry' => 'string',
'api:endpoint' => 'string',
];
}
@ -32,8 +30,6 @@ class BlueprintSettingsFormRequest extends AdminFormRequest
'developer:cmd' => 'Developer Command',
'telemetry' => 'Telemetry',
'api:endpoint' => 'API Endpoint',
];
}
}

View file

@ -14,12 +14,12 @@ class BlueprintTelemetryService
public function send($event) {
if ($this->settings->get('blueprint::telemetry') == "") { $this->settings->set('blueprint::telemetry', "true"); };
if ($this->settings->get('blueprint::telemetry') == "false") { return; };
if ($this->settings->get('blueprint::telemetry:id') == "") { $this->settings->set('blueprint::telemetry:id', uniqid(rand())); };
/*
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://relay.ptero.shop:3511/send/'.$this->settings->get('blueprint::telemetry:id')."/".$event."/",
CURLOPT_URL => 'http://relay.ptero.shop:3511/send/'.$this->settings->get('blueprint::panel:id')."/".$event."/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
@ -31,7 +31,9 @@ class BlueprintTelemetryService
$response = curl_exec($curl);
curl_close($curl);
curl_close($curl);*/
// telemetry will be revived sometime in the future.
return;
}
}

View file

@ -14,7 +14,7 @@ class BlueprintVariableService
}
// $bp->server()
// $bp->serve()
// $bp->version()
// $bp->dbGet('db::record')
// $bp->dbSet('db::record', 'value')

View file

@ -22,11 +22,11 @@ class CreateBlueprintTable extends Migration
$table->string('developer:cmd')->nullable();
$table->string('developer:log')->nullable();
$table->string('api:endpoint')->nullable();
$table->string('telemetry')->nullable();
$table->string('telemetry:id')->nullable();
$table->string('panel:id')->nullable();
$table->string('notification:text')->nullable();
$table->timestamp('timestamp')->useCurrent()->onUpdate(null);

View file

@ -75,12 +75,9 @@
<p class="text-muted small">Automatically share anonymous usage data with Blueprint.</p>
</div>
<div class="col-xs-4">
<label class="control-label">Endpoint</label>
<select class="form-control" name="api:endpoint" readonly>
<option value="api.ptero.shop">api.ptero.shop (default)</option>
<option value="none" @if($bp->dbGet('api:endpoint') == "none") selected @endif>none</option>
</select>
<p class="text-muted small">Select your preferred API endpoint.</p>
<label class="control-label">ID</label>
<input type="text" required name="panel:id" id="panel:id" value="{{ $bp->dbGet('panel:id') }}" class="form-control" readonly/>
<p class="text-muted small">Randomly generated string with your version that is used as a panel identifier.</p>
</div>
<div class="col-xs-4">
<label class="control-label">Developer Mode</label>