feat: xxbb
This commit is contained in:
@@ -70,6 +70,43 @@ Artisan::command('telegram:set-webhook {url?} {--agent= : Agent user id}', funct
|
||||
return 1;
|
||||
})->purpose('Register Telegram webhook (official or --agent=ID)');
|
||||
|
||||
Artisan::command('xxbb:build {--channel-c=} {--random-c}', function () {
|
||||
$channelC = trim((string) $this->option('channel-c'));
|
||||
$random = (bool) $this->option('random-c');
|
||||
try {
|
||||
$result = app(\App\Services\ChannelProjectService::class)->buildSharedArtifacts(
|
||||
$channelC !== '' ? $channelC : null,
|
||||
$random,
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$c = (string) data_get($result, 'seeds.channel_c', '');
|
||||
$this->info('XXBB_CHANNEL_C='.$c);
|
||||
$this->info('details -> /details/');
|
||||
$staged = (string) ($result['staged_weifile'] ?? '');
|
||||
if ($staged !== '') {
|
||||
$this->info('staged weifile -> '.$staged);
|
||||
}
|
||||
$this->line('domains:');
|
||||
$domains = array_values((array) data_get($result, 'domains.deployment', []));
|
||||
if ($domains === []) {
|
||||
$this->warn('(empty)');
|
||||
}
|
||||
foreach ($domains as $i => $domain) {
|
||||
$this->line(sprintf(' %03d %s', $i + 1, $domain));
|
||||
}
|
||||
$configured = strtolower(trim((string) config('coruna.xxbb.channel_c', '')));
|
||||
if ($c !== '' && $configured !== $c) {
|
||||
$this->warn('把上面的 XXBB_CHANNEL_C 写入 .env,新建设备才能按 IP 归因到渠道。');
|
||||
}
|
||||
|
||||
return 0;
|
||||
})->purpose('Build shared xxbb /details and staged weifile from channel c');
|
||||
|
||||
Artisan::command('coruna:channel-domains {--json}', function () {
|
||||
$domains = array_values(array_filter(config('coruna.channel_domains', [])));
|
||||
if ($this->option('json')) {
|
||||
|
||||
Reference in New Issue
Block a user