mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 14:15:56 +00:00
feat(config): add proxy section to unified config loader
- merge proxy config with defaults in loadUnifiedConfig - preserve user overrides for remote/fallback/local sections
This commit is contained in:
1 parent
eff2e2d29f
commit
197174441f
1 file changed
+19
@@ -16,6 +16,7 @@ import {
|
|||||||
UNIFIED_CONFIG_VERSION,
|
UNIFIED_CONFIG_VERSION,
|
||||||
DEFAULT_COPILOT_CONFIG,
|
DEFAULT_COPILOT_CONFIG,
|
||||||
DEFAULT_GLOBAL_ENV,
|
DEFAULT_GLOBAL_ENV,
|
||||||
|
DEFAULT_PROXY_CONFIG,
|
||||||
GlobalEnvConfig,
|
GlobalEnvConfig,
|
||||||
} from './unified-config-types';
|
} from './unified-config-types';
|
||||||
import { isUnifiedConfigEnabled } from './feature-flags';
|
import { isUnifiedConfigEnabled } from './feature-flags';
|
||||||
@@ -177,6 +178,24 @@ function mergeWithDefaults(partial: Partial<UnifiedConfig>): UnifiedConfig {
|
|||||||
enabled: partial.global_env?.enabled ?? true,
|
enabled: partial.global_env?.enabled ?? true,
|
||||||
env: partial.global_env?.env ?? { ...DEFAULT_GLOBAL_ENV },
|
env: partial.global_env?.env ?? { ...DEFAULT_GLOBAL_ENV },
|
||||||
},
|
},
|
||||||
|
// Proxy config - remote/local CLIProxyAPI settings
|
||||||
|
proxy: {
|
||||||
|
remote: {
|
||||||
|
enabled: partial.proxy?.remote?.enabled ?? DEFAULT_PROXY_CONFIG.remote.enabled,
|
||||||
|
host: partial.proxy?.remote?.host ?? DEFAULT_PROXY_CONFIG.remote.host,
|
||||||
|
port: partial.proxy?.remote?.port ?? DEFAULT_PROXY_CONFIG.remote.port,
|
||||||
|
protocol: partial.proxy?.remote?.protocol ?? DEFAULT_PROXY_CONFIG.remote.protocol,
|
||||||
|
auth_token: partial.proxy?.remote?.auth_token ?? DEFAULT_PROXY_CONFIG.remote.auth_token,
|
||||||
|
},
|
||||||
|
fallback: {
|
||||||
|
enabled: partial.proxy?.fallback?.enabled ?? DEFAULT_PROXY_CONFIG.fallback.enabled,
|
||||||
|
auto_start: partial.proxy?.fallback?.auto_start ?? DEFAULT_PROXY_CONFIG.fallback.auto_start,
|
||||||
|
},
|
||||||
|
local: {
|
||||||
|
port: partial.proxy?.local?.port ?? DEFAULT_PROXY_CONFIG.local.port,
|
||||||
|
auto_start: partial.proxy?.local?.auto_start ?? DEFAULT_PROXY_CONFIG.local.auto_start,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user