Enable non-root Docker runtime for repository creation paths#237
Enable non-root Docker runtime for repository creation paths#237Copilot wants to merge 6 commits into
Conversation
Agent-Logs-Url: https://github.com/mlapaglia/Borgitory/sessions/07e190b9-f50a-4195-8bcf-582b6672d7b4 Co-authored-by: mlapaglia <4184746+mlapaglia@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mlapaglia/Borgitory/sessions/07e190b9-f50a-4195-8bcf-582b6672d7b4 Co-authored-by: mlapaglia <4184746+mlapaglia@users.noreply.github.com>
|
@copilot don't fallback to /tmp, just fail to start with a descriptive error message. get rid of the stupid emojis. |
Agent-Logs-Url: https://github.com/mlapaglia/Borgitory/sessions/513810e4-ad8c-44fe-af8c-9ea05384bebe Co-authored-by: mlapaglia <4184746+mlapaglia@users.noreply.github.com>
Updated in commit cfae5ba. |
There was a problem hiding this comment.
Pull request overview
This PR improves Borgitory’s Docker startup behavior when running as a non-root UID/GID by ensuring Borg runtime state directories are writable (or failing fast with clear errors), and updating container/docs to support a /cache mount point.
Changes:
- Add startup checks in
start.shto require writableHOMEandBORG_BASE_DIR, defaultingBORG_BASE_DIRto/cache/borgwhen unset. - Create
/cachein the runtime image filesystem. - Update README Compose example to document optional UID/GID user mapping and a
/cachevolume.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| start.sh | Adds writable-dir checks for HOME and BORG_BASE_DIR, removes emoji from logs. |
| Dockerfile | Creates /cache directory in the runtime image. |
| README.md | Updates Docker Compose example and notes for non-root runs and /cache volume. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #237 +/- ##
========================================
Coverage 79.68% 79.68%
========================================
Files 147 147
Lines 13870 13870
========================================
Hits 11052 11052
Misses 2818 2818
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Running Borgitory in Docker as a non-root UID/GID could fail during repo creation because Borg runtime state paths were not guaranteed writable outside root. This change makes container startup resilient to non-root permissions while keeping root behavior unchanged.
Entrypoint runtime defaults (non-root-safe)
start.shnow requires a writableHOMEand fails startup with a descriptive error ifHOMEis unset or not writable.BORG_BASE_DIRis unset, startup defaults it to/cache/borg.BORG_BASE_DIRis not writable.Image filesystem preparation
/cachealongside/app/data, enabling a predictable mount target for Borg state under non-root users.Compose/docs updates for UID/GID mapping
user: "${UID}:${GID}", adds/cachevolume usage, and clarifies settingUID/GIDbefore launch.