@@ -6,21 +6,36 @@ RUN apt-get update && apt-get install -y curl && \
66ARG BUILD_TYPE
77COPY requirements.txt /
88
9- # Download and install FRP client
9+ # Download and install FRP client with checksum verification
10+ # FRP version and checksums - update these when upgrading
11+ ARG FRP_VERSION=0.61.1
12+ ARG FRP_AMD64_SHA256=bff260b68ca7b1461182a46c4f34e9709ba32764eed30a15dd94ac97f50a2c40
13+ ARG FRP_ARM64_SHA256=af6366f2b43920ebfe6235dba6060770399ed1fb18601e5818552bd46a7621f8
14+
1015RUN set -ex; \
1116 ARCH=$(uname -m); \
1217 if [ "$ARCH" = "aarch64" ]; then \
13- FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_arm64.tar.gz" ; \
18+ FRP_ARCH="arm64" ; \
19+ FRP_SHA256="${FRP_ARM64_SHA256}" ; \
1420 else \
15- FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_amd64.tar.gz" ; \
21+ FRP_ARCH="amd64" ; \
22+ FRP_SHA256="${FRP_AMD64_SHA256}" ; \
23+ fi; \
24+ FRP_URL="https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_${FRP_ARCH}.tar.gz" ; \
25+ echo "Downloading FRP v${FRP_VERSION} for ${FRP_ARCH}..." ; \
26+ curl -fsSL "${FRP_URL}" -o /tmp/frp.tar.gz; \
27+ ACTUAL_SHA256=$(sha256sum /tmp/frp.tar.gz | cut -d' ' -f1); \
28+ if [ "$ACTUAL_SHA256" != "$FRP_SHA256" ]; then \
29+ echo "Checksum verification failed for FRP v${FRP_VERSION} (${FRP_ARCH})" ; \
30+ echo "Expected: ${FRP_SHA256}" ; \
31+ echo "Got: ${ACTUAL_SHA256}" ; \
32+ exit 1; \
1633 fi; \
17- echo "Downloading FRP client from $FRP_URL" ; \
18- curl -L "$FRP_URL" -o /tmp/frp.tar.gz; \
1934 tar -C /tmp -xzf /tmp/frp.tar.gz; \
20- mv /tmp/frp_0.61.1_linux_* /tmp/frp; \
21- cp /tmp/frp/frpc /usr/local/bin/frpc; \
35+ cp /tmp/frp_${FRP_VERSION}_linux_${FRP_ARCH}/frpc /usr/local/bin/frpc; \
2236 chmod +x /usr/local/bin/frpc; \
23- rm -rf /tmp/frp /tmp/frp.tar.gz
37+ rm -rf /tmp/frp_${FRP_VERSION}_linux_${FRP_ARCH} /tmp/frp.tar.gz; \
38+ echo "FRP client installed successfully"
2439
2540# Installing PyTorch based on BUILD_TYPE
2641RUN --mount=type=cache,target=/root/.cache/pip \
0 commit comments