Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94d8e73

Browse files
author
Corlzee
committed
feat: Add configuration schema for safety features
- Add readOnlyDirectories for protected paths- Add requireExplicitPermission flag for destructive commands- Add allowedSudoCommands array for sudo whitelist- Backward compatible with defaults (empty arrays, false flag)This commit adds configuration without changing behavior.
1 parent218531b commit94d8e73

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/config-manager.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export interface ServerConfig {
1010
blockedCommands?:string[];
1111
defaultShell?:string;
1212
allowedDirectories?:string[];
13+
readOnlyDirectories?:string[];// Directories that can be read but not modified
14+
requireExplicitPermission?:boolean;// Require explicit flag for destructive commands
15+
allowedSudoCommands?:string[];// Whitelist of allowed sudo commands with pattern support
1316
telemetryEnabled?:boolean;// New field for telemetry control
1417
fileWriteLineLimit?:number;// Line limit for file write operations
1518
fileReadLineLimit?:number;// Default line limit for file read operations (changed from character-based)
@@ -131,6 +134,9 @@ class ConfigManager {
131134
],
132135
defaultShell:os.platform()==='win32' ?'powershell.exe' :'/bin/sh',
133136
allowedDirectories:[],
137+
readOnlyDirectories:[],// Empty by default - no directories are read-only
138+
requireExplicitPermission:false,// Default to false for backward compatibility
139+
allowedSudoCommands:[],// Empty array allows no sudo commands by default
134140
telemetryEnabled:true,// Default to opt-out approach (telemetry on by default)
135141
fileWriteLineLimit:50,// Default line limit for file write operations (changed from 100)
136142
fileReadLineLimit:1000// Default line limit for file read operations (changed from character-based)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp