dsh-auth-remote 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/CHANGELOG.zh-CN.md +8 -1
- package/CONTRIBUTING.md +1 -1
- package/CONTRIBUTING.zh-CN.md +1 -1
- package/README.md +28 -12
- package/README.zh-CN.md +28 -12
- package/dist/cli.js +50 -0
- package/dist/cli.js.map +2 -2
- package/dist/client.js +457 -1
- package/dist/client.js.map +4 -4
- package/dist/index.js +356 -23
- package/dist/index.js.map +3 -3
- package/dist/login.js +50 -0
- package/dist/login.js.map +2 -2
- package/dist/types/adapters/dsh/account-callback.d.ts +12 -0
- package/dist/types/adapters/dsh/account-callback.d.ts.map +1 -0
- package/dist/types/adapters/dsh/browser-capability.d.ts +1 -1
- package/dist/types/adapters/dsh/browser-capability.d.ts.map +1 -1
- package/dist/types/adapters/dsh/webserver.d.ts +3 -0
- package/dist/types/adapters/dsh/webserver.d.ts.map +1 -1
- package/dist/types/http/account-login.d.ts +43 -0
- package/dist/types/http/account-login.d.ts.map +1 -0
- package/dist/types/http/routes.d.ts +16 -1
- package/dist/types/http/routes.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shared/account-login.d.ts +21 -0
- package/dist/types/shared/account-login.d.ts.map +1 -0
- package/dist/types/shared/i18n.d.ts +50 -0
- package/dist/types/shared/i18n.d.ts.map +1 -1
- package/dist/types/shared/locales/en.d.ts +25 -0
- package/dist/types/shared/locales/en.d.ts.map +1 -1
- package/dist/types/shared/locales/zh.d.ts +25 -0
- package/dist/types/shared/locales/zh.d.ts.map +1 -1
- package/docs/deployment.md +19 -15
- package/docs/deployment.zh-CN.md +19 -15
- package/docs/development.md +16 -6
- package/docs/development.zh-CN.md +16 -6
- package/docs/legacy-compatibility.md +170 -117
- package/docs/legacy-compatibility.zh-CN.md +170 -0
- package/docs/releasing.md +6 -6
- package/docs/releasing.zh-CN.md +6 -6
- package/docs/reverse-proxy.md +2 -2
- package/docs/reverse-proxy.zh-CN.md +2 -2
- package/package.json +25 -11
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WebRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
2
|
+
/** Retain the native temporary handler without exposing a second callback entry. */
|
|
3
|
+
export declare class AccountCallbackBridge {
|
|
4
|
+
private handler;
|
|
5
|
+
capture(route: WebRoute): {
|
|
6
|
+
handler: WebRoute['handler'];
|
|
7
|
+
dispose(): void;
|
|
8
|
+
} | undefined;
|
|
9
|
+
/** Use Node's actual response lifecycle: DSH awaits its completion during cleanup. */
|
|
10
|
+
submit(query: URLSearchParams): Promise<number>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=account-callback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-callback.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh/account-callback.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAG/D,oFAAoF;AACpF,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAiC;IAEhD,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG;QAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QAAC,OAAO,IAAI,IAAI,CAAA;KAAE,GAAG,SAAS;IAcvF,sFAAsF;IAChF,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CA8BtD"}
|
|
@@ -4,5 +4,5 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
4
4
|
* the public origin. Install the fact before the index boots Connection and
|
|
5
5
|
* Remote; neither service can be repaired after its constructor caches it.
|
|
6
6
|
*/
|
|
7
|
-
export declare function installAuthenticatedHostCapability(ctx: Context): void;
|
|
7
|
+
export declare function installAuthenticatedHostCapability(ctx: Context, version?: string): void;
|
|
8
8
|
//# sourceMappingURL=browser-capability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-capability.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh/browser-capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"browser-capability.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh/browser-capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAMvF"}
|
|
@@ -4,6 +4,7 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
4
4
|
import WebServer, { type WebRoute, type WebUpgradeRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
5
5
|
import type { NativeListenerConfig } from './runtime-capabilities.js';
|
|
6
6
|
import { type OriginPolicy } from '../../http/origin-policy.js';
|
|
7
|
+
import type { AccountCallbackBridge } from './account-callback.js';
|
|
7
8
|
export declare const READY_PATH = "/auth-remote/ready";
|
|
8
9
|
export declare const READY_PROTOCOL_VERSION = 1;
|
|
9
10
|
/** A gate owns admission and then calls the official route exactly once. */
|
|
@@ -30,11 +31,13 @@ export declare class SwitchGate implements WebGate {
|
|
|
30
31
|
export declare class GuardedWebServer extends WebServer {
|
|
31
32
|
private readonly gate;
|
|
32
33
|
private originPolicy;
|
|
34
|
+
private accountCallbackBridge;
|
|
33
35
|
constructor(ctx: Context, config: NativeListenerConfig & {
|
|
34
36
|
originPolicy?: OriginPolicy;
|
|
35
37
|
}, gate?: WebGate);
|
|
36
38
|
/** Ready and the authenticated gate consume the same listener-finalized policy. */
|
|
37
39
|
protected setOriginPolicy(policy: OriginPolicy): void;
|
|
40
|
+
installAccountCallbackBridge(bridge: AccountCallbackBridge): void;
|
|
38
41
|
register(route: WebRoute): () => void;
|
|
39
42
|
registerFallback(handler: WebRoute['handler']): () => void;
|
|
40
43
|
registerUpgrade(route: WebUpgradeRoute): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webserver.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh/webserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,SAAS,EAAE,EAEhB,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"webserver.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh/webserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,SAAS,EAAE,EAEhB,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAA;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAElE,eAAO,MAAM,UAAU,uBAAuB,CAAA;AAC9C,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,4EAA4E;AAC5E,MA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mC;gBAG9D,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,oBAAoB,GAAG;QAAE,YAAY,CAAC,EAAE,YAAY,CAAA;KAAE,EAC7C,IAAI,GAAE,OAAwB;IA+CjD,mFAAmF;IACnF,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAIrD,4BAA4B,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI;IAIxD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,IAAI;IAkBrC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI;IAM1D,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,IAAI;CAS7D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { GuardedWebServer } from '../adapters/dsh/webserver.js';
|
|
3
|
+
import { type AuthService } from '../auth/service.js';
|
|
4
|
+
import { type AccountLoginState } from '../shared/account-login.js';
|
|
5
|
+
import type { AuthStateStore } from '../storage/store.js';
|
|
6
|
+
/** Only the public account service surface is used; no private provider state. */
|
|
7
|
+
export interface AccountProvider {
|
|
8
|
+
getState(): Promise<Omit<AccountLoginState, 'supported'>>;
|
|
9
|
+
startSignIn(client: {
|
|
10
|
+
version: string;
|
|
11
|
+
locale: string;
|
|
12
|
+
timezoneOffsetSeconds: number;
|
|
13
|
+
}, callbackOrigin: string, source: 'web'): Promise<Omit<AccountLoginState, 'supported'>>;
|
|
14
|
+
cancelSignIn(id: string): Promise<unknown>;
|
|
15
|
+
}
|
|
16
|
+
/** Authenticated clipboard handoff into the native state/PKCE/credential lifecycle. */
|
|
17
|
+
export declare class ManualAccountLogin {
|
|
18
|
+
private readonly auth;
|
|
19
|
+
private readonly version;
|
|
20
|
+
private readonly bridge;
|
|
21
|
+
private readonly unsubscribe;
|
|
22
|
+
private active;
|
|
23
|
+
private starting;
|
|
24
|
+
private disposed;
|
|
25
|
+
private currentProvider;
|
|
26
|
+
private disposal;
|
|
27
|
+
constructor(ctx: Context, auth: AuthService, store: AuthStateStore, version: string);
|
|
28
|
+
install(server: GuardedWebServer): void;
|
|
29
|
+
private provider;
|
|
30
|
+
private session;
|
|
31
|
+
private owned;
|
|
32
|
+
private schedule;
|
|
33
|
+
private state;
|
|
34
|
+
private start;
|
|
35
|
+
private callback;
|
|
36
|
+
private submit;
|
|
37
|
+
private cancelAttempt;
|
|
38
|
+
private reconcile;
|
|
39
|
+
private handle;
|
|
40
|
+
dispose(): Promise<void>;
|
|
41
|
+
private disposeAttempt;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=account-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-login.d.ts","sourceRoot":"","sources":["../../../src/http/account-login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhE,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAUzD,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAA;IACzD,WAAW,CACT,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAA;KAAE,EAC1E,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,KAAK,GACZ,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAA;IAChD,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3C;AAcD,uFAAuF;AACvF,qBAAa,kBAAkB;IAW3B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAErB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAZ1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAY;IACxC,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAA2B;gBAGzC,GAAG,EAAE,OAAO,EACK,IAAI,EAAE,WAAW,EAClC,KAAK,EAAE,cAAc,EACJ,OAAO,EAAE,MAAM;IAoBlC,OAAO,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAUvC,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,QAAQ;YASF,KAAK;YA2BL,KAAK;IAyDnB,OAAO,CAAC,QAAQ;YAyBF,MAAM;YAkCN,aAAa;YAWb,SAAS;YAoBT,MAAM;IA8BpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAIV,cAAc;CAK7B"}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import type { IncomingMessage } from 'node:http';
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import type { GuardedWebServer } from '../adapters/dsh/webserver.js';
|
|
3
3
|
import { AuthService } from '../auth/service.js';
|
|
4
|
+
import { type AuthErrorResponse } from '../shared/auth-contract.js';
|
|
4
5
|
export type RoutePermission = 'public' | 'session' | 'logout' | null;
|
|
5
6
|
export declare function routePermission(method: string | undefined, pathname: string): RoutePermission;
|
|
7
|
+
export declare class HttpFailure extends Error {
|
|
8
|
+
readonly status: number;
|
|
9
|
+
readonly code: string;
|
|
10
|
+
constructor(status: number, code: string);
|
|
11
|
+
}
|
|
12
|
+
export declare function stringField(body: Record<string, unknown>, field: string): string;
|
|
13
|
+
export declare function readJsonBody(req: IncomingMessage): Promise<Record<string, unknown>>;
|
|
14
|
+
export declare function sendJson(res: ServerResponse, status: number, body: unknown, headers?: Record<string, string>): void;
|
|
6
15
|
export declare function currentSessionToken(req: IncomingMessage): string | null;
|
|
16
|
+
export declare function errorStatus(error: unknown): {
|
|
17
|
+
status: number;
|
|
18
|
+
body: AuthErrorResponse;
|
|
19
|
+
retryAfter?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function sendHttpError(req: IncomingMessage, res: ServerResponse, error: unknown): void;
|
|
7
22
|
/** Explicit path/method registry; no prefix grants anonymous access. */
|
|
8
23
|
export declare class AuthRoutes {
|
|
9
24
|
private readonly auth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/http/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/http/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,EAAa,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAG3D,OAAO,EAGL,KAAK,iBAAiB,EAIvB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAA;AAsBpE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAE7F;AAED,qBAAa,WAAY,SAAQ,KAAK;IAElC,QAAQ,CAAC,MAAM,EAAE,MAAM;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vD,eAAO,MAAM,IAAI,gBAAgB,CAAA;AAEjC,qBAAa,mBAAoB,SAAQ,gBAAgB;IACvD,OAAgB,MAAM,EAAwB,OAAO,gBAAgB,CAAC,MAAM,CAAA;IAC5E,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAE3B,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU;IAmB5B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;IA6G9C,OAAO,KAAK,QAAQ,GAGnB;IAED,qFAAqF;IACrF,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,OAAO,IAAI,cAAc,CAG5B;IAED,IAAI,cAAc,IAAI,WAAW,CAGhC;IAED,wFAAwF;IACxF,IAAI,sBAAsB,IAAI,SAAS,MAAM,EAAE,CAK9C;CACF;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** The manual callback is transported in an authenticated POST, never fetched. */
|
|
2
|
+
export declare const ACCOUNT_LOGIN_BASE = "/auth-remote/account";
|
|
3
|
+
export declare const ACCOUNT_CALLBACK_PATH = "/oauth/callback";
|
|
4
|
+
export declare const ACCOUNT_LOGIN_CAPABILITY = "__DSH_AUTH_REMOTE_MANUAL_ACCOUNT_LOGIN__";
|
|
5
|
+
/** Temporary adapter: future releases must be reviewed before enabling it. */
|
|
6
|
+
export declare function supportsManualAccountLogin(version: string): boolean;
|
|
7
|
+
export type AccountLoginPhase = 'initializing' | 'waiting-browser' | 'exchanging' | 'committing' | 'succeeded' | 'failed' | 'expired' | 'cancelled';
|
|
8
|
+
export interface AccountLoginAttempt {
|
|
9
|
+
id: string;
|
|
10
|
+
phase: AccountLoginPhase;
|
|
11
|
+
authorizeUrl?: string;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
errorCode?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AccountLoginState {
|
|
16
|
+
supported: boolean;
|
|
17
|
+
status: 'signed-out' | 'credential-stored';
|
|
18
|
+
attempt: AccountLoginAttempt | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function isActiveAccountLogin(phase: AccountLoginPhase): boolean;
|
|
21
|
+
//# sourceMappingURL=account-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-login.d.ts","sourceRoot":"","sources":["../../../src/shared/account-login.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,yBAAyB,CAAA;AACxD,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AACtD,eAAO,MAAM,wBAAwB,6CAA6C,CAAA;AAElF,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,SAAS,GACT,WAAW,CAAA;AAEf,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,iBAAiB,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,YAAY,GAAG,mBAAmB,CAAA;IAC1C,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACpC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAEtE"}
|
|
@@ -9,6 +9,31 @@ export declare const dictionaries: {
|
|
|
9
9
|
readonly errorUnauthorized: "Your session has expired. Sign in again.";
|
|
10
10
|
readonly errorServiceUnavailable: "The service is temporarily unavailable. Try again later.";
|
|
11
11
|
readonly errorGeneric: "The operation could not be completed. Try again.";
|
|
12
|
+
readonly accountLoginTitle: "Sign in to your DeepSeek account";
|
|
13
|
+
readonly accountLoginDescription: "Complete authorization in a new tab, then return here to finish signing in.";
|
|
14
|
+
readonly accountLoginStepOpen: "Click “Open DeepSeek sign-in” below and sign in on the official page.";
|
|
15
|
+
readonly accountLoginStepCopy: "After authorization, the new tab may show a connection error or 404. Copy its full address from the address bar.";
|
|
16
|
+
readonly accountLoginStepSubmit: "Return to this dialog, paste the address below and click “Confirm sign-in”.";
|
|
17
|
+
readonly accountLoginCallbackLabel: "Full callback address";
|
|
18
|
+
readonly accountLoginCallbackHint: "Include both code and state. The page does not need to load. Submit before this authorization expires.";
|
|
19
|
+
readonly accountLoginOpen: "Open DeepSeek sign-in";
|
|
20
|
+
readonly accountLoginConfirm: "Confirm sign-in";
|
|
21
|
+
readonly accountLoginCancel: "Cancel";
|
|
22
|
+
readonly accountLoginUseApiKey: "Use API key";
|
|
23
|
+
readonly accountLoginClose: "Close";
|
|
24
|
+
readonly accountLoginRetry: "Start again";
|
|
25
|
+
readonly accountLoginReopen: "Reopen authorization page";
|
|
26
|
+
readonly accountLoginPopupBlocked: "The new tab was blocked.";
|
|
27
|
+
readonly accountLoginInitializing: "Preparing authorization…";
|
|
28
|
+
readonly accountLoginWaiting: "Waiting for the callback address. This authorization lasts at most 10 minutes.";
|
|
29
|
+
readonly accountLoginExchanging: "Completing sign-in…";
|
|
30
|
+
readonly accountLoginInvalidCallback: "This callback address does not match the current authorization. Copy the full address, including code and state, from the latest authorization tab.";
|
|
31
|
+
readonly accountLoginExpired: "This authorization has expired. Start again.";
|
|
32
|
+
readonly accountLoginMismatch: "This authorization is no longer available in this session. Close this dialog and start again.";
|
|
33
|
+
readonly accountLoginBusy: "Another authorization is in progress. Finish or cancel it before starting again.";
|
|
34
|
+
readonly accountLoginUnavailable: "This DSH version does not provide compatible account sign-in.";
|
|
35
|
+
readonly accountLoginFailed: "Authorization could not be completed. Start again and submit the address from the new tab.";
|
|
36
|
+
readonly accountLoginNoResponse: "The DeepSeek platform did not respond. Check the DSH server’s network connection and start again.";
|
|
12
37
|
readonly loginInitialTitle: "Sign in to DSH";
|
|
13
38
|
readonly loginInitialLoading: "Checking sign-in status…";
|
|
14
39
|
readonly loginLanguageLabel: "Language";
|
|
@@ -158,6 +183,31 @@ export declare const dictionaries: {
|
|
|
158
183
|
readonly errorUnauthorized: "会话已失效,请重新登录。";
|
|
159
184
|
readonly errorServiceUnavailable: "服务暂时不可用,请稍后重试。";
|
|
160
185
|
readonly errorGeneric: "操作未完成,请重试。";
|
|
186
|
+
readonly accountLoginTitle: "登录 DeepSeek 官方账号";
|
|
187
|
+
readonly accountLoginDescription: "在新标签页完成官方授权后,返回此处继续登录。";
|
|
188
|
+
readonly accountLoginStepOpen: "点击下方“打开 DeepSeek 登录页”,在官方页面登录账号。";
|
|
189
|
+
readonly accountLoginStepCopy: "授权后,新标签页可能显示连接失败或 404。请复制该标签页地址栏中的完整地址。";
|
|
190
|
+
readonly accountLoginStepSubmit: "返回此弹窗,将地址粘贴到下方输入框,再点击“确认登录”。";
|
|
191
|
+
readonly accountLoginCallbackLabel: "完整回调地址";
|
|
192
|
+
readonly accountLoginCallbackHint: "地址须包含 code 和 state;该页面无需能正常打开。请在本次授权到期前提交。";
|
|
193
|
+
readonly accountLoginOpen: "打开 DeepSeek 登录页";
|
|
194
|
+
readonly accountLoginConfirm: "确认登录";
|
|
195
|
+
readonly accountLoginCancel: "取消";
|
|
196
|
+
readonly accountLoginUseApiKey: "使用 API Key";
|
|
197
|
+
readonly accountLoginClose: "关闭";
|
|
198
|
+
readonly accountLoginRetry: "重新开始";
|
|
199
|
+
readonly accountLoginReopen: "重新打开授权页";
|
|
200
|
+
readonly accountLoginPopupBlocked: "新标签页被浏览器拦截。";
|
|
201
|
+
readonly accountLoginInitializing: "正在准备授权…";
|
|
202
|
+
readonly accountLoginWaiting: "等待填写回调地址。本次授权最长有效期为 10 分钟。";
|
|
203
|
+
readonly accountLoginExchanging: "正在完成登录…";
|
|
204
|
+
readonly accountLoginInvalidCallback: "回调地址与当前授权不匹配,请从最近一次授权标签页复制包含 code 和 state 的完整地址。";
|
|
205
|
+
readonly accountLoginExpired: "本次授权已过期,请重新开始。";
|
|
206
|
+
readonly accountLoginMismatch: "当前会话已无法继续此授权,请关闭弹窗后重新开始。";
|
|
207
|
+
readonly accountLoginBusy: "已有授权正在进行,请先完成或取消后再开始。";
|
|
208
|
+
readonly accountLoginUnavailable: "当前 DSH 版本未提供兼容的账号登录功能。";
|
|
209
|
+
readonly accountLoginFailed: "未能完成授权,请重新开始,并提交新标签页中的回调地址。";
|
|
210
|
+
readonly accountLoginNoResponse: "DeepSeek 平台未响应,请检查 DSH 服务器的网络连接后重新开始。";
|
|
161
211
|
readonly loginInitialTitle: "登录 DSH";
|
|
162
212
|
readonly loginInitialLoading: "正在检查登录状态…";
|
|
163
213
|
readonly loginLanguageLabel: "语言";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/shared/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AACjB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/shared/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AACjB,eAAO,MAAM,YAAY;;;;;;;;;;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,GAAG,IAAI,GAAG,KAAY,CAAA;AAEnG,KAAK,UAAU,CAAC,GAAG,SAAS,UAAU,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACtF,EAAE,GACF,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAA;AAErE,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,GAAG,SAAS,UAAU,EAClD,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACnC,GAAG,EAAE,GAAG,EACR,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,GACvB,MAAM,CAOR;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAepD"}
|
|
@@ -6,6 +6,31 @@ export declare const en: {
|
|
|
6
6
|
readonly errorUnauthorized: "Your session has expired. Sign in again.";
|
|
7
7
|
readonly errorServiceUnavailable: "The service is temporarily unavailable. Try again later.";
|
|
8
8
|
readonly errorGeneric: "The operation could not be completed. Try again.";
|
|
9
|
+
readonly accountLoginTitle: "Sign in to your DeepSeek account";
|
|
10
|
+
readonly accountLoginDescription: "Complete authorization in a new tab, then return here to finish signing in.";
|
|
11
|
+
readonly accountLoginStepOpen: "Click “Open DeepSeek sign-in” below and sign in on the official page.";
|
|
12
|
+
readonly accountLoginStepCopy: "After authorization, the new tab may show a connection error or 404. Copy its full address from the address bar.";
|
|
13
|
+
readonly accountLoginStepSubmit: "Return to this dialog, paste the address below and click “Confirm sign-in”.";
|
|
14
|
+
readonly accountLoginCallbackLabel: "Full callback address";
|
|
15
|
+
readonly accountLoginCallbackHint: "Include both code and state. The page does not need to load. Submit before this authorization expires.";
|
|
16
|
+
readonly accountLoginOpen: "Open DeepSeek sign-in";
|
|
17
|
+
readonly accountLoginConfirm: "Confirm sign-in";
|
|
18
|
+
readonly accountLoginCancel: "Cancel";
|
|
19
|
+
readonly accountLoginUseApiKey: "Use API key";
|
|
20
|
+
readonly accountLoginClose: "Close";
|
|
21
|
+
readonly accountLoginRetry: "Start again";
|
|
22
|
+
readonly accountLoginReopen: "Reopen authorization page";
|
|
23
|
+
readonly accountLoginPopupBlocked: "The new tab was blocked.";
|
|
24
|
+
readonly accountLoginInitializing: "Preparing authorization…";
|
|
25
|
+
readonly accountLoginWaiting: "Waiting for the callback address. This authorization lasts at most 10 minutes.";
|
|
26
|
+
readonly accountLoginExchanging: "Completing sign-in…";
|
|
27
|
+
readonly accountLoginInvalidCallback: "This callback address does not match the current authorization. Copy the full address, including code and state, from the latest authorization tab.";
|
|
28
|
+
readonly accountLoginExpired: "This authorization has expired. Start again.";
|
|
29
|
+
readonly accountLoginMismatch: "This authorization is no longer available in this session. Close this dialog and start again.";
|
|
30
|
+
readonly accountLoginBusy: "Another authorization is in progress. Finish or cancel it before starting again.";
|
|
31
|
+
readonly accountLoginUnavailable: "This DSH version does not provide compatible account sign-in.";
|
|
32
|
+
readonly accountLoginFailed: "Authorization could not be completed. Start again and submit the address from the new tab.";
|
|
33
|
+
readonly accountLoginNoResponse: "The DeepSeek platform did not respond. Check the DSH server’s network connection and start again.";
|
|
9
34
|
readonly loginInitialTitle: "Sign in to DSH";
|
|
10
35
|
readonly loginInitialLoading: "Checking sign-in status…";
|
|
11
36
|
readonly loginLanguageLabel: "Language";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/shared/locales/en.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/shared/locales/en.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0NL,CAAA"}
|
|
@@ -5,6 +5,31 @@ export declare const zh: {
|
|
|
5
5
|
readonly errorUnauthorized: "会话已失效,请重新登录。";
|
|
6
6
|
readonly errorServiceUnavailable: "服务暂时不可用,请稍后重试。";
|
|
7
7
|
readonly errorGeneric: "操作未完成,请重试。";
|
|
8
|
+
readonly accountLoginTitle: "登录 DeepSeek 官方账号";
|
|
9
|
+
readonly accountLoginDescription: "在新标签页完成官方授权后,返回此处继续登录。";
|
|
10
|
+
readonly accountLoginStepOpen: "点击下方“打开 DeepSeek 登录页”,在官方页面登录账号。";
|
|
11
|
+
readonly accountLoginStepCopy: "授权后,新标签页可能显示连接失败或 404。请复制该标签页地址栏中的完整地址。";
|
|
12
|
+
readonly accountLoginStepSubmit: "返回此弹窗,将地址粘贴到下方输入框,再点击“确认登录”。";
|
|
13
|
+
readonly accountLoginCallbackLabel: "完整回调地址";
|
|
14
|
+
readonly accountLoginCallbackHint: "地址须包含 code 和 state;该页面无需能正常打开。请在本次授权到期前提交。";
|
|
15
|
+
readonly accountLoginOpen: "打开 DeepSeek 登录页";
|
|
16
|
+
readonly accountLoginConfirm: "确认登录";
|
|
17
|
+
readonly accountLoginCancel: "取消";
|
|
18
|
+
readonly accountLoginUseApiKey: "使用 API Key";
|
|
19
|
+
readonly accountLoginClose: "关闭";
|
|
20
|
+
readonly accountLoginRetry: "重新开始";
|
|
21
|
+
readonly accountLoginReopen: "重新打开授权页";
|
|
22
|
+
readonly accountLoginPopupBlocked: "新标签页被浏览器拦截。";
|
|
23
|
+
readonly accountLoginInitializing: "正在准备授权…";
|
|
24
|
+
readonly accountLoginWaiting: "等待填写回调地址。本次授权最长有效期为 10 分钟。";
|
|
25
|
+
readonly accountLoginExchanging: "正在完成登录…";
|
|
26
|
+
readonly accountLoginInvalidCallback: "回调地址与当前授权不匹配,请从最近一次授权标签页复制包含 code 和 state 的完整地址。";
|
|
27
|
+
readonly accountLoginExpired: "本次授权已过期,请重新开始。";
|
|
28
|
+
readonly accountLoginMismatch: "当前会话已无法继续此授权,请关闭弹窗后重新开始。";
|
|
29
|
+
readonly accountLoginBusy: "已有授权正在进行,请先完成或取消后再开始。";
|
|
30
|
+
readonly accountLoginUnavailable: "当前 DSH 版本未提供兼容的账号登录功能。";
|
|
31
|
+
readonly accountLoginFailed: "未能完成授权,请重新开始,并提交新标签页中的回调地址。";
|
|
32
|
+
readonly accountLoginNoResponse: "DeepSeek 平台未响应,请检查 DSH 服务器的网络连接后重新开始。";
|
|
8
33
|
readonly loginInitialTitle: "登录 DSH";
|
|
9
34
|
readonly loginInitialLoading: "正在检查登录状态…";
|
|
10
35
|
readonly loginLanguageLabel: "语言";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../../src/shared/locales/zh.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../../src/shared/locales/zh.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2M0C,CAAA"}
|
package/docs/deployment.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](deployment.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
This guide uses DSH `0.2.1-alpha.
|
|
5
|
+
This guide uses DSH `0.2.1-alpha.3` and its default `~/.dsh` data directory. See the [compatibility matrix](../README.md#dsh-compatibility) for the other six releases and the [development guide](development.md) for isolated source builds. Choose your own hostname, proxy network and service manager.
|
|
6
6
|
|
|
7
7
|
## Minimal installation from npm
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Install the published package into the default `web` profile:
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
dsh --version
|
|
13
|
-
dsh plugin --profile web add dsh-auth-remote@0.1.
|
|
13
|
+
dsh plugin --profile web add dsh-auth-remote@0.1.9
|
|
14
14
|
dsh plugin --profile web list
|
|
15
15
|
dsh web --no-open --port 13090
|
|
16
16
|
```
|
|
@@ -50,19 +50,19 @@ DSH replaces the entire plugin `config` when a later patch row supplies one. Pre
|
|
|
50
50
|
|
|
51
51
|
All plugin fields below belong directly in `auth-remote.config`; there are no aliases or nested TLS objects.
|
|
52
52
|
|
|
53
|
-
| Field | Effective value
|
|
54
|
-
| --------------------- |
|
|
55
|
-
| `publicUrl` | CLI `--public-url` replaces the whole file URL on alpha.1
|
|
56
|
-
| `host` | CLI `--host`, then file, then `127.0.0.1`. Require a concrete IPv4 literal; alpha.2 also
|
|
57
|
-
| `port` | CLI `--port`, then file, then `3080`, independently of host. `0` derives the entry only after the actual nonzero port is bound.
|
|
58
|
-
| `tlsCert`, `tlsKey` |
|
|
59
|
-
| `requireTotp` | Defaults to `true`. With `false`, an unbound account may skip setup; an already bound account still needs its second factor.
|
|
60
|
-
| `sessionHours` | Fixed default lifetime of 168 hours. Reducing it tightens existing sessions; increasing it does not revive expired sessions.
|
|
61
|
-
| `preserveOriginPaths` | Optional canonical segment-prefix paths; default `[]`. Matching routes keep the validated public Host and existing Origin after authentication. The final public origin configures native Connection trust automatically.
|
|
53
|
+
| Field | Effective value |
|
|
54
|
+
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `publicUrl` | CLI `--public-url` replaces the whole file URL on DSH `0.2.1-alpha.1`, `0.2.1-alpha.2`, `0.2.1-alpha.3`; otherwise file URL, migrated legacy single item, then actual listener root. Accept only absolute HTTP(S) roots with optional final slash, no credentials/path/query/fragment. |
|
|
56
|
+
| `host` | CLI `--host`, then file, then `127.0.0.1`. Require a concrete IPv4 literal; DSH `0.2.1-alpha.2`, `0.2.1-alpha.3` also accept concrete IPv6, including mapped forms. No DNS names or wildcard binds. |
|
|
57
|
+
| `port` | CLI `--port`, then file, then `3080`, independently of host. `0` derives the entry only after the actual nonzero port is bound. |
|
|
58
|
+
| `tlsCert`, `tlsKey` | DSH `0.2.1-alpha.2`, `0.2.1-alpha.3`. Supply both file fields, or both CLI `--tls-cert`/`--tls-key`. A CLI pair replaces the whole file pair; sources are never mixed and unused file certificate paths are not read. Omit TLS for HTTP. |
|
|
59
|
+
| `requireTotp` | Defaults to `true`. With `false`, an unbound account may skip setup; an already bound account still needs its second factor. |
|
|
60
|
+
| `sessionHours` | Fixed default lifetime of 168 hours. Reducing it tightens existing sessions; increasing it does not revive expired sessions. |
|
|
61
|
+
| `preserveOriginPaths` | Optional canonical segment-prefix paths; default `[]`. Matching routes keep the validated public Host and existing Origin after authentication. The final public origin configures native Connection trust automatically. |
|
|
62
62
|
|
|
63
63
|
**Pay particular attention to TLS paths:** relative file values resolve from the selected profile directory, where its `cordis.patch.yml` lives. Relative CLI paths resolve from the process's launch working directory. Neither uses the bundle or another overlay's directory. Absolute paths stay absolute.
|
|
64
64
|
|
|
65
|
-
For
|
|
65
|
+
For a DSH `0.2.1-alpha.2`, `0.2.1-alpha.3` override example, `dsh web --no-open --host ::1 --port 0 --public-url https://dsh.example.com/` replaces file host, port and URL independently. The listener binds an actual free port; the explicit public root stays unchanged. Configure any proxy to reach that actual port. Omit `--host` to keep the file host when overriding only the port.
|
|
66
66
|
|
|
67
67
|
For example, file `tlsCert: ./tls/dsh.crt` means `~/.dsh/profiles/web/tls/dsh.crt` even if you launch from a different directory. The following command uses `./launch-workdir/tls/dsh.crt` and the matching key instead:
|
|
68
68
|
|
|
@@ -73,11 +73,13 @@ dsh web --no-open --tls-cert ./tls/dsh.crt --tls-key ./tls/dsh.key
|
|
|
73
73
|
|
|
74
74
|
Supplying only one CLI flag fails even if the file contains the other half. Missing, unreadable, empty, malformed or mismatched certificate/key material fails startup without an HTTP fallback, and releases listener/admin/storage resources. Choose a certificate valid for the browser hostname; the plugin delegates TLS to the official listener.
|
|
75
75
|
|
|
76
|
-
CLI public URL overrides are available only on alpha.1
|
|
76
|
+
CLI public URL overrides are available only on DSH `0.2.1-alpha.1`, `0.2.1-alpha.2`, `0.2.1-alpha.3`. DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2` reject that unknown flag and need the plugin file field; their Web prompt and `DSH_WEB_URL` retain the native fixed IPv4 loopback URL with the actual port. The plugin admission and printed public root still follow its effective configuration. DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1` reject native IPv6/TLS.
|
|
77
|
+
|
|
78
|
+
DSH `0.2.1-alpha.3` publishes the final Web URL in model runtime context and `DSH_WEB_URL`; DSH `0.2.1-alpha.1`, `0.2.1-alpha.2` embed it in the Web prompt section.
|
|
77
79
|
|
|
78
80
|
## Native HTTPS and IPv6
|
|
79
81
|
|
|
80
|
-
On alpha.2
|
|
82
|
+
On DSH `0.2.1-alpha.2`, `0.2.1-alpha.3`, merge this complete auth row for direct IPv6 loopback HTTPS, using your own certificate and key:
|
|
81
83
|
|
|
82
84
|
```yaml
|
|
83
85
|
- id: auth-remote
|
|
@@ -117,7 +119,7 @@ Anonymous GET/HEAD requests to exactly `/manifest.webmanifest`, `/favicon.svg`,
|
|
|
117
119
|
|
|
118
120
|
Plugin cookies follow the validated external origin and are host-only, HttpOnly and SameSite; HTTPS sets Secure. Native bridge credentials stay server-side and follow the native listener protocol, including HTTPS cookie audience/Secure when a public HTTP proxy fronts native HTTPS. Ports do not isolate browser cookies.
|
|
119
121
|
|
|
120
|
-
Standard `/api` routes work with `preserveOriginPaths: []`; there is no need to list `/api`. The plugin always declares its finalized native bridge authority in Connection's `trustedHosts`, using the actual bound port (including `--port 0`), so downstream plugins that read this list can recognize the bridge without an extra trusted-host flag. Explicit CLI trusted hosts are merged and deduplicated; they do not expand the outer public-origin policy. Add a prefix only when a downstream route needs the original public Host. The plugin forwards an Origin only when the request supplied one, and preflights and declares the selected public authority for preserved paths. No separate Connection row is needed. Ordinary alpha.2 routes use the normalized native bind authority;
|
|
122
|
+
Standard `/api` routes work with `preserveOriginPaths: []`; there is no need to list `/api`. The plugin always declares its finalized native bridge authority in Connection's `trustedHosts`, using the actual bound port (including `--port 0`), so downstream plugins that read this list can recognize the bridge without an extra trusted-host flag. Explicit CLI trusted hosts are merged and deduplicated; they do not expand the outer public-origin policy. Add a prefix only when a downstream route needs the original public Host. The plugin forwards an Origin only when the request supplied one, and preflights and declares the selected public authority for preserved paths. No separate Connection row is needed. Ordinary DSH `0.2.1-alpha.2`, `0.2.1-alpha.3` routes use the normalized native bind authority; Connection on DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1` retains its internal HTTP loopback bridge. Both paths still require a full session. Revocation, Connection loss or storage failure closes active uploads, streams and upgrades and withdraws business admission. Readiness does not mean the account is initialized.
|
|
121
123
|
|
|
122
124
|
## Start and verify the public entry
|
|
123
125
|
|
|
@@ -135,3 +137,5 @@ Stop DSH and verify it released the profile lock before copying `~/.dsh/profiles
|
|
|
135
137
|
For recovery, stop DSH, check schema/package compatibility, restore with private ownership/mode, then check readiness and CLI `status --json`. Local `reset-password`, `reset-totp` and `revoke-sessions` revoke sessions. A lost management response has an uncertain outcome; inspect status before another mutation.
|
|
136
138
|
|
|
137
139
|
To change the external entry, replace the one `publicUrl`, update the proxy and restart DSH. Verify the new entry and rejection of the former non-loopback entry, including cookies, redirects, uploads and long connections. Do not temporarily configure both origins in this plugin.
|
|
140
|
+
|
|
141
|
+
Official DeepSeek account authorization on DSH `0.2.1-alpha.3` uses the manual callback dialog described in the [README](../README.md#sign-in-to-an-official-deepseek-account). No callback listener or open loopback port is needed on the browser computer. Keep `/auth-remote/account/*` behind the same session/origin gate; submissions use same-origin JSON POSTs. Direct HTTP access to the native `/oauth/callback` cannot complete this manual handoff. No proxy exception, broader `preserveOriginPaths`, or cross-site allowance is required.
|
package/docs/deployment.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](deployment.md)
|
|
4
4
|
|
|
5
|
-
本指南使用 DSH `0.2.1-alpha.
|
|
5
|
+
本指南使用 DSH `0.2.1-alpha.3` 和默认 `~/.dsh` 数据目录。其他六版能力见[兼容矩阵](../README.zh-CN.md#dsh-兼容性),隔离源码构建见[开发指南](development.zh-CN.md)。域名、代理网络和服务管理器由部署者选择。
|
|
6
6
|
|
|
7
7
|
## 从 npm 最小化安装
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
dsh --version
|
|
13
|
-
dsh plugin --profile web add dsh-auth-remote@0.1.
|
|
13
|
+
dsh plugin --profile web add dsh-auth-remote@0.1.9
|
|
14
14
|
dsh plugin --profile web list
|
|
15
15
|
dsh web --no-open --port 13090
|
|
16
16
|
```
|
|
@@ -50,19 +50,19 @@ HTTPS 代理入口可把以下条目合并到 `~/.dsh/profiles/web/cordis.patch.
|
|
|
50
50
|
|
|
51
51
|
以下字段均直接位于 `auth-remote.config`,没有别名或嵌套 TLS 对象。
|
|
52
52
|
|
|
53
|
-
| 字段 | 生效值
|
|
54
|
-
| --------------------- |
|
|
55
|
-
| `publicUrl` | alpha.1
|
|
56
|
-
| `host` | CLI `--host`、文件、默认 `127.0.0.1`。要求具体 IPv4 字面量;alpha.2 还接受具体 IPv6,包含 mapped 格式。拒绝 DNS 名称和通配绑定。
|
|
57
|
-
| `port` | CLI `--port`、文件、默认 `3080`,与 host 分别覆盖。`0` 在真实非零端口绑定后才生成入口。
|
|
58
|
-
| `tlsCert`、`tlsKey` |
|
|
59
|
-
| `requireTotp` | 默认 `true`。设为 `false` 时未绑定账号可跳过;已绑定账号仍需第二因素。
|
|
60
|
-
| `sessionHours` | 默认固定 168 小时。缩短会收紧已有会话,放宽不会复活过期会话。
|
|
61
|
-
| `preserveOriginPaths` | 可选的规范路径段前缀,默认 `[]`。匹配路径在认证后保留已验证公网 Host 和已有 Origin;最终公开来源自动配置原生 Connection 信任。
|
|
53
|
+
| 字段 | 生效值 |
|
|
54
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `publicUrl` | DSH `0.2.1-alpha.1`、`0.2.1-alpha.2`、`0.2.1-alpha.3` 的 CLI `--public-url` 整项替换文件 URL;否则依次为文件、旧单项迁移、实际监听根地址。仅接受绝对 HTTP(S) 根 URL,可带末尾斜杠,不能带凭据、子路径、查询或片段。 |
|
|
56
|
+
| `host` | CLI `--host`、文件、默认 `127.0.0.1`。要求具体 IPv4 字面量;DSH `0.2.1-alpha.2`、`0.2.1-alpha.3` 还接受具体 IPv6,包含 mapped 格式。拒绝 DNS 名称和通配绑定。 |
|
|
57
|
+
| `port` | CLI `--port`、文件、默认 `3080`,与 host 分别覆盖。`0` 在真实非零端口绑定后才生成入口。 |
|
|
58
|
+
| `tlsCert`、`tlsKey` | DSH `0.2.1-alpha.2`、`0.2.1-alpha.3` 可用。两个文件字段必须成对,CLI `--tls-cert`/`--tls-key` 也必须成对。CLI 整组替换文件组,不混合来源、不读取未采用的文件证书路径。省略 TLS 即 HTTP。 |
|
|
59
|
+
| `requireTotp` | 默认 `true`。设为 `false` 时未绑定账号可跳过;已绑定账号仍需第二因素。 |
|
|
60
|
+
| `sessionHours` | 默认固定 168 小时。缩短会收紧已有会话,放宽不会复活过期会话。 |
|
|
61
|
+
| `preserveOriginPaths` | 可选的规范路径段前缀,默认 `[]`。匹配路径在认证后保留已验证公网 Host 和已有 Origin;最终公开来源自动配置原生 Connection 信任。 |
|
|
62
62
|
|
|
63
63
|
**特别注意 TLS 路径:**文件中的相对值以所选 profile 目录为基准,即其 `cordis.patch.yml` 所在目录;CLI 的相对路径以进程启动 cwd 为基准。两者均不以 bundle 或其他 overlay 目录为基准。绝对路径保持绝对。
|
|
64
64
|
|
|
65
|
-
alpha.2 的覆盖示例 `dsh web --no-open --host ::1 --port 0 --public-url https://dsh.example.com/` 分别替换文件 host、port 和 URL。监听绑定真实空闲端口,显式公开根地址保持不变;代理须到达该实际端口。仅覆盖端口时,省略 `--host` 即保留文件 host。
|
|
65
|
+
DSH `0.2.1-alpha.2`、`0.2.1-alpha.3` 的覆盖示例 `dsh web --no-open --host ::1 --port 0 --public-url https://dsh.example.com/` 分别替换文件 host、port 和 URL。监听绑定真实空闲端口,显式公开根地址保持不变;代理须到达该实际端口。仅覆盖端口时,省略 `--host` 即保留文件 host。
|
|
66
66
|
|
|
67
67
|
例如文件 `tlsCert: ./tls/dsh.crt` 始终指 `~/.dsh/profiles/web/tls/dsh.crt`,从其他目录启动也不变。以下命令则使用 `./launch-workdir/tls/dsh.crt` 和对应私钥:
|
|
68
68
|
|
|
@@ -73,11 +73,13 @@ dsh web --no-open --tls-cert ./tls/dsh.crt --tls-key ./tls/dsh.key
|
|
|
73
73
|
|
|
74
74
|
只给一个 CLI 参数会失败,即使文件提供另一半也不混用。证书/私钥缺失、不可读、空内容、PEM 无效或不匹配时启动失败,不回退 HTTP,并释放监听、管理 socket 和存储资源。证书须对浏览器主机名有效;TLS 由官方监听处理。
|
|
75
75
|
|
|
76
|
-
CLI 公开 URL 覆盖仅在 alpha.1
|
|
76
|
+
CLI 公开 URL 覆盖仅在 DSH `0.2.1-alpha.1`、`0.2.1-alpha.2`、`0.2.1-alpha.3` 可用。DSH `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2` 对该未知参数报错,须使用插件文件字段;其 Web 提示和 `DSH_WEB_URL` 保留原生固定 IPv4 回环 URL 加实际端口,插件准入和公开地址输出仍取生效配置。DSH `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1` 明确拒绝原生 IPv6/TLS。
|
|
77
|
+
|
|
78
|
+
DSH `0.2.1-alpha.3` 将最终 Web 地址写入模型运行时上下文和 `DSH_WEB_URL`;DSH `0.2.1-alpha.1`、`0.2.1-alpha.2` 将地址写入 Web 提示段落。
|
|
77
79
|
|
|
78
80
|
## 原生 HTTPS 与 IPv6
|
|
79
81
|
|
|
80
|
-
alpha.2 的 IPv6 回环 HTTPS 可合并以下完整认证条目,使用自己的证书和私钥:
|
|
82
|
+
DSH `0.2.1-alpha.2`、`0.2.1-alpha.3` 的 IPv6 回环 HTTPS 可合并以下完整认证条目,使用自己的证书和私钥:
|
|
81
83
|
|
|
82
84
|
```yaml
|
|
83
85
|
- id: auth-remote
|
|
@@ -117,7 +119,7 @@ alpha.2 的 IPv6 回环 HTTPS 可合并以下完整认证条目,使用自己
|
|
|
117
119
|
|
|
118
120
|
插件 Cookie 跟随已验证外部来源,限主机、HttpOnly、SameSite,HTTPS 设置 Secure。原生桥接凭据仅保留服务端,跟随原生监听协议;公开 HTTP 代理接入原生 HTTPS 时,其原生 Cookie audience/Secure 仍按 HTTPS。浏览器 Cookie 不通过端口隔离。
|
|
119
121
|
|
|
120
|
-
标准 `/api` 路由在 `preserveOriginPaths: []` 下即可工作,无需列 `/api`。插件始终将定稿的原生桥接 authority 登记到 Connection 的 `trustedHosts`,使用实际绑定端口(包含 `--port 0`),读取该列表的下游插件无需额外 trusted-host 参数即可识别桥接地址。显式 CLI trusted hosts 合并去重,不扩大外层公开来源策略。仅在下游需要原始公网 Host 时加入前缀;Origin 仅在请求已有时透传,保留路径预检并登记所选公开 authority。无需单独 Connection 条目。alpha.2 普通路径使用归一化原生 bind authority
|
|
122
|
+
标准 `/api` 路由在 `preserveOriginPaths: []` 下即可工作,无需列 `/api`。插件始终将定稿的原生桥接 authority 登记到 Connection 的 `trustedHosts`,使用实际绑定端口(包含 `--port 0`),读取该列表的下游插件无需额外 trusted-host 参数即可识别桥接地址。显式 CLI trusted hosts 合并去重,不扩大外层公开来源策略。仅在下游需要原始公网 Host 时加入前缀;Origin 仅在请求已有时透传,保留路径预检并登记所选公开 authority。无需单独 Connection 条目。DSH `0.2.1-alpha.2`、`0.2.1-alpha.3` 普通路径使用归一化原生 bind authority,DSH `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1` 的 Connection 保留内部 HTTP 回环桥接;两类路径均需完整会话。撤销、Connection 丢失或存储故障会关闭活跃上传、流和升级连接,撤回业务准入。ready 不表示账号已初始化。
|
|
121
123
|
|
|
122
124
|
## 启动并验证公开入口
|
|
123
125
|
|
|
@@ -135,3 +137,5 @@ alpha.2 的 IPv6 回环 HTTPS 可合并以下完整认证条目,使用自己
|
|
|
135
137
|
恢复时先停止 DSH,检查 schema/包兼容,以私有属主/权限恢复,再核对 ready 和 CLI `status --json`。本地 `reset-password`、`reset-totp`、`revoke-sessions` 均撤销会话。管理响应丢失后结果不明,先查状态再执行下一次修改。
|
|
136
138
|
|
|
137
139
|
外部入口变更时,替换唯一 `publicUrl`、更新代理并重启 DSH。检查新入口与旧非回环入口的拒绝,包含 Cookie、重定向、上传和长连接。不要在插件中临时配置两个来源。
|
|
140
|
+
|
|
141
|
+
DSH `0.2.1-alpha.3` 官方 DeepSeek 账号授权使用 [README 中的手动回填弹窗](../README.zh-CN.md#登录-deepseek-官方账号)。浏览器所在电脑无需回调监听器或开放回环端口。`/auth-remote/account/*` 继续经过相同的会话与来源门禁,回填通过同源 JSON POST 提交;直接 HTTP 访问原生 `/oauth/callback` 不能完成此手动对接。无需代理例外、扩大 `preserveOriginPaths` 或放宽跨站规则。
|
package/docs/development.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](development.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
Development and the full test suite use Linux (`/proc` is required for the profile lock), Node.js 24+, pnpm 12.5.1, and DSH `0.2.1-alpha.
|
|
5
|
+
Development and the full test suite use Linux (`/proc` is required for the profile lock), Node.js 24+, pnpm 12.5.1, and DSH `0.2.1-alpha.3`. Browser tests use Playwright-managed Chromium and a Node HTTP/HTTPS forwarder.
|
|
6
6
|
|
|
7
7
|
## Set up and check a checkout
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ pnpm pack:local
|
|
|
14
14
|
pnpm smoke
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
`pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.1.
|
|
17
|
+
`pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.1.9.tgz` after static checks; it does not publish. `pnpm smoke` installs that archive into an isolated DSH home, starts the pinned DSH runtime briefly, checks readiness, anonymous redirection/denial and an online CLI status, then stops it.
|
|
18
18
|
|
|
19
19
|
## Use the isolated development profile
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ The scripts manage only `.dev/runtime-<version>` and `.dev/dsh-home` under this
|
|
|
29
29
|
For direct inspection, use the same isolated home explicitly:
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-alpha.
|
|
32
|
+
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-alpha.3/node_modules/.bin/dsh" plugin --profile web exec dsh-auth-remote status --json
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
The development home contains test account data. Keep it private and do not commit or copy it into a deployment profile.
|
|
@@ -38,15 +38,17 @@ The development home contains test account data. Keep it private and do not comm
|
|
|
38
38
|
|
|
39
39
|
`pnpm test:unit` covers the auth state machine, TOTP, backup codes, origin policy, translations, storage durability and lock recovery. `pnpm test:integration` exercises real HTTP/WebSocket sockets, native readiness, cookies, origin decisions and revocation. `pnpm test:cli` builds the real archive and tests interactive and noninteractive commands against isolated profiles and Unix sockets. `pnpm test:browser` boots the selected DSH version with temporary profiles and verifies the login and Security UI, native settings, workspace, upload/preview, SSE, WebSocket and an HTTPS forwarding chain.
|
|
40
40
|
|
|
41
|
-
Browser network traffic uses a Node HTTP/HTTPS forwarder. The dedicated self-signed certificate and key under `tests/fixtures/tls/` are test fixtures only; they are never packaged or deployment credentials. Chat uses a local model stub. No real third-party authorization or paid model request is exercised. The default browser is Playwright Chromium; `DSH_TEST_BROWSER` can select a local browser executable, and `DSH_TEST_BIN` can select another binary only if it reports the exact selected version (default `0.2.1-alpha.
|
|
41
|
+
Browser network traffic uses a Node HTTP/HTTPS forwarder. The dedicated self-signed certificate and key under `tests/fixtures/tls/` are test fixtures only; they are never packaged or deployment credentials. Chat uses a local model stub. No real third-party authorization or paid model request is exercised. The default browser is Playwright Chromium; `DSH_TEST_BROWSER` can select a local browser executable, and `DSH_TEST_BIN` can select another binary only if it reports the exact selected version (default `0.2.1-alpha.3`).
|
|
42
42
|
|
|
43
43
|
The DSH test runtime lives in `.cache/test-runtime/<version>` and is pinned separately from the source dependencies. Host services and React remain external to the client bundle. The [deployment guide](deployment.md) describes profile and backup rules.
|
|
44
44
|
|
|
45
|
-
Before changing compatibility declarations or adaptations, read the [legacy compatibility inventory](legacy-compatibility.md)
|
|
45
|
+
Before changing compatibility declarations or adaptations, read the [legacy compatibility inventory](legacy-compatibility.md). Check runtime admission, test targets, CI and user claims together; remove exclusive runtime code and tests in the same change when its applicable versions leave support. Old plugin configuration follows its own migration policy. Keep shared security checks and update both inventory languages and both matrix views with exact-version evidence.
|
|
46
|
+
|
|
47
|
+
Isolated verification installs use pnpm file copies so shared package hardlink metadata changes cannot trigger client hot reloads in another profile.
|
|
46
48
|
|
|
47
49
|
## Cross-version verification
|
|
48
50
|
|
|
49
|
-
The default test target is DSH `0.2.1-alpha.
|
|
51
|
+
The default test target is DSH `0.2.1-alpha.3`. Set `DSH_TEST_VERSION` to `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.2`, or `0.2.1-alpha.3`; test runtimes live separately under `.cache/test-runtime/<version>` and development runtimes under `.dev/runtime-<version>`. `DSH_TEST_BIN` must report the exact selected version. CI runs CLI, installation smoke and browser tests for all seven versions. Development types and integration tests use the pinned DSH `0.2.1-alpha.3` packages. The source checkout test guide (`tests/README.md`) describes real Loader/model URL checks and native IPv6/TLS positive or unsupported-capability assertions; unavailable native test transport fails instead of skipping.
|
|
50
52
|
|
|
51
53
|
```sh
|
|
52
54
|
DSH_TEST_VERSION=0.1.7-rc.1 pnpm test:cli
|
|
@@ -59,8 +61,16 @@ DSH_TEST_VERSION=0.2.0-rc.2 pnpm test:cli
|
|
|
59
61
|
DSH_TEST_VERSION=0.2.0-rc.2 pnpm test:browser
|
|
60
62
|
DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:cli
|
|
61
63
|
DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:browser
|
|
64
|
+
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:cli
|
|
65
|
+
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:browser
|
|
62
66
|
pnpm test:cli
|
|
63
67
|
pnpm test:browser
|
|
64
68
|
```
|
|
65
69
|
|
|
66
70
|
Browser tests save light/dark, desktop/narrow-screen screenshots under `.cache/ui-review/<version>` for visual review. Security CSS is installed and removed with the plugin, scopes its selectors to the plugin page, and reads the host's live `--dsw-*` tokens. The standalone login uses a subset of DSH 0.2.0-rc.1 theme tokens and the system color scheme without reading host preferences before authentication.
|
|
71
|
+
|
|
72
|
+
Official-account tests use a local Platform stand-in with the actual DSH `0.2.1-alpha.3` account provider. They check the original redirect URI and PKCE verifier during exchange, rejected state/URL/session combinations, duplicate submissions, cancellation, expiry and retries. Browser coverage checks the instruction-first menu and onboarding dialog, failed loopback navigation followed by paste/confirm, blocked popups, live locale and responsive light/dark layout. These tests do not establish a real official-account authorization session.
|
|
73
|
+
|
|
74
|
+
Core account tests load the exact provider from locked development dependencies, so they do not require a pre-existing CLI runtime cache. Browser tests still exercise the provider installed into each isolated DSH profile.
|
|
75
|
+
|
|
76
|
+
This temporary adapter is enabled only on exact `0.2.1-alpha.3`, which alone needs full feature regression. DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.2` need startup, Settings and disabled-feature checks for this change, without a full seven-version rerun. Support-range or shared host adaptation changes still need the complete matrix; CI targets stay unchanged. Later releases default to their native flow. See `DSH-ACCOUNT-001` in the compatibility inventory for public-callback evidence, migration and retirement conditions.
|