diff --git a/start.sh b/start.sh index 2524bba..d040cb6 100644 --- a/start.sh +++ b/start.sh @@ -1597,6 +1597,17 @@ window.process = window.process || {}; window.process.env = window.process.env || {}; window.process.env.NEXT_PUBLIC_ENTE_ENDPOINT = '${API_ENDPOINT}'; window.process.env.NEXT_PUBLIC_ENTE_PUBLIC_ALBUMS_ENDPOINT = '${CLOUDRON_APP_ORIGIN}/public'; +window.process.env.NEXT_PUBLIC_REACT_APP_ENTE_ENDPOINT = '${API_ENDPOINT}'; +window.process.env.REACT_APP_ENTE_ENDPOINT = '${API_ENDPOINT}'; + +// Make sure all URLs are properly formatted for URL constructor +if (!window.ENTE_CONFIG.API_URL.startsWith('http')) { + console.log('Adding https:// prefix to API_URL'); + window.ENTE_CONFIG.API_URL = window.location.origin + window.ENTE_CONFIG.API_URL; + window.process.env.NEXT_PUBLIC_ENTE_ENDPOINT = window.location.origin + window.process.env.NEXT_PUBLIC_ENTE_ENDPOINT; + window.process.env.REACT_APP_ENTE_ENDPOINT = window.location.origin + window.process.env.REACT_APP_ENTE_ENDPOINT; + window.process.env.NEXT_PUBLIC_REACT_APP_ENTE_ENDPOINT = window.location.origin + window.process.env.NEXT_PUBLIC_REACT_APP_ENTE_ENDPOINT; +} console.log('Ente runtime config loaded from runtime-config.js'); console.log('API_URL:', window.ENTE_CONFIG.API_URL); @@ -1679,6 +1690,17 @@ cat > /app/data/caddy/Caddyfile <