diff --git a/.env.example b/.env.example index a7142e9..3265047 100644 --- a/.env.example +++ b/.env.example @@ -53,6 +53,12 @@ VITE_API_URL=/api # Timezone 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) VITE_UMAMI_URL= VITE_UMAMI_WEBSITE_ID= diff --git a/docker-compose.yml b/docker-compose.yml index 6bc8b9b..ad4680d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,11 @@ services: - ADMIN_URL=${ADMIN_URL:-http://localhost:3001} - TZ=${TZ:-UTC} - 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: - ./events:/app/events - ./data:/app/data @@ -122,4 +127,4 @@ volumes: networks: picpeak-network: - driver: bridge \ No newline at end of file + driver: bridge diff --git a/scripts/setup.sh b/scripts/setup.sh index 4b28de0..93d28a2 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -77,6 +77,21 @@ run_as_user() { 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() { echo -e "${PURPLE}" echo "╔════════════════════════════════════════════════════════════════════════╗" @@ -1284,6 +1299,9 @@ main() { # Check system requirements check_system_requirements + # Prompt for admin email (design choice: always ask unless provided) + prompt_admin_email + # Configure email (optional) configure_email