mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 04:15:52 +00:00
fix(web-server): harden shared route symlink scanning
This commit is contained in:
1 parent
e3dbc67634
commit
498b66d9cc
3 files changed
+396
-88
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
/**
|
||||
* Resolve Claude config directory with test/dev overrides.
|
||||
* Precedence:
|
||||
* 1. CLAUDE_CONFIG_DIR (explicit override)
|
||||
* 2. CCS_HOME compatibility path (<CCS_HOME>/.claude)
|
||||
* 3. ~/.claude (default)
|
||||
*/
|
||||
export function getClaudeConfigDir(): string {
|
||||
if (process.env.CLAUDE_CONFIG_DIR) {
|
||||
return path.resolve(process.env.CLAUDE_CONFIG_DIR);
|
||||
}
|
||||
|
||||
if (process.env.CCS_HOME) {
|
||||
return path.join(path.resolve(process.env.CCS_HOME), '.claude');
|
||||
}
|
||||
|
||||
return path.join(os.homedir(), '.claude');
|
||||
}
|
||||
|
||||
/** Resolve Claude settings.json path. */
|
||||
export function getClaudeSettingsPath(): string {
|
||||
return path.join(getClaudeConfigDir(), 'settings.json');
|
||||
}
|
||||
Reference in new issue
Block a user