Skip to content

Commit 4a0bb94

Browse files
authored
Make sure /ro and other resources are protected (#248)
1 parent 85e1186 commit 4a0bb94

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

HerokuCaddyfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55

66
:PORT
77

8-
basicauth / {
8+
@protected path / /index.html /css/* /js/* /ro /ro/* /jsonrpc
9+
10+
basicauth @protected {
911
ARIA2_USER ARIA2_PWD_ENCRYPT
1012
}
1113

1214
redir /ui / 301
1315
redir /ui/ / 301
1416
redir /rclone /rclone/ 301
1517
redir /files /files/ 301
18+
redir /ro /ro/ 301
1619

1720
reverse_proxy /jsonrpc 127.0.0.1:6800
1821

@@ -26,6 +29,14 @@ route /files/* {
2629
reverse_proxy 127.0.0.1:8080
2730
}
2831

32+
route /ro/* {
33+
uri strip_prefix /ro
34+
root * /data
35+
file_server {
36+
browse "{$CADDY_FILE_SERVER_BROWSE_HTML}"
37+
}
38+
}
39+
2940
route /ping {
3041
respond "app version: {env.APP_VERSION}"
3142
}

SecureCaddyfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ log {
55
output stderr
66
}
77

8-
basicauth / {
8+
@protected path / /index.html /css/* /js/* /ro /ro/* /jsonrpc
9+
10+
basicauth @protected {
911
ARIA2_USER ARIA2_PWD_ENCRYPT
1012
}
1113

1214
redir /ui / 301
1315
redir /ui/ / 301
1416
redir /rclone /rclone/ 301
1517
redir /files /files/ 301
18+
redir /ro /ro/ 301
1619

1720
reverse_proxy /rpc 127.0.0.1:6800
1821
reverse_proxy /jsonrpc 127.0.0.1:6800

0 commit comments

Comments
 (0)