mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-29 22:26:26 -04:00
Compare commits
2 Commits
6be9304523
...
e50cacf333
Author | SHA1 | Date | |
---|---|---|---|
|
e50cacf333 | ||
|
4be877bf8c |
128
.github/workflows/build.yaml
vendored
128
.github/workflows/build.yaml
vendored
@ -55,7 +55,7 @@ jobs:
|
||||
path: |
|
||||
source/gp/.build/tarball/*.tar.gz
|
||||
|
||||
build-gp:
|
||||
build-deb:
|
||||
needs:
|
||||
- setup-matrix
|
||||
- tarball
|
||||
@ -65,17 +65,130 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Prepare workspace
|
||||
run: rm -rf build-gp && mkdir build-gp
|
||||
run: rm -rf build-deb && mkdir build-deb
|
||||
- name: Download tarball
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact-source
|
||||
path: build-gp
|
||||
path: build-deb
|
||||
- name: Docker Login
|
||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
- name: Build gp in Docker
|
||||
- name: Build DEB package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-gp:/gp yuezk/gpdev:gp-builder
|
||||
docker run --rm -v $(pwd)/build-deb:/deb yuezk/gpdev:deb-builder
|
||||
- name: Install DEB package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-deb:/deb yuezk/gpdev:deb-builder \
|
||||
bash -c "sudo dpkg -i /deb/*.deb; gpclient --version; gpservice --version; gpauth --version; gpgui-helper --version;"
|
||||
- name: Upload DEB package
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact-deb-${{ matrix.os }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
build-deb/*.deb
|
||||
|
||||
build-rpm:
|
||||
needs:
|
||||
- setup-matrix
|
||||
- tarball
|
||||
strategy:
|
||||
matrix:
|
||||
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Prepare workspace
|
||||
run: rm -rf build-rpm && mkdir build-rpm
|
||||
- name: Download tarball
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact-source
|
||||
path: build-rpm
|
||||
- name: Docker Login
|
||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
- name: Build RPM package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-rpm:/rpm yuezk/gpdev:rpm-builder
|
||||
- name: Install RPM package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-rpm:/rpm yuezk/gpdev:rpm-builder \
|
||||
bash -c "sudo rpm -i /rpm/*.$(uname -m).rpm; gpclient --version; gpservice --version; gpauth --version; gpgui-helper --version;"
|
||||
- name: Upload RPM package
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact-rpm-${{ matrix.os }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
build-rpm/*.rpm
|
||||
|
||||
build-pkgbuild:
|
||||
needs:
|
||||
- setup-matrix
|
||||
- tarball
|
||||
strategy:
|
||||
matrix:
|
||||
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Prepare workspace
|
||||
run: rm -rf build-pkgbuild && mkdir build-pkgbuild
|
||||
- name: Download tarball
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact-source
|
||||
path: build-pkgbuild
|
||||
- name: Docker Login
|
||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
- name: Build PKGBUILD package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-pkgbuild:/pkgbuild yuezk/gpdev:pkgbuild
|
||||
- name: Install PKGBUILD package in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-pkgbuild:/pkgbuild yuezk/gpdev:pkgbuild \
|
||||
bash -c "sudo pacman -U --noconfirm /pkgbuild/*.pkg.tar.zst; gpclient --version; gpservice --version; gpauth --version; gpgui-helper --version;"
|
||||
- name: Upload PKGBUILD package
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact-pkgbuild-${{ matrix.os }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
build-pkgbuild/*.pkg.tar.zst
|
||||
|
||||
build-binary:
|
||||
needs:
|
||||
- setup-matrix
|
||||
- tarball
|
||||
strategy:
|
||||
matrix:
|
||||
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Prepare workspace
|
||||
run: rm -rf build-binary && mkdir build-binary
|
||||
- name: Download tarball
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact-source
|
||||
path: build-binary
|
||||
- name: Docker Login
|
||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
- name: Build binary in Docker
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/build-binary:/binary yuezk/gpdev:binary-builder
|
||||
- name: Install binary in Docker
|
||||
run: |
|
||||
cd build-binary
|
||||
tar -xJf ./*.bin.tar.xz
|
||||
docker run --rm -v $(pwd):/binary yuezk/gpdev:binary-builder \
|
||||
bash -c "cd /binary/globalprotect-openconnect*/ && sudo make install && gpclient --version && gpservice --version && gpauth --version && gpgui-helper --version;"
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact-binary-${{ matrix.os }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
build-binary/*.bin.tar.xz
|
||||
build-binary/*.bin.tar.xz.sha256
|
||||
|
||||
build-gpgui:
|
||||
needs:
|
||||
@ -130,7 +243,10 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-gp
|
||||
- build-deb
|
||||
- build-rpm
|
||||
- build-pkgbuild
|
||||
- build-binary
|
||||
- build-gpgui
|
||||
|
||||
steps:
|
||||
|
51
.github/workflows/release-rpm.yaml
vendored
51
.github/workflows/release-rpm.yaml
vendored
@ -1,51 +0,0 @@
|
||||
name: Release RPM
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Tag to release'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check tag exists
|
||||
uses: mukunku/tag-exists-action@v1.6.0
|
||||
id: check-tag
|
||||
with:
|
||||
tag: ${{ github.event.inputs.tag }}
|
||||
- name: Exit if tag does not exist
|
||||
run: |
|
||||
if [[ "${{ steps.check-tag.outputs.exists }}" == "false" ]]; then
|
||||
echo "Tag ${{ github.event.inputs.tag }} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Include arm64 if ref is a tag
|
||||
setup-matrix:
|
||||
needs:
|
||||
- check
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Set up matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||
echo "matrix=[\"ubuntu-latest\", \"arm64\"]" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "matrix=[\"ubuntu-latest\"]" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build:
|
||||
needs:
|
||||
- setup-matrix
|
||||
strategy:
|
||||
matrix:
|
||||
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Dowload ${{ github.event.inputs.tag }} source code
|
||||
uses: robinraju/release-downloader@v1.9
|
12
Cargo.lock
generated
12
Cargo.lock
generated
@ -1423,7 +1423,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpapi"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.5",
|
||||
@ -1455,7 +1455,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpauth"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1475,7 +1475,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpclient"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1496,7 +1496,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpgui-helper"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1514,7 +1514,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpservice"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@ -2519,7 +2519,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openconnect"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"is_executable",
|
||||
|
@ -5,7 +5,7 @@ members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/g
|
||||
|
||||
[workspace.package]
|
||||
rust-version = "1.70"
|
||||
version = "2.1.0"
|
||||
version = "2.0.0"
|
||||
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
edition = "2021"
|
||||
|
23
Makefile
23
Makefile
@ -1,6 +1,5 @@
|
||||
OFFLINE ?= 0
|
||||
BUILD_FE ?= 1
|
||||
INCLUDE_GUI ?= 0
|
||||
CARGO ?= cargo
|
||||
|
||||
VERSION = $(shell $(CARGO) metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
||||
@ -51,19 +50,7 @@ tarball: clean-tarball
|
||||
|
||||
tar --exclude .vendor --exclude target --transform 's,^,${PKG}/,' -czf .build/tarball/${PKG}.tar.gz * .cargo
|
||||
|
||||
download-gui:
|
||||
rm -rf .build/gpgui
|
||||
|
||||
if [ $(INCLUDE_GUI) -eq 1 ]; then \
|
||||
echo "Downloading GlobalProtect GUI..."; \
|
||||
mkdir -p .build/gpgui; \
|
||||
curl -sSL https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v$(VERSION)/gpgui_$(VERSION)_$(shell uname -m).bin.tar.xz -o .build/gpgui/gpgui_$(VERSION)_x$(shell uname -m).bin.tar.xz; \
|
||||
tar -xJf .build/gpgui/*.tar.xz -C .build/gpgui; \
|
||||
else \
|
||||
echo "Skipping GlobalProtect GUI download (INCLUDE_GUI=0)"; \
|
||||
fi
|
||||
|
||||
build: download-gui build-fe build-rs
|
||||
build: build-fe build-rs
|
||||
|
||||
# Install and build the frontend
|
||||
# If OFFLINE is set to 1, skip it
|
||||
@ -101,10 +88,6 @@ install:
|
||||
install -Dm755 target/release/gpservice $(DESTDIR)/usr/bin/gpservice
|
||||
install -Dm755 target/release/gpgui-helper $(DESTDIR)/usr/bin/gpgui-helper
|
||||
|
||||
if [ -f .build/gpgui/gpgui_*/gpgui ]; then \
|
||||
install -Dm755 .build/gpgui/gpgui_*/gpgui $(DESTDIR)/usr/bin/gpgui; \
|
||||
fi
|
||||
|
||||
install -Dm644 packaging/files/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop
|
||||
install -Dm644 packaging/files/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
|
||||
install -Dm644 packaging/files/usr/share/icons/hicolor/32x32/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/gpgui.png
|
||||
@ -112,8 +95,6 @@ install:
|
||||
install -Dm644 packaging/files/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||
install -Dm644 packaging/files/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||
|
||||
update-desktop-database $(DESTDIR)/usr/share/applications
|
||||
|
||||
uninstall:
|
||||
@echo "Uninstalling $(PKG_NAME)..."
|
||||
|
||||
@ -130,8 +111,6 @@ uninstall:
|
||||
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||
rm -f $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||
|
||||
update-desktop-database $(DESTDIR)/usr/share/applications
|
||||
|
||||
clean-debian:
|
||||
rm -rf .build/deb
|
||||
|
||||
|
46
README.md
46
README.md
@ -53,6 +53,15 @@ The GUI version is also available after you installed it. You can launch it from
|
||||
|
||||
## Installation
|
||||
|
||||
> [!Note]
|
||||
>
|
||||
> This instruction is for the 2.x version. The 1.x version is still available on the [1.x](https://github.com/yuezk/GlobalProtect-openconnect/tree/1.x) branch, you can build it from the source code by following the instructions in the `README.md` file.
|
||||
|
||||
> [!Warning]
|
||||
>
|
||||
> The client requires `openconnect >= 8.20, pkexec, and gnome-keyring`, please make sure you have them installed.
|
||||
> Installing the client from PPA will automatically install the required version of `openconnect`.
|
||||
|
||||
### Debian/Ubuntu based distributions
|
||||
|
||||
#### Install from PPA
|
||||
@ -94,7 +103,7 @@ Download the latest package from [releases](https://github.com/yuezk/GlobalProte
|
||||
sudo pacman -U globalprotect-openconnect-*.pkg.tar.zst
|
||||
```
|
||||
|
||||
### Fedora 38 and later / Fedora Rawhide
|
||||
### Fedora/OpenSUSE/CentOS/RHEL
|
||||
|
||||
#### Install from COPR
|
||||
|
||||
@ -105,47 +114,20 @@ sudo dnf copr enable yuezk/globalprotect-openconnect
|
||||
sudo dnf install globalprotect-openconnect
|
||||
```
|
||||
|
||||
### openSUSE Leap 15.6 / openSUSE Tumbleweed
|
||||
|
||||
#### Install from OBS (openSUSE Build Service)
|
||||
#### Install from OBS (OpenSUSE Build Service)
|
||||
|
||||
The package is also available on [OBS](https://build.opensuse.org/package/show/home:yuezk/globalprotect-openconnect) for various RPM-based distributions. You can follow the instructions [on this page](https://software.opensuse.org//download.html?project=home%3Ayuezk&package=globalprotect-openconnect) to install it.
|
||||
|
||||
### Other RPM-based distributions
|
||||
|
||||
#### Install from RPM package
|
||||
|
||||
Download the latest RPM package from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page.
|
||||
|
||||
```bash
|
||||
sudo rpm -i globalprotect-openconnect-*.rpm
|
||||
```
|
||||
|
||||
### Other distributions
|
||||
|
||||
- Install `openconnect >= 8.20`, `webkit2gtk`, `libsecret`, `libayatana-appindicator` or `libappindicator-gtk3`.
|
||||
- Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page.
|
||||
- Extract the tarball with `tar -xJf globalprotect-openconnect_${version}_${arch}.bin.tar.xz`.
|
||||
- Run `sudo make install` to install the client.
|
||||
|
||||
## Build from source
|
||||
|
||||
You can also build the client from source, steps are as follows:
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Install Rust](https://www.rust-lang.org/tools/install)
|
||||
- Install Tauri dependencies: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux
|
||||
- Install `perl`
|
||||
- Install `openconnect >= 8.20` and `libopenconnect-dev` (or `openconnect-devel` on RPM-based distributions)
|
||||
- Install `pkexec`, `gnome-keyring` (or `pam_kwallet` on KDE)
|
||||
|
||||
### Build
|
||||
|
||||
1. Download the source code tarball from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page. Choose `globalprotect-openconnect-${version}.tar.gz`.
|
||||
2. Extract the tarball with `tar -xzf globalprotect-openconnect-${version}.tar.gz`.
|
||||
3. Enter the source directory and run `make build BUILD_FE=0` to build the client.
|
||||
3. Run `sudo make install` to install the client. (Note, `DESTDIR` is not supported)
|
||||
- Download `globalprotect-openconnect.tar.gz` from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page.
|
||||
- Extract the tarball and run `make build` to build the client.
|
||||
- Run `make install` to install the client.
|
||||
|
||||
## FAQ
|
||||
|
||||
|
@ -1,11 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 2.1.0 - 2024-02-27
|
||||
|
||||
- Update distribution channel for `gpgui` to complaint with the GPL-3 license.
|
||||
- Add `mtu` option.
|
||||
- Retry auth if failed to obtain the auth cookie
|
||||
|
||||
## 2.0.0 - 2024-02-05
|
||||
|
||||
- Refactor using Tauri
|
||||
|
@ -5,7 +5,6 @@ install:
|
||||
install -Dm755 artifacts/usr/bin/gpservice $(DESTDIR)/usr/bin/gpservice
|
||||
install -Dm755 artifacts/usr/bin/gpauth $(DESTDIR)/usr/bin/gpauth
|
||||
install -Dm755 artifacts/usr/bin/gpgui-helper $(DESTDIR)/usr/bin/gpgui-helper
|
||||
install -Dm755 artifacts/usr/bin/gpgui $(DESTDIR)/usr/bin/gpgui
|
||||
|
||||
install -Dm644 artifacts/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop
|
||||
install -Dm644 artifacts/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
|
||||
|
@ -3,4 +3,4 @@
|
||||
export OFFLINE = @OFFLINE@ BUILD_FE=0
|
||||
|
||||
%:
|
||||
dh $@ --no-parallel
|
||||
dh $@
|
||||
|
@ -15,9 +15,9 @@ BuildRequires: jq
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: openconnect-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: curl
|
||||
BuildRequires: wget
|
||||
BuildRequires: file
|
||||
BuildRequires: perl
|
||||
|
||||
BuildRequires: (webkit2gtk4.0-devel or webkit2gtk3-soup2-devel)
|
||||
BuildRequires: (libappindicator-gtk3-devel or libappindicator3-1)
|
||||
@ -44,7 +44,10 @@ make build OFFLINE=@OFFLINE@ BUILD_FE=0
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_bindir}/gpclient
|
||||
%{_bindir}/gpservice
|
||||
%{_bindir}/gpauth
|
||||
%{_bindir}/gpgui-helper
|
||||
%{_datadir}/applications/gpgui.desktop
|
||||
%{_datadir}/icons/hicolor/32x32/apps/gpgui.png
|
||||
%{_datadir}/icons/hicolor/128x128/apps/gpgui.png
|
||||
|
Loading…
x
Reference in New Issue
Block a user