feat: Add check_proxmox.php for Proxmox server configuration retrieval
This commit is contained in:
21
check_proxmox.php
Normal file
21
check_proxmox.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
require '/var/www/paymenter/vendor/autoload.php';
|
||||||
|
$app = require '/var/www/paymenter/bootstrap/app.php';
|
||||||
|
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||||
|
|
||||||
|
// Check Server model for Proxmox config
|
||||||
|
$server = \App\Models\Server::where('extension', 'Proxmox')->first();
|
||||||
|
if ($server) {
|
||||||
|
echo 'Server model found: ' . $server->name . PHP_EOL;
|
||||||
|
$settings = $server->settings->pluck('value', 'key')->toArray();
|
||||||
|
foreach ($settings as $k => $v) {
|
||||||
|
if (stripos($k, 'token') !== false || stripos($k, 'password') !== false || stripos($k, 'secret') !== false) {
|
||||||
|
$settings[$k] = substr($v ?? '', 0, 8) . '...';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo 'Settings: ' . json_encode($settings, JSON_PRETTY_PRINT) . PHP_EOL;
|
||||||
|
} else {
|
||||||
|
echo 'Server not found' . PHP_EOL;
|
||||||
|
$all = \App\Models\Server::pluck('name', 'extension');
|
||||||
|
echo 'Available: ' . json_encode($all, JSON_PRETTY_PRINT) . PHP_EOL;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user