feat(docker): add PUID/PGID and user mapping to avoid bind mount permission issues; feat(setup): prompt for admin email interactively; docs: PUID/PGID in .env.example
Mirror to GitHub / mirror (push) Successful in 1m41s
Test and Lint / backend-test (push) Successful in 1m47s
Test and Lint / frontend-test (push) Successful in 2m10s
Version and Release / version-bump (push) Successful in 1m5s
Version and Release / trigger-drone (push) Successful in 3s

This commit is contained in:
2025-09-14 15:45:16 +02:00
parent 05ebaaeedb
commit 410a33fecf
3 changed files with 30 additions and 1 deletions
+6
View File
@@ -53,6 +53,12 @@ VITE_API_URL=/api
# Timezone # Timezone
TZ=UTC TZ=UTC
# Runtime user mapping for Docker (optional)
# Set these to your host user's UID/GID to avoid permission issues on bind mounts.
# Run `id -u` and `id -g` on host to get values. Defaults to 1001.
PUID=1001
PGID=1001
# Analytics (Optional - Umami) # Analytics (Optional - Umami)
VITE_UMAMI_URL= VITE_UMAMI_URL=
VITE_UMAMI_WEBSITE_ID= VITE_UMAMI_WEBSITE_ID=
+5
View File
@@ -29,6 +29,11 @@ services:
- ADMIN_URL=${ADMIN_URL:-http://localhost:3001} - ADMIN_URL=${ADMIN_URL:-http://localhost:3001}
- TZ=${TZ:-UTC} - TZ=${TZ:-UTC}
- STORAGE_PATH=/app/storage - STORAGE_PATH=/app/storage
# Optional: run container as matching host user to avoid bind mount permission issues
- PUID=${PUID:-1001}
- PGID=${PGID:-1001}
# Use host-matching user ID/GID so bind-mounted folders are writable
user: "${PUID:-1001}:${PGID:-1001}"
volumes: volumes:
- ./events:/app/events - ./events:/app/events
- ./data:/app/data - ./data:/app/data
+18
View File
@@ -77,6 +77,21 @@ run_as_user() {
fi fi
} }
# Prompt for admin email interactively (unless provided or unattended)
prompt_admin_email() {
if [[ -n "$ADMIN_EMAIL" ]]; then
return
fi
if [[ "$UNATTENDED" == "true" ]]; then
ADMIN_EMAIL="admin@example.com"
return
fi
echo
echo "Please enter the admin email address (used for the initial admin account):"
read -p "Admin email [admin@example.com]: " ADMIN_EMAIL
ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
}
print_banner() { print_banner() {
echo -e "${PURPLE}" echo -e "${PURPLE}"
echo "╔════════════════════════════════════════════════════════════════════════╗" echo "╔════════════════════════════════════════════════════════════════════════╗"
@@ -1284,6 +1299,9 @@ main() {
# Check system requirements # Check system requirements
check_system_requirements check_system_requirements
# Prompt for admin email (design choice: always ask unless provided)
prompt_admin_email
# Configure email (optional) # Configure email (optional)
configure_email configure_email