Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@ services:
backend:
image: zimengxiong/excalidash-backend:latest
container_name: excalidash-backend
environment:
- DATABASE_URL=file:/app/prisma/dev.db
- PORT=8000
- NODE_ENV=production
- AUTH_MODE=${AUTH_MODE:-local}
#environment:
#- DATABASE_URL=file:/app/prisma/dev.db
#- PORT=8000
#- NODE_ENV=production
#- AUTH_MODE=${AUTH_MODE:-local}
# Keep disabled by default; only enable when a trusted proxy sanitizes forwarded headers.
- TRUST_PROXY=false
#- TRUST_PROXY=false
# Optional for single-instance deployments:
# if unset, backend auto-generates and persists one in the volume.
# Recommended to set explicitly for portability and multi-instance setups.
- JWT_SECRET=${JWT_SECRET}
- CSRF_SECRET=${CSRF_SECRET}
#- JWT_SECRET=${JWT_SECRET}
#- CSRF_SECRET=${CSRF_SECRET}
# Optional OIDC settings (required for AUTH_MODE=hybrid or oidc_enforced)
# - OIDC_PROVIDER_NAME=Authentik
# - OIDC_ISSUER_URL=https://auth.example.com/application/o/excalidash/
# - OIDC_CLIENT_ID=your-client-id
# - OIDC_CLIENT_SECRET=your-client-secret
# - OIDC_REDIRECT_URI=https://excalidash.example.com/api/auth/oidc/callback
Comment on lines +5 to 22
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original environment variable configuration has been commented out and duplicated below. This creates maintainability issues as there are now two sets of configuration (one commented, one active). The recommended approach is to either use the original configuration with proper environment variable substitution (${VAR}) or remove the commented section entirely to avoid confusion.

Copilot uses AI. Check for mistakes.
environment:
- DATABASE_URL=file:/app/prisma/dev.db
- PORT=8000
- NODE_ENV=production
- AUTH_MODE=local
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AUTH_MODE is hardcoded to 'local' instead of using the flexible default pattern AUTH_MODE=${AUTH_MODE:-local} from the original configuration. This removes the ability to override the auth mode via environment variables without editing the docker-compose file, which goes against the principle of configuration management and makes the setup less flexible for different deployment scenarios.

Suggested change
- AUTH_MODE=local
- AUTH_MODE=${AUTH_MODE:-local}

Copilot uses AI. Check for mistakes.
- TRUST_PROXY=true
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting TRUST_PROXY=true unconditionally is potentially insecure for a production configuration file. The original docker-compose.prod.yml correctly set TRUST_PROXY=false by default with a comment explaining it should only be enabled when a trusted proxy sanitizes forwarded headers. The README documentation also recommends setting this to a specific hop count (like 1) only when using a reverse proxy. Enabling this without a proper reverse proxy setup could allow header spoofing attacks.

Suggested change
- TRUST_PROXY=true
- TRUST_PROXY=false

Copilot uses AI. Check for mistakes.
- ALLOWED_ORIGIN=http://{{ip_server}}:6767
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable ALLOWED_ORIGIN is not used by the backend application. Based on the backend code (backend/src/config.ts and backend/src/index.ts), the correct variable name is FRONTEND_URL, not ALLOWED_ORIGIN. This variable will have no effect and CORS will not work as intended.

Suggested change
- ALLOWED_ORIGIN=http://{{ip_server}}:6767
- FRONTEND_URL=http://{{ip_server}}:6767

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder '{{ip_server}}' is not valid syntax for docker-compose environment variables. This will be treated as a literal string, not interpolated. Users would need to manually edit this value to their actual IP address. Consider using ${SERVER_IP} syntax or removing this hardcoded value entirely and letting users provide it via environment variables.

Suggested change
- ALLOWED_ORIGIN=http://{{ip_server}}:6767
- ALLOWED_ORIGIN=${ALLOWED_ORIGIN:-http://localhost:6767}

Copilot uses AI. Check for mistakes.
- JWT_SECRET=sua_chave_secreta_aqui
- CSRF_SECRET=outra_chave_secreta_aqui
Comment on lines +30 to +31
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded secret 'outra_chave_secreta_aqui' (Portuguese for 'another_secret_key_here') should not be committed to the repository. This is a production compose file and should use environment variables for secrets. The original file correctly used CSRF_SECRET=${CSRF_SECRET} to allow secrets to be provided externally via .env file or environment variables.

Suggested change
- JWT_SECRET=sua_chave_secreta_aqui
- CSRF_SECRET=outra_chave_secreta_aqui
- JWT_SECRET=${JWT_SECRET}
- CSRF_SECRET=${CSRF_SECRET}

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +31
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable NEXT_PUBLIC_BACKEND_URL mentioned in the PR description is not present in this docker-compose.prod.yml file and is not used anywhere in the codebase. The frontend uses BACKEND_URL (without the NEXT_PUBLIC_ prefix) for nginx proxy configuration, as shown in docker-compose.yml. If CORS issues were encountered, they should be resolved using the FRONTEND_URL variable on the backend, not a nonexistent frontend variable.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +31
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded secret 'sua_chave_secreta_aqui' (Portuguese for 'your_secret_key_here') should not be committed to the repository. This is a production compose file and should use environment variables for secrets. The original file correctly used JWT_SECRET=${JWT_SECRET} to allow secrets to be provided externally via .env file or environment variables.

Suggested change
- JWT_SECRET=sua_chave_secreta_aqui
- CSRF_SECRET=outra_chave_secreta_aqui
- JWT_SECRET=${JWT_SECRET}
- CSRF_SECRET=${CSRF_SECRET}

Copilot uses AI. Check for mistakes.
volumes:
- backend-data:/app/prisma
networks:
Expand Down