Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3-pyfuse3=${PYFUSE3_VERSION} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& mkdir -p /app/data
&& mkdir -p /app/data /cache \
&& chmod 1777 /cache

COPY --from=builder /opt/venv /opt/venv

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ Borgitory is a comprehensive web-based management interface for BorgBackup repos
image: mlapaglia/borgitory:latest
ports:
- "8000:8000"
# Optional: run as your host user to avoid root-owned files (set UID/GID first)
# user: "${UID}:${GID}"
volumes:
- ./data:/app/data # database and encryption key location
- ./cache:/cache # borg cache/config/security directories
- /path/to/backup/sources:/sources:ro
- /path/to/any/backup/repos:/repos:ro
cap_add:
Expand All @@ -68,6 +71,9 @@ Borgitory is a comprehensive web-based management interface for BorgBackup repos
docker-compose up -d
```

When running with a non-root container user, ensure mounted directories are writable by that user.
On Linux you can set these variables with `export UID; export GID=$(id -g)` before starting Compose.

2. **Access the web interface**
- Open <http://localhost:8000> in your browser
- Create your first admin account on initial setup
Expand Down
29 changes: 26 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
#!/bin/bash

echo "🚀 Starting Borgitory with HTTP on port 8000"
ensure_writable_dir() {
mkdir -p "$1" 2>/dev/null && [ -d "$1" ] && [ -w "$1" ] && [ -x "$1" ]
}

echo "Starting Borgitory with HTTP on port 8000"

if [ -z "${HOME}" ]; then
echo "ERROR: HOME is not set. Set HOME to a writable directory for Borg runtime files."
exit 1
fi

if ! ensure_writable_dir "${HOME}"; then
echo "ERROR: HOME=${HOME} is not writable. Set HOME to a writable directory."
exit 1
fi

if [ -z "${BORG_BASE_DIR}" ]; then
export BORG_BASE_DIR="/cache/borg"
fi

if ! ensure_writable_dir "${BORG_BASE_DIR}"; then
echo "ERROR: BORG_BASE_DIR=${BORG_BASE_DIR} is not writable. Set BORG_BASE_DIR to a writable directory."
exit 1
fi

if [ "$BORGITORY_DEBUG" = "true" ]; then
echo "🐛 Debug mode: Debugger listening on port 5678"
python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m borgitory.cli serve --host 0.0.0.0 --port 8000
echo "Debug mode: Debugger listening on port 5678"
exec python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m borgitory.cli serve --host 0.0.0.0 --port 8000
else
exec borgitory serve --host 0.0.0.0 --port 8000
fi
Loading