From d4c8b66138e200f607fb079e72ecd57418e63b1a Mon Sep 17 00:00:00 2001 From: maki maki Date: Thu, 12 Nov 2026 14:50:38 +0800 Subject: [PATCH] fix(account): use codeshell.site as default service origin --- docs/desktop-cloud-account.md | 2 +- packages/desktop/scripts/owned-account-discovery.cjs | 2 +- .../desktop/scripts/owned-account-discovery.test.mjs | 9 +++++---- packages/desktop/src/shared/cloud-account.ts | 2 +- packages/server/src/account/types.ts | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/desktop-cloud-account.md b/docs/desktop-cloud-account.md index 4e60d544d..1b58305f3 100644 --- a/docs/desktop-cloud-account.md +++ b/docs/desktop-cloud-account.md @@ -9,7 +9,7 @@ updates the sidebar account, and returns focus after completion. Services withou this capability retain their existing native login controls. The account entry is a compact avatar icon beside Settings in the sidebar footer; its hover text and accessible description retain the account name and state. -The service address defaults to `https://115.159.45.55` and remains editable for +The service address defaults to `https://codeshell.site` and remains editable for self-hosted deployments. Prefilling it does not initiate an account connection; the selected server must expose the account API before sign-in is available. Opening the account form checks the selected service's public sign-in capabilities. diff --git a/packages/desktop/scripts/owned-account-discovery.cjs b/packages/desktop/scripts/owned-account-discovery.cjs index 3cd3078e0..9909d9c94 100644 --- a/packages/desktop/scripts/owned-account-discovery.cjs +++ b/packages/desktop/scripts/owned-account-discovery.cjs @@ -4,7 +4,7 @@ const { EventEmitter } = require("node:events"); const { Readable } = require("node:stream"); -const DEFAULT_ACCOUNT_ORIGIN = "https://115.159.45.55"; +const DEFAULT_ACCOUNT_ORIGIN = "https://codeshell.site"; const STATUS_URL = `${DEFAULT_ACCOUNT_ORIGIN}/api/v1/account/status`; const STATUS_BODY = JSON.stringify({ registrationAllowed: false, diff --git a/packages/desktop/scripts/owned-account-discovery.test.mjs b/packages/desktop/scripts/owned-account-discovery.test.mjs index 7267b96d6..21786c375 100644 --- a/packages/desktop/scripts/owned-account-discovery.test.mjs +++ b/packages/desktop/scripts/owned-account-discovery.test.mjs @@ -8,7 +8,7 @@ import { fileURLToPath, pathToFileURL } from "node:url"; import { build } from "esbuild"; import { withOwnedAccountDiscovery } from "./owned-account-discovery.cjs"; -const origin = "https://115.159.45.55"; +const origin = "https://codeshell.site"; const url = `${origin}/api/v1/account/status`; const options = () => ({ method: "GET", headers: { Origin: origin, Accept: "application/json" } }); function fixture() { @@ -65,8 +65,9 @@ test("all other targets, request methods and credentials still invoke the origin [url + "?next=/", options()], [url + "#fragment", options()], [url.replace("https:", "http:"), options()], - [url.replace("115.159.45.55", "127.0.0.1"), options()], - [url.replace("115.159.45.55", "115.159.45.55.example.invalid"), options()], + [url.replace("codeshell.site", "127.0.0.1"), options()], + [url.replace("codeshell.site", "115.159.45.55"), options()], + [url.replace("codeshell.site", "codeshell.site.example.invalid"), options()], [url.replace("/status", "/login"), options()], [url.replace("/status", "/overview"), options()], [url.replace("https://", "https://user:pass@"), options()], @@ -76,7 +77,7 @@ test("all other targets, request methods and credentials still invoke the origin [url, { ...options(), path: "/other" }], [url, { ...options(), host: "untrusted.invalid" }], [url, { ...options(), ca: "other" }], - [{ hostname: "115.159.45.55", path: "/api/v1/account/status" }, options()], + [{ hostname: "codeshell.site", path: "/api/v1/account/status" }, options()], ...["Authorization", "authorization", "Cookie", "Proxy-Authorization"].map((name) => [ url, { ...options(), headers: { ...options().headers, [name]: "private" } }, diff --git a/packages/desktop/src/shared/cloud-account.ts b/packages/desktop/src/shared/cloud-account.ts index 53e514c70..2b94c8e5f 100644 --- a/packages/desktop/src/shared/cloud-account.ts +++ b/packages/desktop/src/shared/cloud-account.ts @@ -1,4 +1,4 @@ /** Public account state. Tokens and OAuth receipts never cross the preload bridge. */ -export const DEFAULT_CLOUD_ACCOUNT_ORIGIN = "https://115.159.45.55"; +export const DEFAULT_CLOUD_ACCOUNT_ORIGIN = "https://codeshell.site"; export type * from "@cjhyy/code-shell-server/account"; diff --git a/packages/server/src/account/types.ts b/packages/server/src/account/types.ts index ee200bc34..70073bbfb 100644 --- a/packages/server/src/account/types.ts +++ b/packages/server/src/account/types.ts @@ -1,6 +1,6 @@ import type { AccountFeatureMap } from "@cjhyy/code-shell-web/account"; /** Public account state. Tokens and OAuth receipts never cross the preload bridge. */ -export const DEFAULT_CLOUD_ACCOUNT_ORIGIN = "https://115.159.45.55"; +export const DEFAULT_CLOUD_ACCOUNT_ORIGIN = "https://codeshell.site"; export interface CloudAccountIdentity { id: string;