-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCaddyfile
106 lines (89 loc) · 2 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
{
http_port 8888
security {
oauth identity provider github {env.GITHUB_CLIENT_ID} {env.GITHUB_CLIENT_SECRET}
local identity store localdb {
realm local
path {$HOME}/.local/caddy/users.json
}
authentication portal myportal {
enable identity store localdb
enable identity provider github
crypto default token lifetime 3600
cookie domain *
cookie insecure on
ui {
links {
"IDE" /ide/ icon "las la-terminal"
"IPFS GUI" /webui/ icon "las la-star"
"GLANCES" /glances/ icon "las la-tachometer-alt"
"CADVISOR" /cadvisor/containers/ icon "las la-chart-line"
"PROMETHEUS" /prometheus/graph icon "las la-archive"
"GRAFANA" /grafana icon "las la-info"
}
}
transform user {
match realm github
match sub github.com/TtheBC01
action add role authp/admin
}
}
authorization policy admins_policy {
set auth url /auth
crypto default token lifetime 3600
allow roles authp/admin
inject headers with claims
}
}
}
:2222 {
metrics /metrics
}
:8888 {
log
route /auth* {
authenticate with myportal
}
route /ide* {
authorize with admins_policy
uri strip_prefix /ide
reverse_proxy http://127.0.0.1:8080
}
route /glances* {
authorize with admins_policy
uri strip_prefix /glances
reverse_proxy http://glances:61208
}
route /ipfs* {
authorize with admins_policy
reverse_proxy http://ipfs_node:5001
}
route /api* {
authorize with admins_policy
reverse_proxy http://ipfs_node:5001
}
handle_path /gateway/* {
reverse_proxy http://ipfs_node:8080
}
route /webui* {
authorize with admins_policy
reverse_proxy http://ipfs_node:5001
}
route /cadvisor* {
authorize with admins_policy
reverse_proxy http://cadvisor:8080
}
route /prometheus* {
authorize with admins_policy
uri strip_prefix /prometheus
reverse_proxy http://prometheus:9090
}
route /grafana* {
authorize with admins_policy
uri strip_prefix /grafana
reverse_proxy http://grafana:3000
}
route {
redir https://{hostport}/auth/ 302
}
}