From 5068e120253ed216cfe7cf720e4443b346b78ba1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 21 Jul 2025 17:18:51 -0600 Subject: [PATCH] Fix port conflict between Museum server and Caddy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed Museum server to run on port 8080 instead of 3080 - Updated all health check URLs to use port 8080 - Updated Caddy reverse proxy to forward API requests to port 8080 - Added clarifying comment about port usage This resolves the circular reference where both Caddy and Museum were trying to use port 3080. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- start.sh | 66 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/start.sh b/start.sh index 8914ef9..fb09f8a 100644 --- a/start.sh +++ b/start.sh @@ -108,6 +108,21 @@ fi if [ -f "$S3_CONFIG" ]; then source "$S3_CONFIG" log "INFO" "Loaded S3 configuration" + # Validate S3 configuration + if [ -z "$S3_ENDPOINT" ]; then + log "ERROR" "S3_ENDPOINT is not set. S3 storage will not work." + fi + if [ -z "$S3_ACCESS_KEY" ]; then + log "ERROR" "S3_ACCESS_KEY is not set. S3 storage will not work." + fi + if [ -z "$S3_SECRET_KEY" ]; then + log "ERROR" "S3_SECRET_KEY is not set. S3 storage will not work." + fi + if [ -z "$S3_BUCKET" ]; then + log "ERROR" "S3_BUCKET is not set. S3 storage will not work." + fi +else + log "WARN" "S3 configuration file not found at $S3_CONFIG. S3 storage may not be configured." fi # Museum server configuration @@ -118,7 +133,7 @@ if [ ! -f "$MUSEUM_CONFIG" ]; then # Museum server configuration # Server settings -port: 3080 +port: 8080 host: 0.0.0.0 log_level: info @@ -275,6 +290,8 @@ if [ ! -f "$MUSEUM_BIN" ]; then "https://github.com/ente-io/ente/releases/download/latest/museum-${OS}-${ARCH}" "https://github.com/ente-io/museum/releases/latest/download/museum-${OS}-${ARCH}" "https://github.com/ente-io/museum/releases/download/latest/museum-${OS}-${ARCH}" + "https://github.com/ente-io/ente/releases/download/v0.9.0/museum-${OS}-${ARCH}" + "https://github.com/ente-io/museum/releases/download/v0.9.0/museum-${OS}-${ARCH}" ) # Try each URL @@ -453,7 +470,7 @@ const fs = require('fs'); const { execSync } = require('child_process'); const path = require('path'); -const PORT = 3080; +const PORT = 8080; const LOG_FILE = '/app/data/logs/museum.log'; const DB_SCHEMA_FILE = '/app/data/ente/server/schema.sql'; @@ -727,7 +744,7 @@ EOF SUCCESS=false while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - if curl -s http://localhost:3080/health > /dev/null 2>&1; then + if curl -s http://localhost:8080/health > /dev/null 2>&1; then log "INFO" "Node.js placeholder server started successfully" SUCCESS=true break @@ -770,7 +787,7 @@ else SUCCESS=false while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - if curl -s http://localhost:3080/health > /dev/null 2>&1; then + if curl -s http://localhost:8080/health > /dev/null 2>&1; then log "INFO" "Museum server started successfully" SUCCESS=true break @@ -798,52 +815,53 @@ fi log "INFO" "Setting up Caddy web server" # Create Caddy configuration +# Note: Caddy listens on port 3080 (Cloudron's httpPort) and proxies API requests to Museum on port 8080 CADDY_CONFIG="/app/data/Caddyfile" cat > "$CADDY_CONFIG" << EOF :3080 { log { output file /app/data/logs/caddy.log } - - # API endpoints - handle /api/* { - reverse_proxy localhost:3080 - } - - # Public albums endpoint - handle /public/* { - reverse_proxy localhost:3080 - } - - # Health check endpoint - handle /health { - reverse_proxy localhost:3080 - } - + # Static web apps - handle /photos/* { + handle_path /photos/* { root * /app/data/web/photos try_files {path} /index.html file_server } - handle /accounts/* { + handle_path /accounts/* { root * /app/data/web/accounts try_files {path} /index.html file_server } - handle /auth/* { + handle_path /auth/* { root * /app/data/web/auth try_files {path} /index.html file_server } - handle /cast/* { + handle_path /cast/* { root * /app/data/web/cast try_files {path} /index.html file_server } + + # API endpoints + handle /api/* { + reverse_proxy localhost:8080 + } + + # Public albums endpoint + handle /public/* { + reverse_proxy localhost:8080 + } + + # Health check endpoint + handle /health { + reverse_proxy localhost:8080 + } # Redirect root to photos handle {