Skip to content

Commit a71201b

Browse files
committed
chore(HaRP-frp): install FRP from releases
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 5576d72 commit a71201b

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

Dockerfile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,36 @@ COPY requirements.txt /
1212
RUN --mount=type=cache,target=/root/.cache/pip \
1313
python3 -m pip install --root-user-action=ignore -r requirements.txt && rm requirements.txt
1414

15-
# Download and install FRP client into /usr/local/bin.
15+
# Download and install FRP client with checksum verification
16+
# FRP version and checksums - update these when upgrading
17+
ARG FRP_VERSION=0.61.1
18+
ARG FRP_AMD64_SHA256=bff260b68ca7b1461182a46c4f34e9709ba32764eed30a15dd94ac97f50a2c40
19+
ARG FRP_ARM64_SHA256=af6366f2b43920ebfe6235dba6060770399ed1fb18601e5818552bd46a7621f8
20+
1621
RUN set -ex; \
1722
ARCH=$(uname -m); \
1823
if [ "$ARCH" = "aarch64" ]; then \
19-
FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_arm64.tar.gz"; \
24+
FRP_ARCH="arm64"; \
25+
FRP_SHA256="${FRP_ARM64_SHA256}"; \
2026
else \
21-
FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_amd64.tar.gz"; \
27+
FRP_ARCH="amd64"; \
28+
FRP_SHA256="${FRP_AMD64_SHA256}"; \
29+
fi; \
30+
FRP_URL="https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_${FRP_ARCH}.tar.gz"; \
31+
echo "Downloading FRP v${FRP_VERSION} for ${FRP_ARCH}..."; \
32+
curl -fsSL "${FRP_URL}" -o /tmp/frp.tar.gz; \
33+
ACTUAL_SHA256=$(sha256sum /tmp/frp.tar.gz | cut -d' ' -f1); \
34+
if [ "$ACTUAL_SHA256" != "$FRP_SHA256" ]; then \
35+
echo "Checksum verification failed for FRP v${FRP_VERSION} (${FRP_ARCH})"; \
36+
echo "Expected: ${FRP_SHA256}"; \
37+
echo "Got: ${ACTUAL_SHA256}"; \
38+
exit 1; \
2239
fi; \
23-
echo "Downloading FRP client from $FRP_URL"; \
24-
curl -L "$FRP_URL" -o /tmp/frp.tar.gz; \
2540
tar -C /tmp -xzf /tmp/frp.tar.gz; \
26-
mv /tmp/frp_0.61.1_linux_* /tmp/frp; \
27-
cp /tmp/frp/frpc /usr/local/bin/frpc; \
41+
cp /tmp/frp_${FRP_VERSION}_linux_${FRP_ARCH}/frpc /usr/local/bin/frpc; \
2842
chmod +x /usr/local/bin/frpc; \
29-
rm -rf /tmp/frp /tmp/frp.tar.gz
43+
rm -rf /tmp/frp_${FRP_VERSION}_linux_${FRP_ARCH} /tmp/frp.tar.gz; \
44+
echo "FRP client installed successfully"
3045

3146
#############################
3247
# Stage 2: Final Runtime Image

0 commit comments

Comments
 (0)