From a0af6ec84c1c7a83edb51c772433130334bdc83b Mon Sep 17 00:00:00 2001 From: Andreas Dueren Date: Fri, 1 Aug 2025 13:55:53 -0600 Subject: [PATCH] Fix static asset routing for all web apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add specific _next asset routes for accounts, auth, cast apps - Add image asset routes for each app - Ensure each app's assets are served from correct directory - Keep photos app routing unchanged Should fix accounts/auth/cast apps loading issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CloudronManifest.json | 2 +- start.sh | 87 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 81 insertions(+), 8 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 0a38a4a..b353c7d 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -7,7 +7,7 @@ "contactEmail": "contact@ente.io", "tagline": "Open Source End-to-End Encrypted Photos & Authentication", "upstreamVersion": "1.0.0", - "version": "0.1.79", + "version": "0.1.80", "healthCheckPath": "/ping", "httpPort": 3080, "memoryLimit": 1073741824, diff --git a/start.sh b/start.sh index c3c4b35..9c7fe78 100644 --- a/start.sh +++ b/start.sh @@ -666,18 +666,91 @@ cat > "$CADDY_CONFIG" << EOF reverse_proxy localhost:8080 } - # Static files for Next.js assets from all apps - handle /_next/* { - @photosNext path /_next/* - handle @photosNext { - root * /app/web/photos - file_server - } + # Next.js assets for cast app + handle_path /cast/_next/* { + root * /app/web/cast + file_server header { Cache-Control "public, max-age=31536000" Access-Control-Allow-Origin "*" } } + + # Next.js assets for accounts app + handle_path /accounts/_next/* { + root * /app/web/accounts + file_server + header { + Cache-Control "public, max-age=31536000" + Access-Control-Allow-Origin "*" + } + } + + # Next.js assets for auth app + handle_path /auth/_next/* { + root * /app/web/auth + file_server + header { + Cache-Control "public, max-age=31536000" + Access-Control-Allow-Origin "*" + } + } + + # Next.js assets for photos app + handle_path /photos/_next/* { + root * /app/web/photos + file_server + header { + Cache-Control "public, max-age=31536000" + Access-Control-Allow-Origin "*" + } + } + + # Generic _next assets (fallback to photos) + handle /_next/* { + root * /app/web/photos + file_server + header { + Cache-Control "public, max-age=31536000" + Access-Control-Allow-Origin "*" + } + } + + # Images for cast app + handle_path /cast/images/* { + root * /app/web/cast + file_server + header { + Cache-Control "public, max-age=86400" + } + } + + # Images for accounts app + handle_path /accounts/images/* { + root * /app/web/accounts + file_server + header { + Cache-Control "public, max-age=86400" + } + } + + # Images for auth app + handle_path /auth/images/* { + root * /app/web/auth + file_server + header { + Cache-Control "public, max-age=86400" + } + } + + # Images for photos app + handle_path /photos/images/* { + root * /app/web/photos + file_server + header { + Cache-Control "public, max-age=86400" + } + } # Photos app handle_path /photos/* {