-
Notifications
You must be signed in to change notification settings - Fork 11
/
traefik.yaml
106 lines (95 loc) · 2.47 KB
/
traefik.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
http:
services:
grist:
loadBalancer:
servers:
- url: 'http://127.0.0.1:{{ env "GRIST_PORT" }}'
dex:
loadBalancer:
servers:
- url: 'http://127.0.0.1:{{ env "DEX_PORT" }}'
tfa:
loadBalancer:
servers:
- url: 'http://127.0.0.1:{{ env "TFA_PORT" }}'
whoami:
loadBalancer:
servers:
- url: 'http://127.0.0.1:{{ env "WHOAMI_PORT" }}'
middlewares:
tfa:
forwardauth:
address: 'http://127.0.0.1:{{ env "TFA_PORT" }}'
authResponseHeaders: [ '{{ env "GRIST_FORWARD_AUTH_HEADER" }}' ]
trustForwardHeader: '{{ env "TFA_TRUST_FORWARD_HEADER" }}'
no-fwd:
headers:
customRequestHeaders:
'{{ env "GRIST_FORWARD_AUTH_HEADER" }}': ""
routers:
route-grist-login:
rule: "PathPrefix(`/auth/login`) || PathPrefix(`/_oauth`)"
service: grist
middlewares:
- tfa
entryPoints:
- web
route-grist:
rule: "PathPrefix(`/`)"
priority: 1 # Set a lower priority than the other rules
service: grist
middlewares:
- no-fwd
entryPoints:
- web
route-dex:
rule: "PathPrefix(`/dex/`) || Path(`/dex`)"
service: dex
entryPoints:
- web
route-who:
rule: "Path(`/who`)"
service: whoami
entryPoints:
- web
{{ $use_https := env "USE_HTTPS" }}
{{if eq $use_https "true" }}
https-route-grist-login:
rule: "Host(`{{ env "APP_HOST" }}`) && (PathPrefix(`/auth/login`) || PathPrefix(`/_oauth`))"
service: grist
middlewares:
- tfa
entryPoints:
- websecure
tls: {{ env "TLS" }}
https-route-grist:
rule: "Host(`{{ env "APP_HOST" }}`) && PathPrefix(`/`)"
priority: 1 # Set a lower priority than the other rules
service: grist
middlewares:
- no-fwd
entryPoints:
- websecure
tls: {{ env "TLS" }}
https-route-dex:
rule: "Host(`{{ env "APP_HOST" }}`) && (PathPrefix(`/dex/`) || Path(`/dex`))"
service: dex
entryPoints:
- websecure
tls: {{ env "TLS" }}
https-route-who:
rule: "Host(`{{ env "APP_HOST" }}`) && Path(`/who`)"
service: whoami
entryPoints:
- websecure
tls: true
{{end}}
{{ $https := env "HTTPS" }}
{{if eq $https "manual"}}
tls:
stores:
default:
defaultCertificate:
certFile: /custom/grist.crt
keyFile: /custom/grist.key
{{end}}