Compare commits

..

1 Commits

Author SHA1 Message Date
Kevin Yue
33d62334db
chore: release ubuntu 18.04 ppa 2025-01-21 13:56:13 +08:00
12 changed files with 113 additions and 163 deletions

View File

@ -67,47 +67,6 @@ 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
@ -208,7 +167,6 @@ 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

@ -61,21 +61,22 @@ jobs:
tarBall: false tarBall: false
zipBall: false zipBall: false
out-file-path: publish-ppa out-file-path: publish-ppa
- name: Patch the source code - name: Patch the source code
run: | run: |
cd publish-ppa cd publish-ppa
# Rename the source tarball without the offline suffix # Remove the `offline` from the tarball name
mv *.tar.gz $(basename *.tar.gz .offline.tar.gz).tar.gz new_tarball=$(ls globalprotect-openconnect-*.offline.tar.gz | sed 's/.offline//')
mv globalprotect-openconnect-*.offline.tar.gz $new_tarball
# Extract the source tarball # Extract the source code
tar -xzf *.tar.gz tar -xf $new_tarball
# Prepare the debian directory with custom files
cd globalprotect-openconnect-*/ cd globalprotect-openconnect-*/
# Prepare the debian directory with custom files
mkdir -p .build/debian mkdir -p .build/debian
sed 's/@RUST@/rust-all(>=1.71)/g' packaging/deb/control.in > .build/debian/control sed 's/@RUST@/rust-all(>=1.70)/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

View File

@ -96,16 +96,15 @@ 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
env: uses: robinraju/release-downloader@v1.9
GH_TOKEN: ${{ secrets.GH_PAT }} with:
run: | token: ${{ secrets.GH_PAT }}
gh -R yuezk/GlobalProtect-openconnect \ tag: ${{ inputs.tag }}
release download ${{ inputs.tag }} \ fileName: globalprotect-openconnect-*.tar.gz
--pattern '*[^offline].tar.gz' \ tarBall: false
--dir build-${{ matrix.package }} zipBall: false
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.7.9" version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8"
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,11 +208,10 @@ dependencies = [
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.4.5" 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 = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733"
dependencies = [ dependencies = [
"async-trait",
"bytes", "bytes",
"futures-util", "futures-util",
"http 1.2.0", "http 1.2.0",
@ -309,9 +308,9 @@ dependencies = [
[[package]] [[package]]
name = "brotli-decompressor" name = "brotli-decompressor"
version = "4.0.2" version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362"
dependencies = [ dependencies = [
"alloc-no-stdlib", "alloc-no-stdlib",
"alloc-stdlib", "alloc-stdlib",
@ -319,9 +318,9 @@ dependencies = [
[[package]] [[package]]
name = "bstr" name = "bstr"
version = "1.10.0" version = "1.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde", "serde",
@ -489,9 +488,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.4.18" version = "4.5.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -499,23 +498,23 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.4.18" version = "4.5.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
"clap_lex", "clap_lex",
"strsim 0.10.0", "strsim",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.4.7" version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [ dependencies = [
"heck 0.4.1", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.96", "syn 2.0.96",
@ -523,9 +522,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.6.0" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]] [[package]]
name = "cocoa" name = "cocoa"
@ -581,7 +580,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"is_executable", "is_executable",
] ]
@ -801,7 +800,7 @@ dependencies = [
"ident_case", "ident_case",
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.11.1", "strsim",
"syn 2.0.96", "syn 2.0.96",
] ]
@ -997,16 +996,6 @@ 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"
@ -1015,15 +1004,15 @@ checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe"
[[package]] [[package]]
name = "env_logger" name = "env_logger"
version = "0.11.6" version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
dependencies = [ dependencies = [
"anstream",
"anstyle",
"env_filter",
"humantime", "humantime",
"is-terminal",
"log", "log",
"regex",
"termcolor",
] ]
[[package]] [[package]]
@ -1480,10 +1469,10 @@ dependencies = [
[[package]] [[package]]
name = "gpapi" name = "gpapi"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.22.1", "base64 0.21.7",
"chacha20poly1305", "chacha20poly1305",
"clap", "clap",
"dns-lookup", "dns-lookup",
@ -1505,7 +1494,7 @@ dependencies = [
"specta-macros", "specta-macros",
"tauri", "tauri",
"tempfile", "tempfile",
"thiserror 2.0.11", "thiserror 1.0.69",
"tokio", "tokio",
"url", "url",
"urlencoding", "urlencoding",
@ -1517,7 +1506,7 @@ dependencies = [
[[package]] [[package]]
name = "gpauth" name = "gpauth"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1538,7 +1527,7 @@ dependencies = [
[[package]] [[package]]
name = "gpclient" name = "gpclient"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1560,7 +1549,7 @@ dependencies = [
[[package]] [[package]]
name = "gpgui-helper" name = "gpgui-helper"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1578,7 +1567,7 @@ dependencies = [
[[package]] [[package]]
name = "gpservice" name = "gpservice"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@ -1704,6 +1693,12 @@ 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"
@ -2186,6 +2181,17 @@ 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"
@ -2466,9 +2472,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]] [[package]]
name = "matchit" name = "matchit"
version = "0.7.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]] [[package]]
name = "md5" name = "md5"
@ -2747,7 +2753,7 @@ dependencies = [
[[package]] [[package]]
name = "openconnect" name = "openconnect"
version = "2.3.11" version = "2.3.10"
dependencies = [ dependencies = [
"cc", "cc",
"common", "common",
@ -3402,9 +3408,12 @@ dependencies = [
[[package]] [[package]]
name = "roxmltree" name = "roxmltree"
version = "0.20.0" version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302"
dependencies = [
"xmlparser",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
@ -3906,12 +3915,6 @@ 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"
@ -3971,9 +3974,9 @@ dependencies = [
[[package]] [[package]]
name = "sysinfo" name = "sysinfo"
version = "0.30.13" version = "0.29.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"core-foundation-sys", "core-foundation-sys",
@ -3981,7 +3984,7 @@ dependencies = [
"ntapi", "ntapi",
"once_cell", "once_cell",
"rayon", "rayon",
"windows 0.52.0", "winapi",
] ]
[[package]] [[package]]
@ -4468,9 +4471,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.24.0" version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
@ -4657,9 +4660,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.24.0" version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"bytes", "bytes",
@ -4669,7 +4672,7 @@ dependencies = [
"log", "log",
"rand 0.8.5", "rand 0.8.5",
"sha1", "sha1",
"thiserror 1.0.69", "thiserror 2.0.11",
"utf-8", "utf-8",
] ]
@ -4757,18 +4760,18 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.12.1" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4"
dependencies = [ dependencies = [
"getrandom 0.2.15", "getrandom 0.2.15",
] ]
[[package]] [[package]]
name = "uzers" name = "uzers"
version = "0.12.1" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4df81ff504e7d82ad53e95ed1ad5b72103c11253f39238bcc0235b90768a97dd" checksum = "76d283dc7e8c901e79e32d077866eaf599156cbf427fffa8289aecc52c5c3f63"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
@ -5135,16 +5138,6 @@ 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"
@ -5629,6 +5622,12 @@ 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.71.1" rust-version = "1.70"
version = "2.3.11" version = "2.3.10"
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.22" base64 = "0.21"
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.11" env_logger = "0.10"
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.20" roxmltree = "0.18"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
sysinfo = "0.30" sysinfo = "0.29"
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.7" axum = "0.8"
futures = "0.3" futures = "0.3"
futures-util = "0.3" futures-util = "0.3"
tokio-tungstenite = "0.26.1" tokio-tungstenite = "0.20.1"
uzers = "0.12" uzers = "0.11"
whoami = "1" whoami = "1"
thiserror = "2" thiserror = "1"
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" } tauri = { version = "1.5" }
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, Signal, System}; use sysinfo::{Pid, ProcessExt, Signal, System, SystemExt};
#[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(crate) async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) { pub 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,5 +1,4 @@
use std::{ use std::{
borrow::Cow,
fs::{File, Permissions}, fs::{File, Permissions},
io::BufReader, io::BufReader,
ops::ControlFlow, ops::ControlFlow,
@ -12,7 +11,7 @@ use anyhow::bail;
use axum::{ use axum::{
body::Bytes, body::Bytes,
extract::{ extract::{
ws::{self, CloseFrame, Message, WebSocket}, ws::{self, CloseFrame, Message, Utf8Bytes, WebSocket},
State, WebSocketUpgrade, State, WebSocketUpgrade,
}, },
http::StatusCode, http::StatusCode,
@ -43,7 +42,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(crate) async fn update_gui(State(ctx): State<Arc<WsServerContext>>, body: Bytes) -> Result<(), StatusCode> { pub 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) => {
@ -137,7 +136,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: Cow::from("Goodbye"), reason: Utf8Bytes::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); let msg = Message::Binary(encrypted.into());
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) { Message::Binary(data) => match self.crypto.decrypt(data.into()) {
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,10 +1,6 @@
# Changelog # Changelog
## 2.3.11 - 2025-01-21 ## 2.3.10 - 2024-01-20
- 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))

View File

@ -1,2 +0,0 @@
[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-*/*
} }