From c61c35ebad88ee8953bc5a9cbf2119e2e2737b7c Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 22 Oct 2025 13:01:52 -0400 Subject: [PATCH] fix: env files and logo --- .env.example | 7 +++++++ docker-compose.example.yml | 23 +++++++++++------------ start_web.py | 9 +++++++++ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.env.example b/.env.example index 5b6750d..7ef2928 100644 --- a/.env.example +++ b/.env.example @@ -23,6 +23,9 @@ DOWNLOAD_PATH_INDICATORS=/downloads/,/nzbget/,/completed/,/sabnzbd/,/torrents/ # =========================================== # SERVER CONFIGURATION # =========================================== +# Timezone for container logging and timestamps +TZ=America/New_York + # NFOGuard Core API (webhooks, processing, database management) CORE_API_HOST=0.0.0.0 CORE_API_PORT=8080 @@ -31,6 +34,9 @@ CORE_API_PORT=8080 WEB_API_HOST=0.0.0.0 WEB_API_PORT=8081 +# External port where web interface is accessible (for dynamic port reference) +WEB_EXTERNAL_PORT=8081 + # =========================================== # DATABASE CONFIGURATION # =========================================== @@ -45,6 +51,7 @@ DB_TYPE=postgresql DB_HOST=nfoguard-db # Container name from docker-compose DB_PORT=5432 DB_NAME=nfoguard +DB_USER=nfoguard # Legacy SQLite Configuration (Deprecated in v2.6+) # Only use for existing SQLite installations diff --git a/docker-compose.example.yml b/docker-compose.example.yml index d1401d9..8240232 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -16,11 +16,14 @@ services: image: postgres:15-alpine container_name: nfoguard-db restart: unless-stopped + env_file: + - .env + - .env.secrets environment: - - POSTGRES_DB=${DB_NAME:-nfoguard} - - POSTGRES_USER=${DB_USER:-nfoguard} - - POSTGRES_PASSWORD=${DB_PASSWORD:-} - - TZ=${TZ:-America/New_York} + - POSTGRES_DB=${DB_NAME} + - POSTGRES_USER=${DB_USER} + - POSTGRES_PASSWORD=${DB_PASSWORD} + - TZ=${TZ} volumes: - postgres_data:/var/lib/postgresql/data ports: @@ -35,17 +38,15 @@ services: # NFOGuard Core (Processing Engine) nfoguard: - image: gitea.skalas.org/sbcrumb/nfoguard:latest + image: sbcrumb/nfoguard:latest container_name: nfoguard-core restart: unless-stopped env_file: - .env - .env.secrets environment: - - TZ=${TZ:-America/New_York} - - CORE_API_HOST=0.0.0.0 - - CORE_API_PORT=8080 - - WEB_EXTERNAL_PORT=${WEB_API_PORT:-8081} # External port where web interface is accessible + - TZ=${TZ} + - WEB_EXTERNAL_PORT=${WEB_EXTERNAL_PORT} volumes: # Media paths (adjust to your setup) - /mnt/unionfs/Media/TV:/media/TV:ro @@ -70,7 +71,7 @@ services: # NFOGuard Web Interface nfoguard-web: - image: gitea.skalas.org/sbcrumb/nfoguard:latest # Same image as core! + image: sbcrumb/nfoguard:latest # Same image as core! container_name: nfoguard-web restart: unless-stopped command: ["python", "start_web.py"] # Different entry point @@ -79,8 +80,6 @@ services: - .env.secrets environment: - TZ=${TZ:-America/New_York} - - WEB_HOST=0.0.0.0 - - WEB_PORT=8081 ports: - "${WEB_API_PORT:-8081}:8081" # Web Interface depends_on: diff --git a/start_web.py b/start_web.py index 57ddd5b..b77ba63 100644 --- a/start_web.py +++ b/start_web.py @@ -38,11 +38,20 @@ def setup_static_files(app: FastAPI) -> None: static_path = os.path.join(os.path.dirname(__file__), "nfoguard-web", "static") logo_path = os.path.join(os.path.dirname(__file__), "logo") + print(f"🔍 Checking static path: {static_path} (exists: {os.path.exists(static_path)})") + print(f"🔍 Checking logo path: {logo_path} (exists: {os.path.exists(logo_path)})") + if os.path.exists(static_path): app.mount("/static", StaticFiles(directory=static_path), name="static") + print(f"✅ Mounted static files from: {static_path}") + else: + print(f"❌ Static path not found: {static_path}") if os.path.exists(logo_path): app.mount("/logo", StaticFiles(directory=logo_path), name="logo") + print(f"✅ Mounted logo files from: {logo_path}") + else: + print(f"❌ Logo path not found: {logo_path}") # Serve index.html at root @app.get("/")