mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
feat: add prebuilt Nix package
This commit is contained in:
11 files changed
+309
-71
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use std::process::Stdio;
|
||||
use std::{path::PathBuf, process::Stdio};
|
||||
|
||||
use anyhow::bail;
|
||||
use common::constants::GP_AUTH_BINARY;
|
||||
use common::binary_paths;
|
||||
use tokio::process::Command;
|
||||
|
||||
use crate::{auth::SamlAuthResult, credential::Credential, os_profile::OsProfile};
|
||||
@@ -113,8 +113,11 @@ impl<'a> SamlAuthLauncher<'a> {
|
||||
|
||||
/// Launch the authenticator binary as the current user or SUDO_USER if available.
|
||||
pub async fn launch(self) -> anyhow::Result<Credential> {
|
||||
let program = self.auth_executable.unwrap_or(GP_AUTH_BINARY);
|
||||
let mut auth_cmd = Command::new(program);
|
||||
let program = self
|
||||
.auth_executable
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(binary_paths::gpauth);
|
||||
let mut auth_cmd = Command::new(&program);
|
||||
auth_cmd.arg(self.server);
|
||||
|
||||
if self.gateway {
|
||||
@@ -174,7 +177,7 @@ impl<'a> SamlAuthLauncher<'a> {
|
||||
let child = match child {
|
||||
Ok(child) => child,
|
||||
Err(err) => {
|
||||
bail!("Failed to spawn {}: {}", program, err);
|
||||
bail!("Failed to spawn {}: {}", program.display(), err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{collections::HashMap, path::PathBuf, process::Stdio};
|
||||
|
||||
use anyhow::bail;
|
||||
use common::constants::GP_GUI_HELPER_BINARY;
|
||||
use common::binary_paths;
|
||||
use log::info;
|
||||
use tokio::{io::AsyncWriteExt, process::Command};
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct GuiHelperLauncher<'a> {
|
||||
impl<'a> GuiHelperLauncher<'a> {
|
||||
pub fn new(api_key: &'a [u8]) -> Self {
|
||||
Self {
|
||||
program: GP_GUI_HELPER_BINARY.into(),
|
||||
program: binary_paths::gpgui_helper(),
|
||||
envs: None,
|
||||
api_key,
|
||||
gui_version: None,
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::bail;
|
||||
use common::constants::GP_GUI_BINARY;
|
||||
use common::binary_paths;
|
||||
use log::info;
|
||||
use tokio::{io::AsyncWriteExt, process::Command};
|
||||
|
||||
@@ -25,7 +25,7 @@ impl<'a> GuiLauncher<'a> {
|
||||
pub fn new(version: &'a str, api_key: &'a [u8]) -> Self {
|
||||
Self {
|
||||
version,
|
||||
program: GP_GUI_BINARY.into(),
|
||||
program: binary_paths::gpgui(),
|
||||
api_key,
|
||||
minimized: false,
|
||||
envs: None,
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::{
|
||||
process::{ExitStatus, Stdio},
|
||||
};
|
||||
|
||||
use common::constants::GP_SERVICE_BINARY;
|
||||
use common::binary_paths;
|
||||
use tokio::process::Command;
|
||||
|
||||
use super::command_traits::CommandExt;
|
||||
@@ -26,7 +26,7 @@ impl Default for ServiceLauncher<'_> {
|
||||
impl<'a> ServiceLauncher<'a> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
program: GP_SERVICE_BINARY.into(),
|
||||
program: binary_paths::gpservice(),
|
||||
minimized: false,
|
||||
env_file: None,
|
||||
log_file: None,
|
||||
|
||||
Reference in new issue
Block a user