Skip to content

Commit

Permalink
caddy: remove speedtest (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Jan 27, 2024
1 parent bf2ea5e commit bbe89e8
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 442 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
cp ./secrets/docker-registry.ci.yml ./secrets/docker-registry.yml
cp ./secrets/pg.env.example ./secrets/pg.env
touch ./secrets/lug-secrets.sh
touch ./speedtest/settings.toml
- name: verify config
run: docker-compose -f docker-compose.yml -f docker-compose.${{ matrix.mirror }}.yml config
- name: docker-compose build
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ docker-compose.override.yml
.env
/secrets
.pytest_cache/
speedtest/settings.toml
venv/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ For more information, refer to our [Wiki](https://github.com/sjtug/mirror-docker

## License

Apache 2.0, except `speedtest`, which is licensed under GPL 3.
Apache 2.0
12 changes: 2 additions & 10 deletions caddy-gen/src/caddy-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ def gen_repos(base: str, repos: dict, first_site: bool, site: str) -> tuple[list

http_file_server_nodes = []
http_git_server_nodes = []
http_gzip_disabled_list = ["speedtest"]
http_gzip_disabled_list = []

https_file_server_nodes = []
https_git_server_nodes = []
https_gzip_disabled_list = ["speedtest"]
https_gzip_disabled_list = []

for repo_ in repos:
repo = dict_to_repo(repo_)
Expand Down Expand Up @@ -180,14 +180,6 @@ def gen_repos(base: str, repos: dict, first_site: bool, site: str) -> tuple[list
http_file_server_nodes += http_git_server_nodes
https_file_server_nodes += https_git_server_nodes

speed_test_nodes = [BLANK_NODE,
Node('redir /speedtest /speedtest/ 308'),
Node('handle_path /speedtest/*', [
Node(f'reverse_proxy {SPEEDTEST_ADDR}')
])]
http_file_server_nodes += speed_test_nodes
https_file_server_nodes += speed_test_nodes

# disable gzip for all proxy repos
http_gzip_disabled = [Node(
'@gzip_enabled', [Node(f'not path /{prefix}/*') for prefix in http_gzip_disabled_list])]
Expand Down
1 change: 0 additions & 1 deletion caddy-gen/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
}

LUG_ADDR = 'lug:7001'
SPEEDTEST_ADDR = 'speedtest:8989'
FRONTEND_DIR = '/dists'
NODE_EXPORTER_ADDR = '172.31.0.1:9100'
CADVISOR_ADDR = 'cadvisor:8080'
Expand Down
12 changes: 0 additions & 12 deletions caddy/Caddyfile.siyuan
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ http://mirror.sjtu.edu.cn {
header * x-sjtug-mirror-id siyuan

@gzip_enabled {
not path /speedtest/*
not path /docker-ce/*
}
encode @gzip_enabled gzip zstd
Expand Down Expand Up @@ -127,11 +126,6 @@ http://mirror.sjtu.edu.cn {
respond @hidden 404
}


redir /speedtest /speedtest/ 308
handle_path /speedtest/* {
reverse_proxy speedtest:8989
}
}

https://mirror.sjtu.edu.cn {
Expand Down Expand Up @@ -192,7 +186,6 @@ https://mirror.sjtu.edu.cn {
header /mirrorz/* Access-Control-Request-Method GET

@gzip_enabled {
not path /speedtest/*
not path /nspawn/*
not path /anthon/*
not path /leopardsh/*
Expand Down Expand Up @@ -1168,10 +1161,5 @@ https://mirror.sjtu.edu.cn {
handle_path /git/qemu.git/* {
redir * https://mirrors.sjtug.sjtu.edu.cn/git/qemu.git{uri} 302
}

redir /speedtest /speedtest/ 308
handle_path /speedtest/* {
reverse_proxy speedtest:8989
}
}

12 changes: 0 additions & 12 deletions caddy/Caddyfile.zhiyuan
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ http://mirrors.sjtug.sjtu.edu.cn {
header * x-sjtug-mirror-id zhiyuan

@gzip_enabled {
not path /speedtest/*
not path /raspbian/*
}
encode @gzip_enabled gzip zstd
Expand Down Expand Up @@ -103,11 +102,6 @@ http://mirrors.sjtug.sjtu.edu.cn {
respond @hidden 404
}


redir /speedtest /speedtest/ 308
handle_path /speedtest/* {
reverse_proxy speedtest:8989
}
}

https://mirrors.sjtug.sjtu.edu.cn {
Expand Down Expand Up @@ -168,7 +162,6 @@ https://mirrors.sjtug.sjtu.edu.cn {
header /mirrorz/* Access-Control-Request-Method GET

@gzip_enabled {
not path /speedtest/*
not path /kali-images/*
not path /git/homebrew-core.git/*
not path /git/homebrew-cask.git/*
Expand Down Expand Up @@ -1087,10 +1080,5 @@ https://mirrors.sjtug.sjtu.edu.cn {
handle_path /git/lean4-packages/mathematics_in_lean/* {
redir * https://mirror.sjtu.edu.cn/git/lean4-packages/mathematics_in_lean{uri} 302
}

redir /speedtest /speedtest/ 308
handle_path /speedtest/* {
reverse_proxy speedtest:8989
}
}

5 changes: 0 additions & 5 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ services:
args:
- USE_SJTUG=false

speedtest:
build:
args:
- USE_SJTUG=false

git-backend:
build:
args:
Expand Down
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,6 @@ services:
networks:
- ipv6-service-net

speedtest:
build:
context: ./speedtest
args:
- USE_SJTUG=true
- SPEEDTEST_URL=v1.1.3/speedtest-go_1.1.3_linux_amd64.tar.gz
expose:
- 8989
logging:
options:
max-size: "2M"
max-file: "10"
restart: unless-stopped
networks:
- ipv6-service-net

networks:
host-monitor-net:
driver: bridge
Expand Down
27 changes: 0 additions & 27 deletions speedtest/Dockerfile

This file was deleted.

0 comments on commit bbe89e8

Please sign in to comment.