-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdynamic.yml
121 lines (106 loc) · 2.75 KB
/
dynamic.yml
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
http:
routers:
# Route for hash-based paths
app-hash:
rule: >
PathPrefix(`/`) &&
Regex(`^/([a-fA-F0-9]{64})(?:\\.(\\w+))?$|^/([a-fA-F0-9]{64})/([a-fA-F0-9]{64})(?:\\.(\\w+))?$`)
entryPoints:
- web
service: app
middlewares:
- replacepathregex-hash
# Route for /nostr.json
app-nostrjson:
rule: Path(`/ .well-known/nostr.json`)
entryPoints:
- web
service: app
middlewares:
- replacepath-nostrjson
# Route for /nip96.json
app-nip96:
rule: Path(`/ .well-known/nostr/nip96.json`)
entryPoints:
- web
service: app
middlewares:
- replacepath-nip96
# Route for /media
app-media:
rule: PathPrefix(`/media`)
entryPoints:
- web
service: app
middlewares:
- replacepathregex-media
# Route for /upload
app-upload:
rule: PathPrefix(`/upload`)
entryPoints:
- web
service: app
middlewares:
- replacepathregex-upload
# Route for /list
app-list:
rule: PathPrefix(`/list`)
entryPoints:
- web
service: app
middlewares:
- replacepathregex-list
# Route for /mirror
app-mirror:
rule: PathPrefix(`/mirror`)
entryPoints:
- web
service: app
middlewares:
- replacepathregex-mirror
# Route for /lnurlp
app-lightning:
rule: Path(`/ .well-known/lnurlp/`)
entryPoints:
- web
service: app
middlewares:
- replacepath-lightning
middlewares:
# Middleware for hash paths
replacepathregex-hash:
replacePathRegex:
regex: "^/([a-fA-F0-9]{64})(?:\\.(\\w+))?$|^/([a-fA-F0-9]{64})/([a-fA-F0-9]{64})(?:\\.(\\w+))?$"
replacement: "/api/v2/media/$$1$$3$$4"
# Middleware for /nostr.json
replacepath-nostrjson:
replacePath:
path: "/api/v2/nostraddress"
# Middleware for /nip96.json
replacepath-nip96:
replacePath:
path: "/api/v2/nip96"
# Middleware for /media
replacepathregex-media:
replacePathRegex:
regex: "^/media/(.*)"
replacement: "/api/v2/media/$$1"
# Middleware for /upload
replacepathregex-upload:
replacePathRegex:
regex: "^/upload/(.*)"
replacement: "/api/v2/media/upload/$$1"
# Middleware for /list
replacepathregex-list:
replacePathRegex:
regex: "^/list/(.*)"
replacement: "/api/v2/media/list/$$1"
# Middleware for /mirror
replacepathregex-mirror:
replacePathRegex:
regex: "^/mirror/(.*)"
replacement: "/api/v2/media/mirror/$$1"
# Middleware for /lnurlp
replacepath-lightning:
replacePath:
path: "/api/v2/lightningaddress"