Compare commits

..

6 Commits

Author SHA1 Message Date
Kevin Yue
200d13ef15 Release 2.2.1 2024-05-07 11:58:15 -04:00
Kevin Yue
ddeef46d2e Restore the browser auth, related #360 2024-05-07 11:40:44 -04:00
Dr. Larry D. Pyeatt
97c3998383 Install instructions for Gentoo (#352)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Add install instructions for Gentoo
2024-05-06 19:00:17 +08:00
Kevin Yue
93aea4ee60 doc: using the default browser for CLI 2024-04-30 18:47:38 +08:00
Kevin Yue
546dbf542e Update README.md 2024-04-30 13:28:20 +08:00
Kevin Yue
005410d40b Update README.md 2024-04-30 13:19:52 +08:00
10 changed files with 57 additions and 20 deletions

16
Cargo.lock generated
View File

@@ -564,7 +564,7 @@ dependencies = [
[[package]]
name = "common"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"is_executable",
]
@@ -1430,7 +1430,7 @@ dependencies = [
[[package]]
name = "gpapi"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"anyhow",
"base64 0.21.5",
@@ -1439,6 +1439,7 @@ dependencies = [
"dotenvy_macro",
"log",
"md5",
"open",
"redact-engine",
"regex",
"reqwest",
@@ -1461,7 +1462,7 @@ dependencies = [
[[package]]
name = "gpauth"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"anyhow",
"clap",
@@ -1470,7 +1471,6 @@ dependencies = [
"gpapi",
"html-escape",
"log",
"open",
"regex",
"serde_json",
"tauri",
@@ -1483,7 +1483,7 @@ dependencies = [
[[package]]
name = "gpclient"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"anyhow",
"clap",
@@ -1505,7 +1505,7 @@ dependencies = [
[[package]]
name = "gpgui-helper"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"anyhow",
"clap",
@@ -1523,7 +1523,7 @@ dependencies = [
[[package]]
name = "gpservice"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"anyhow",
"axum",
@@ -2537,7 +2537,7 @@ dependencies = [
[[package]]
name = "openconnect"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"cc",
"common",

View File

@@ -5,7 +5,7 @@ members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/g
[workspace.package]
rust-version = "1.70"
version = "2.2.0"
version = "2.2.1"
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
edition = "2021"
@@ -44,7 +44,6 @@ compile-time = "0.2"
serde_urlencoded = "0.7"
md5="0.7"
sha256="1"
open = "5"
# Tauri dependencies
tauri = { version = "1.5" }

View File

@@ -43,6 +43,12 @@ Options:
See 'gpclient help <command>' for more information on a specific command.
```
To use the default browser for authentication with the CLI version, you need to use the following command:
```bash
sudo -E gpclient connect --default-browser <portal>
```
### GUI
The GUI version is also available after you installed it. You can launch it from the application menu or run `gpclient launch-gui` in the terminal.
@@ -70,7 +76,7 @@ sudo apt-get install globalprotect-openconnect
#### **Ubuntu 24.04**
The `libwebkit2gtk-4.0-37` was [removed](https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2061914) from its repo, before [the issue](https://github.com/yuezk/GlobalProtect-openconnect/issues/351) gets resolved, you need to install them manually:
The `libwebkit2gtk-4.0-37` package was [removed](https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2061914) from its repo, before [the issue](https://github.com/yuezk/GlobalProtect-openconnect/issues/351) gets resolved, you need to install them manually:
```bash
wget http://launchpadlibrarian.net/704701349/libwebkit2gtk-4.0-37_2.43.3-1_amd64.deb
@@ -87,10 +93,10 @@ The latest package is not available in the PPA either, but you still needs to ad
#### Install from deb package
Download the latest deb package from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page. Then install it with `dpkg`:
Download the latest deb package from [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page. Then install it with `apt`:
```bash
sudo dpkg -i globalprotect-openconnect_*.deb
sudo apt install --fix-broken globalprotect-openconnect_*.deb
```
### Arch Linux / Manjaro
@@ -137,6 +143,30 @@ Download the latest RPM package from [releases](https://github.com/yuezk/GlobalP
```bash
sudo rpm -i globalprotect-openconnect-*.rpm
```
### Gentoo
Install from the ```rios``` or ```slonko``` overlays. Example using rios:
#### 1. Enable the overlay
```
sudo eselect repository enable rios
```
#### 2. Sync with the repository
- If you have eix installed, use it:
```
sudo eix-sync
```
- Otherwise, use:
```
sudo emerge --sync
```
#### 3. Install
```sudo emerge globalprotect-openconnect```
### Other distributions

View File

@@ -8,7 +8,11 @@ license.workspace = true
tauri-build = { version = "1.5", features = [] }
[dependencies]
gpapi = { path = "../../crates/gpapi", features = ["tauri", "clap"] }
gpapi = { path = "../../crates/gpapi", features = [
"tauri",
"clap",
"browser-auth",
] }
anyhow.workspace = true
clap.workspace = true
env_logger.workspace = true
@@ -22,4 +26,3 @@ html-escape = "0.2.13"
webkit2gtk = "0.18.2"
tauri = { workspace = true, features = ["http-all"] }
compile-time.workspace = true
open.workspace = true

View File

@@ -3,6 +3,7 @@ use gpapi::{
auth::{SamlAuthData, SamlAuthResult},
clap::args::Os,
gp_params::{ClientOs, GpParams},
process::browser_authenticator::BrowserAuthenticator,
utils::{normalize_server, openssl},
GP_USER_AGENT,
};
@@ -11,10 +12,7 @@ use serde_json::json;
use tauri::{App, AppHandle, RunEvent};
use tempfile::NamedTempFile;
use crate::{
auth_window::{portal_prelogin, AuthWindow},
browser_authenticator::BrowserAuthenticator,
};
use crate::auth_window::{portal_prelogin, AuthWindow};
const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", compile_time::date_str!(), ")");

View File

@@ -1,7 +1,6 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod auth_window;
mod browser_authenticator;
mod cli;
#[tokio::main]

View File

@@ -1,5 +1,9 @@
# Changelog
## 2.2.1 - 2024-05-07
- GUI: Restore the default browser auth implementation (fix [#360](https://github.com/yuezk/GlobalProtect-openconnect/issues/360))
## 2.2.0 - 2024-04-30
- CLI: support authentication with external browser (fix [#298](https://github.com/yuezk/GlobalProtect-openconnect/issues/298))

View File

@@ -31,7 +31,9 @@ sha256.workspace = true
tauri = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
open = { version = "5", optional = true }
[features]
tauri = ["dep:tauri"]
clap = ["dep:clap"]
browser-auth = ["dep:open"]

View File

@@ -2,6 +2,8 @@ pub(crate) mod command_traits;
pub(crate) mod gui_helper_launcher;
pub mod auth_launcher;
#[cfg(feature = "browser-auth")]
pub mod browser_authenticator;
pub mod gui_launcher;
pub mod hip_launcher;
pub mod service_launcher;