From f4a4831f12b5c90f29eb3dd7da9612124d65a175 Mon Sep 17 00:00:00 2001 From: SimpleTest Date: Mon, 3 Aug 2026 14:47:07 +0300 Subject: [PATCH] Allow public LiveView origin in development --- deploy/helm/who-need-help/templates/deployments.yaml | 4 ++++ deploy/helm/who-need-help/values-kind.yaml | 7 ++++--- deploy/helm/who-need-help/values.yaml | 3 +++ scripts/quality.sh | 10 ++++++++++ scripts/verify-beam-runtime.sh | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/deploy/helm/who-need-help/templates/deployments.yaml b/deploy/helm/who-need-help/templates/deployments.yaml index 4f3bc21..8148969 100644 --- a/deploy/helm/who-need-help/templates/deployments.yaml +++ b/deploy/helm/who-need-help/templates/deployments.yaml @@ -83,6 +83,10 @@ spec: value: {{ $root.Values.app.scheme | quote }} - name: PHX_URL_PORT value: {{ $root.Values.app.urlPort | quote }} + {{- with $root.Values.app.checkOrigins }} + - name: PHX_CHECK_ORIGINS + value: {{ . | quote }} + {{- end }} - name: PORT value: {{ $root.Values.app.port | quote }} - name: POOL_SIZE diff --git a/deploy/helm/who-need-help/values-kind.yaml b/deploy/helm/who-need-help/values-kind.yaml index 9e85201..1527155 100644 --- a/deploy/helm/who-need-help/values-kind.yaml +++ b/deploy/helm/who-need-help/values-kind.yaml @@ -11,6 +11,7 @@ service: existingSecret: who-need-help-local app: - host: localhost - scheme: http - urlPort: "4011" + host: whoneedhelp.imalto.site + scheme: https + urlPort: "443" + checkOrigins: "https://whoneedhelp.imalto.site,http://localhost:4011" diff --git a/deploy/helm/who-need-help/values.yaml b/deploy/helm/who-need-help/values.yaml index c83b57d..51d88d3 100644 --- a/deploy/helm/who-need-help/values.yaml +++ b/deploy/helm/who-need-help/values.yaml @@ -22,6 +22,9 @@ app: host: localhost scheme: https urlPort: "443" + # Optional comma-separated HTTP(S) origins accepted by Phoenix for + # LiveView/WebSocket connections. Leave empty to use the public URL above. + checkOrigins: "" port: "4000" migratePoolSize: "2" # OTP otherwise derives this from the container nofile ulimit. Some diff --git a/scripts/quality.sh b/scripts/quality.sh index 1bab212..a40c26c 100755 --- a/scripts/quality.sh +++ b/scripts/quality.sh @@ -1274,6 +1274,16 @@ test "$( test "$( grep -c 'value: "+Q 65536"' "$scan_dir/rendered-helm.yaml" )" -eq 5 +test "$( + grep -c 'name: PHX_CHECK_ORIGINS' "$scan_dir/rendered-helm.yaml" +)" -eq 2 +test "$( + grep -c 'value: "https://whoneedhelp.imalto.site,http://localhost:4011"' \ + "$scan_dir/rendered-helm.yaml" +)" -eq 2 +test "$( + grep -c 'value: "whoneedhelp.imalto.site"' "$scan_dir/rendered-helm.yaml" +)" -eq 2 test "$( grep -c '^kind: NetworkPolicy$' "$scan_dir/rendered-helm.yaml" )" -eq 1 diff --git a/scripts/verify-beam-runtime.sh b/scripts/verify-beam-runtime.sh index b9da2e3..e3186b4 100755 --- a/scripts/verify-beam-runtime.sh +++ b/scripts/verify-beam-runtime.sh @@ -145,6 +145,7 @@ case "$MODE" in | .metadata.labels["app.kubernetes.io/component"] as $component | select( ($component == "web" or $component == "worker") and + .metadata.deletionTimestamp == null and .status.phase == "Running" and ([.status.containerStatuses[]?.ready] | all) )