-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCaddyfile
507 lines (382 loc) · 15.1 KB
/
Caddyfile
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
{
admin 0.0.0.0:2019
crowdsec {
api_url http://192.168.1.1:8089
api_key {env.CROWDSEC_API_KEY}
ticker_interval 15s
#disable_streaming
#enable_hard_fails
}
order crowdsec first
}
*.martinbjeldbak.com {
reverse_proxy {
trusted_proxies private_ranges # TODO: hardcode authentik-server
}
tls {
dns cloudflare {
zone_token {env.CLOUDFLARE_ZONE_TOKEN}
api_token {env.CLOUDFLARE_API_TOKEN}
}
}
log {
output file /data/access-external.log
}
@invidious host invidious.martinbjeldbak.com
handle @invidious {
reverse_proxy invidious:3000
}
@dawarich host dawarich.martinbjeldbak.com
handle @dawarich {
reverse_proxy dawarich:3000
}
}
*.local.martinbjeldbak.com {
reverse_proxy {
trusted_proxies private_ranges # TODO: hardcode authentik-server
}
tls {
dns cloudflare {
zone_token {env.CLOUDFLARE_ZONE_TOKEN}
api_token {env.CLOUDFLARE_API_TOKEN}
}
}
log {
output file /data/access-internal.log
}
@nas host nas.local.martinbjeldbak.com
handle @nas {
reverse_proxy {env.NAS_IP}:5000
encode gzip
}
#@huginn host h.local.martinbjeldbak.com
#handle @huginn {
# reverse_proxy huginn:3000
# encode gzip
#}
@homeassistant host homeassistant.local.martinbjeldbak.com
handle @homeassistant {
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version
}
reverse_proxy homeassistant:8123
}
@tautulli host tautulli.local.martinbjeldbak.com
handle @tautulli {
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version
}
reverse_proxy tautulli:8181
}
@esphome host esphome.local.martinbjeldbak.com
handle @esphome {
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlementp X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy esphome:6052
}
@speedtest host speedtest.local.martinbjeldbak.com
handle @speedtest {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy speedtest-tracker:80
}
@tv host tv.local.martinbjeldbak.com
handle @tv {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy sonarr:8989
}
@movies host movies.local.martinbjeldbak.com
handle @movies {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy radarr:7878
}
@torrents host torrents.local.martinbjeldbak.com
handle @torrents {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy gluetun:9091
}
@slzb-06m host slzb-06m.local.martinbjeldbak.com
handle @slzb-06m {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy {env.SLZB06M_IP}:80
}
@dns host dns.local.martinbjeldbak.com
handle @dns {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy 192.168.1.1:3000
}
@dns2 host dns2.local.martinbjeldbak.com
handle @dns2 {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy adguardhome:3000
}
@prowlarr host prowlarr.local.martinbjeldbak.com
handle @prowlarr {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy gluetun:9696
}
@subtitles host subtitles.local.martinbjeldbak.com
handle @subtitles {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy bazarr:6767
}
@dozzle host dozzle.local.martinbjeldbak.com
handle @dozzle {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
copy_headers Remote-User Remote-Email Remote-Name Remote-Filter
}
reverse_proxy dozzle:8080
}
@calibre-web host calibre-web.local.martinbjeldbak.com
handle @calibre-web {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy calibre-web:8083
}
@syncthing host syncthing.local.martinbjeldbak.com
handle @syncthing {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy syncthing:8384
}
@readarr host readarr.local.martinbjeldbak.com
handle @readarr {
# always forward outpost path to actual outpost
reverse_proxy /outpost.goauthentik.io/* http://authentik-server:9000
# forward authentication to outpost
forward_auth http://authentik-server:9000 {
uri /outpost.goauthentik.io/auth/caddy
# capitalization of the headers is important, otherwise they will be empty
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Entitlements X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version Authorization
}
reverse_proxy readarr:8787
}
@unifi host unifi.local.martinbjeldbak.com
handle @unifi {
reverse_proxy https://192.168.1.1:8443 {
transport http {
tls_insecure_skip_verify
}
}
encode gzip
}
@router host opnsense.local.martinbjeldbak.com
handle @router {
reverse_proxy https://192.168.1.1:443 {
transport http {
tls_insecure_skip_verify
}
}
encode gzip
}
#@pterodactyllocal host panel.local.martinbjeldbak.com
#handle @pterodactyllocal {
# reverse_proxy panel:80
# encode gzip
#}
#@pterodactylmartin host node-martin.local.martinbjeldbak.com
#handle @pterodactylmartin {
# reverse_proxy 192.168.1.14:443
# encode gzip
#}
@elmbot host elmbot.local.martinbjeldbak.com
handle @elmbot {
reverse_proxy elmbot:54377
encode gzip
}
@autobrr host autobrr.local.martinbjeldbak.com
handle @autobrr {
reverse_proxy autobrr:7474
encode gzip
}
@epicgames host epicgames.local.martinbjeldbak.com
handle @epicgames {
reverse_proxy epicgames-freegames:3000
encode gzip
}
@plex host plex.local.martinbjeldbak.com
handle @plex {
reverse_proxy plex:32400
encode gzip
}
@invidious host invidious.local.martinbjeldbak.com
handle @invidious {
reverse_proxy invidious:3000
encode gzip
}
@scrypted host scrypted.local.martinbjeldbak.com
handle @scrypted {
reverse_proxy scrypted:11080
encode gzip
}
@request host request.local.martinbjeldbak.com
handle @request {
reverse_proxy overseerr:5055
encode gzip
}
@homepage host homepage.local.martinbjeldbak.com
handle @homepage {
reverse_proxy homepage:3000
encode gzip
}
@peanut host peanut-eaton-5e-1100i.local.martinbjeldbak.com
handle @peanut {
reverse_proxy peanut-eaton-5e-1100i:8080
encode gzip
}
@scrutiny host scrutiny.local.martinbjeldbak.com
handle @scrutiny {
reverse_proxy scrutiny-web:8080
encode gzip
}
@paperless host paperless.local.martinbjeldbak.com
handle @paperless {
reverse_proxy paperless:8000
encode gzip
}
@roms host roms.local.martinbjeldbak.com
handle @roms {
reverse_proxy romm:8080
encode gzip
}
@icloudpd-n host icloudpd-n.local.martinbjeldbak.com
handle @icloudpd-n {
reverse_proxy icloudpd-n:8080
encode gzip
}
# Forward proxy auth breaks websocket auth
@zigbee2mqtt host zigbee2mqtt.local.martinbjeldbak.com
handle @zigbee2mqtt {
reverse_proxy zigbee2mqtt:8080
encode gzip
}
# OAuth support: https://github.com/Freika/dawarich/discussions/66
@dawarich host dawarich.local.martinbjeldbak.com
handle @dawarich {
reverse_proxy dawarich:3000
encode gzip
}
@lubelogger host lubelogger.local.martinbjeldbak.com
handle @lubelogger {
reverse_proxy lubelogger:8080
encode gzip
}
@calibre host calibre.local.martinbjeldbak.com
handle @calibre {
reverse_proxy calibre:8080
encode gzip
}
@calibre-server host calibre-server.local.martinbjeldbak.com
handle @calibre-server {
reverse_proxy calibre:8081
encode gzip
}
@immich host immich.local.martinbjeldbak.com
handle @immich {
reverse_proxy immich-server:2283
encode gzip
}
@authentik host auth.local.martinbjeldbak.com
handle @authentik {
reverse_proxy authentik-server:9000
encode gzip
}
@thelounge host thelounge.local.martinbjeldbak.com
handle @thelounge {
reverse_proxy thelounge:9000
encode gzip
}
# REMEMBER TO ADD HOSTS TO UNBOUND
# Fallback for otherwise unhandled domains
handle {
abort
}
}