From ad30453922302315bd597f5c5b69eb3142fb68e9 Mon Sep 17 00:00:00 2001 From: hashbro Date: Sun, 9 Aug 2026 22:05:47 +0800 Subject: [PATCH] fix: ios 16 --- .env.example | 4 +--- README.md | 2 +- app/Models/Channel.php | 9 ++------- config/coruna.php | 3 +-- docs/BAOTA_DEPLOY.md | 6 ++---- resources/views/admin/channels/index.blade.php | 2 +- tests/Feature/ChannelProjectServiceTest.php | 3 --- 7 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.env.example b/.env.example index e661436..2f02256 100644 --- a/.env.example +++ b/.env.example @@ -57,9 +57,7 @@ CORUNA_CHANNEL_BUILDER_PYTHON= CORUNA_ARTIFACT_ROOT= CORUNA_CHANNEL_STATE_ROOT= CORUNA_CHANNEL_BUILDER_TIMEOUT=600 -# Optional complete origin/base path prepended before /web/{id}/support.html -# Same-host: leave empty or set to APP_URL -CORUNA_STATIC_SITE_BASE_URL= +# Scheme for support links built from CORUNA_LAB_CHANNEL_DOMAINS CORUNA_STATIC_SITE_SCHEME=https # Max channel links per agent (super-admin settings can override) CORUNA_MAX_CHANNELS_PER_AGENT=5 diff --git a/README.md b/README.md index 90d709c..08dd1f6 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ CORUNA_CHANNEL_BUILDER_PYTHON=/path/to/channel-builder/.venv/bin/python # CORUNA_ARTIFACT_ROOT= # CORUNA_CHANNEL_STATE_ROOT= CORUNA_CHANNEL_BUILDER_TIMEOUT=600 -CORUNA_STATIC_SITE_BASE_URL=https://admin.example.com +CORUNA_LAB_CHANNEL_DOMAINS=cdn.example.com ``` 同机时 Admin 站点 `public/` 即静态根;DGA 域名反代到同一 `public/`: diff --git a/app/Models/Channel.php b/app/Models/Channel.php index 1f6a8d2..0c48fbe 100644 --- a/app/Models/Channel.php +++ b/app/Models/Channel.php @@ -47,8 +47,8 @@ class Channel extends Model } /** - * Domains for support-link display and builder channel hosts. - * Channel row wins; otherwise CORUNA_LAB_CHANNEL_DOMAINS. + * Domains for support-link display. + * Channel row wins; otherwise CORUNA_LAB_CHANNEL_DOMAINS (system settings). * * @return list */ @@ -90,11 +90,6 @@ class Channel extends Model { $links = []; $path = '/web/'.$this->channel_id.'/support.html'; - $baseUrl = rtrim((string) config('coruna.static_site.base_url', ''), '/'); - if ($baseUrl !== '') { - $links[] = $baseUrl.$path; - } - $scheme = trim((string) config('coruna.static_site.scheme', 'https')) ?: 'https'; foreach ($this->resolvedDomains() as $domain) { $origin = rtrim($domain, '/'); diff --git a/config/coruna.php b/config/coruna.php index be3fd7d..b128c3e 100644 --- a/config/coruna.php +++ b/config/coruna.php @@ -14,8 +14,7 @@ return [ 'deployment_domains' => $channelDomains, 'reporting_domains' => $reportingDomains, 'static_site' => [ - // Optional complete origin/base path prepended before /web/{id}/support.html. - 'base_url' => rtrim((string) env('CORUNA_STATIC_SITE_BASE_URL', ''), '/'), + // Scheme used when CORUNA_LAB_CHANNEL_DOMAINS entries omit https://. 'scheme' => env('CORUNA_STATIC_SITE_SCHEME', 'https'), ], 'channel_builder' => [ diff --git a/docs/BAOTA_DEPLOY.md b/docs/BAOTA_DEPLOY.md index 201e232..dd43918 100644 --- a/docs/BAOTA_DEPLOY.md +++ b/docs/BAOTA_DEPLOY.md @@ -223,11 +223,9 @@ CORUNA_CHANNEL_BUILDER_PYTHON=/www/wwwroot/coruna-lab/channel-builder/.venv/bin/ # CORUNA_CHANNEL_STATE_ROOT=/www/wwwroot/coruna-lab/storage/app/channel-builder CORUNA_CHANNEL_BUILDER_TIMEOUT=600 -CORUNA_STATIC_SITE_BASE_URL=https://admin.example.com +# 后台「投放链接」展示域名(不驱动二进制补丁;DGA 域名以首次构建返回为准) +CORUNA_LAB_CHANNEL_DOMAINS=cdn.example.com CORUNA_STATIC_SITE_SCHEME=https - -# 可选:后台链接展示用(不驱动二进制补丁;DGA 域名以首次构建返回为准) -CORUNA_LAB_CHANNEL_DOMAINS= CORUNA_REPORTING_DOMAINS= # C2 上报 7z 解包(与 build_api 无关,仍需配置) diff --git a/resources/views/admin/channels/index.blade.php b/resources/views/admin/channels/index.blade.php index 8d2f4e1..bfad9f3 100644 --- a/resources/views/admin/channels/index.blade.php +++ b/resources/views/admin/channels/index.blade.php @@ -130,7 +130,7 @@ layui.use(['table', 'form', 'layer'], function () { function openLinks(row) { var links = row.links || []; if (!links.length) { - return layer.msg('未生成投放链接(请配置 CORUNA_STATIC_SITE_BASE_URL)'); + return layer.msg('未生成投放链接(请配置 CORUNA_LAB_CHANNEL_DOMAINS 或系统设置→投放域名)'); } var html = '
'; links.forEach(function (u, i) { diff --git a/tests/Feature/ChannelProjectServiceTest.php b/tests/Feature/ChannelProjectServiceTest.php index 055cfc6..de73441 100644 --- a/tests/Feature/ChannelProjectServiceTest.php +++ b/tests/Feature/ChannelProjectServiceTest.php @@ -28,7 +28,6 @@ class ChannelProjectServiceTest extends TestCase 'coruna.channel_builder.artifact_root' => storage_path('app/channel-artifacts-test'), 'coruna.channel_builder.timeout' => 30, 'coruna.channel_domains' => ['fallback.test'], - 'coruna.static_site.base_url' => 'https://static.test/assets', ]); } @@ -173,13 +172,11 @@ class ChannelProjectServiceTest extends TestCase 'domains' => ['channel.test'], ]); $this->assertSame([ - 'https://static.test/assets/web/'.self::CHANNEL_ID.'/support.html', 'https://channel.test/web/'.self::CHANNEL_ID.'/support.html', ], $withStored->supportLinks()); $fallback = new Channel(['channel_id' => self::CHANNEL_ID, 'domains' => []]); $this->assertSame([ - 'https://static.test/assets/web/'.self::CHANNEL_ID.'/support.html', 'https://fallback.test/web/'.self::CHANNEL_ID.'/support.html', ], $fallback->supportLinks()); }