Skip to content

Conversation

@MaxWolf-01
Copy link
Owner

No description provided.

MaxWolf-01 and others added 4 commits May 31, 2025 12:58
- Add ProxyHeadersMiddleware to process X-Forwarded-* headers
- Fix mixed content errors by properly handling HTTPS redirects
- Update deployment docs with corrected nginx configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxWolf-01 MaxWolf-01 requested a review from Copilot May 31, 2025 13:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the production API base URL to the www subdomain and ensures the application routes and documentation align with the new path, adds proxy header handling in the backend, and enhances the deployment instructions with SSL and redirection.

  • Update default VITE_API_BASE_URL to https://www.aleatoric.agency/api in Dockerfile and compose
  • Add ProxyHeadersMiddleware and prefix health check route to /api/health in the backend
  • Revise DEPLOYMENT.md and .env.example for new CORS settings, SSL/nginx config, and redirect rules

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/Dockerfile Change default API URL to include /api on the www subdomain
docker-compose.yml Align compose build arg with updated API base URL
backend/app/init.py Add proxy-headers middleware and change health endpoint to /api/health
DEPLOYMENT.md Update CORS origins, API URL, nginx SSL settings, and redirect blocks
.env.example Extend production CORS origins to include www.aleatoric.agency
Comments suppressed due to low confidence (1)

backend/app/init.py:43

  • The health endpoint path was changed to /api/health; ensure existing tests are updated or add new tests to cover this new route.
@app.get("/api/health")

)

# Add ProxyHeaders middleware first to handle X-Forwarded-* headers
app.add_middleware(ProxyHeadersMiddleware, trusted_hosts=["*"])
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

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

Using trusted_hosts=["*"] allows any proxy to be trusted, which can expose the app to header spoofing. Restrict this setting to known proxy hosts or specific IP ranges.

Copilot uses AI. Check for mistakes.
- `DATABASE_URL`: Replace `your_password_here` with your POSTGRES_PASSWORD
- `CORS_ORIGINS`: Change to `["https://aleatoric.agency"]`
- `VITE_API_BASE_URL`: Set to `https://aleatoric.agency/api`
- `CORS_ORIGINS`: Change to `["https://aleatoric.agency", "https://www.aleatoric.agency"]`
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

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

The bullet formatting here differs from the earlier list items; unify indentation and bullet syntax (e.g., use - consistently) to prevent markdown rendering issues.

Copilot uses AI. Check for mistakes.
# CORS origins - List of allowed frontend URLs
# Development: ["http://localhost:5173", "http://localhost:5174", "http://localhost:3000"]
# Production: ["https://aleatoric.agency"]
# Production: ["https://aleatoric.agency", "https://www.aleatoric.agency"]
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

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

The commented production example was updated, but the actual CORS_ORIGINS line remains only localhost. Consider adding or clarifying a separate production example assignment for clarity.

Copilot uses AI. Check for mistakes.
MaxWolf-01 and others added 4 commits May 31, 2025 16:40
- Fix VITE_API_BASE_URL to not include /api suffix
- Add production commands to Makefile for easy management
- Document nginx proxy_pass configuration without trailing slash
- Add prod-up, prod-down, prod-rebuild, prod-update commands
- Add database backup and restore commands for production

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxWolf-01 MaxWolf-01 merged commit 740103c into master May 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants