mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-19 08:14:52 +00:00
fix(logging): harden log storage and cleanup
This commit is contained in:
1 parent
a47cf022c6
commit
1923fce2ed
5 files changed
+151
-9
No files matched your search
@@ -3,6 +3,7 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
ensureLoggingDirectories,
|
||||
getCurrentLogPath,
|
||||
getLogArchiveDir,
|
||||
getNativeLogsDir,
|
||||
@@ -43,4 +44,14 @@ describe('logging path helpers', () => {
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
it('creates log directories with restrictive permissions', () => {
|
||||
ensureLoggingDirectories();
|
||||
|
||||
const logsMode = fs.statSync(getNativeLogsDir()).mode & 0o777;
|
||||
const archiveMode = fs.statSync(getLogArchiveDir()).mode & 0o777;
|
||||
|
||||
expect(logsMode).toBe(0o700);
|
||||
expect(archiveMode).toBe(0o700);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user