Compare commits

..

No commits in common. "b2ca82e1059df3704cb191e06edd99fe77d9d604" and "187ca778f23dc7a15b413741c3fc253d3bde19c0" have entirely different histories.

9 changed files with 15 additions and 35 deletions

View File

@ -9,9 +9,6 @@ on:
branches: branches:
- main - main
- dev - dev
- hotfix/*
- feature/*
- release/*
tags: tags:
- latest - latest
- v*.*.* - v*.*.*
@ -45,7 +42,6 @@ jobs:
with: with:
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GH_PAT }}
repository: yuezk/GlobalProtect-openconnect repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: source/gp path: source/gp
- name: Create tarball - name: Create tarball
run: | run: |
@ -99,14 +95,12 @@ jobs:
with: with:
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GH_PAT }}
repository: yuezk/GlobalProtect-openconnect repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: gpgui-source/gp path: gpgui-source/gp
- name: Checkout gpgui@${{ github.ref_name }} - name: Checkout gpgui
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GH_PAT }}
repository: yuezk/gpgui repository: yuezk/gpgui
ref: ${{ github.ref_name }}
path: gpgui-source/gpgui path: gpgui-source/gpgui
- name: Tarball - name: Tarball
run: | run: |

14
Cargo.lock generated
View File

@ -564,7 +564,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"is_executable", "is_executable",
] ]
@ -1430,7 +1430,7 @@ dependencies = [
[[package]] [[package]]
name = "gpapi" name = "gpapi"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.21.5", "base64 0.21.5",
@ -1462,7 +1462,7 @@ dependencies = [
[[package]] [[package]]
name = "gpauth" name = "gpauth"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1482,7 +1482,7 @@ dependencies = [
[[package]] [[package]]
name = "gpclient" name = "gpclient"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1504,7 +1504,7 @@ dependencies = [
[[package]] [[package]]
name = "gpgui-helper" name = "gpgui-helper"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1522,7 +1522,7 @@ dependencies = [
[[package]] [[package]]
name = "gpservice" name = "gpservice"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@ -2527,7 +2527,7 @@ dependencies = [
[[package]] [[package]]
name = "openconnect" name = "openconnect"
version = "2.1.2" version = "2.1.1"
dependencies = [ dependencies = [
"cc", "cc",
"common", "common",

View File

@ -5,7 +5,7 @@ members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/g
[workspace.package] [workspace.package]
rust-version = "1.70" rust-version = "1.70"
version = "2.1.2" version = "2.1.1"
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"

View File

@ -153,7 +153,7 @@ impl<'a> ConnectHandler<'a> {
} }
async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> { async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> {
info!("Performing the gateway authentication..."); info!("Treat the portal as the gateway, connecting...");
let mut gp_params = self.build_gp_params(); let mut gp_params = self.build_gp_params();
gp_params.set_is_gateway(true); gp_params.set_is_gateway(true);

View File

@ -1,9 +1,5 @@
# Changelog # Changelog
## 2.1.2 - 2024-03-29
- Treat portal as gateway when the gateway login is failed (fix #338)
## 2.1.1 - 2024-03-25 ## 2.1.1 - 2024-03-25
- Add the `--hip` option to enable HIP report - Add the `--hip` option to enable HIP report

View File

@ -6,6 +6,6 @@ pub enum PortalError {
PreloginError(String), PreloginError(String),
#[error("Portal config error: {0}")] #[error("Portal config error: {0}")]
ConfigError(String), ConfigError(String),
#[error("Network error: {0}")] #[error("Gateway error: {0}")]
NetworkError(String), GatewayError(String),
} }

View File

@ -34,7 +34,7 @@ pub async fn gateway_login(gateway: &str, cred: &Credential, gp_params: &GpParam
.form(&params) .form(&params)
.send() .send()
.await .await
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?; .map_err(|e| anyhow::anyhow!(PortalError::GatewayError(e.to_string())))?;
let status = res.status(); let status = res.status();

View File

@ -102,12 +102,7 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara
info!("Portal config, user_agent: {}", gp_params.user_agent()); info!("Portal config, user_agent: {}", gp_params.user_agent());
let res = client let res = client.post(&url).form(&params).send().await?;
.post(&url)
.form(&params)
.send()
.await
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?;
let status = res.status(); let status = res.status();
if status == StatusCode::NOT_FOUND { if status == StatusCode::NOT_FOUND {

View File

@ -118,12 +118,7 @@ pub async fn prelogin(portal: &str, gp_params: &GpParams) -> anyhow::Result<Prel
.user_agent(user_agent) .user_agent(user_agent)
.build()?; .build()?;
let res = client let res = client.post(&prelogin_url).form(&params).send().await?;
.post(&prelogin_url)
.form(&params)
.send()
.await
.map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?;
let status = res.status(); let status = res.status();
if status == StatusCode::NOT_FOUND { if status == StatusCode::NOT_FOUND {