diff --git a/CloudronManifest.json b/CloudronManifest.json index 851f017..7856c4a 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.66", + "version": "0.1.69", "healthCheckPath": "/ping", "httpPort": 3080, "memoryLimit": 1073741824, diff --git a/Dockerfile b/Dockerfile index 6c2ed83..5b2655f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,10 +28,20 @@ RUN apt-get update && apt-get install -y git && \ RUN corepack enable # Set environment variables for web app build -# Set the API endpoint to use current origin - this will work at runtime -ENV NEXT_PUBLIC_ENTE_ENDPOINT="/api" -# Use relative path so it works with any domain -RUN echo "Building with NEXT_PUBLIC_ENTE_ENDPOINT=/api, will work with any domain via Caddy proxy" +# Instead of using a relative path, patch the origins.ts file to use dynamic origin +RUN echo "Patching origins.ts to use dynamic API endpoint based on current origin" + +# Patch the origins.ts file to use relative API endpoint instead of hardcoded ente.io +RUN if [ -f "web/packages/base/origins.ts" ]; then \ + echo "Patching origins.ts to use window.location.origin + '/api'"; \ + sed -i 's|(await customAPIOrigin()) ?? "https://api.ente.io"|(await customAPIOrigin()) ?? (typeof window !== "undefined" ? window.location.origin + "/api" : "https://api.ente.io")|g' web/packages/base/origins.ts; \ + sed -i 's|(await customAPIOrigin()) ?? "https://uploader.ente.io"|(await customAPIOrigin()) ?? (typeof window !== "undefined" ? window.location.origin + "/api" : "https://uploader.ente.io")|g' web/packages/base/origins.ts; \ + echo "Patched origins.ts:"; \ + cat web/packages/base/origins.ts | head -20; \ + else \ + echo "origins.ts not found, checking alternative paths"; \ + find . -name "origins.ts" -type f; \ + fi # Debugging the repository structure RUN find . -type d -maxdepth 3 | sort diff --git a/debug-network.html b/debug-network.html new file mode 100644 index 0000000..e4a788a --- /dev/null +++ b/debug-network.html @@ -0,0 +1,38 @@ + + + + Debug Ente Auth Network Calls + + +

Debug Ente Auth Network Calls

+
+ + + + \ No newline at end of file diff --git a/ente-source b/ente-source new file mode 160000 index 0000000..702b03a --- /dev/null +++ b/ente-source @@ -0,0 +1 @@ +Subproject commit 702b03a288cfe52d51bd2eb926737dcfb0b30374 diff --git a/start.sh b/start.sh index 37aa143..d73d816 100644 --- a/start.sh +++ b/start.sh @@ -152,9 +152,9 @@ email: # WebAuthn configuration for passkey support webauthn: - rpid: "${CLOUDRON_APP_FQDN:-localhost}" + rpid: "${CLOUDRON_APP_DOMAIN:-localhost}" rporigins: - - "https://${CLOUDRON_APP_FQDN:-localhost}" + - "https://${CLOUDRON_APP_DOMAIN:-localhost}" EOF chmod 600 "$MUSEUM_CONFIG" log "INFO" "Created Museum configuration at ${MUSEUM_CONFIG}"