Skip to content

Commit 647152a

Browse files
lug: support proxy (#481)
1 parent a9cfa67 commit 647152a

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ services:
7474
- USE_SJTUG=true
7575
- CLONE_VERSION=v0.1.18
7676
- CLONE_V2_VERSION=v0.2.37
77-
- RSYNC_SJTUG_VERSION=v0.4.15
77+
- RSYNC_SJTUG_VERSION=v0.4.16
7878
- LUG_VERSION=v0.12.10
7979
expose:
8080
- 8081
@@ -211,6 +211,7 @@ services:
211211
- proxy-net
212212
expose:
213213
- 8080
214+
- 1080
214215
restart: unless-stopped
215216
logging:
216217
options:

lug/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM debian:bullseye
1+
FROM debian:bookworm
22

33
ARG USE_SJTUG
4-
RUN if [ "$USE_SJTUG" = true ] ; then sed -i 's/http:\/\/deb.debian.org/http:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list ; fi
5-
RUN if [ "$USE_SJTUG" = true ] ; then sed -i 's/http:\/\/security.debian.org/http:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list ; fi
4+
RUN if [ "$USE_SJTUG" = true ] ; then sed -i 's/http:\/\/deb.debian.org/http:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list.d/debian.sources ; fi
5+
RUN if [ "$USE_SJTUG" = true ] ; then sed -i 's/http:\/\/security.debian.org/http:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list.d/debian.sources ; fi
66

77
WORKDIR /app
88
RUN apt-get update && apt-get install rsync wget git jq curl unzip -y
@@ -28,7 +28,7 @@ RUN /app/build-script/setup-julia.sh
2828
ENV PATH="/app/julia-1.5.0/bin:${PATH}"
2929

3030
# Python packages
31-
RUN if [ "$USE_SJTUG" = true ] ; then pip3 install python-dateutil -i https://mirror.sjtu.edu.cn/pypi/web/simple; else pip3 install python-dateutil ; fi
31+
RUN apt-get install python3-dateutil -y
3232

3333
# StorageMirrorServer.jl
3434
COPY build-script/setup-julia-mirror.sh build-script/setup-julia-mirror.sh

lug/build-script/setup-php.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
55
if [ "$USE_SJTUG" = true ] ; then
6-
echo "deb https://mirror.sjtu.edu.cn/sury/php/ bullseye main" > /etc/apt/sources.list.d/php.list
6+
echo "deb https://mirror.sjtu.edu.cn/sury/php/ bookworm main" > /etc/apt/sources.list.d/php.list
77
else
8-
echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list
8+
echo "deb https://packages.sury.org/php/ bookworm main" > /etc/apt/sources.list.d/php.list
99
fi

lug/worker-script/rsync-fetcher.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ mkdir -p "${LUG_tmp_path}"
1414

1515
LUG_timeout="${LUG_timeout:-4h}"
1616

17+
if [ "${LUG_use_proxy}" ]; then
18+
export SOCKS5_PROXY=socks5://clash:1080
19+
fi
20+
1721
eval timeout $LUG_timeout /app/rsync_sjtug/rsync-gc --s3-url "\"${LUG_s3_api}\"" --s3-region "\"${LUG_s3_region}\"" --s3-bucket "\"${LUG_s3_bucket}\"" --s3-prefix "\"rsync/${LUG_name}\"" --pg-url "\"${LUG_pg}\"" --namespace "\"${LUG_name}\"" --keep "\"${LUG_keep}\"" --partial "\"${LUG_partial}\""
1822
eval timeout $LUG_timeout /app/rsync_sjtug/rsync-fetcher --src "\"${LUG_source}\"" --s3-url "\"${LUG_s3_api}\"" --s3-region "\"${LUG_s3_region}\"" --s3-bucket "\"${LUG_s3_bucket}\"" --s3-prefix "\"rsync/${LUG_name}\"" --pg-url "\"${LUG_pg}\"" --namespace "\"${LUG_name}\"" --tmp-path "\"${LUG_tmp_path}\"" ${LUG_rsync_extra_flags}

0 commit comments

Comments
 (0)