Merge: fix self-hosted KBDB_BASE_URL injection (issue #2)
self-hosted cypher 不再 fallback 到官方 kbdb;注入用戶自己帳號的 arcrun-kbdb。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -397,6 +397,16 @@ function injectWranglerConfig(tomlPath: string, ctx: DeployContext): void {
|
|||||||
// 只對有 [vars] 的 worker(mcp / cypher-executor)生效;其餘無 [vars] 的不動。
|
// 只對有 [vars] 的 worker(mcp / cypher-executor)生效;其餘無 [vars] 的不動。
|
||||||
if (ctx.selfHosted) {
|
if (ctx.selfHosted) {
|
||||||
toml = injectMultiTenant(toml);
|
toml = injectMultiTenant(toml);
|
||||||
|
|
||||||
|
// self-hosted:把 cypher 的 KBDB_BASE_URL 從官方 arcrun-kbdb.uncle6-me 改成用戶自己帳號的
|
||||||
|
// arcrun-kbdb.<subdomain>.workers.dev(issue #2)。比照 database_id / MULTI_TENANT 注入模式。
|
||||||
|
// 漏這一個 → cypher /kbdb/* fallback 到官方 kbdb worker,self-hosted 資料寫進官方庫(隔離破損)。
|
||||||
|
if (ctx.workerSubdomain) {
|
||||||
|
toml = toml.replace(
|
||||||
|
/(KBDB_BASE_URL\s*=\s*")[^"]*(")/,
|
||||||
|
`$1https://arcrun-kbdb.${ctx.workerSubdomain}.workers.dev$2`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toml = stripOfficialOnlyBindings(toml);
|
toml = stripOfficialOnlyBindings(toml);
|
||||||
|
|||||||
Reference in New Issue
Block a user