Skip to content

Commit 10ed6cf

Browse files
authored
chore(HaRP-frp): install FRP from releases (#39)
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 974f99b commit 10ed6cf

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

Dockerfile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,36 @@ RUN apt-get update && apt-get install -y curl && \
66
ARG BUILD_TYPE
77
COPY 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+
1015
RUN 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
2641
RUN --mount=type=cache,target=/root/.cache/pip \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ build-push-latest:
3939
DOCKER_BUILDKIT=1 docker buildx build --progress=plain --push --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-rocm --build-arg BUILD_TYPE=rocm .
4040

4141
.PHONY: build-podman-latest
42-
build-push-latest:
42+
build-podman-latest:
4343
podman build --format=docker --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest --build-arg BUILD_TYPE=cpu .
4444
podman build --format=docker --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-cuda --build-arg BUILD_TYPE=cuda .
4545
podman build --format=docker --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-rocm --build-arg BUILD_TYPE=rocm .

0 commit comments

Comments
 (0)