Skip to content
Open
Show file tree
Hide file tree
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
Empty file.
2 changes: 2 additions & 0 deletions deploy/manifests/balancer/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
envFrom:
- secretRef:
name: balancer-config
- configMapRef:
name: balancer-config
ports:
- containerPort: 8000
readinessProbe:
Expand Down
5 changes: 5 additions & 0 deletions deploy/manifests/balancer/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ resources:
- deployment.yaml
- service.yaml
- ingress.yaml

configMapGenerator:
- name: balancer-config
envs:
- balancer.env
1 change: 1 addition & 0 deletions deploy/manifests/balancer/overlays/production/balancer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CORS_ALLOWED_ORIGINS=https://balancerproject.org
11 changes: 11 additions & 0 deletions deploy/manifests/balancer/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

configMapGenerator:
- name: balancer-config
behavior: merge
envs:
- balancer.env
1 change: 1 addition & 0 deletions deploy/manifests/balancer/overlays/sandbox/balancer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CORS_ALLOWED_ORIGINS=https://sandbox.balancerproject.org
11 changes: 11 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

configMapGenerator:
- name: balancer-config
behavior: merge
envs:
- balancer.env
5 changes: 4 additions & 1 deletion server/balancer_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@

ROOT_URLCONF = "balancer_backend.urls"

CORS_ALLOW_ALL_ORIGINS = True
# CORS configuration
CORS_ALLOWED_ORIGINS = os.environ.get("CORS_ALLOWED_ORIGINS", "http://localhost:3000").split(",")
# Ensure no empty strings if input was empty or trailing comma
CORS_ALLOWED_ORIGINS = [origin.strip() for origin in CORS_ALLOWED_ORIGINS if origin.strip()]

TEMPLATES = [
{
Expand Down
Loading