Compare commits

..
9 changed files with 27 additions and 280 deletions

No files matched your search

Generated
+8 -8
View File
@@ -214,7 +214,7 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "auth"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"block2",
@@ -705,7 +705,7 @@ dependencies = [
[[package]]
name = "common"
version = "2.6.4"
version = "2.6.2"
[[package]]
name = "compile-time"
@@ -1732,7 +1732,7 @@ dependencies = [
[[package]]
name = "gpapi"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"base64 0.22.1",
@@ -1776,7 +1776,7 @@ dependencies = [
[[package]]
name = "gpauth"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"auth",
@@ -1796,7 +1796,7 @@ dependencies = [
[[package]]
name = "gpclient"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"askama",
@@ -1825,7 +1825,7 @@ dependencies = [
[[package]]
name = "gpgui-helper"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"clap",
@@ -1843,7 +1843,7 @@ dependencies = [
[[package]]
name = "gpservice"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"anyhow",
"axum",
@@ -3191,7 +3191,7 @@ dependencies = [
[[package]]
name = "openconnect"
version = "2.6.4"
version = "2.6.2"
dependencies = [
"autotools",
"cc",
+1 -1
View File
@@ -11,7 +11,7 @@ members = [
[workspace.package]
rust-version = "1.89"
version = "2.6.4"
version = "2.6.2"
authors = ["Kevin Yue <[email protected]>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
edition = "2024"
+1 -21
View File
@@ -72,7 +72,7 @@ For browser-based authentication with the CLI:
**Method 1:** Using sudo with environment preservation:
```bash
sudo gpclient connect --browser <portal>
sudo -E gpclient connect --browser <portal>
```
**Method 2:** Using authentication piping:
@@ -200,26 +200,6 @@ 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:
-14
View File
@@ -1,19 +1,5 @@
# Changelog
## 2.6.4
### Fixed
- Fixed gateway login MFA OTP retries sending duplicate `passwd` form fields, which could cause authentication to fail with HTTP 512 after 2.6.0 (fix [#626](https://github.com/yuezk/GlobalProtect-openconnect/issues/626)).
## 2.6.3
### Fixed
- Fixed NixOS GUI launch authorization after package updates.
- Fixed disconnect handling so a normal Ctrl+C logout no longer reports an error.
- Fixed snapshot flake hash update automation for prebuilt Nix packages.
## 2.6.2
### Fixed
+1 -44
View File
@@ -39,7 +39,7 @@ pub(crate) fn build(input: &GatewayLoginInput) -> RequestParams {
input.gp_params.input_str().unwrap_or_default().into(),
));
if let Some(otp) = input.gp_params.otp() {
set_body_param(&mut body, "passwd", otp);
body.push(("passwd".into(), otp.into()));
}
if let Some(os_version) = input.gp_params.os_version() {
body.push(("os-version".into(), os_version.into()));
@@ -99,15 +99,6 @@ pub(crate) fn build(input: &GatewayLoginInput) -> RequestParams {
RequestParams { body, query: vec![] }
}
fn set_body_param(body: &mut Vec<(String, String)>, key: &str, value: impl Into<String>) {
let value = value.into();
if let Some(pos) = body.iter().position(|(k, _)| k == key) {
body[pos].1 = value;
} else {
body.push((key.to_string(), value));
}
}
/// Resolve the gateway server to an IPv4 address if the profile requires it.
///
/// Falls back to the original gateway host if resolution fails.
@@ -162,40 +153,6 @@ mod tests {
Credential::Password(PasswordCredential::new("alice", "secret"))
}
fn passwd_values(body: &[(String, String)]) -> Vec<&str> {
body
.iter()
.filter(|(k, _)| k == "passwd")
.map(|(_, v)| v.as_str())
.collect()
}
#[test]
fn otp_retry_replaces_passwd_instead_of_appending_duplicate() {
let mut gp_params = make_gp_params();
gp_params.set_input_str("challenge-token");
gp_params.set_otp("123456");
let cred = make_credential();
let input = GatewayLoginInput {
gp_params: &gp_params,
cred: &cred,
gateway_host: "vpn.example.com",
context: None,
client_ip: None,
extend_lifetime: false,
};
let result = build(&input);
assert_eq!(passwd_values(&result.body), vec!["123456"]);
let encoded = serde_urlencoded::to_string(&result.body).expect("form body should encode");
assert_eq!(encoded.matches("passwd=").count(), 1);
assert!(encoded.contains("passwd=123456"));
assert!(!encoded.contains("passwd=secret"));
}
#[test]
fn build_without_context_includes_identity_fields() {
let profile = test_profile(ClientOs::Linux);
-91
View File
@@ -1,91 +0,0 @@
# 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
```
+8 -11
View File
@@ -26,7 +26,7 @@
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
pname = "globalprotect-openconnect";
version = cargoToml.workspace.package.version;
releaseTag = "v2.6.4";
releaseTag = "snapshot";
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
@@ -37,14 +37,14 @@
src = pkgs.fetchzip {
url = "https://github.com/yuezk/GlobalProtect-openconnect/releases/download/${releaseTag}/globalprotect-openconnect-${version}.tar.gz";
hash = "sha256-cp7KRUwVJsyg8m7O70k/uo6WwLqCPbFCnWtXzHn1GgU=";
hash = "sha256-FVovTNkVzAQHdkpKAmLpdauALnxJqzKIY6uTJYSpA8k=";
};
cpu = pkgs.stdenv.hostPlatform.parsed.cpu.name;
gpguiHashes = {
x86_64 = "sha256-7va5dBhmamOqJYbsHUtjWYFnoM8q5ZshB2CyK0NW6fE=";
aarch64 = "sha256-uBzBKx39te5R4PloDusjSjUf1Y2iF/xO4dXUX2K4P8o=";
x86_64 = "sha256-72EmKF1EZx45ohU0TAGSQcuacjFqoHancHSQoMCXWEg=";
aarch64 = "sha256-Kl7WUkeMVz1qJg8m0o/22rs1TVZP8EV1d6MvyouW7Xw=";
};
gpgui = pkgs.fetchzip {
@@ -53,8 +53,8 @@
};
binaryHashes = {
x86_64 = "sha256-AqF+mwxmXxF/dFxmMXbtT2PONVArKKfMpwmX+3cYr5o=";
aarch64 = "sha256-Ul77xppKrrQQDRl/zKjrrj2+8CRjrMagJbLqmDlfz9U=";
x86_64 = "sha256-NwZmlVW/+GSyed3R7xnejxb+8NzfVgBYvPhqiRaag0E=";
aarch64 = "sha256-WmsN2/8sdW39eqOsKHBs5wwFfAjQgTY3tOe6If5+SNg=";
};
binaryPackage = pkgs.fetchzip {
@@ -91,7 +91,7 @@
rewriteSourceInstallPaths = ''
substituteInPlace $out/share/applications/gpgui.desktop \
--replace-fail /usr/bin/gpclient /run/current-system/sw/bin/gpclient
--replace-fail /usr/bin/gpclient $out/bin/gpclient
substituteInPlace $out/libexec/gpclient/hipreport.sh \
--replace-fail /usr/bin/gpclient $out/bin/gpclient
@@ -107,7 +107,7 @@
rewriteHostInstallPaths = ''
substituteInPlace $out/share/applications/gpgui.desktop \
--replace-fail /usr/bin/gpclient /run/current-system/sw/bin/gpclient
--replace-fail /usr/bin/gpclient $out/bin/gpclient
substituteInPlace $out/share/polkit-1/actions/com.yuezk.gpgui.policy \
--replace-fail /usr/bin/gpservice $out/bin/gpservice
@@ -238,9 +238,6 @@
"--bind-try"
"/run/wrappers"
"/run/wrappers"
"--ro-bind-try"
"/etc/gpgui"
"/etc/gpgui"
];
};
-74
View File
@@ -1,74 +0,0 @@
# 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:<version>
```
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:<version> \
connect <portal> --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:<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 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:
```bash
docker run --rm yuezk/globalprotect-openconnect:<version> --help
```
Show help for a command:
```bash
docker run --rm yuezk/globalprotect-openconnect:<version> 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
+8 -16
View File
@@ -29,27 +29,19 @@ if [[ "$release_tag" != "v$version" ]]; then
body="Updates the Nix flake fetchzip hashes for v${version} using ${release_tag} release assets."
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [[ "$release_tag" == "snapshot" ]]; then
source_branch="${GITHUB_REF_NAME:-$(git branch --show-current)}"
source_branch_slug="$(printf '%s' "$source_branch" | sed -E 's#[/[:space:]]+#-#g; s#[^A-Za-z0-9._-]##g; s#^-+##; s#-+$##')"
branch="chore/flake-${source_branch_slug}"
git switch -C "$branch"
git add flake.nix
git commit -m "$title"
git push --force origin "$branch"
echo "Updated snapshot flake hashes on branch $branch from $source_branch; skipping PR creation"
exit 0
fi
branch="chore/update-flake-hashes-${branch_suffix}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -C "$branch"
git add flake.nix
git commit -m "$title"
git push --force origin "$branch"
git push --force-with-lease origin "$branch"
if [[ "$release_tag" == "snapshot" ]]; then
echo "Updated snapshot flake hashes on branch $branch; skipping PR creation"
exit 0
fi
if gh pr view "$branch" --json number > /tmp/flake-pr.json 2> /dev/null; then
pr_number="$(jq -r '.number' /tmp/flake-pr.json)"