Repository navigation
Expand file tree
/
Copy pathCaddyfile
More file actions
70 lines (60 loc) · 1.65 KB
/
Copy pathCaddyfile
File metadata and controls
70 lines (60 loc) · 1.65 KB
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
# The registry container: the signed list, its icons and SurfSense's OAuth files.
# Static and read-only; anything not named here is a 404.
{
admin off
auto_https off
persist_config off
}
:{$PORT:8080} {
root * {$REGISTRY_ROOT:/srv/registry}
header {
X-Content-Type-Options nosniff
Referrer-Policy no-referrer
-Server
}
@not_read not method GET HEAD
handle @not_read {
respond 405
}
handle /health {
header Cache-Control no-store
respond "ok" 200
}
# Short, so a merged change or a delisting reaches apps within minutes.
# The signed copies CI writes; the source list beside them is never served.
handle /plugins.json {
rewrite * /published/plugins.json
header Content-Type application/json
header Cache-Control "public, max-age=300"
file_server
}
handle /plugins.json.sig {
rewrite * /published/plugins.json.sig
header Content-Type "text/plain; charset=utf-8"
header Cache-Control "public, max-age=300"
file_server
}
@icon path_regexp ^/icons/[a-z0-9][a-z0-9_-]*\.(svg|png)$
handle @icon {
header Cache-Control "public, max-age=300"
# An SVG opened on its own runs nothing.
header Content-Security-Policy "default-src 'none'; style-src 'unsafe-inline'; sandbox"
file_server
}
handle /oauth/client.json {
header Content-Type application/json
header Cache-Control "public, max-age=300"
file_server
}
# Every query carries a one-time code: never cached, never framed.
handle /oauth/callback {
rewrite * /oauth/callback.html
header Content-Type "text/html; charset=utf-8"
header Cache-Control no-store
header Content-Security-Policy "frame-ancestors 'none'"
file_server
}
handle {
respond 404
}
}