Dev (#164)
* chore(release): stop publishing legacy Windows update packages * feat(agents): support OpenCode Desktop across platforms Detect CLI and desktop installations on Windows, macOS, and Linux, and add separate launch and restart controls. Closes #156 * fix(codex): align model display names and show total session count - preserve runtime model identity in generated catalogs - count distinct sessions across database and rollout sources - update session count labels in all supported languages * fix(codex): keep config and auth files in sync - generate auth.json for API key configuration - preserve and validate OAuth credentials - include auth.json in transactional updates and rollback - retain compatibility with legacy Codex configuration states * fix(cpa-gui): update version to 0.2.59 in Cargo files * fix(codex): preserve OAuth mode after closing configuration * feat(config): add TLS management and protocol-aware local URLs - add TLS controls to advanced settings - persist certificate and private key paths - restart the core after TLS changes - switch WebUI, API and management URLs between HTTP and HTTPS - synchronize agent configurations and detection with the active protocol * refactor(config): reorganize network, routing, and TLS settings - split network settings and session routing into separate tabs - move TLS configuration into network settings - preserve TLS restart and HTTPS URL synchronization behavior * feat(config): add independent network settings and custom listen IP * fix(navigation): allow access to usage records while core is stopped * refactor(home): show a single API URL based on the configured listen IP * feat(config): add file pickers for TLS certificate and private key
This commit is contained in:
1 parent
c3cd57bd8e
commit
2b9ceb11fb
21 files changed
+1355
-261
No files matched your search
@@ -5,20 +5,39 @@ export type ClientApiProfile = {
|
||||
name: string;
|
||||
description: string;
|
||||
baseUrl: string;
|
||||
lanUrl: string | null;
|
||||
};
|
||||
|
||||
const safeLocalPort = (port: number) =>
|
||||
Number.isInteger(port) && port >= 1 && port <= 65535 ? port : 8317;
|
||||
|
||||
export function webUiManagementUrl(port: number): string {
|
||||
return `http://127.0.0.1:${safeLocalPort(port)}/management.html#/login`;
|
||||
const normalizedConnectHost = (listenHost: string) => {
|
||||
const host = listenHost.trim().replace(/^\[|\]$/g, '');
|
||||
if (!host || host === '0.0.0.0') return '127.0.0.1';
|
||||
if (host === '::') return '::1';
|
||||
return host;
|
||||
};
|
||||
|
||||
const urlHost = (host: string) => host.includes(':') ? `[${host}]` : host;
|
||||
|
||||
export function webUiManagementUrl(
|
||||
port: number,
|
||||
tlsEnabled = false,
|
||||
listenHost = '127.0.0.1',
|
||||
): string {
|
||||
const scheme = tlsEnabled ? 'https' : 'http';
|
||||
const host = urlHost(normalizedConnectHost(listenHost));
|
||||
return `${scheme}://${host}:${safeLocalPort(port)}/management.html#/login`;
|
||||
}
|
||||
|
||||
export function clientApiProfiles(port: number, lanIpv4?: string | null): ClientApiProfile[] {
|
||||
export function clientApiProfiles(
|
||||
port: number,
|
||||
tlsEnabled = false,
|
||||
listenHost = '127.0.0.1',
|
||||
): ClientApiProfile[] {
|
||||
const safePort = safeLocalPort(port);
|
||||
const origin = `http://127.0.0.1:${safePort}`;
|
||||
const lanOrigin = lanIpv4?.trim() ? `http://${lanIpv4.trim()}:${safePort}` : null;
|
||||
const scheme = tlsEnabled ? 'https' : 'http';
|
||||
const connectHost = normalizedConnectHost(listenHost);
|
||||
const origin = `${scheme}://${urlHost(connectHost)}:${safePort}`;
|
||||
|
||||
return [
|
||||
{
|
||||
@@ -26,21 +45,18 @@ export function clientApiProfiles(port: number, lanIpv4?: string | null): Client
|
||||
name: 'OpenAI',
|
||||
description: translate(getCurrentLocale(), 'kernel.access.openaiDescription'),
|
||||
baseUrl: `${origin}/v1`,
|
||||
lanUrl: lanOrigin ? `${lanOrigin}/v1` : null,
|
||||
},
|
||||
{
|
||||
id: 'claude',
|
||||
name: 'Claude',
|
||||
description: translate(getCurrentLocale(), 'kernel.access.claudeDescription'),
|
||||
baseUrl: origin,
|
||||
lanUrl: lanOrigin,
|
||||
},
|
||||
{
|
||||
id: 'gemini',
|
||||
name: 'Gemini',
|
||||
description: translate(getCurrentLocale(), 'kernel.access.geminiDescription'),
|
||||
baseUrl: origin,
|
||||
lanUrl: lanOrigin,
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user