Compare commits

...

4 Commits

Author SHA1 Message Date
Kevin Yue
51c55376e8
ci: use gh to download release asset 2025-01-21 22:48:40 +08:00
Kevin Yue
26d5d5bcf0
Release 2.3.11 2025-01-21 21:37:56 +08:00
Kevin Yue
b99053718a
ci: upload offline tarball 2025-01-21 21:11:03 +08:00
Kevin Yue
6e603c84b3
chore: pin rust version 1.71.1 2025-01-21 20:18:06 +08:00
12 changed files with 170 additions and 115 deletions

View File

@ -67,6 +67,47 @@ jobs:
path: | path: |
source/gp/.build/tarball/*.tar.gz source/gp/.build/tarball/*.tar.gz
tarball-offline:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs:
- tarball
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Prepare workspace
run: rm -rf source-offline && mkdir source-offline
- name: Download tarball
uses: actions/download-artifact@v3
with:
name: artifact-source
path: source-offline
- name: Create offline tarball
run: |
cd source-offline
offline_tarball=$(basename *.tar.gz .tar.gz).offline.tar.gz
# Extract the tarball
tar -xzf *.tar.gz
cd */
make tarball OFFLINE=1
# Rename the tarball to .offline.tar.gz
mv -v .build/tarball/*.tar.gz ../$offline_tarball
- name: Upload offline tarball
uses: actions/upload-artifact@v3
with:
path: source-offline/*.offline.tar.gz
name: artifact-source-offline
if-no-files-found: error
build-gp: build-gp:
needs: needs:
- setup-matrix - setup-matrix
@ -167,6 +208,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- tarball - tarball
- tarball-offline
- build-gp - build-gp
- build-gpgui - build-gpgui

View File

@ -52,39 +52,43 @@ jobs:
version: 8 version: 8
- name: Prepare workspace - name: Prepare workspace
run: rm -rf publish-ppa && mkdir publish-ppa run: rm -rf publish-ppa && mkdir publish-ppa
- name: Download ${{ inputs.tag }} source code - name: Download ${{ inputs.tag }} offline source code
uses: robinraju/release-downloader@v1.9 uses: robinraju/release-downloader@v1.9
with: with:
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GH_PAT }}
tag: ${{ inputs.tag }} tag: ${{ inputs.tag }}
fileName: globalprotect-openconnect-*.tar.gz fileName: globalprotect-openconnect-*.offline.tar.gz
tarBall: false tarBall: false
zipBall: false zipBall: false
out-file-path: publish-ppa out-file-path: publish-ppa
- name: Make the offline tarball - name: Patch the source code
run: | run: |
cd publish-ppa cd publish-ppa
tar -xf globalprotect-openconnect-*.tar.gz
cd globalprotect-openconnect-*/
make tarball OFFLINE=1 # Rename the source tarball without the offline suffix
mv *.tar.gz $(basename *.tar.gz .offline.tar.gz).tar.gz
# Extract the source tarball
tar -xzf *.tar.gz
# Prepare the debian directory with custom files # Prepare the debian directory with custom files
cd globalprotect-openconnect-*/
mkdir -p .build/debian mkdir -p .build/debian
sed 's/@RUST@/rust-all(>=1.70)/g' packaging/deb/control.in > .build/debian/control sed 's/@RUST@/rust-all(>=1.71)/g' packaging/deb/control.in > .build/debian/control
sed 's/@OFFLINE@/1/g' packaging/deb/rules.in > .build/debian/rules sed 's/@OFFLINE@/1/g' packaging/deb/rules.in > .build/debian/rules
cp packaging/deb/postrm .build/debian/postrm cp packaging/deb/postrm .build/debian/postrm
- name: Publish to PPA - name: Publish to PPA
uses: yuezk/publish-ppa-package@v2 uses: yuezk/publish-ppa-package@gp_2.3.x
with: with:
repository: "yuezk/globalprotect-openconnect" repository: "yuezk/globalprotect-openconnect"
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
tarball: publish-ppa/globalprotect-openconnect-*/.build/tarball/*.tar.gz tarball: publish-ppa/globalprotect-openconnect-*.tar.gz
debian_dir: publish-ppa/globalprotect-openconnect-*/.build/debian debian_dir: publish-ppa/globalprotect-openconnect-*/.build/debian
deb_email: "k3vinyue@gmail.com" deb_email: "k3vinyue@gmail.com"
deb_fullname: "Kevin Yue" deb_fullname: "Kevin Yue"
extra_ppa: "yuezk/globalprotect-openconnect liushuyu-011/rust-bpo-1.75" extra_ppa: "yuezk/globalprotect-openconnect liushuyu-011/rust-bpo-1.75"
series: "focal" series: "bionic focal"
revision: ${{ inputs.revision }} revision: ${{ inputs.revision }}

View File

@ -96,15 +96,16 @@ jobs:
steps: steps:
- name: Prepare workspace - name: Prepare workspace
run: rm -rf build-${{ matrix.package }} && mkdir -p build-${{ matrix.package }} run: rm -rf build-${{ matrix.package }} && mkdir -p build-${{ matrix.package }}
- name: Download ${{ inputs.tag }} source code - name: Download ${{ inputs.tag }} source code
uses: robinraju/release-downloader@v1.9 env:
with: GH_TOKEN: ${{ secrets.GH_PAT }}
token: ${{ secrets.GH_PAT }} run: |
tag: ${{ inputs.tag }} gh -R yuezk/GlobalProtect-openconnect \
fileName: globalprotect-openconnect-*.tar.gz release download ${{ inputs.tag }} \
tarBall: false --pattern '*[^offline].tar.gz' \
zipBall: false --dir build-${{ matrix.package }}
out-file-path: build-${{ matrix.package }}
- name: Docker Login - name: Docker Login
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Build ${{ matrix.package }} package in Docker - name: Build ${{ matrix.package }} package in Docker

153
Cargo.lock generated
View File

@ -171,14 +171,14 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]] [[package]]
name = "axum" name = "axum"
version = "0.8.1" version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
dependencies = [ dependencies = [
"async-trait",
"axum-core", "axum-core",
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
"form_urlencoded",
"futures-util", "futures-util",
"http 1.2.0", "http 1.2.0",
"http-body 1.0.1", "http-body 1.0.1",
@ -208,10 +208,11 @@ dependencies = [
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.5.0" version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
dependencies = [ dependencies = [
"async-trait",
"bytes", "bytes",
"futures-util", "futures-util",
"http 1.2.0", "http 1.2.0",
@ -308,9 +309,9 @@ dependencies = [
[[package]] [[package]]
name = "brotli-decompressor" name = "brotli-decompressor"
version = "4.0.1" version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37"
dependencies = [ dependencies = [
"alloc-no-stdlib", "alloc-no-stdlib",
"alloc-stdlib", "alloc-stdlib",
@ -318,9 +319,9 @@ dependencies = [
[[package]] [[package]]
name = "bstr" name = "bstr"
version = "1.11.3" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde", "serde",
@ -488,9 +489,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.26" version = "4.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -498,23 +499,23 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.26" version = "4.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
"clap_lex", "clap_lex",
"strsim", "strsim 0.10.0",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.24" version = "4.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.4.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.96", "syn 2.0.96",
@ -522,9 +523,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.4" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
[[package]] [[package]]
name = "cocoa" name = "cocoa"
@ -580,7 +581,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"is_executable", "is_executable",
] ]
@ -800,7 +801,7 @@ dependencies = [
"ident_case", "ident_case",
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim", "strsim 0.11.1",
"syn 2.0.96", "syn 2.0.96",
] ]
@ -996,6 +997,16 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "env_filter"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0"
dependencies = [
"log",
"regex",
]
[[package]] [[package]]
name = "env_home" name = "env_home"
version = "0.1.0" version = "0.1.0"
@ -1004,15 +1015,15 @@ checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe"
[[package]] [[package]]
name = "env_logger" name = "env_logger"
version = "0.10.2" version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0"
dependencies = [ dependencies = [
"anstream",
"anstyle",
"env_filter",
"humantime", "humantime",
"is-terminal",
"log", "log",
"regex",
"termcolor",
] ]
[[package]] [[package]]
@ -1469,10 +1480,10 @@ dependencies = [
[[package]] [[package]]
name = "gpapi" name = "gpapi"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.21.7", "base64 0.22.1",
"chacha20poly1305", "chacha20poly1305",
"clap", "clap",
"dns-lookup", "dns-lookup",
@ -1494,7 +1505,7 @@ dependencies = [
"specta-macros", "specta-macros",
"tauri", "tauri",
"tempfile", "tempfile",
"thiserror 1.0.69", "thiserror 2.0.11",
"tokio", "tokio",
"url", "url",
"urlencoding", "urlencoding",
@ -1506,7 +1517,7 @@ dependencies = [
[[package]] [[package]]
name = "gpauth" name = "gpauth"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1527,7 +1538,7 @@ dependencies = [
[[package]] [[package]]
name = "gpclient" name = "gpclient"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1549,7 +1560,7 @@ dependencies = [
[[package]] [[package]]
name = "gpgui-helper" name = "gpgui-helper"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1567,7 +1578,7 @@ dependencies = [
[[package]] [[package]]
name = "gpservice" name = "gpservice"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@ -1693,12 +1704,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
[[package]] [[package]]
name = "hex" name = "hex"
version = "0.4.3" version = "0.4.3"
@ -2181,17 +2186,6 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "is-terminal"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b"
dependencies = [
"hermit-abi",
"libc",
"windows-sys 0.52.0",
]
[[package]] [[package]]
name = "is-wsl" name = "is-wsl"
version = "0.4.0" version = "0.4.0"
@ -2472,9 +2466,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]] [[package]]
name = "matchit" name = "matchit"
version = "0.8.4" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]] [[package]]
name = "md5" name = "md5"
@ -2753,7 +2747,7 @@ dependencies = [
[[package]] [[package]]
name = "openconnect" name = "openconnect"
version = "2.3.10" version = "2.3.11"
dependencies = [ dependencies = [
"cc", "cc",
"common", "common",
@ -3408,12 +3402,9 @@ dependencies = [
[[package]] [[package]]
name = "roxmltree" name = "roxmltree"
version = "0.18.1" version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
dependencies = [
"xmlparser",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
@ -3915,6 +3906,12 @@ dependencies = [
"quote", "quote",
] ]
[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.11.1" version = "0.11.1"
@ -3974,9 +3971,9 @@ dependencies = [
[[package]] [[package]]
name = "sysinfo" name = "sysinfo"
version = "0.29.11" version = "0.30.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"core-foundation-sys", "core-foundation-sys",
@ -3984,7 +3981,7 @@ dependencies = [
"ntapi", "ntapi",
"once_cell", "once_cell",
"rayon", "rayon",
"winapi", "windows 0.52.0",
] ]
[[package]] [[package]]
@ -4471,9 +4468,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.26.1" version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
@ -4660,9 +4657,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.26.1" version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"bytes", "bytes",
@ -4672,7 +4669,7 @@ dependencies = [
"log", "log",
"rand 0.8.5", "rand 0.8.5",
"sha1", "sha1",
"thiserror 2.0.11", "thiserror 1.0.69",
"utf-8", "utf-8",
] ]
@ -4760,18 +4757,18 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.12.0" version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b"
dependencies = [ dependencies = [
"getrandom 0.2.15", "getrandom 0.2.15",
] ]
[[package]] [[package]]
name = "uzers" name = "uzers"
version = "0.11.3" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76d283dc7e8c901e79e32d077866eaf599156cbf427fffa8289aecc52c5c3f63" checksum = "4df81ff504e7d82ad53e95ed1ad5b72103c11253f39238bcc0235b90768a97dd"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
@ -5138,6 +5135,16 @@ dependencies = [
"windows-targets 0.48.5", "windows-targets 0.48.5",
] ]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.6",
]
[[package]] [[package]]
name = "windows-bindgen" name = "windows-bindgen"
version = "0.39.0" version = "0.39.0"
@ -5622,12 +5629,6 @@ dependencies = [
"rustix", "rustix",
] ]
[[package]]
name = "xmlparser"
version = "0.13.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4"
[[package]] [[package]]
name = "xz2" name = "xz2"
version = "0.1.7" version = "0.1.7"

View File

@ -10,8 +10,8 @@ members = [
] ]
[workspace.package] [workspace.package]
rust-version = "1.70" rust-version = "1.71.1"
version = "2.3.10" version = "2.3.11"
authors = ["Kevin Yue <k3vinyue@gmail.com>"] authors = ["Kevin Yue <k3vinyue@gmail.com>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect" homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
edition = "2021" edition = "2021"
@ -19,34 +19,34 @@ license = "GPL-3.0"
[workspace.dependencies] [workspace.dependencies]
anyhow = "1.0" anyhow = "1.0"
base64 = "0.21" base64 = "0.22"
clap = { version = "4.4.2", features = ["derive"] } clap = { version = "~4.4.2", features = ["derive"] }
ctrlc = "3.4" ctrlc = "3.4"
directories = "5.0" directories = "5.0"
dns-lookup = "2.0.4" dns-lookup = "2.0.4"
env_logger = "0.10" env_logger = "0.11"
is_executable = "1.0" is_executable = "1.0"
log = "0.4" log = "0.4"
regex = "1" regex = "1"
reqwest = { version = "0.11", features = ["native-tls-vendored", "json"] } reqwest = { version = "0.11", features = ["native-tls-vendored", "json"] }
openssl = "0.10" openssl = "0.10"
pem = "3" pem = "3"
roxmltree = "0.18" roxmltree = "0.20"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
sysinfo = "0.29" sysinfo = "0.30"
tempfile = "3.8" tempfile = "3.8"
tokio = { version = "1" } tokio = { version = "1" }
tokio-util = "0.7" tokio-util = "0.7"
url = "2.4" url = "2.4"
urlencoding = "2.1.3" urlencoding = "2.1.3"
axum = "0.8" axum = "0.7"
futures = "0.3" futures = "0.3"
futures-util = "0.3" futures-util = "0.3"
tokio-tungstenite = "0.20.1" tokio-tungstenite = "0.26.1"
uzers = "0.11" uzers = "0.12"
whoami = "1" whoami = "1"
thiserror = "1" thiserror = "2"
redact-engine = "0.1" redact-engine = "0.1"
compile-time = "0.2" compile-time = "0.2"
serde_urlencoded = "0.7" serde_urlencoded = "0.7"
@ -55,7 +55,7 @@ sha256 = "1"
which = "7" which = "7"
# Tauri dependencies # Tauri dependencies
tauri = { version = "1.5" } tauri = { version = "1" }
specta = "=2.0.0-rc.1" specta = "=2.0.0-rc.1"
specta-macros = "=2.0.0-rc.1" specta-macros = "=2.0.0-rc.1"
rspc = { version = "1.0.0-rc.5", features = ["tauri"] } rspc = { version = "1.0.0-rc.5", features = ["tauri"] }

View File

@ -3,7 +3,7 @@ use clap::Args;
use gpapi::utils::lock_file::gpservice_lock_info; use gpapi::utils::lock_file::gpservice_lock_info;
use log::{info, warn}; use log::{info, warn};
use std::{fs, str::FromStr, thread, time::Duration}; use std::{fs, str::FromStr, thread, time::Duration};
use sysinfo::{Pid, ProcessExt, Signal, System, SystemExt}; use sysinfo::{Pid, Signal, System};
#[derive(Args)] #[derive(Args)]
pub struct DisconnectArgs { pub struct DisconnectArgs {

View File

@ -145,7 +145,7 @@ mod signals {
const DISCONNECTED_PID_FILE: &str = "/tmp/gpservice_disconnected.pid"; const DISCONNECTED_PID_FILE: &str = "/tmp/gpservice_disconnected.pid";
pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) { pub(crate) async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) {
use gpapi::service::event::WsEvent; use gpapi::service::event::WsEvent;
use tokio::signal::unix::{signal, Signal, SignalKind}; use tokio::signal::unix::{signal, Signal, SignalKind};

View File

@ -1,4 +1,5 @@
use std::{ use std::{
borrow::Cow,
fs::{File, Permissions}, fs::{File, Permissions},
io::BufReader, io::BufReader,
ops::ControlFlow, ops::ControlFlow,
@ -11,7 +12,7 @@ use anyhow::bail;
use axum::{ use axum::{
body::Bytes, body::Bytes,
extract::{ extract::{
ws::{self, CloseFrame, Message, Utf8Bytes, WebSocket}, ws::{self, CloseFrame, Message, WebSocket},
State, WebSocketUpgrade, State, WebSocketUpgrade,
}, },
http::StatusCode, http::StatusCode,
@ -42,7 +43,7 @@ pub(crate) async fn auth_data(State(ctx): State<Arc<WsServerContext>>, body: Str
ctx.send_event(WsEvent::AuthData(body)).await; ctx.send_event(WsEvent::AuthData(body)).await;
} }
pub async fn update_gui(State(ctx): State<Arc<WsServerContext>>, body: Bytes) -> Result<(), StatusCode> { pub(crate) async fn update_gui(State(ctx): State<Arc<WsServerContext>>, body: Bytes) -> Result<(), StatusCode> {
let payload = match ctx.decrypt::<UpdateGuiRequest>(body.to_vec()) { let payload = match ctx.decrypt::<UpdateGuiRequest>(body.to_vec()) {
Ok(payload) => payload, Ok(payload) => payload,
Err(err) => { Err(err) => {
@ -136,7 +137,7 @@ async fn handle_socket(mut socket: WebSocket, ctx: Arc<WsServerContext>) {
let close_msg = Message::Close(Some(CloseFrame { let close_msg = Message::Close(Some(CloseFrame {
code: ws::close_code::NORMAL, code: ws::close_code::NORMAL,
reason: Utf8Bytes::from("Goodbye"), reason: Cow::from("Goodbye"),
})); }));
if let Err(err) = sender.send(close_msg).await { if let Err(err) = sender.send(close_msg).await {

View File

@ -20,7 +20,7 @@ impl WsConnection {
pub async fn send_event(&self, event: &WsEvent) -> anyhow::Result<()> { pub async fn send_event(&self, event: &WsEvent) -> anyhow::Result<()> {
let encrypted = self.crypto.encrypt(event)?; let encrypted = self.crypto.encrypt(event)?;
let msg = Message::Binary(encrypted.into()); let msg = Message::Binary(encrypted);
self.tx.send(msg).await?; self.tx.send(msg).await?;
@ -29,7 +29,7 @@ impl WsConnection {
pub fn recv_msg(&self, msg: Message) -> ControlFlow<(), WsRequest> { pub fn recv_msg(&self, msg: Message) -> ControlFlow<(), WsRequest> {
match msg { match msg {
Message::Binary(data) => match self.crypto.decrypt(data.into()) { Message::Binary(data) => match self.crypto.decrypt(data) {
Ok(ws_req) => ControlFlow::Continue(ws_req), Ok(ws_req) => ControlFlow::Continue(ws_req),
Err(err) => { Err(err) => {
info!("Failed to decrypt message: {}", err); info!("Failed to decrypt message: {}", err);

View File

@ -1,6 +1,10 @@
# Changelog # Changelog
## 2.3.10 - 2024-01-20 ## 2.3.11 - 2025-01-21
- Update minimal Rust version to 1.71.1, so that the PPA can be built on Ubuntu 18.04.
## 2.3.10 - 2025-01-20
- Disconnect the VPN when sleep (fix [#166](https://github.com/yuezk/GlobalProtect-openconnect/issues/166), [#267](https://github.com/yuezk/GlobalProtect-openconnect/issues/267)) - Disconnect the VPN when sleep (fix [#166](https://github.com/yuezk/GlobalProtect-openconnect/issues/166), [#267](https://github.com/yuezk/GlobalProtect-openconnect/issues/267))

2
rust-toolchain.toml Normal file
View File

@ -0,0 +1,2 @@
[toolchain]
channel = "1.71.1"

View File

@ -40,7 +40,7 @@ release_tag() {
gh -R "$REPO" release create $TAG \ gh -R "$REPO" release create $TAG \
--title "$TAG" \ --title "$TAG" \
--notes "$RELEASE_NOTES" \ --notes "$RELEASE_NOTES" \
"$PROJECT_DIR"/.build/artifacts/artifact-source/* \ "$PROJECT_DIR"/.build/artifacts/artifact-source*/* \
"$PROJECT_DIR"/.build/artifacts/artifact-gpgui-*/* "$PROJECT_DIR"/.build/artifacts/artifact-gpgui-*/*
} }