diff --git a/start.sh b/start.sh index 330f1cd..fa228a7 100644 --- a/start.sh +++ b/start.sh @@ -677,8 +677,14 @@ EOF chmod 644 /app/data/web/runtime-config.js -# Create a custom URL patch file to fix the URL constructor error -echo "==> Creating URL and SRP patch file" +# Create necessary directories +mkdir -p /app/data/web/photos/static +mkdir -p /app/data/web/photos/_next/static/runtime +mkdir -p /app/data/web/accounts +mkdir -p /app/data/web/auth +mkdir -p /app/data/web/cast + +# Now create the ente-patches.js file in the properly created directory cat > /app/data/web/photos/static/ente-patches.js << 'ENDPATCHES' (function() { console.log('Applying Ente URL and SRP patches...'); @@ -1071,47 +1077,120 @@ cat > /app/data/web/photos/static/ente-patches.js << 'ENDPATCHES' })(); ENDPATCHES -# Create the static HTML files with scripts pre-injected -for app_dir in photos accounts auth cast; do - # Create directory for our modified files - mkdir -p /app/data/web/$app_dir - - # If the original index.html exists, copy and modify it - if [ -f "/app/web/$app_dir/index.html" ]; then - echo "==> Copying and modifying index.html for $app_dir app" - cp "/app/web/$app_dir/index.html" "/app/data/web/$app_dir/index.html" +# Create a patched runtime configuration for the Ente web app +cat > /app/data/web/photos/static/runtime-config.js << 'ENDCONFIG' +// Runtime configuration for Ente web app +(function() { + if (typeof window !== 'undefined') { + // Polyfill process for browser environment + if (!window.process) { + window.process = { + env: {}, + nextTick: function(cb) { setTimeout(cb, 0); } + }; + } - # Fix any potential issues with the head tag - if ! grep -q "
" "/app/data/web/$app_dir/index.html"; then - echo "==> Warning: No head tag found in $app_dir/index.html, adding one" - sed -i 's//\n<\/head>/' "/app/data/web/$app_dir/index.html" - fi + const BASE_URL = window.location.origin; + const API_URL = BASE_URL + '/api'; + const PUBLIC_ALBUMS_URL = BASE_URL + '/public'; - # Insert config scripts right after the opening head tag - sed -i 's//\n - - - - -Loading...
-If this page doesn't redirect automatically, click here.
+End-to-end encrypted photo storage and sharing platform. Your photos stay private, always.
+ Get Started +