ci: support remote auth in docker image

This commit is contained in:
Kevin Yue committed 2026-05-09 22:43:44 +08:00
1 parent 3e23fc7d22
commit 7d63836e35
4 files changed
+37 -1

No files matched your search

+12
View File
@@ -223,6 +223,7 @@ jobs:
run: |
docker run --rm "$IMAGE@$DIGEST" --help
docker run --rm --entrypoint gpauth "$IMAGE@$DIGEST" --help
docker run --rm --entrypoint sh "$IMAGE@$DIGEST" -lc 'test "$(id -u gp)" = "1000" && test "$SUDO_UID" = "1000"'
- name: Export digest
run: |
mkdir -p /tmp/digests
@@ -329,6 +330,17 @@ jobs:
with:
path: gh-release/gp/.build/artifacts
- name: Rename APK artifacts
run: |
shopt -s nullglob
for file in gh-release/gp/.build/artifacts/artifact-gp-apk-amd64/*.apk; do
mv "$file" "${file%.apk}-x86_64.apk"
done
for file in gh-release/gp/.build/artifacts/artifact-gp-apk-ubuntu-24.04-arm/*.apk; do
mv "$file" "${file%.apk}-aarch64.apk"
done
- name: Create GH release
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
+1
View File
@@ -197,6 +197,7 @@ jobs:
run: |
docker run --rm "$IMAGE@$DIGEST" --help
docker run --rm --entrypoint gpauth "$IMAGE@$DIGEST" --help
docker run --rm --entrypoint sh "$IMAGE@$DIGEST" -lc 'test "$(id -u gp)" = "1000" && test "$SUDO_UID" = "1000"'
- name: Export digest
run: |
mkdir -p /tmp/digests
+19 -1
View File
@@ -281,7 +281,25 @@ docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
connect <portal> --cookie-on-stdin
```
For browser authentication in a headless environment, pipe `gpauth` remote-browser output into `gpclient`:
For browser authentication in a headless environment, use remote browser authentication:
```bash
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
yuezk/globalprotect-openconnect:<version> \
connect <portal> --browser remote
```
On a Linux host, add host networking if the VPN routes should affect the host network namespace:
```bash
docker run --rm -it --network host --cap-add=NET_ADMIN --device=/dev/net/tun \
yuezk/globalprotect-openconnect:<version> \
connect <portal> --browser remote
```
Without `--network host`, the VPN connection stays inside the container's network namespace. Docker Desktop on macOS and Windows does not make the host use the VPN through `--network host`; run `gpclient` on the host or use a container gateway setup for host traffic.
Alternatively, pipe `gpauth` remote-browser output into `gpclient`:
```bash
docker run --rm -it --entrypoint gpauth yuezk/globalprotect-openconnect:<version> \
+5
View File
@@ -42,6 +42,9 @@ RUN install -Dm755 target/release/gpclient /out/usr/bin/gpclient \
FROM alpine:${ALPINE_VERSION}
ENV SUDO_UID=1000 \
HOME=/root
RUN apk add --no-cache \
ca-certificates \
gmp \
@@ -55,6 +58,8 @@ RUN apk add --no-cache \
openssl \
p11-kit \
zlib \
&& addgroup -g 1000 gp \
&& adduser -D -u 1000 -G gp gp \
&& update-ca-certificates
COPY --from=builder /out/ /