mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb994f4030 | ||
|
|
2507a42226 | ||
|
|
633da4cbe5 | ||
|
|
a155d2e9e3 | ||
|
|
4a53ab9d28 | ||
|
|
755300f554 | ||
|
|
7eefe91864 | ||
|
|
281628957f | ||
|
|
d461aa6568 | ||
|
|
94493dd1e3 | ||
|
|
8ebe2973b8 | ||
|
|
0e1e0486d6 | ||
|
|
90f823adcd | ||
|
|
0e444236d9 | ||
|
|
673cf464b0 | ||
|
|
48d7938541 | ||
|
|
3a9f8459a0 | ||
|
|
ed39f7f983 | ||
|
|
d9581de71f | ||
|
|
8d45b66660 | ||
|
|
94bc0f0472 | ||
|
|
94b04add4f | ||
|
|
d0d413281b | ||
|
|
6ccb834189 | ||
|
|
d518177bd1 | ||
|
|
eec18375cd | ||
|
|
87ffc46551 | ||
|
|
6b79772f54 | ||
|
|
dcdedf3e8b | ||
|
|
b750cfbf16 | ||
|
|
05814e9da7 | ||
|
|
cc43a88ade | ||
|
|
b5f3bac256 | ||
|
|
688e3e4ee7 | ||
|
|
2f76b3d4eb | ||
|
|
c67998a540 | ||
|
|
bdd2fc9883 | ||
|
|
91c480c274 | ||
|
|
ba1a70f3ce | ||
|
|
56c3babfe7 | ||
|
|
a91c04fa64 | ||
|
|
739cf7234b | ||
|
|
24d935ea61 | ||
|
|
00a92dabeb | ||
|
|
05b63991a8 | ||
|
|
42ac612916 | ||
|
|
56516abc62 | ||
|
|
308957283b | ||
|
|
9d8c3b4e34 | ||
|
|
e2a64ed7d4 | ||
|
|
dbab0150fe | ||
|
|
1c9bef6e63 | ||
|
|
59102edfb5 | ||
|
|
aa41998e58 | ||
|
|
a3397e81a7 | ||
|
|
2910870371 | ||
|
|
fb82bb4b8d | ||
|
|
630e8ec0de | ||
|
|
890daea78f | ||
|
|
8e57f5723b | ||
|
|
bfb27a279f | ||
|
|
b33701a83f | ||
|
|
193dfc247f | ||
|
|
08389271f0 | ||
|
|
842df3201b | ||
|
|
cd8eb1d9eb | ||
|
|
32cd228c02 | ||
|
|
8b4821948d | ||
|
|
79b7837189 | ||
|
|
b62db0e9a1 | ||
|
|
581710a770 | ||
|
|
c92bdaed1d | ||
|
|
58738f6fd7 | ||
|
|
ada320044b | ||
|
|
fb35e6ee1c | ||
|
|
4cfa9a9b5b | ||
|
|
d1d9f0c6fc | ||
|
|
cc4d35c228 | ||
|
|
17d1555155 | ||
|
|
588790f2d5 | ||
|
|
918abeb9bc | ||
|
|
812965f020 | ||
|
|
5c3b7d118a | ||
|
|
4fdcb15629 | ||
|
|
88f4623f52 | ||
|
|
3d2dfe4be0 | ||
|
|
8c831b1fc2 | ||
|
|
912bf3046d | ||
|
|
4a12de6156 | ||
|
|
b0b8e5ec32 | ||
|
|
cfe8430cae | ||
|
|
7ae09aad8c | ||
|
|
40b35804e7 | ||
|
|
6999b2725e | ||
|
|
0a528b4aae | ||
|
|
7134d92ee8 | ||
|
|
d21b909a0d | ||
|
|
e066362c92 | ||
|
|
fd9b48cd90 | ||
|
|
2c29dda2ac | ||
|
|
d3845678ab | ||
|
|
355f8d82aa | ||
|
|
2ca6b80728 | ||
|
|
c0c517806e | ||
|
|
537e12d706 | ||
|
|
4197927f56 | ||
|
|
1b7380d2f2 | ||
|
|
090e479e20 | ||
|
|
cbce8b5609 | ||
|
|
6edd3408aa | ||
|
|
5da7b45407 | ||
|
|
bd064713a8 | ||
|
|
822d10528f | ||
|
|
ce8cc5b8dd | ||
|
|
b407c56239 | ||
|
|
9c1428fb72 | ||
|
|
ce97729984 | ||
|
|
3817227942 | ||
|
|
88975379bf | ||
|
|
11b410f1d9 | ||
|
|
917e1091a1 | ||
|
|
68f35cc582 | ||
|
|
293cd56930 | ||
|
|
ca221e3488 | ||
|
|
6e01164a56 | ||
|
|
d83bb22c58 | ||
|
|
e808ccbdb5 | ||
|
|
f17dd27d55 | ||
|
|
2b7b97f0e4 | ||
|
|
3a2398e677 | ||
|
|
7a373813ce | ||
|
|
8a41765c53 | ||
|
|
7a16e6bce8 | ||
|
|
6d23d41797 | ||
|
|
5263c03889 | ||
|
|
c44be546c3 | ||
|
|
63c873a906 | ||
|
|
3c16026acc | ||
|
|
81fcd253d3 | ||
|
|
4f94a28ad2 | ||
|
|
f403f19164 | ||
|
|
ab10af726b | ||
|
|
52f719d192 | ||
|
|
6723685385 | ||
|
|
aa14c67e92 | ||
|
|
fa14b94520 | ||
|
|
ded66586b2 | ||
|
|
cb1716ba9c | ||
|
|
25cca2831b |
No files matched your search
@@ -476,7 +476,6 @@ jobs:
|
||||
--extra-experimental-features "nix-command flakes" --print-build-logs
|
||||
|
||||
trigger-gpgui-macos:
|
||||
needs: test-gp
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.build_macos) }}
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -802,7 +801,6 @@ jobs:
|
||||
attestations: write
|
||||
artifact-metadata: write
|
||||
needs:
|
||||
- test-gp
|
||||
- nix-source
|
||||
- nix-prebuilt
|
||||
- tarball
|
||||
@@ -956,7 +954,6 @@ jobs:
|
||||
|
||||
publish-docker-image:
|
||||
needs:
|
||||
- test-gp
|
||||
- build-docker-image
|
||||
if: ${{ (github.event_name == 'workflow_dispatch' && !inputs.build_only) || startsWith(github.ref, 'refs/tags/') }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
name: Nix
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "flake.nix"
|
||||
- "flake.lock"
|
||||
- "nix/**"
|
||||
- ".github/workflows/nix.yaml"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "flake.nix"
|
||||
- "flake.lock"
|
||||
- "nix/**"
|
||||
- ".github/workflows/nix.yaml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
standalone-package:
|
||||
name: standalone-package (${{ matrix.platform.system }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- runner: ubuntu-latest
|
||||
system: x86_64-linux
|
||||
- runner: ubuntu-24.04-arm
|
||||
system: aarch64-linux
|
||||
runs-on: ${{ matrix.platform.runner }}
|
||||
steps:
|
||||
- name: Checkout GlobalProtect-openconnect
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
|
||||
- name: Build standalone prebuilt package
|
||||
run: |
|
||||
nix build .#prebuilt \
|
||||
--extra-experimental-features "nix-command flakes" \
|
||||
--print-build-logs
|
||||
|
||||
- name: Inspect prebuilt package
|
||||
run: |
|
||||
test -x result/bin/gpclient
|
||||
test -x result/bin/gpauth
|
||||
test -x result/bin/gpservice
|
||||
test -x result/bin/gpgui-helper
|
||||
test -x result/bin/gpgui
|
||||
|
||||
nixos-module:
|
||||
name: nixos-module (${{ matrix.platform.system }}, ${{ matrix.nixpkgs }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- runner: ubuntu-latest
|
||||
system: x86_64-linux
|
||||
- runner: ubuntu-24.04-arm
|
||||
system: aarch64-linux
|
||||
nixpkgs:
|
||||
- nixos-25.11
|
||||
- nixos-26.05
|
||||
- nixpkgs-unstable
|
||||
runs-on: ${{ matrix.platform.runner }}
|
||||
steps:
|
||||
- name: Checkout GlobalProtect-openconnect
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
|
||||
- name: Build package through host NixOS module
|
||||
env:
|
||||
NIXPKGS_URL: github:NixOS/nixpkgs/${{ matrix.nixpkgs }}
|
||||
NIX_SYSTEM: ${{ matrix.platform.system }}
|
||||
run: |
|
||||
nix build \
|
||||
--impure \
|
||||
--extra-experimental-features "nix-command flakes" \
|
||||
--print-build-logs \
|
||||
--expr '
|
||||
let
|
||||
gp = builtins.getFlake (toString ./.);
|
||||
hostNixpkgs =
|
||||
builtins.getFlake (builtins.getEnv "NIXPKGS_URL");
|
||||
|
||||
hostSystem = hostNixpkgs.lib.nixosSystem {
|
||||
system = builtins.getEnv "NIX_SYSTEM";
|
||||
modules = [
|
||||
gp.nixosModules.default
|
||||
{
|
||||
programs.globalprotect-openconnect.enable = true;
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
package =
|
||||
hostSystem.config.programs.globalprotect-openconnect.package;
|
||||
in
|
||||
assert builtins.elem package
|
||||
hostSystem.config.environment.systemPackages;
|
||||
assert hostSystem.config.services.ayatana-indicators.enable;
|
||||
package
|
||||
'
|
||||
|
||||
- name: Inspect module package
|
||||
run: |
|
||||
test -x result/bin/gpclient
|
||||
test -x result/bin/gpauth
|
||||
test -x result/bin/gpservice
|
||||
test -x result/bin/gpgui-helper
|
||||
test -x result/bin/gpgui
|
||||
Generated
+10
-13
@@ -214,7 +214,7 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
||||
|
||||
[[package]]
|
||||
name = "auth"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"block2",
|
||||
@@ -423,7 +423,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "browser-launcher"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -719,10 +719,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "common"
|
||||
version = "3.0.1"
|
||||
dependencies = [
|
||||
"tempfile",
|
||||
]
|
||||
version = "2.6.5"
|
||||
|
||||
[[package]]
|
||||
name = "compile-time"
|
||||
@@ -1831,7 +1828,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpapi"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.22.1",
|
||||
@@ -1882,7 +1879,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpauth"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"auth",
|
||||
@@ -1901,7 +1898,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpclient"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -1927,7 +1924,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpgui-helper"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -1948,7 +1945,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gphip"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"askama",
|
||||
@@ -1965,7 +1962,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpservice"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@@ -3386,7 +3383,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openconnect"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"autotools",
|
||||
"cc",
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ members = [
|
||||
|
||||
[workspace.package]
|
||||
rust-version = "1.91"
|
||||
version = "3.0.1"
|
||||
version = "2.6.5"
|
||||
authors = ["Kevin Yue <[email protected]>"]
|
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
edition = "2024"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# GlobalProtect-openconnect
|
||||
|
||||
A GlobalProtect VPN client built on OpenConnect with support for SSO authentication. It provides command-line tools and the GP Connect desktop application for macOS, Linux, FreeBSD, and OpenBSD.
|
||||
A modern GlobalProtect VPN client for Linux, built on OpenConnect with full support for SSO authentication. This project provides both command-line and graphical interfaces for seamless VPN connectivity.
|
||||
|
||||
<p align="center">
|
||||
<img width="300" src="https://github.com/user-attachments/assets/2fb6116c-dc57-43f2-af75-9c3d97ab7122">
|
||||
@@ -15,15 +15,12 @@ A GlobalProtect VPN client built on OpenConnect with support for SSO authenticat
|
||||
- [Command-Line Interface](#command-line-interface)
|
||||
- [Graphical User Interface](#graphical-user-interface)
|
||||
- [Installation](#installation)
|
||||
- [macOS](#macos)
|
||||
- [Debian / Ubuntu](#debian--ubuntu)
|
||||
- [Arch Linux / Manjaro](#arch-linux--manjaro)
|
||||
- [Fedora 38+ / Rawhide](#fedora-38--rawhide)
|
||||
- [openSUSE Leap 15.6+ / Tumbleweed](#opensuse-leap-156--tumbleweed)
|
||||
- [Other RPM-based Distributions](#other-rpm-based-distributions)
|
||||
- [Alpine Linux](#alpine-linux)
|
||||
- [FreeBSD](#freebsd)
|
||||
- [OpenBSD](#openbsd)
|
||||
- [Gentoo](#gentoo)
|
||||
- [NixOS](#nixos)
|
||||
- [Official Docker Image](#official-docker-image)
|
||||
@@ -31,11 +28,11 @@ A GlobalProtect VPN client built on OpenConnect with support for SSO authenticat
|
||||
- [Building from Source](#building-from-source)
|
||||
- [Frequently Asked Questions](#frequently-asked-questions)
|
||||
- [NetworkManager Integration](#networkmanager-integration)
|
||||
- [Licensing](#licensing)
|
||||
- [License](#license)
|
||||
|
||||
## Features
|
||||
|
||||
- **Desktop Platform Support** – macOS, Linux, FreeBSD, and OpenBSD
|
||||
- **Cross-Platform Linux Support** – Optimized for various Linux distributions
|
||||
- **Dual Interface** – Available as both CLI and GUI applications
|
||||
- **Flexible Authentication** – Supports SSO, non-SSO, FIDO2 (e.g., YubiKey), and client certificate authentication
|
||||
- **Browser Integration** – Authenticate using your default browser or any specified browser
|
||||
@@ -48,7 +45,7 @@ A GlobalProtect VPN client built on OpenConnect with support for SSO authenticat
|
||||
|
||||
### Command-Line Interface
|
||||
|
||||
The CLI is free and open source. Use it to authenticate, connect to portals or gateways, and generate HIP reports from the terminal.
|
||||
The CLI version is fully open source and feature-rich, providing nearly identical functionality to the GUI version.
|
||||
|
||||
#### Basic Commands
|
||||
|
||||
@@ -65,7 +62,6 @@ Commands:
|
||||
Options:
|
||||
--fix-openssl Uses extended compatibility mode for OpenSSL operations to support a broader range of systems and formats.
|
||||
--ignore-tls-errors Ignore the TLS errors
|
||||
--lock-file <LOCK_FILE> Path to the gpclient PID lock file
|
||||
--log-format <LOG_FORMAT> Log output format. JSON is intended for non-interactive consumers; interactive prompts remain text. [default: text] [possible values: text, json]
|
||||
-v, --verbose... Enable verbose output, -v for debug, -vv for trace
|
||||
-q, --quiet... Decrease logging verbosity, -q for warnings, -qq for errors
|
||||
@@ -89,34 +85,27 @@ Use `--hip=/absolute/path/to/script` for a custom executable. It runs as the `gp
|
||||
|
||||
#### External Browser Authentication
|
||||
|
||||
Use `gpclient` directly for browser-based authentication. It opens the browser as your normal desktop user while keeping VPN tunnel setup privileged:
|
||||
For browser-based authentication with the CLI:
|
||||
|
||||
**Method 1:** Using sudo with environment preservation:
|
||||
```bash
|
||||
sudo gpclient connect <portal> --browser
|
||||
sudo gpclient connect --browser <portal>
|
||||
```
|
||||
|
||||
To reuse a saved portal cookie for later connections, add `--cookie-cache`:
|
||||
|
||||
**Method 2:** Using authentication piping:
|
||||
```bash
|
||||
sudo gpclient connect <portal> --browser --cookie-cache
|
||||
```
|
||||
|
||||
Add `--gateway <gateway>` to select a particular gateway. Cookie caching is handled by `gpclient`. Its default cache file is `$HOME/.config/gpclient/cookie.json`, which normally belongs to root when running with `sudo`. To choose a predictable location, specify the path explicitly:
|
||||
|
||||
```bash
|
||||
sudo gpclient connect <portal> --browser --cookie-cache=/absolute/path/to/cookie.json
|
||||
gpauth <portal> --browser 2>/dev/null | sudo gpclient connect <portal> --cookie-on-stdin
|
||||
```
|
||||
|
||||
**Browser Options:**
|
||||
|
||||
- Use `--browser` to try your recognized default browser first, then another detected browser, and finally the system URL handler
|
||||
- Use `--browser` to auto-select Chrome, Firefox, then the system default browser
|
||||
- Use `--browser default` to use the system default browser
|
||||
- Use `--browser <browser>` to specify a browser (e.g., `firefox`, `chrome`)
|
||||
- Use `--browser remote` for headless servers – this provides a URL you can access from another machine to complete authentication
|
||||
|
||||
### Graphical User Interface
|
||||
|
||||
GP Connect provides a desktop interface for managing VPN connections. On macOS, open GP Connect from Applications. On Linux, FreeBSD, and OpenBSD, launch it from your application menu or via the terminal:
|
||||
The GUI application provides an intuitive interface for managing VPN connections. Launch it from your application menu or via the terminal:
|
||||
|
||||
```bash
|
||||
gpclient launch-gui
|
||||
@@ -132,26 +121,6 @@ gpclient launch-gui
|
||||
>
|
||||
> For older Linux distributions, use [v2.3.13](https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/v2.3.13) instead of the latest release. It provides release assets for common distro families, including Debian/Ubuntu (`.deb`), Arch Linux / Manjaro (`.pkg.tar.zst`), RPM-based distros such as Fedora / RHEL / Rocky / AlmaLinux / CentOS (`.rpm`), and generic Linux tarballs (`.bin.tar.xz`).
|
||||
|
||||
### macOS
|
||||
|
||||
GP Connect requires Apple silicon and macOS 13 or later. The macOS app includes both the desktop application and the free `gpclient` CLI. The CLI does not require a GUI license.
|
||||
|
||||
#### Option 1: Install with Homebrew
|
||||
|
||||
```bash
|
||||
brew install --cask yuezk/gp-connect/gp-connect
|
||||
```
|
||||
|
||||
Open GP Connect from Applications, or connect from the terminal:
|
||||
|
||||
```bash
|
||||
sudo gpclient connect <portal> --browser
|
||||
```
|
||||
|
||||
#### Option 2: Install from DMG
|
||||
|
||||
Download the GP Connect `.dmg` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, open it, and drag GP Connect into Applications.
|
||||
|
||||
### Debian / Ubuntu
|
||||
|
||||
#### Option 1: Install from PPA (Recommended)
|
||||
@@ -174,7 +143,7 @@ sudo apt-get install globalprotect-openconnect
|
||||
Download the latest `.deb` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
|
||||
|
||||
```bash
|
||||
sudo apt install --fix-broken ./globalprotect-openconnect_*.deb
|
||||
sudo apt install --fix-broken globalprotect-openconnect_*.deb
|
||||
```
|
||||
|
||||
### Arch Linux / Manjaro
|
||||
@@ -362,7 +331,7 @@ Run it with access to the TUN device:
|
||||
```bash
|
||||
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
yuezk/globalprotect-openconnect:<version> \
|
||||
connect <portal>
|
||||
connect <portal> --cookie-on-stdin
|
||||
```
|
||||
|
||||
For browser authentication in a headless environment, use remote browser authentication:
|
||||
@@ -389,6 +358,16 @@ docker run --rm -it --network host --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
|
||||
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> \
|
||||
<portal> --browser remote 2>/dev/null \
|
||||
| docker run --rm -i --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
yuezk/globalprotect-openconnect:<version> \
|
||||
connect <portal> --cookie-on-stdin
|
||||
```
|
||||
|
||||
The image includes `gpclient` and `gpauth` only. It does not include embedded webview authentication, `gpgui-helper`, or `gpgui`.
|
||||
|
||||
### Other Distributions
|
||||
@@ -396,16 +375,14 @@ The image includes `gpclient` and `gpauth` only. It does not include embedded we
|
||||
#### Manual Installation
|
||||
|
||||
1. **Install dependencies:**
|
||||
- WebKitGTK 4.1 (for example, `libwebkit2gtk-4.1-0` on Debian/Ubuntu)
|
||||
- `webkit2gtk`
|
||||
- `libsecret`
|
||||
- `libayatana-appindicator` or `libappindicator-gtk3`
|
||||
- polkit (`pkexec`) for GUI-launched VPN connections
|
||||
|
||||
2. **Download and extract:**
|
||||
Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
|
||||
```bash
|
||||
tar -xJf globalprotect-openconnect_${version}_${arch}.bin.tar.xz
|
||||
cd globalprotect-openconnect_${version}
|
||||
```
|
||||
|
||||
3. **Install:**
|
||||
@@ -415,11 +392,11 @@ The image includes `gpclient` and `gpauth` only. It does not include embedded we
|
||||
|
||||
## Building from Source
|
||||
|
||||
The instructions below build the open-source components on Linux. For FreeBSD and OpenBSD, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md).
|
||||
You can build the application from source using either a DevContainer (recommended) or a local development environment.
|
||||
|
||||
### Method 1: Using DevContainer
|
||||
### Method 1: Using DevContainer (Recommended)
|
||||
|
||||
This project includes a DevContainer configuration for Linux development. The repository's `rust-toolchain.toml` selects the Rust toolchain; rustup may need to download it on the first build.
|
||||
This project includes a DevContainer configuration that provides a consistent, reproducible build environment with all dependencies pre-installed.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
@@ -443,7 +420,7 @@ This project includes a DevContainer configuration for Linux development. The re
|
||||
|
||||
3. **Build the project:**
|
||||
|
||||
To build the open-source components, including the GUI helper, run:
|
||||
To build everything including the GUI helper run this command:
|
||||
```bash
|
||||
docker run --privileged --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
--tty -v "$(pwd)":/workspace -w /workspace gpoc-devcontainer \
|
||||
@@ -451,17 +428,13 @@ This project includes a DevContainer configuration for Linux development. The re
|
||||
```
|
||||
To build without the GUI helper run the same command as above, but with `BUILD_GUI_HELPER=0` passed as an argument to `make`.
|
||||
|
||||
4. **Locate build artifacts:**
|
||||
5. **Locate build artifacts:**
|
||||
|
||||
The compiled binaries will be available in `target/release/`:
|
||||
- `gpclient` – CLI client
|
||||
- `gpservice` – Background service
|
||||
- `gpauth` – Authentication helper
|
||||
- `gpgui-helper` – GUI helper
|
||||
- `gp-hip-script-installer` – Privileged HIP script installer
|
||||
- `gp-vpnc-script-installer` – Privileged VPN script installer
|
||||
|
||||
The proprietary GP Connect desktop application is distributed separately. Use `INCLUDE_GUI=1` with `make build` to download its matching published Linux build for installation.
|
||||
|
||||
#### Alternative: Using VS Code
|
||||
|
||||
@@ -480,7 +453,7 @@ This project includes a DevContainer configuration for Linux development. The re
|
||||
- [Tauri dependencies](https://tauri.app/start/prerequisites/)
|
||||
- OpenConnect source-build dependencies: `autoconf`, `automake`, `autopoint`/`gettext`, `libtool`, `patch`, `pkg-config`, `libxml2`, `zlib`, `lz4`, `gnutls`, `p11-kit`, `nettle`, and `gmp` development packages
|
||||
- `pkexec` and `gnome-keyring` (or `pam_kwallet` on KDE)
|
||||
- Node.js and pnpm if rebuilding the GUI helper frontend
|
||||
- `nodejs` and `pnpm` (optional)
|
||||
|
||||
#### Build Steps
|
||||
|
||||
@@ -500,7 +473,7 @@ This project includes a DevContainer configuration for Linux development. The re
|
||||
sudo make install
|
||||
```
|
||||
|
||||
To stage the files for packaging instead of installing them into the system, use `make install DESTDIR=/absolute/path/to/staging`.
|
||||
> **Note:** `DESTDIR` is not currently supported.
|
||||
|
||||
### Testing Your Build
|
||||
|
||||
@@ -512,33 +485,29 @@ Verify the CLI client is working correctly:
|
||||
|
||||
### Build Options
|
||||
|
||||
- `BUILD_GUI_HELPER=0` – Skip building and installing the GUI helper
|
||||
- `BUILD_WEBVIEW_AUTH=0` – Build `gpauth` without embedded browser authentication; use an external or remote browser
|
||||
- `INCLUDE_GUI=1` – Download the matching published Linux desktop application for installation
|
||||
- `BUILD_GUI_HELPER=0` – Build CLI components only (excludes GUI)
|
||||
- `OFFLINE=1` – Build in offline mode using vendored dependencies
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### Q: How do I resolve the "Secure Storage not ready" error?
|
||||
|
||||
Unlock your desktop keyring and ensure the application can access it. On Linux and BSD, check that a keyring service such as GNOME Keyring is installed and running in your desktop session. On macOS, check Keychain access.
|
||||
**Solution 1:** Update to version 2.2.0 or later, which includes a file-based storage fallback.
|
||||
|
||||
Linux and BSD can use file storage when secure storage is unavailable during initial setup. An existing configuration that uses the keyring still needs access to that keyring.
|
||||
**Solution 2:** Install the `gnome-keyring` package and restart your system.
|
||||
|
||||
See related issues: [#321](https://github.com/yuezk/GlobalProtect-openconnect/issues/321), [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
|
||||
|
||||
### Q: How do I fix the "cannot open display" error when using CLI?
|
||||
|
||||
Run the client from a terminal in your normal desktop session and use an external browser:
|
||||
If you encounter `(gpauth:18869): Gtk-WARNING **: 10:33:37.566: cannot open display:`, try running the command with `sudo -E`:
|
||||
|
||||
```bash
|
||||
sudo gpclient connect <portal> --browser
|
||||
sudo -E gpclient connect <portal>
|
||||
```
|
||||
|
||||
See related issue: [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
|
||||
|
||||
On a headless server, use `--browser remote` and complete authentication from another machine.
|
||||
|
||||
## NetworkManager Integration
|
||||
|
||||
- [WMP/GlobalProtect-SAML-NetworkManager](https://github.com/WMP/GlobalProtect-SAML-NetworkManager) – NetworkManager VPN plugin with SAML/SSO support for GNOME and KDE Plasma
|
||||
@@ -549,7 +518,7 @@ On a headless server, use `--browser remote` and complete authentication from an
|
||||
### Trial and Pricing
|
||||
|
||||
The **CLI version** is completely free and open source.
|
||||
The **GUI version** is a paid application with a **7-day trial**. Start the trial in the app by verifying your email address with a one-time code. Installing the app alone does not start the trial.
|
||||
The **GUI version** is a paid application with a **7-day trial period** after installation.
|
||||
|
||||
### Open Source Licenses
|
||||
|
||||
|
||||
@@ -451,15 +451,6 @@ impl ConnectHandler<'_> {
|
||||
.local_hostname(self.args.local_hostname.clone())
|
||||
.dpd_interval(self.args.dpd_interval.unwrap_or(0))
|
||||
.no_xmlpost(self.args.no_xmlpost);
|
||||
#[cfg(target_os = "macos")]
|
||||
let vpn_builder = if self.args.script.is_none()
|
||||
&& std::env::var_os("GP_VPNC_SCRIPT").is_none_or(|value| value.is_empty())
|
||||
&& let Some(script) = common::binary_paths::bundled_vpnc_script()
|
||||
{
|
||||
vpn_builder.script_path(script.to_string_lossy().into_owned())
|
||||
} else {
|
||||
vpn_builder
|
||||
};
|
||||
let vpn = apply_os_profile(vpn_builder, &os_profile)
|
||||
.build()
|
||||
.map_err(|err| GatewayConnectError::before_establishment(err.into()))?;
|
||||
|
||||
@@ -1,39 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 3.0.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed the bundled macOS CLI when launched through Homebrew.
|
||||
- Fixed browser sign-in failures leaving the CLI waiting without an error.
|
||||
- Fixed first-time startup on Linux and BSD when no system keyring is available.
|
||||
- Improved tray menu behavior on Linux and BSD.
|
||||
- Added clearer results when manually checking for updates.
|
||||
- Improved desktop dialogs, settings, keyboard focus, and Linux window controls.
|
||||
|
||||
## 3.0.0
|
||||
|
||||
### Added
|
||||
|
||||
- GP Connect for Apple silicon Macs running macOS 13 or later.
|
||||
- Support for internal gateways that authenticate your device without creating a VPN tunnel.
|
||||
- More control over device compliance reports (HIP), including generated reports and custom scripts.
|
||||
- Desktop update notifications, with in-app updates on macOS and links to new releases on Linux and BSD.
|
||||
- JSON log output for CLI integrations and automation.
|
||||
|
||||
### Changed
|
||||
|
||||
- Refreshed the desktop connection view, gateway selection, and session details.
|
||||
- Improved browser sign-in, including opening your normal user's browser when the CLI runs with elevated privileges.
|
||||
- Improved session expiry warnings and session extension when allowed by your VPN administrator.
|
||||
- Updated license activation and recovery. Start the seven-day desktop trial by verifying your email address in the app.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Improved cancellation, disconnect, and cached sign-in handling.
|
||||
- Improved desktop window and tray behavior across macOS, Linux, FreeBSD, and OpenBSD.
|
||||
- Improved package installation and desktop integration on Linux and BSD.
|
||||
|
||||
## 2.6.5
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::{Context, bail};
|
||||
use gpapi::{auth::SamlAuthData, error::AuthDataParseError};
|
||||
use gpapi::auth::SamlAuthData;
|
||||
use tokio::{
|
||||
io::{AsyncReadExt, AsyncWriteExt},
|
||||
net::{UnixListener, UnixStream},
|
||||
@@ -27,7 +27,6 @@ const PROTOCOL_VERSION: u8 = 1;
|
||||
const MAX_CALLBACK_SIZE: usize = 1024 * 1024;
|
||||
const IO_TIMEOUT: Duration = Duration::from_secs(5);
|
||||
|
||||
// Acceptance acknowledges delivery, including an authentication failure.
|
||||
const STATUS_ACCEPTED: u8 = 0;
|
||||
const STATUS_INVALID_CALLBACK: u8 = 1;
|
||||
const STATUS_UNSUPPORTED_VERSION: u8 = 2;
|
||||
@@ -71,10 +70,6 @@ impl AuthCallbackReceiver {
|
||||
let _ = write_response(&mut stream, STATUS_ACCEPTED).await;
|
||||
return Ok(auth_data);
|
||||
}
|
||||
Err(error @ AuthDataParseError::AuthenticationFailed(_)) => {
|
||||
let _ = write_response(&mut stream, STATUS_ACCEPTED).await;
|
||||
return Err(error.into());
|
||||
}
|
||||
Err(_) => {
|
||||
let _ = write_response(&mut stream, STATUS_INVALID_CALLBACK).await;
|
||||
}
|
||||
@@ -424,24 +419,6 @@ mod tests {
|
||||
assert!(!socket_path.exists());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn reports_authentication_failure_to_waiting_receiver() {
|
||||
let directory = tempdir().unwrap();
|
||||
let socket_path = directory.path().join("callback.sock");
|
||||
let receiver = AuthCallbackReceiver::bind_at(socket_path.clone()).unwrap();
|
||||
let failure = gpapi::utils::base64::encode(b"<html><saml-auth-status>0</saml-auth-status></html>");
|
||||
let callback = format!("globalprotectcallback:{failure}");
|
||||
let sender = tokio::spawn(async move { forward_auth_callback_to(&callback, &socket_path).await });
|
||||
|
||||
let error = timeout(Duration::from_millis(500), receiver.receive())
|
||||
.await
|
||||
.expect("Failure callback must finish the waiting authentication")
|
||||
.unwrap_err();
|
||||
|
||||
assert!(error.to_string().contains("Authentication failed"));
|
||||
sender.await.unwrap().expect("Failure callback was delivered");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn rejects_bad_requests_and_keeps_waiting() {
|
||||
let directory = tempdir().unwrap();
|
||||
@@ -453,10 +430,6 @@ mod tests {
|
||||
send_raw_callback(&socket_path, PROTOCOL_VERSION, "https://example.com").await,
|
||||
STATUS_INVALID_CALLBACK
|
||||
);
|
||||
assert_eq!(
|
||||
send_raw_callback(&socket_path, PROTOCOL_VERSION, "globalprotectcallback:not-base64").await,
|
||||
STATUS_INVALID_CALLBACK
|
||||
);
|
||||
assert_eq!(
|
||||
send_raw_callback(&socket_path, PROTOCOL_VERSION + 1, VALID_CALLBACK).await,
|
||||
STATUS_UNSUPPORTED_VERSION
|
||||
|
||||
@@ -150,8 +150,8 @@ impl AuthMessenger {
|
||||
|
||||
match auth_result {
|
||||
Ok(data) => self.send_auth_data(data, AuthDataLocation::Body),
|
||||
Err(AuthDataParseError::Invalid(err)) => self.send_auth_error(AuthError::invalid_from_body(err)),
|
||||
Err(AuthDataParseError::NotFound) => self.send_auth_error(AuthError::not_found_in_body()),
|
||||
Err(err) => self.send_auth_error(AuthError::invalid_from_body(err.into())),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,3 @@ authors.workspace = true
|
||||
homepage.workspace = true
|
||||
edition.workspace = true
|
||||
license = "MIT"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile.workspace = true
|
||||
@@ -3,9 +3,6 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
mod macos;
|
||||
|
||||
#[cfg(all(
|
||||
not(debug_assertions),
|
||||
any(target_os = "linux", target_os = "freebsd", target_os = "openbsd")
|
||||
@@ -83,18 +80,13 @@ fn resolve(env_key: &str, binary_name: &str, default_path: &str) -> PathBuf {
|
||||
|
||||
fn sibling_binary(binary_name: &str) -> Option<PathBuf> {
|
||||
let current_exe = env::current_exe().ok()?;
|
||||
sibling_binary_for_executable(¤t_exe, binary_name)
|
||||
}
|
||||
|
||||
fn sibling_binary_for_executable(executable: &Path, binary_name: &str) -> Option<PathBuf> {
|
||||
let executable = executable.canonicalize().ok()?;
|
||||
let bin_dir = executable.parent()?;
|
||||
let bin_dir = current_exe.parent()?;
|
||||
let binary = bin_dir.join(binary_name);
|
||||
if is_file(&binary) {
|
||||
return Some(binary);
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
if let Some(binary) = macos::helper_path(&executable, binary_name)
|
||||
if let Some(binary) = bundled_helper_path(¤t_exe, binary_name)
|
||||
&& is_file(&binary)
|
||||
{
|
||||
return Some(binary);
|
||||
@@ -103,14 +95,14 @@ fn sibling_binary_for_executable(executable: &Path, binary_name: &str) -> Option
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn bundled_vpnc_script() -> Option<PathBuf> {
|
||||
bundled_vpnc_script_for_executable(&env::current_exe().ok()?)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn bundled_vpnc_script_for_executable(executable: &Path) -> Option<PathBuf> {
|
||||
let executable = executable.canonicalize().ok()?;
|
||||
macos::vpnc_script_path(&executable)
|
||||
fn bundled_helper_path(executable: &Path, binary_name: &str) -> Option<PathBuf> {
|
||||
let bin_dir = executable.parent()?;
|
||||
let contents = bin_dir.parent()?;
|
||||
let bundle = contents.parent()?;
|
||||
if bin_dir.file_name()? != "MacOS" || contents.file_name()? != "Contents" || bundle.extension()? != "app" {
|
||||
return None;
|
||||
}
|
||||
Some(contents.join("Helpers").join(binary_name))
|
||||
}
|
||||
|
||||
fn is_file(path: &Path) -> bool {
|
||||
@@ -125,44 +117,14 @@ mod tests {
|
||||
#[cfg(target_os = "macos")]
|
||||
fn desktop_resolves_helpers_in_the_actual_app_bundle_layout() {
|
||||
assert_eq!(
|
||||
macos::helper_path(
|
||||
bundled_helper_path(
|
||||
Path::new("/Applications/GP Connect.app/Contents/MacOS/gpgui"),
|
||||
"gpclient"
|
||||
),
|
||||
Some(PathBuf::from("/Applications/GP Connect.app/Contents/Helpers/gpclient"))
|
||||
);
|
||||
assert!(macos::helper_path(Path::new("/usr/local/bin/gpgui"), "gpclient").is_none());
|
||||
assert!(macos::helper_path(Path::new("/tmp/Contents/MacOS/gpgui"), "gpclient").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn symlinked_executable_resolves_its_bundle_paths() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let helpers = directory.path().join("GP Connect.app/Contents/Helpers");
|
||||
let bin = directory.path().join("bin");
|
||||
std::fs::create_dir_all(&helpers).unwrap();
|
||||
std::fs::create_dir_all(&bin).unwrap();
|
||||
std::fs::write(helpers.join("gpclient"), "").unwrap();
|
||||
std::fs::write(helpers.join("gpauth"), "").unwrap();
|
||||
std::os::unix::fs::symlink(helpers.join("gpclient"), bin.join("gpclient")).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
sibling_binary_for_executable(&bin.join("gpclient"), "gpauth"),
|
||||
Some(helpers.canonicalize().unwrap().join("gpauth"))
|
||||
);
|
||||
#[cfg(target_os = "macos")]
|
||||
assert_eq!(
|
||||
bundled_vpnc_script_for_executable(&bin.join("gpclient")),
|
||||
Some(
|
||||
helpers
|
||||
.canonicalize()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("Resources/Scripts/vpnc-script")
|
||||
)
|
||||
);
|
||||
assert!(bundled_helper_path(Path::new("/usr/local/bin/gpgui"), "gpclient").is_none());
|
||||
assert!(bundled_helper_path(Path::new("/tmp/Contents/MacOS/gpgui"), "gpclient").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn contents_dir(executable: &Path) -> Option<&Path> {
|
||||
let bin_dir = executable.parent()?;
|
||||
let contents = bin_dir.parent()?;
|
||||
let bundle = contents.parent()?;
|
||||
let directory_name = bin_dir.file_name()?;
|
||||
if (directory_name != "MacOS" && directory_name != "Helpers")
|
||||
|| contents.file_name()? != "Contents"
|
||||
|| bundle.extension()? != "app"
|
||||
{
|
||||
return None;
|
||||
}
|
||||
Some(contents)
|
||||
}
|
||||
|
||||
pub(super) fn helper_path(executable: &Path, binary_name: &str) -> Option<PathBuf> {
|
||||
Some(contents_dir(executable)?.join("Helpers").join(binary_name))
|
||||
}
|
||||
|
||||
pub(super) fn vpnc_script_path(executable: &Path) -> Option<PathBuf> {
|
||||
Some(contents_dir(executable)?.join("Resources/Scripts/vpnc-script"))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn bundle_entry_points_use_their_own_vpnc_script() {
|
||||
for executable in [
|
||||
"/Applications/GP Connect.app/Contents/Helpers/gpclient",
|
||||
"/Applications/GP Connect.app/Contents/MacOS/gpgui",
|
||||
] {
|
||||
assert_eq!(
|
||||
vpnc_script_path(Path::new(executable)),
|
||||
Some(PathBuf::from(
|
||||
"/Applications/GP Connect.app/Contents/Resources/Scripts/vpnc-script"
|
||||
))
|
||||
);
|
||||
}
|
||||
assert!(vpnc_script_path(Path::new("/opt/homebrew/bin/gpclient")).is_none());
|
||||
assert!(vpnc_script_path(Path::new("/tmp/Contents/Helpers/gpclient")).is_none());
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,10 @@ impl SamlAuthData {
|
||||
|
||||
Ok(auth_data)
|
||||
}
|
||||
Some(status) => Err(AuthDataParseError::AuthenticationFailed(status)),
|
||||
Some(status) => Err(AuthDataParseError::Invalid(anyhow::anyhow!(
|
||||
"SAML auth status: {}",
|
||||
status
|
||||
))),
|
||||
None => Err(AuthDataParseError::NotFound),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,17 +29,12 @@ impl PortalError {
|
||||
pub enum AuthDataParseError {
|
||||
#[error("No auth data found")]
|
||||
NotFound,
|
||||
#[error("Authentication failed (SAML status: {0})")]
|
||||
AuthenticationFailed(String),
|
||||
#[error(transparent)]
|
||||
Invalid(#[from] anyhow::Error),
|
||||
}
|
||||
|
||||
impl AuthDataParseError {
|
||||
pub fn is_invalid(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
AuthDataParseError::Invalid(_) | AuthDataParseError::AuthenticationFailed(_)
|
||||
)
|
||||
matches!(self, AuthDataParseError::Invalid(_))
|
||||
}
|
||||
}
|
||||
@@ -203,20 +203,12 @@ mod tests {
|
||||
let log_file = dir.path().join("desktop.log");
|
||||
fs::write(&log_file, "[gpservice] started\n").unwrap();
|
||||
let program = dir.path().join("gui");
|
||||
fs::write(&program, "#!/bin/sh\nprintf '[gpgui] initialized\\n' >&2\n").unwrap();
|
||||
fs::set_permissions(&program, fs::Permissions::from_mode(0o755)).unwrap();
|
||||
let launcher = launcher(VERSION, vec![]).envs(HashMap::from([(
|
||||
"GP_LOG_FILE".to_owned(),
|
||||
log_file.to_str().unwrap().to_owned(),
|
||||
)]));
|
||||
let frame_len = launcher.credential.encode_frame().unwrap().len();
|
||||
// Consume the credential frame like the real GUI before exiting.
|
||||
fs::write(
|
||||
&program,
|
||||
format!(
|
||||
"#!/bin/sh\ndd bs=1 count={frame_len} of=/dev/null 2>/dev/null || exit 1\nprintf '[gpgui] initialized\\n' >&2\n"
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
fs::set_permissions(&program, fs::Permissions::from_mode(0o755)).unwrap();
|
||||
|
||||
assert!(launcher.launch_program(&program).await.unwrap().success());
|
||||
assert!(launcher.launch_program(&program).await.unwrap().success());
|
||||
|
||||
Generated
+3
-3
@@ -63,11 +63,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1791487292,
|
||||
"narHash": "sha256-tqM7xDEsaeK1p6VvRygeZ9LkQRpUUkbRT02BHv6hnTM=",
|
||||
"lastModified": 1791366222,
|
||||
"narHash": "sha256-o0N4g6uSOIppU7CGToNvGlMf5vC+B6O6ukFHKY/TKOY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8edc0c72e3a38faf5434e40d1f19431125fe4b30",
|
||||
"rev": "39ad350a0602fa0a58a544344e3e9187526ea45c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
pname = "globalprotect-openconnect";
|
||||
version = cargoToml.workspace.package.version;
|
||||
releaseTag = "v3.0.1";
|
||||
releaseVersion = "3.0.1";
|
||||
releaseTag = "snapshot";
|
||||
releaseVersion = "2.6.5";
|
||||
|
||||
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
cpu = pkgs.stdenv.hostPlatform.parsed.cpu.name;
|
||||
|
||||
gpguiHashes = {
|
||||
x86_64 = "sha256-lc05BKc0lu0qoZWmOPakjxXmenv1XoiQCOMIh5KE8A8=";
|
||||
aarch64 = "sha256-bnmGQ82GJbS0z8yelMeOxzwSNV92iVk8hGEUUd4jkFA=";
|
||||
x86_64 = "sha256-TLL2Ay9PqiWWvWuK6tP9b+gYCNFwplmt6qQeBzIcsUQ=";
|
||||
aarch64 = "sha256-3VTpjm3tbjn5aZtbTxNicuXTUNjbM+f/yAzMj3F3O9o=";
|
||||
};
|
||||
|
||||
gpguiArchive = pkgs.fetchurl {
|
||||
@@ -70,8 +70,8 @@
|
||||
};
|
||||
|
||||
binaryHashes = {
|
||||
x86_64 = "sha256-/nKUzhlIdlgK2Xpv2nCQ/tuwUCTYuoSSft7sCc/M7U0=";
|
||||
aarch64 = "sha256-pDJvHT8p6fMFtSyJypr/3wL/OPHK/TSL7HMt63nP5oQ=";
|
||||
x86_64 = "sha256-OHwmUKM7oEilyZJP2Fw15For1xrG2q0QnuSUrnwymJ4=";
|
||||
aarch64 = "sha256-GDXwaOwtZjjy3VPNrNj4pixlPgkknYn875kIzpVpDyM=";
|
||||
};
|
||||
|
||||
binaryArchive = pkgs.fetchurl {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
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` - authentication helper used by `gpclient`
|
||||
- `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.
|
||||
|
||||
@@ -22,7 +22,7 @@ VPN tunnel creation requires access to `/dev/net/tun` and the `NET_ADMIN` capabi
|
||||
```bash
|
||||
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
yuezk/globalprotect-openconnect:<version> \
|
||||
connect <portal>
|
||||
connect <portal> --cookie-on-stdin
|
||||
```
|
||||
|
||||
For browser authentication in a headless environment, use remote browser authentication:
|
||||
@@ -43,6 +43,16 @@ docker run --rm -it --network host --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
|
||||
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:<version> \
|
||||
<portal> --browser remote 2>/dev/null \
|
||||
| docker run --rm -i --cap-add=NET_ADMIN --device=/dev/net/tun \
|
||||
yuezk/globalprotect-openconnect:<version> \
|
||||
connect <portal> --cookie-on-stdin
|
||||
```
|
||||
|
||||
## Common commands
|
||||
|
||||
Show top-level help:
|
||||
|
||||
@@ -131,7 +131,6 @@ upload_file() {
|
||||
}
|
||||
|
||||
# Update the existing snapshot release in place to avoid notification spam.
|
||||
# Keep its tag fixed; only release assets advance with subsequent builds.
|
||||
# Preserve its macOS update assets when the current run does not replace them.
|
||||
release_snapshot() {
|
||||
mapfile -t files < <(release_assets)
|
||||
@@ -139,11 +138,13 @@ release_snapshot() {
|
||||
local is_current
|
||||
local asset
|
||||
local file
|
||||
local snapshot_commit
|
||||
|
||||
snapshot_commit="$(git -C "$SCRIPT_DIR/.." rev-parse HEAD)"
|
||||
if ! gh -R "$REPO" release view "$TAG" >/dev/null 2>&1; then
|
||||
gh -R "$REPO" release create "$TAG" \
|
||||
--prerelease=false \
|
||||
--latest=false \
|
||||
--target "$(git -C "$SCRIPT_DIR/.." rev-parse HEAD)" \
|
||||
--prerelease \
|
||||
--target "$snapshot_commit" \
|
||||
--title "Snapshot" \
|
||||
--notes "Rolling snapshot release from trusted CI builds."
|
||||
fi
|
||||
@@ -183,7 +184,9 @@ release_snapshot() {
|
||||
fi
|
||||
done <<<"$existing_assets"
|
||||
|
||||
gh -R "$REPO" release edit "$TAG" --prerelease=false --latest=false --title "Snapshot"
|
||||
gh api --method PATCH "repos/$REPO/git/refs/tags/$TAG" \
|
||||
-f sha="$snapshot_commit" -F force=true >/dev/null
|
||||
gh -R "$REPO" release edit "$TAG" --prerelease --title "Snapshot"
|
||||
}
|
||||
|
||||
release_tag() {
|
||||
@@ -196,14 +199,12 @@ release_tag() {
|
||||
# Upload source tarballs, GUI components, and BSD packages. Other Linux
|
||||
# packages are built in `release.yml` from the standalone source tarball.
|
||||
gh -R "$REPO" release create "$TAG" \
|
||||
--prerelease=false \
|
||||
--title "$TAG" \
|
||||
--notes-file "$release_notes_file"
|
||||
fi
|
||||
|
||||
mapfile -t files < <(release_assets)
|
||||
GITHUB_REPOSITORY="$REPO" "$SCRIPT_DIR/upload-release-assets.sh" "$TAG" "${files[@]}"
|
||||
gh -R "$REPO" release edit "$TAG" --prerelease=false
|
||||
}
|
||||
|
||||
if [[ $TAG == *"snapshot" ]]; then
|
||||
|
||||
Reference in new issue
Block a user