From 94fca80194d76cf993759cb81d017d5c72d5239b Mon Sep 17 00:00:00 2001 From: Tsz Lung Chung <22969604+truc0@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:10:35 +0800 Subject: [PATCH] lug: move openwrt to internal and fix error rediction (#497) --- caddy/Caddyfile.siyuan | 24 ++++++++++++++++-------- caddy/Caddyfile.zhiyuan | 4 ++-- config.siyuan.yaml | 20 +++++++++++++------- rsync-gateway/config.siyuan.toml | 5 +++++ 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/caddy/Caddyfile.siyuan b/caddy/Caddyfile.siyuan index 6598081..e1f8f51 100644 --- a/caddy/Caddyfile.siyuan +++ b/caddy/Caddyfile.siyuan @@ -27,7 +27,6 @@ http://mirror.sjtu.edu.cn { not path /opensuse/* not path /remi/* not path /ubuntu/* - not path /openwrt/* not path /openeuler/* not path /fedora/* } @@ -88,8 +87,13 @@ http://mirror.sjtu.edu.cn { respond @hidden 404 } redir /openwrt /openwrt/ 301 - handle_path /openwrt/* { - redir * https://mirrors.cernet.edu.cn/openwrt{uri} 302 + handle /openwrt/* { + file_server browse { + root /srv/nfs27T + hide .* + } + @hidden path */.* + respond @hidden 404 } redir /rpmfusion /rpmfusion/ 301 handle /rpmfusion/* { @@ -202,7 +206,6 @@ https://mirror.sjtu.edu.cn { not path /remi/* not path /ubuntu/* not path /ubuntu-cdimage/* - not path /openwrt/* not path /homebrew-bottles/* not path /rust-static/* not path /pypi-packages/* @@ -354,8 +357,8 @@ https://mirror.sjtu.edu.cn { reverse_proxy rsync-gateway:8000 } redir /debian-cdimage /debian-cdimage/ 301 - handle_path /debian-cdimage/* { - redir * https://ftp.sjtu.edu.cn/debian-cd{uri} 302 + handle /debian-cdimage/* { + reverse_proxy rsync-gateway:8000 } redir /packman /packman/ 301 handle /packman/* { @@ -518,8 +521,13 @@ https://mirror.sjtu.edu.cn { respond @hidden 404 } redir /openwrt /openwrt/ 301 - handle_path /openwrt/* { - redir * https://mirrors.cernet.edu.cn/openwrt{uri} 302 + handle /openwrt/* { + file_server browse { + root /srv/nfs27T + hide .* + } + @hidden path */.* + respond @hidden 404 } redir /rpmfusion /rpmfusion/ 301 handle /rpmfusion/* { diff --git a/caddy/Caddyfile.zhiyuan b/caddy/Caddyfile.zhiyuan index 91f977b..45c9df8 100644 --- a/caddy/Caddyfile.zhiyuan +++ b/caddy/Caddyfile.zhiyuan @@ -617,7 +617,7 @@ https://mirrors.sjtug.sjtu.edu.cn { } redir /debian-cdimage /debian-cdimage/ 301 handle_path /debian-cdimage/* { - redir * https://ftp.sjtu.edu.cn/debian-cd{uri} 302 + redir * https://mirror.sjtu.edu.cn/debian-cdimage{uri} 302 } redir /packman /packman/ 301 handle_path /packman/* { @@ -741,7 +741,7 @@ https://mirrors.sjtug.sjtu.edu.cn { } redir /openwrt /openwrt/ 301 handle_path /openwrt/* { - redir * https://mirrors.cernet.edu.cn/openwrt{uri} 302 + redir * https://mirror.sjtu.edu.cn/openwrt{uri} 302 } redir /rpmfusion /rpmfusion/ 301 handle_path /rpmfusion/* { diff --git a/config.siyuan.yaml b/config.siyuan.yaml index 9b533d8..aa74f31 100644 --- a/config.siyuan.yaml +++ b/config.siyuan.yaml @@ -113,10 +113,14 @@ repos: <<: *rsync_fetcher_common <<: *oneshot_common # debian-cdimage - - type: external + - type: shell_script name: debian-cdimage - serve_mode: redir - target: https://ftp.sjtu.edu.cn/debian-cd + script: /worker-script/rsync-fetcher.sh + interval: 30401 + source: rsync://cdimage.debian.org/cdimage/ + serve_mode: rsync_gateway + rsync_extra_flags: --exclude=archive/ --exclude="daily-*/" --exclude=source/ --include=".latest" --exclude=".*/" --exclude="*alpha*" --exclude="*-edu-*" --exclude=/blends-live --exclude=/cd-sources --exclude=/release --exclude=/experimental-live --exclude="/snapshot*" --exclude="/stretch*" --exclude=/tmp --include=/unofficial/non-free --exclude="/unofficial/*" --exclude="/project*" --exclude=/cloud/test --exclude="/cloud/**/daily" + <<: *rsync_fetcher_common <<: *oneshot_common # packman - type: shell_script @@ -380,11 +384,13 @@ repos: no_redir_http: true <<: *oneshot_common # openwrt - - type: external + - type: shell_script + script: /worker-script/rsync.sh + source: rsync://rsync.openwrt.org/downloads/ + interval: 6900 + path: /srv/nfs27T/openwrt + rsync_extra_flags: --exclude "index.html" --exclude "snapshots/*" name: openwrt - serve_mode: redir - target: https://mirrors.cernet.edu.cn/openwrt - disabled: true no_redir_http: true <<: *oneshot_common # rpmfusion diff --git a/rsync-gateway/config.siyuan.toml b/rsync-gateway/config.siyuan.toml index 1c0220d..8287839 100644 --- a/rsync-gateway/config.siyuan.toml +++ b/rsync-gateway/config.siyuan.toml @@ -47,6 +47,11 @@ namespace = "endeavouros" s3_bucket = "899a892efef34b1b944a19981040f55b-oss01" s3_prefix = "rsync/endeavouros" +[endpoints.debian-cdimage] +namespace = "debian-cdimage" +s3_bucket = "899a892efef34b1b944a19981040f55b-oss01" +s3_prefix = "rsync/debian-cdimage" + [endpoints.packman] namespace = "packman" s3_bucket = "899a892efef34b1b944a19981040f55b-oss01"