mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-04 06:19:31 +00:00
fix(config): migrate all hardcoded paths to getCcsDir() and improve validation
- Replace os.homedir() + '.ccs' with getCcsDir() across 14 instances in 13 files: version-command, model-config, openrouter-catalog, config-checks, disk-cache, aggregator, auth-middleware, shell-completion, shared-manager, recovery-manager, auto-repair, delegation-validator, claude-dir-installer, cliproxy executor - Add isDirectory() validation for --config-dir argument in ccs.ts - Make detectCloudSyncPath() case-insensitive for cloud provider matching - Fix help-command.ts to use dynamic dirDisplay for all path references - Add 5 new tests: setGlobalConfigDir precedence, relative path resolution, reset behavior, getCcsDirSource with --config-dir, case-insensitive detection - Clean up unused os imports after migration
This commit is contained in:
@@ -10,7 +10,7 @@ import { getDashboardAuthConfig } from '../../config/unified-config-loader';
|
||||
import crypto from 'crypto';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
// Extend Express Request with session
|
||||
declare module 'express-session' {
|
||||
@@ -24,7 +24,7 @@ declare module 'express-session' {
|
||||
const PUBLIC_PATHS = ['/api/auth/login', '/api/auth/check', '/api/auth/setup', '/api/health'];
|
||||
|
||||
/** Path to persistent session secret file */
|
||||
const SESSION_SECRET_PATH = path.join(os.homedir(), '.ccs', '.session-secret');
|
||||
const SESSION_SECRET_PATH = path.join(getCcsDir(), '.session-secret');
|
||||
|
||||
/**
|
||||
* Generate or retrieve persistent session secret.
|
||||
|
||||
Reference in New Issue
Block a user