fix for log file permissions

This commit is contained in:
fuomag9
2026-02-28 21:11:26 +01:00
parent f4acb0f637
commit f7cd854cda
2 changed files with 3 additions and 2 deletions

View File

@@ -1586,7 +1586,8 @@ async function buildCaddyDocument() {
http_access: {
writer: {
output: "file",
filename: "/logs/access.log"
filename: "/logs/access.log",
mode: "0640"
},
encoder: {
format: loggingFormat

View File

@@ -139,7 +139,7 @@ async function readLines(startOffset: number): Promise<{ lines: string[]; newOff
const stream = createReadStream(LOG_FILE, { start: startOffset, encoding: 'utf8' });
stream.on('error', (err: NodeJS.ErrnoException) => {
if (err.code === 'ENOENT') resolve({ lines: [], newOffset: startOffset });
if (err.code === 'ENOENT' || err.code === 'EACCES') resolve({ lines: [], newOffset: startOffset });
else reject(err);
});