From b5b71df6e6d83e119aefd5b6c627afe9e89f1aaf Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Wed, 24 Jun 2026 12:53:05 +0800 Subject: [PATCH] doc: update OpenBSD/FreeBSD instructions --- README.md | 22 ++++++++- docs/bsd-source-build.md | 91 ++++++++++++++++++++++++++++++++++++++ packaging/docker/README.md | 74 +++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 docs/bsd-source-build.md create mode 100644 packaging/docker/README.md diff --git a/README.md b/README.md index 87a5f57..721281e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ For browser-based authentication with the CLI: **Method 1:** Using sudo with environment preservation: ```bash -sudo -E gpclient connect --browser +sudo gpclient connect --browser ``` **Method 2:** Using authentication piping: @@ -200,6 +200,26 @@ sudo apk add --allow-untrusted globalprotect-openconnect-*.apk The package uses Alpine's native musl build. Make sure the `community` repository is enabled so GUI dependencies such as `webkit2gtk-4.1`, `libsecret`, and `libayatana-appindicator` can be resolved. GUI-launched connections use polkit, and VPN tunnel creation requires `/dev/net/tun`. +### FreeBSD + +Download the latest FreeBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install: + +```bash +sudo pkg install ./globalprotect-openconnect-*-freebsd-*.pkg +``` + +To build from source, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md). + +### OpenBSD + +Download the latest OpenBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install: + +```bash +doas pkg_add -D unsigned ./globalprotect-openconnect-*-openbsd-*.tgz +``` + +To build from source, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md). + ### Gentoo Available via the `guru` and `lamdness` overlays: diff --git a/docs/bsd-source-build.md b/docs/bsd-source-build.md new file mode 100644 index 0000000..558f648 --- /dev/null +++ b/docs/bsd-source-build.md @@ -0,0 +1,91 @@ +# Building from Source on FreeBSD and OpenBSD + +This guide builds the open-source components from the `GlobalProtect-openconnect` repository on FreeBSD or OpenBSD. + +## Workspace + +Clone `GlobalProtect-openconnect`: + +```sh +mkdir gp-build +cd gp-build +git clone --recurse-submodules https://github.com/yuezk/GlobalProtect-openconnect.git gp +``` + +## FreeBSD + +Install build and runtime dependencies: + +```sh +sudo pkg install git rust libiconv gettext-tools autoconf automake libtool patch \ + gmake pkgconf libxml2 gnutls p11-kit nettle gmp gnome-keyring \ + libayatana-appindicator polkit webkit2-gtk_41 +``` + +Build and install: + +```sh +cd gp +cargo build --release --workspace + +sudo gmake install-bsd +``` + +Verify the installed binaries: + +```sh +gpclient --version +gpauth --version +``` + +## OpenBSD + +Install build and runtime dependencies: + +```sh +doas pkg_add git rust libiconv gettext-tools autoconf-2.72 automake-1.17 \ + libtool patch gmake pkgconf libxml gnutls p11-kit nettle gmp \ + gnome-keyring polkit webkitgtk41 +``` + +Use the installed Autoconf and Automake versions: + +```sh +export AUTOCONF_VERSION=2.72 +export AUTOMAKE_VERSION=1.17 +``` + +If your shell cannot resolve the versioned tools automatically, add the usual unversioned command links: + +```sh +doas ln -sf /usr/local/bin/autoreconf-2.72 /usr/local/bin/autoreconf +doas ln -sf /usr/local/bin/autoconf-2.72 /usr/local/bin/autoconf +doas ln -sf /usr/local/bin/autoheader-2.72 /usr/local/bin/autoheader +doas ln -sf /usr/local/bin/autom4te-2.72 /usr/local/bin/autom4te +doas ln -sf /usr/local/bin/aclocal-1.17 /usr/local/bin/aclocal +doas ln -sf /usr/local/bin/automake-1.17 /usr/local/bin/automake +``` + +Build and install: + +```sh +cd gp +cargo build --release --workspace + +doas gmake install-bsd +``` + +Verify the installed binaries: + +```sh +gpclient --version +gpauth --version +``` + +## Verify + +After installation, check the CLI help: + +```sh +gpclient --help +``` diff --git a/packaging/docker/README.md b/packaging/docker/README.md new file mode 100644 index 0000000..e125ba6 --- /dev/null +++ b/packaging/docker/README.md @@ -0,0 +1,74 @@ +# GlobalProtect-openconnect Docker image + +This image provides the GlobalProtect-openconnect command-line tools on Alpine Linux. It includes: + +- `gpclient` - connect to and disconnect from GlobalProtect VPN portals and gateways +- `gpauth` - complete authentication separately and pipe the result into `gpclient` + +The image does not include embedded webview authentication, `gpgui-helper`, or the graphical `gpgui` application. + +## Pull + +```bash +docker pull yuezk/globalprotect-openconnect: +``` + +Release images are tagged as `vX.Y.Z`, `X.Y.Z`, and `latest`. + +## Usage + +VPN tunnel creation requires access to `/dev/net/tun` and the `NET_ADMIN` capability: + +```bash +docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \ + yuezk/globalprotect-openconnect: \ + connect --cookie-on-stdin +``` + +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: \ + connect --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: \ + connect --browser remote +``` + +Without `--network host`, the VPN connection stays inside the container 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. + +You can also run `gpauth` separately and pipe its remote-browser output into `gpclient`: + +```bash +docker run --rm -it --entrypoint gpauth yuezk/globalprotect-openconnect: \ + --browser remote 2>/dev/null \ + | docker run --rm -i --cap-add=NET_ADMIN --device=/dev/net/tun \ + yuezk/globalprotect-openconnect: \ + connect --cookie-on-stdin +``` + +## Common commands + +Show top-level help: + +```bash +docker run --rm yuezk/globalprotect-openconnect: --help +``` + +Show help for a command: + +```bash +docker run --rm yuezk/globalprotect-openconnect: help connect +``` + +## Project + +GlobalProtect-openconnect is a modern GlobalProtect VPN client for Linux, built on OpenConnect with support for SSO, non-SSO, FIDO2, client certificate authentication, multiple portals and gateways, and direct gateway connections. + +Source: https://github.com/yuezk/GlobalProtect-openconnect