-
Notifications
You must be signed in to change notification settings - Fork 0
feat(demo): add docker/demo compose with NEXTAUTH_URL for demo.vectorflow.sh #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+72
−3
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Database password for PostgreSQL. Use a random 32+ character string. | ||
| POSTGRES_PASSWORD=change-me-to-a-random-32-char-string | ||
|
|
||
| # Secret used to sign NextAuth sessions and to derive the initial encryption key. | ||
| # Use a random 32+ character string. Generate with: openssl rand -base64 32 | ||
| NEXTAUTH_SECRET=change-me-to-a-random-32-char-string | ||
|
|
||
| # VF_VERSION pins the server image tag (default: latest). | ||
| #VF_VERSION=1.2.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| services: | ||
| postgres: | ||
| container_name: vectorflow-demo-postgres | ||
| image: timescale/timescaledb:latest-pg16 | ||
| environment: | ||
| POSTGRES_DB: vectorflow | ||
| POSTGRES_USER: vectorflow | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
| volumes: | ||
| - pgdata:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U vectorflow"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
| restart: unless-stopped | ||
|
|
||
| vectorflow: | ||
| container_name: vectorflow-demo-server | ||
| image: ghcr.io/terrifiedbug/vectorflow-server:${VF_VERSION:-latest} | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
| ports: | ||
| - "3000:3000" | ||
| environment: | ||
| DATABASE_URL: postgresql://vectorflow:${POSTGRES_PASSWORD}@postgres:5432/vectorflow | ||
| NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} | ||
| NEXTAUTH_URL: https://demo.vectorflow.sh | ||
| AUTH_TRUST_HOST: "true" | ||
| VF_DEMO_MODE: "true" | ||
| volumes: | ||
| - vfdata:/app/.vectorflow | ||
| - backups:/backups | ||
| healthcheck: | ||
| test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health/ready"] | ||
| interval: 30s | ||
| timeout: 5s | ||
| start_period: 30s | ||
| retries: 3 | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| memory: 1g | ||
| cpus: "2.0" | ||
| restart: unless-stopped | ||
|
|
||
| volumes: | ||
| pgdata: | ||
| name: vectorflow-demo-pgdata | ||
| vfdata: | ||
| name: vectorflow-demo-data | ||
| backups: | ||
| name: vectorflow-demo-backups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AUTH_TRUST_HOSTwith optionalNEXTAUTH_URLWhen
AUTH_TRUST_HOSTis"true"andNEXTAUTH_URLis absent or empty, NextAuth v5 infers its canonical URL from theX-Forwarded-Host/Hostrequest header. In this compose,NEXTAUTH_URLcomes from an optional env var with no required default, so Docker passes an empty string when operators omit it. An attacker who can reach port 3000 directly and inject a craftedX-Forwarded-Hostheader can make NextAuth treat their domain as a valid callback origin, enabling open-redirect and OAuth callback-hijacking.The demo compose avoids this correctly by hardcoding the canonical URL. The server compose should either remove
AUTH_TRUST_HOST(operators who need it can add it themselves when they also setNEXTAUTH_URL), or enforce thatNEXTAUTH_URLis provided using Docker Compose's${VAR:?error message}required-variable syntax, which aborts startup with a clear error if the variable is unset.Prompt To Fix With AI