Skip to content

Commit

Permalink
Adds ov-wag ingressroute paths as seperate rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Feb 9, 2024
1 parent 8a2e48c commit 37fb961
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
5 changes: 0 additions & 5 deletions ov-frontend/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ spec:
name: ov-frontend
port:
number: 80

tls:
- hosts:
- ov.wgbh-mla.org
secretName: ov-frontend-tls
4 changes: 0 additions & 4 deletions ov-wag/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ metadata:
name: ov-wag-config
data:
DJANGO_SETTINGS_MODULE: ov_wag.settings.production
OV_DB_HOST: postgres
OV_DB_PORT: '5432'
OV_DB_USER: postgres
OV_DB_NAME: ov
OV_ALLOWED_HOSTS: '*'
OV_TRUSTED_ORIGINS: https://admin.ov.wgbh-mla.org,http://localhost:8000
OV_DEBUG: 'true'
Expand Down
39 changes: 31 additions & 8 deletions ov-wag/ingressroute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,53 @@ spec:
entryPoints:
- websecure
routes:
# Allow only access to predefined paths
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/static`) || Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/admin`)
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/admin`)
services:
- kind: Service
name: ov-wag
port: 80
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && !PathPrefix(`/admin`) && !PathPrefix(`/static`)
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/static`)
services:
- kind: Service
name: ov-wag
port: 80
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/accounts`)
services:
- kind: Service
name: ov-wag
port: 80
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/search`)
services:
- kind: Service
name: ov-wag
port: 80
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && PathPrefix(`/footnotes`)
services:
- kind: Service
name: ov-wag
port: 80

# Redirect other paths to /admin, since Wagtail serves the admin site at /admin
- kind: Rule
match: Host(`admin.ov.wgbh-mla.org`) && !PathPrefix(`/admin`) && !PathPrefix(`/static`) && !PathPrefix(`/accounts`) && !PathPrefix(`/search`) && !PathPrefix(`/footnotes`)
middlewares:
- name: add-admin-prefix
services:
- kind: Service
name: ov-wag
port: 80
tls:
secretName: ov-wag-tls
domains:
- main: admin.ov.wgbh-mla.org
---
# Add prefix /admin
# Add prefix /admin to the request path
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: add-admin-prefix
spec:
addPrefix:
prefix: /admin
prefix: /admin

0 comments on commit 37fb961

Please sign in to comment.