Skip to content

Commit

Permalink
lug: bmclapi (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Mar 13, 2024
1 parent 03bd84e commit f82f316
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caddy/Caddyfile.siyuan
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ https://mirror.sjtu.edu.cn {
header /mirrorz/* Access-Control-Request-Method GET

@gzip_enabled {
not path /bmclapi/*
not path /alhp/*
not path /nspawn/*
not path /anthon/*
Expand Down Expand Up @@ -320,6 +321,10 @@ https://mirror.sjtu.edu.cn {
}
encode @gzip_enabled gzip zstd

redir /bmclapi /bmclapi/ 301
handle /bmclapi/* {
reverse_proxy rsync-gateway:8000
}
redir /alhp /alhp/ 301
handle /alhp/* {
reverse_proxy rsync-gateway:8000
Expand Down
5 changes: 5 additions & 0 deletions caddy/Caddyfile.zhiyuan
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ https://mirrors.sjtug.sjtu.edu.cn {
not path /docker-registry/*
not path /google-fonts/*
not path /anaconda/*
not path /bmclapi/*
not path /alhp/*
not path /nspawn/*
not path /anthon/*
Expand Down Expand Up @@ -587,6 +588,10 @@ https://mirrors.sjtug.sjtu.edu.cn {
@hidden path */.*
respond @hidden 404
}
redir /bmclapi /bmclapi/ 301
handle_path /bmclapi/* {
redir * https://mirror.sjtu.edu.cn/bmclapi{uri} 302
}
redir /alhp /alhp/ 301
handle_path /alhp/* {
redir * https://mirror.sjtu.edu.cn/alhp{uri} 302
Expand Down
10 changes: 10 additions & 0 deletions config.siyuan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ repos:
# no_redir_http: true
# <<: *oneshot_common

# bmclapi
- type: shell_script
name: bmclapi
script: /worker-script/rsync-fetcher.sh
interval: 12901
source: rsync://rsync.mirrors.ustc.edu.cn/bmclapi
serve_mode: rsync_gateway
rsync_extra_flags: --exclude='*.links.tar.gz*' --exclude='/other' --exclude='/sources' --exclude='/logs'
<<: *rsync_fetcher_common
<<: *oneshot_common
# alhp
- type: shell_script
name: alhp
Expand Down
5 changes: 5 additions & 0 deletions rsync-gateway/config.siyuan.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ database_url = "postgres://rsync-sjtug@postgres/rsync-sjtug"
format = "json"
target = "tcp://tunnel:5007"

[endpoints.bmclapi]
namespace = "bmclapi"
s3_bucket = "899a892efef34b1b944a19981040f55b-oss01"
s3_prefix = "rsync/bmclapi"

[endpoints.alhp]
namespace = "alhp"
s3_bucket = "899a892efef34b1b944a19981040f55b-oss01"
Expand Down

0 comments on commit f82f316

Please sign in to comment.