Skip to content

Commit

Permalink
lug(qt): move back to hdd (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum authored Aug 30, 2024
1 parent 27c5caa commit 91df382
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
cp ./secrets/pg.env.example ./secrets/pg.env
touch ./secrets/lug-secrets.sh
- name: verify config
run: docker-compose -f docker-compose.yml -f docker-compose.${{ matrix.mirror }}.yml config
- name: docker-compose build
run: docker-compose -f docker-compose.yml -f docker-compose.${{ matrix.mirror }}.yml -f docker-compose.ci.yml build --parallel
run: docker compose -f docker-compose.yml -f docker-compose.${{ matrix.mirror }}.yml config
- name: docker compose build
run: docker compose -f docker-compose.yml -f docker-compose.${{ matrix.mirror }}.yml -f docker-compose.ci.yml build --parallel
- name: validate Caddyfile
run: make caddy-verify-config
test-caddy-file:
Expand All @@ -73,7 +73,7 @@ jobs:
cp ./secrets/pg.env.example ./secrets/pg.env
touch ./secrets/lug-secrets.sh
- name: validate Caddyfile
run: docker-compose build caddy && make caddy-verify-config
run: docker compose build caddy && make caddy-verify-config
test-gateway-file:
runs-on: ubuntu-latest
name: rsync-gateway config up-to-date
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ caddy-update-dist:
./scripts/download_latest_frontend.sh

caddy-verify-config:
docker-compose run --rm caddy caddy validate --adapter caddyfile --config /etc/caddy/Caddyfile.siyuan
docker-compose run --rm caddy caddy validate --adapter caddyfile --config /etc/caddy/Caddyfile.zhiyuan
docker compose run --rm caddy caddy validate --adapter caddyfile --config /etc/caddy/Caddyfile.siyuan
docker compose run --rm caddy caddy validate --adapter caddyfile --config /etc/caddy/Caddyfile.zhiyuan

caddy-gen:
cd caddy-gen && pipenv run python src/caddy-gen.py -i ../ -o ../caddy --site siyuan,zhiyuan

caddy-hash-password:
docker-compose run --rm caddy caddy hash-password
docker compose run --rm caddy caddy hash-password

caddy-gen-local:
cd caddy-gen && pipenv run python src/caddy-gen.py -i ../lug -o ../caddy --site local

caddy-reload:
docker-compose exec -w /etc/caddy caddy caddy reload
docker compose exec -w /etc/caddy caddy caddy reload

format-config: # You need to install prettier from npm to use this functionality
prettier *.yaml -w
Expand All @@ -27,21 +27,21 @@ gateway-gen:
cd gateway-gen && pipenv run python src/gateway-gen.py -i ../ -o ../rsync-gateway --site siyuan,zhiyuan

up:
docker-compose up -d --build
docker compose up -d --build

up-siyuan:
docker-compose -f docker-compose.yml -f docker-compose.siyuan.yml up -d --build
docker compose -f docker-compose.yml -f docker-compose.siyuan.yml up -d --build

up-zhiyuan:
docker-compose -f docker-compose.yml -f docker-compose.zhiyuan.yml up -d --build
docker compose -f docker-compose.yml -f docker-compose.zhiyuan.yml up -d --build

build-siyuan:
docker-compose -f docker-compose.yml -f docker-compose.siyuan.yml build
docker compose -f docker-compose.yml -f docker-compose.siyuan.yml build

build-zhiyuan:
docker-compose -f docker-compose.yml -f docker-compose.zhiyuan.yml build
docker compose -f docker-compose.yml -f docker-compose.zhiyuan.yml build

build:
docker-compose build
docker compose build

.PHONY: caddy-gen gateway-gen integration-test
10 changes: 5 additions & 5 deletions caddy/Caddyfile.siyuan
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ https://mirror.sjtu.edu.cn {
not path /packman/*
not path /raspberry-pi-os-images/*
not path /opencloudos/*
not path /qt/*
not path /debian-cd/*
not path /deepin-cd/*
not path /docker-ce/*
Expand Down Expand Up @@ -320,6 +319,7 @@ https://mirror.sjtu.edu.cn {
not path /CRAN/*
not path /CTAN/*
not path /ctan/*
not path /qt/*
}
encode @gzip_enabled gzip zstd

Expand Down Expand Up @@ -407,10 +407,6 @@ https://mirror.sjtu.edu.cn {
handle /opencloudos/* {
reverse_proxy rsync-gateway:8000
}
redir /qt /qt/ 301
handle /qt/* {
reverse_proxy rsync-gateway:8000
}
redir /debian /debian/ 301
handle /debian/* {
file_server browse {
Expand Down Expand Up @@ -1038,6 +1034,10 @@ https://mirror.sjtu.edu.cn {
handle_path /ctan/* {
redir * https://mirrors.sjtug.sjtu.edu.cn/ctan{uri} 302
}
redir /qt /qt/ 301
handle_path /qt/* {
redir * https://mirrors.sjtug.sjtu.edu.cn/qt{uri} 302
}

redir /git/homebrew-services.git /git/homebrew-services.git/ 301
handle /git/homebrew-services.git/* {
Expand Down
14 changes: 9 additions & 5 deletions caddy/Caddyfile.zhiyuan
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ https://mirrors.sjtug.sjtu.edu.cn {
not path /archlinuxarm/*
not path /archlinux-cn/*
not path /opencloudos/*
not path /qt/*
not path /debian/*
not path /debian-cd/*
not path /debian-security/*
Expand Down Expand Up @@ -572,6 +571,15 @@ https://mirrors.sjtug.sjtu.edu.cn {
@hidden path */.*
respond @hidden 404
}
redir /qt /qt/ 301
handle /qt/* {
file_server browse {
root /mnt
hide .*
}
@hidden path */.*
respond @hidden 404
}
redir /keyarchos /keyarchos/ 301
handle_path /keyarchos/* {
redir * https://mirror.sjtu.edu.cn/keyarchos{uri} 302
Expand Down Expand Up @@ -636,10 +644,6 @@ https://mirrors.sjtug.sjtu.edu.cn {
handle_path /opencloudos/* {
redir * https://mirror.sjtu.edu.cn/opencloudos{uri} 302
}
redir /qt /qt/ 301
handle_path /qt/* {
redir * https://mirror.sjtu.edu.cn/qt{uri} 302
}
redir /debian /debian/ 301
handle_path /debian/* {
redir * https://mirror.sjtu.edu.cn/debian{uri} 302
Expand Down
20 changes: 10 additions & 10 deletions config.siyuan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ repos:
serve_mode: rsync_gateway
<<: *rsync_fetcher_common
<<: *oneshot_common
# qt
- type: shell_script
script: /worker-script/rsync-fetcher.sh
source: rsync://master.qt.io/qt-all
interval: 6000
rsync_extra_flags: --exclude "snapshots/*"
name: qt
serve_mode: rsync_gateway
<<: *rsync_fetcher_common
<<: *oneshot_common
## qt
#- type: shell_script
# script: /worker-script/rsync-fetcher.sh
# source: rsync://master.qt.io/qt-all
# interval: 6000
# rsync_extra_flags: --exclude "snapshots/*"
# name: qt
# serve_mode: rsync_gateway
# <<: *rsync_fetcher_common
# <<: *oneshot_common
# debian
- type: shell_script
script: /worker-script/debian.sh
Expand Down
10 changes: 5 additions & 5 deletions config.zhiyuan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ repos:
source: master.qt.io::qt-all
interval: 6000
path: /mnt/qt
name: qt_rsync
name: qt
rsync_extra_flags: --exclude "snapshots/*"
no_redir_http: true
serve_mode: ignore
unified: disable
hidden: true
# no_redir_http: true
# serve_mode: ignore
# unified: disable
# hidden: true
5 changes: 0 additions & 5 deletions rsync-gateway/config.siyuan.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ namespace = "opencloudos"
s3_bucket = "899a892efef34b1b944a19981040f55b-oss01"
s3_prefix = "rsync/opencloudos"

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

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

0 comments on commit 91df382

Please sign in to comment.