mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
refactor: align GP profile and packaging flow
Main changes: - Refactor connect/auth flows around a single OS profile and host identity model, including gateway fallback and cookie-on-stdin handling. - Align request parameters, HIP host-id propagation, SAML webview user-agent behavior, and portal default-browser handling with observed official client behavior. - Add opt-in cookie cache support and Microsoft Defender HIP reporting while keeping host-id validation explicit. - Add BSD build, packaging, release artifact, and provenance support with FreeBSD/OpenBSD path and dependency cleanup. - Update NixOS install documentation and dependency compatibility fixes.
This commit is contained in:
92 files changed
+9847
-2868
No files matched your search
@@ -58,6 +58,7 @@ build() {
|
||||
make build \
|
||||
INCLUDE_GUI="${INCLUDE_GUI:-0}" \
|
||||
BUILD_GUI_HELPER="${BUILD_GUI_HELPER:-1}" \
|
||||
BUILD_WEBVIEW_AUTH="${BUILD_WEBVIEW_AUTH:-1}" \
|
||||
LIBXML2_STATIC="${LIBXML2_STATIC:-1}"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
<vendor>The GlobalProtect-openconnect Project</vendor>
|
||||
<vendor_url>https://github.com/yuezk/GlobalProtect-openconnect</vendor_url>
|
||||
<icon_name>gpgui</icon_name>
|
||||
<action id="com.yuezk.gpgui.service">
|
||||
<description>Run GPService as root</description>
|
||||
<message>Authentication is required to run the GPService as root</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/gpservice</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
||||
@@ -0,0 +1,53 @@
|
||||
name: "@PKG_NAME@"
|
||||
version: "@VERSION@"
|
||||
origin: "security/@PKG_NAME@"
|
||||
comment: "GlobalProtect VPN client based on OpenConnect"
|
||||
maintainer: "Kevin Yue <[email protected]>"
|
||||
www: "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
abi: "@ABI@"
|
||||
arch: "@ARCH@"
|
||||
prefix: "@PREFIX@"
|
||||
licenselogic: single
|
||||
licenses: ["GPLv3"]
|
||||
categories: ["security", "net"]
|
||||
deps: {
|
||||
"gmp": {
|
||||
origin: "math/gmp"
|
||||
version: "*"
|
||||
}
|
||||
"gnome-keyring": {
|
||||
origin: "security/gnome-keyring"
|
||||
version: "*"
|
||||
}
|
||||
"gnutls": {
|
||||
origin: "security/gnutls"
|
||||
version: "*"
|
||||
}
|
||||
"libayatana-appindicator": {
|
||||
origin: "devel/libayatana-appindicator"
|
||||
version: "*"
|
||||
}
|
||||
"libxml2": {
|
||||
origin: "textproc/libxml2"
|
||||
version: "*"
|
||||
}
|
||||
"nettle": {
|
||||
origin: "security/nettle"
|
||||
version: "*"
|
||||
}
|
||||
"p11-kit": {
|
||||
origin: "security/p11-kit"
|
||||
version: "*"
|
||||
}
|
||||
"polkit": {
|
||||
origin: "sysutils/polkit"
|
||||
version: "*"
|
||||
}
|
||||
"webkit2-gtk_41": {
|
||||
origin: "www/webkit2-gtk"
|
||||
version: "*"
|
||||
}
|
||||
}
|
||||
desc: <<EOD
|
||||
A GlobalProtect VPN client based on OpenConnect.
|
||||
EOD
|
||||
@@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=GP Connect
|
||||
Comment=A GUI client for GlobalProtect VPN
|
||||
GenericName=GlobalProtect VPN Client
|
||||
Categories=Network;Dialup;
|
||||
Exec=/usr/local/bin/gpclient launch-gui %u
|
||||
MimeType=x-scheme-handler/globalprotectcallback;
|
||||
Icon=gpgui
|
||||
Keywords=GlobalProtect;Openconnect;SAML;connection;VPN;
|
||||
@@ -0,0 +1 @@
|
||||
GlobalProtect VPN client based on OpenConnect
|
||||
@@ -0,0 +1 @@
|
||||
A GlobalProtect VPN client based on OpenConnect.
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export BUILD_GUI_HELPER = @BUILD_GUI_HELPER@
|
||||
export BUILD_WEBVIEW_AUTH = @BUILD_WEBVIEW_AUTH@
|
||||
export DISABLE_RUST_TOOLCHAIN = 0
|
||||
|
||||
export PATH := /usr/lib/rust-@RUST_VERSION@/bin:/usr/local/cargo/bin:$(PATH)
|
||||
|
||||
@@ -32,6 +32,7 @@ COPY . .
|
||||
RUN RUSTFLAGS="-C target-feature=-crt-static" \
|
||||
make build \
|
||||
BUILD_GUI_HELPER=0 \
|
||||
BUILD_WEBVIEW_AUTH=0 \
|
||||
INCLUDE_GUI=0 \
|
||||
LIBXML2_STATIC=1
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ LOGFILE="/tmp/gpclient-hipreport.log"
|
||||
|
||||
LINUX_GPCLIENT_BIN="/usr/bin/gpclient"
|
||||
ARM64_HOMEBREW_GPCLIENT_BIN="/opt/homebrew/bin/gpclient"
|
||||
X86_64_HOMEBREW_GPCLIENT_BIN="/usr/local/bin/gpclient"
|
||||
LOCAL_GPCLIENT_BIN="/usr/local/bin/gpclient"
|
||||
GPCLIENT_BIN=""
|
||||
|
||||
if [ -x "$LINUX_GPCLIENT_BIN" ]; then
|
||||
GPCLIENT_BIN="$LINUX_GPCLIENT_BIN"
|
||||
elif [ -x "$ARM64_HOMEBREW_GPCLIENT_BIN" ]; then
|
||||
GPCLIENT_BIN="$ARM64_HOMEBREW_GPCLIENT_BIN"
|
||||
elif [ -x "$X86_64_HOMEBREW_GPCLIENT_BIN" ]; then
|
||||
GPCLIENT_BIN="$X86_64_HOMEBREW_GPCLIENT_BIN"
|
||||
elif [ -x "$LOCAL_GPCLIENT_BIN" ]; then
|
||||
GPCLIENT_BIN="$LOCAL_GPCLIENT_BIN"
|
||||
else
|
||||
echo "Error: gpclient binary not found." > "$LOGFILE"
|
||||
exit 1
|
||||
|
||||
@@ -336,7 +336,11 @@ if [ -n "$IPROUTE" ]; then
|
||||
del_vpngateway_route() {
|
||||
echo "$VPNGATEWAY" | grep -q : && FAMILY=-6 || FAMILY=-4
|
||||
|
||||
$IPROUTE route $route_syntax_del "$VPNGATEWAY"
|
||||
# iproute2 deletes only one matching route at a time. The connect path may
|
||||
# add one host route per matching uplink, so remove them until none remain.
|
||||
while $IPROUTE $FAMILY route $route_syntax_del "$VPNGATEWAY" 2>/dev/null ; do
|
||||
:
|
||||
done
|
||||
if [ $FAMILY != -4 ]; then
|
||||
$IPROUTE $FAMILY route flush cache 2>/dev/null
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user