diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c7e5319..5f6e75f5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,6 +9,8 @@ on: branches: - main - dev + - hotfix/* + - feature/* tags: - latest - v*.*.* @@ -42,6 +44,7 @@ jobs: with: token: ${{ secrets.GH_PAT }} repository: yuezk/GlobalProtect-openconnect + ref: ${{ github.ref }} path: source/gp - name: Create tarball run: | @@ -95,12 +98,14 @@ jobs: with: token: ${{ secrets.GH_PAT }} repository: yuezk/GlobalProtect-openconnect + ref: ${{ github.ref }} path: gpgui-source/gp - name: Checkout gpgui uses: actions/checkout@v3 with: token: ${{ secrets.GH_PAT }} repository: yuezk/gpgui + ref: ${{ github.ref_name }} path: gpgui-source/gpgui - name: Tarball run: | diff --git a/apps/gpclient/src/connect.rs b/apps/gpclient/src/connect.rs index 639501be..62ed2af1 100644 --- a/apps/gpclient/src/connect.rs +++ b/apps/gpclient/src/connect.rs @@ -153,7 +153,7 @@ impl<'a> ConnectHandler<'a> { } async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> { - info!("Treat the portal as the gateway, connecting..."); + info!("Performing the gateway authentication..."); let mut gp_params = self.build_gp_params(); gp_params.set_is_gateway(true); diff --git a/crates/gpapi/src/error.rs b/crates/gpapi/src/error.rs index 972374e1..712e6794 100644 --- a/crates/gpapi/src/error.rs +++ b/crates/gpapi/src/error.rs @@ -6,6 +6,6 @@ pub enum PortalError { PreloginError(String), #[error("Portal config error: {0}")] ConfigError(String), - #[error("Gateway error: {0}")] - GatewayError(String), + #[error("Network error: {0}")] + NetworkError(String), } diff --git a/crates/gpapi/src/gateway/login.rs b/crates/gpapi/src/gateway/login.rs index a315fde7..233082f8 100644 --- a/crates/gpapi/src/gateway/login.rs +++ b/crates/gpapi/src/gateway/login.rs @@ -34,7 +34,7 @@ pub async fn gateway_login(gateway: &str, cred: &Credential, gp_params: &GpParam .form(¶ms) .send() .await - .map_err(|e| anyhow::anyhow!(PortalError::GatewayError(e.to_string())))?; + .map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?; let status = res.status(); diff --git a/crates/gpapi/src/portal/config.rs b/crates/gpapi/src/portal/config.rs index b68b5972..8beaf13f 100644 --- a/crates/gpapi/src/portal/config.rs +++ b/crates/gpapi/src/portal/config.rs @@ -102,7 +102,12 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara info!("Portal config, user_agent: {}", gp_params.user_agent()); - let res = client.post(&url).form(¶ms).send().await?; + let res = client + .post(&url) + .form(¶ms) + .send() + .await + .map_err(|e| anyhow::anyhow!(PortalError::NetworkError(e.to_string())))?; let status = res.status(); if status == StatusCode::NOT_FOUND { diff --git a/crates/gpapi/src/portal/prelogin.rs b/crates/gpapi/src/portal/prelogin.rs index c8444ba6..37e50c83 100644 --- a/crates/gpapi/src/portal/prelogin.rs +++ b/crates/gpapi/src/portal/prelogin.rs @@ -118,7 +118,12 @@ pub async fn prelogin(portal: &str, gp_params: &GpParams) -> anyhow::Result