Skip to content

Commit

Permalink
lug: add nspawn (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum authored Dec 23, 2023
1 parent eda1a82 commit 74c2aac
Show file tree
Hide file tree
Showing 4 changed files with 24 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 @@ -193,6 +193,7 @@ https://mirror.sjtu.edu.cn {

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

redir /nspawn /nspawn/ 301
handle /nspawn/* {
reverse_proxy rsync-gateway:8000
}
redir /anthon /anthon/ 301
handle /anthon/* {
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 @@ -186,6 +186,7 @@ https://mirrors.sjtug.sjtu.edu.cn {
not path /docker-registry/*
not path /google-fonts/*
not path /anaconda/*
not path /nspawn/*
not path /anthon/*
not path /leopardsh/*
not path /endeavouros/*
Expand Down Expand Up @@ -553,6 +554,10 @@ https://mirrors.sjtug.sjtu.edu.cn {
@hidden path */.*
respond @hidden 404
}
redir /nspawn /nspawn/ 301
handle_path /nspawn/* {
redir * https://mirror.sjtu.edu.cn/nspawn{uri} 302
}
redir /anthon /anthon/ 301
handle_path /anthon/* {
redir * https://mirror.sjtu.edu.cn/anthon{uri} 302
Expand Down
9 changes: 9 additions & 0 deletions config.siyuan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ repos:
# no_redir_http: true
# <<: *oneshot_common

# nspawn
- type: shell_script
name: nspawn
script: /worker-script/rsync-fetcher.sh
interval: 6901
source: rsync://hub.nspawn.org/containers
serve_mode: rsync_gateway
<<: *rsync_fetcher_common
<<: *oneshot_common
# anthon
- type: shell_script
name: anthon
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.nspawn]
namespace = "nspawn"
s3_bucket = "899a892efef34b1b944a19981040f55b-oss01"
s3_prefix = "rsync/nspawn"

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

0 comments on commit 74c2aac

Please sign in to comment.