From c52adc8a9ec61ad36bf8a98bce4a02f0b511f9d2 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 24 Jul 2025 19:40:15 -0500 Subject: [PATCH] Fix Phoenix check_origin configuration and add kubectl docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace invalid wildcard domains (*.aprs.me) with explicit origins - Phoenix doesn't support wildcard syntax in check_origin - Added specific domains for aprs.me, sentry.io, and openstreetmap.org - Updated CLAUDE.md with kubectl commands for debugging k3s deployment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 32 +++++++++++++++++++++++++++++++- config/runtime.exs | 8 +++++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8e4568e..20985ea 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -114,4 +114,34 @@ Tests use comprehensive mocking to prevent external connections: ## Deployment -The application supports Kubernetes deployment with manifests in `k8s/` directory and GitHub Actions CI/CD pipeline. Database migrations run automatically via init containers. \ No newline at end of file +The application supports Kubernetes deployment with manifests in `k8s/` directory and GitHub Actions CI/CD pipeline. Database migrations run automatically via init containers. + +### Kubernetes Commands + +The app is deployed in a k3s cluster with the following structure: +- **App name**: `aprs` +- **Namespace**: `aprs` + +Common kubectl commands for debugging: +```bash +# Check pod status +kubectl get pods -n aprs + +# Get logs from the app +kubectl logs -f deployment/aprs -n aprs + +# Get logs from a specific pod +kubectl logs -n aprs + +# Describe pod for events and details +kubectl describe pod -n aprs + +# Restart the deployment +kubectl rollout restart deployment/aprs -n aprs + +# Check deployment status +kubectl rollout status deployment/aprs -n aprs + +# Execute commands in the pod +kubectl exec -it deployment/aprs -n aprs -- /app/bin/aprsme remote +``` \ No newline at end of file diff --git a/config/runtime.exs b/config/runtime.exs index b7ada22..8009f63 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -107,10 +107,12 @@ if config_env() == :prod do check_origin: [ "https://#{host}", "http://10.0.19.222:33897", - "*.aprs.me", + "https://aprs.me", + "https://www.aprs.me", "https://js.sentry-cdn.com", - "*.sentry.io", - "*.openstreetmap.org" + "https://sentry.io", + "https://www.openstreetmap.org", + "https://tile.openstreetmap.org" ] # Optional: Set the default "from" email address