fix: updater resolves project_root to / in Docker containers

In Docker, main.py lives at /app/main.py so Path.parent.parent
resolves to filesystem root /, causing PermissionError on .github
and other dirs. Now detects this case and falls back to cwd.
Also grants backenduser write access to /app for auto-update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Former-commit-id: 12c8bb5816a70161d5ab5d79f9240e7eab6e6e15
This commit is contained in:
anoracleofra-code
2026-03-14 14:34:11 -06:00
co-authored by Claude Opus 4.6
parent b99a5e5d66
commit 95474c3ac5
2 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -23,8 +23,10 @@ RUN npm ci --omit=dev
COPY . .
# Create a non-root user for security
# Grant write access to /app so the auto-updater can extract files
RUN adduser --system --uid 1001 backenduser \
&& chown -R backenduser /app
&& chown -R backenduser /app \
&& chmod -R u+w /app
# Switch to the non-root user
USER backenduser