-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remote setup #631
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
Remote setup #631
Changes from 8 commits
59d66d9
1f7a439
caa9805
673f682
9afe278
37645b2
49fbe6f
d1dec87
e76d915
2beb592
e742baa
8c7471e
42e8eba
cc463f9
08381a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Example .env for LAN deployment on mcdonaldhomelab.com | ||
| # Copy this to .env on your LAN server machine | ||
|
|
||
| # ======================================== | ||
| # REQUIRED: Database Connection (same as dev) | ||
| # ======================================== | ||
| SUPABASE_URL=https://your-project.supabase.co | ||
| SUPABASE_SERVICE_KEY=your-service-role-key-here | ||
|
|
||
| # ======================================== | ||
| # LAN Server Configuration | ||
| # ======================================== | ||
| # Network binding - bind to all interfaces for LAN access | ||
| BIND_IP=0.0.0.0 | ||
|
|
||
| # Domain configuration for mcdonaldhomelab.com | ||
| HOST=archon.mcdonaldhomelab.com | ||
|
|
||
| # CORS - allow access from the domain | ||
| CORS_ORIGINS=https://archon.mcdonaldhomelab.com | ||
|
|
||
| # API base URL for internal service communication | ||
| API_BASE_URL=https://archon.mcdonaldhomelab.com/api | ||
|
|
||
| # ======================================== | ||
| # Optional: API Keys (can be set via UI) | ||
| # ======================================== | ||
| OPENAI_API_KEY=your-openai-key-optional | ||
|
|
||
| # ======================================== | ||
| # Optional: Logging and Monitoring | ||
| # ======================================== | ||
| LOGFIRE_TOKEN=your-logfire-token-optional | ||
| LOG_LEVEL=INFO | ||
|
|
||
| # ======================================== | ||
| # Port Configuration (defaults usually fine) | ||
| # ======================================== | ||
| ARCHON_SERVER_PORT=8181 | ||
| ARCHON_MCP_PORT=8051 | ||
| ARCHON_AGENTS_PORT=8052 | ||
| ARCHON_UI_PORT=3737 | ||
|
|
||
| # ======================================== | ||
| # MCP Configuration for LAN deployment | ||
| # ======================================== | ||
| VITE_MCP_HOST=archon.mcdonaldhomelab.com | ||
| VITE_MCP_PROTOCOL=https | ||
| VITE_MCP_USE_PROXY=true | ||
| VITE_MCP_PORT=8051 | ||
|
|
||
| # ======================================== | ||
| # Optional: Enable Agents Service | ||
| # ======================================== | ||
| AGENTS_ENABLED=false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # LAN/Production Configuration | ||
| # Copy to .env for LAN deployment | ||
|
|
||
| # ======================================== | ||
| # REQUIRED: Database Connection | ||
| # ======================================== | ||
| SUPABASE_URL=https://ywqhytytvsugasmbpdfa.supabase.co | ||
| SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inl3cWh5dHl0dnN1Z2FzbWJwZGZhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc1NjQyMjIxNiwiZXhwIjoyMDcxOTk4MjE2fQ.3DnxBT2hVtQgDdrxq5L2YgElZBV2-vkhUFKnJ7txQGQ | ||
|
|
||
| # ======================================== | ||
| # Deployment Mode: LAN/PRODUCTION | ||
| # ======================================== | ||
| DEPLOYMENT_MODE=lan | ||
| BUILD_TARGET=production | ||
| NODE_ENV=production | ||
|
|
||
| # ======================================== | ||
| # Network Configuration - UPDATE YOUR DOMAIN | ||
| # ======================================== | ||
| HOST=archon.mcdonaldhomelab.com | ||
| BIND_IP=0.0.0.0 | ||
| CORS_ORIGINS=https://archon.mcdonaldhomelab.com | ||
| API_BASE_URL=https://archon.mcdonaldhomelab.com/api | ||
| VITE_API_URL=https://archon.mcdonaldhomelab.com | ||
|
|
||
| # ======================================== | ||
| # MCP Configuration for LAN | ||
| # ======================================== | ||
| VITE_MCP_HOST=archon.mcdonaldhomelab.com | ||
| VITE_MCP_PROTOCOL=https | ||
| VITE_MCP_USE_PROXY=true | ||
| VITE_MCP_PORT=8051 | ||
|
|
||
| # ======================================== | ||
| # Service Ports (internal) | ||
| # ======================================== | ||
| ARCHON_SERVER_PORT=8181 | ||
| ARCHON_MCP_PORT=8051 | ||
| ARCHON_AGENTS_PORT=8052 | ||
| ARCHON_UI_PORT=3737 | ||
| VITE_ARCHON_SERVER_PORT= | ||
|
|
||
|
Comment on lines
+41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainUnset VITE_ARCHON_SERVER_PORT: verify consumers. An empty value can override defaults in some loaders. Either remove the key or set an explicit value. Run to check usages: 🏁 Script executed: #!/bin/bash
rg -nP --type=ts --type=py -C2 '\bVITE_ARCHON_SERVER_PORT\b|ARCHON_SERVER_PORT'Length of output: 12015 Remove or set explicit VITE_ARCHON_SERVER_PORT in .env.unified.lan. Blank entries become empty strings in import.meta.env and will override built-in defaults in api.ts/vite.config.ts; delete the key if it’s unused or assign a concrete port (e.g. 8181). 🤖 Prompt for AI Agents |
||
| # ======================================== | ||
| # Production Settings | ||
| # ======================================== | ||
| DOCKER_SOCKET=/var/run/docker.sock | ||
| PROD=true | ||
| # Use prod profile for production without volume mounts | ||
| COMPOSE_PROFILES=prod | ||
|
|
||
| # ======================================== | ||
| # Network Configuration (LAN/Traefik) | ||
| # ======================================== | ||
| # Use external Traefik proxy network | ||
| PROXY_EXTERNAL=true | ||
| PROXY_NETWORK=proxy | ||
|
|
||
| # ======================================== | ||
| # Optional Features | ||
| # ======================================== | ||
| AGENTS_ENABLED=false | ||
| OPENAI_API_KEY= | ||
| LOGFIRE_TOKEN= | ||
| LOG_LEVEL=INFO | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| # Unified Docker Deployment | ||
|
|
||
| This repository now uses a **single unified docker-compose.yml** file that works for both local development and LAN/production deployments through environment variables. | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Local Development | ||
| ```bash | ||
| # Copy local environment template | ||
| cp .env.unified.local .env | ||
|
|
||
| # Edit .env with your Supabase credentials | ||
| nano .env | ||
|
|
||
| # Start services | ||
| docker-compose -f docker-compose.unified.yml up -d | ||
| ``` | ||
|
|
||
| Access at: `http://localhost:3737` | ||
|
|
||
| ### LAN/Production Deployment | ||
| ```bash | ||
| # Copy LAN environment template | ||
| cp .env.unified.lan .env | ||
|
|
||
| # Edit .env with your Supabase credentials and domain | ||
| nano .env | ||
|
|
||
| # Start services (with Traefik proxy) | ||
| docker-compose -f docker-compose.unified.yml up -d | ||
| ``` | ||
|
|
||
| Access at: `https://archon.yourdomain.com` | ||
|
|
||
| ## Key Differences Between Modes | ||
|
|
||
| | Setting | Local Development | LAN/Production | | ||
| |---------|------------------|----------------| | ||
| | **BUILD_TARGET** | `development` | `production` | | ||
| | **BIND_IP** | `127.0.0.1` | `0.0.0.0` | | ||
| | **HOST** | `localhost` | `archon.yourdomain.com` | | ||
| | **CORS_ORIGINS** | `http://localhost:3737` | `https://archon.yourdomain.com` | | ||
| | **VITE_MCP_USE_PROXY** | `false` | `true` | | ||
| | **Volume Mounts** | Enabled | Disabled | | ||
| | **Docker Socket** | Mounted | Not mounted | | ||
| | **External Proxy** | Not used | Traefik proxy network | | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| ### Core Settings | ||
| - `DEPLOYMENT_MODE`: `local` or `lan` | ||
| - `BUILD_TARGET`: `development` or `production` | ||
| - `NODE_ENV`: `development` or `production` | ||
|
|
||
| ### Network Configuration | ||
| - `HOST`: Domain or localhost | ||
| - `BIND_IP`: IP to bind ports to (127.0.0.1 for local, 0.0.0.0 for LAN) | ||
| - `CORS_ORIGINS`: Allowed CORS origins | ||
| - `API_BASE_URL`: Base URL for API | ||
|
|
||
| ### MCP Configuration | ||
| - `VITE_MCP_HOST`: MCP server hostname | ||
| - `VITE_MCP_PROTOCOL`: `http` or `https` | ||
| - `VITE_MCP_USE_PROXY`: `true` for LAN (routes through /mcp) | ||
| - `VITE_MCP_PORT`: MCP server port | ||
|
|
||
| ## Migration from Separate Files | ||
|
|
||
| If you're currently using separate docker-compose files: | ||
|
|
||
| 1. **Backup current configuration**: | ||
| ```bash | ||
| cp .env .env.backup | ||
| cp docker-compose.yml docker-compose.yml.backup | ||
| cp docker-compose-lan.yml docker-compose-lan.yml.backup | ||
| ``` | ||
|
|
||
| 2. **Choose your deployment mode**: | ||
| - For local: `cp .env.unified.local .env` | ||
| - For LAN: `cp .env.unified.lan .env` | ||
|
|
||
| 3. **Update .env with your credentials**: | ||
| - Copy `SUPABASE_URL` and `SUPABASE_SERVICE_KEY` from backup | ||
| - Update domain settings if using LAN mode | ||
|
|
||
| 4. **Switch to unified compose**: | ||
| ```bash | ||
| docker-compose down | ||
| docker-compose -f docker-compose.unified.yml up -d | ||
| ``` | ||
|
|
||
| ## Using with Traefik | ||
|
|
||
| For LAN deployment with Traefik: | ||
|
|
||
| 1. **Ensure proxy network exists**: | ||
| ```bash | ||
| docker network create proxy | ||
| ``` | ||
|
|
||
| 2. **Set in .env**: | ||
| ```bash | ||
| PROXY_NETWORK=proxy | ||
| ``` | ||
|
|
||
| 3. **Configure Traefik labels** (optional - add to docker-compose.unified.yml): | ||
| ```yaml | ||
| labels: | ||
| - "traefik.enable=true" | ||
| - "traefik.http.routers.archon.rule=Host(`archon.yourdomain.com`)" | ||
| ``` | ||
|
|
||
| ## Benefits of Unified Approach | ||
|
|
||
| 1. **Single source of truth**: One docker-compose file to maintain | ||
| 2. **Environment-based configuration**: Everything controlled via .env | ||
| 3. **Easier testing**: Switch between modes by changing .env | ||
| 4. **Reduced complexity**: No need to remember different compose files | ||
| 5. **Version control friendly**: Same file structure for all deployments | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Services not accessible externally | ||
| - Check `BIND_IP` is set to `0.0.0.0` for LAN | ||
| - Verify firewall rules allow the ports | ||
|
|
||
| ### MCP connection issues | ||
| - Ensure `VITE_MCP_USE_PROXY` matches your deployment mode | ||
| - Check browser console for the loaded configuration | ||
|
|
||
| ### Traefik proxy not working | ||
| - Verify proxy network exists: `docker network ls` | ||
| - Check `PROXY_NETWORK` in .env matches your Traefik network name | ||
|
|
||
| ## Third-Party MCP Clients | ||
|
|
||
| External MCP clients can connect to: | ||
| - **Local**: `http://localhost:8051/mcp` | ||
| - **LAN**: `https://archon.yourdomain.com/mcp` | ||
|
|
||
| The configuration automatically handles routing based on `VITE_MCP_USE_PROXY` setting. |
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.
Critical: Hardcoded Supabase service role key committed. Rotate immediately and purge history.
A real JWT service role key is present. This grants DB-wide privileges. Immediate action required:
Apply this minimal diff to remove the secret from the repo:
Additionally, move this file to
.env.unified.lan.exampleand add.env.unified.lanto.gitignore:I can provide a sanitized commit plan and a filter-repo script if helpful.
📝 Committable suggestion
🧰 Tools
🪛 dotenv-linter (3.3.0)
[warning] 8-8: [UnorderedKey] The SUPABASE_SERVICE_KEY key should go before the SUPABASE_URL key
(UnorderedKey)
🪛 Gitleaks (8.27.2)
[high] 8-8: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.
(jwt)
🤖 Prompt for AI Agents