diff --git a/src/main/docker.js b/src/main/docker.js index 4a1ff3d..76df610 100644 --- a/src/main/docker.js +++ b/src/main/docker.js @@ -164,7 +164,10 @@ class DockerManager { async readStack(id, file) { const s = this.get(id); const f = absPath(file); - const r = await this.sh(s, `cat ${q(f)} && printf '\\n\\0' && { cat ${q(dirname(f) + '/.env')} 2>/dev/null || true; }`); + // .env wird mit umask 077 geschrieben – beim Speichern per sudo gehört sie root. Dann scheitert cat mit + // „Permission denied“ und sh() wiederholt das Lesen per sudo (vorher wurde der Fehler verschluckt). + const env = q(dirname(f) + '/.env'); + const r = await this.sh(s, `cat ${q(f)} && printf '\\n\\0' && { [ ! -e ${env} ] || cat ${env}; }`); if (r.code) throw new Error(lastLine(r.err) || i18n.t('Could not read {file}', { file: f })); const i = r.out.lastIndexOf('\n\0'); return { compose: r.out.slice(0, i), env: r.out.slice(i + 2) };