Add fully manual VPN mode
This commit is contained in:
@@ -66,13 +66,16 @@ grep -q '"event":"waiting"' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q -- '--patch-only' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q -- '--auto' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q -- '--manual' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q -- '--manual-full' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q -- '--manual-sso' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q 'LEMANA_VPN_AUTOFILL_DISABLE' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q 'LEMANA_VPN_AUTOFILL_CLICK' "$ROOT/bin/vpn-lemanapro.sh"
|
||||
grep -q 'vpn-auto' "$ROOT/install.sh"
|
||||
grep -q 'vpn-manual' "$ROOT/install.sh"
|
||||
grep -q 'vpn-manual-full' "$ROOT/install.sh"
|
||||
grep -q 'connect(mode: .auto)' "$ROOT/app/Sources/LemanaVPN/LemanaVPNApp.swift"
|
||||
grep -q 'connect(mode: .manual)' "$ROOT/app/Sources/LemanaVPN/LemanaVPNApp.swift"
|
||||
grep -q 'connect(mode: .manualFull)' "$ROOT/app/Sources/LemanaVPN/LemanaVPNApp.swift"
|
||||
grep -q 'enum VPNLaunchMode' "$ROOT/app/Sources/LemanaVPN/VPNManager.swift"
|
||||
grep -q 'struct Credentials: Decodable' "$ROOT/app/Sources/LemanaVPN/VPNManager.swift"
|
||||
grep -q 'credential_source' "$ROOT/app/Sources/LemanaVPN/VPNManager.swift"
|
||||
@@ -235,6 +238,51 @@ if printf '%s\n' "$manual_output" | grep -q 'Cleaning up VPN DNS'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fake_path_bin="$TMP_DIR/fake-path-bin"
|
||||
mkdir -p "$fake_path_bin"
|
||||
cat > "$fake_path_bin/security" <<'SH'
|
||||
#!/bin/sh
|
||||
if [ "${1:-}" = "find-generic-password" ]; then
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
SH
|
||||
chmod +x "$fake_path_bin/security"
|
||||
|
||||
fake_oc_bin="$TMP_DIR/fake-openconnect-lite"
|
||||
manual_full_capture="$TMP_DIR/manual-full-capture"
|
||||
cat > "$fake_oc_bin" <<'SH'
|
||||
#!/bin/sh
|
||||
{
|
||||
printf 'args=%s\n' "$*"
|
||||
printf 'autofill_disable=%s\n' "${LEMANA_VPN_AUTOFILL_DISABLE:-}"
|
||||
printf 'autofill_click=%s\n' "${LEMANA_VPN_AUTOFILL_CLICK:-}"
|
||||
} > "$LEMANA_VPN_CAPTURE_LAUNCH"
|
||||
exit 0
|
||||
SH
|
||||
chmod +x "$fake_oc_bin"
|
||||
|
||||
manual_full_output="$(
|
||||
HOME="$HOME" \
|
||||
PATH="$fake_path_bin:$PATH" \
|
||||
LEMANA_VPN_USERNAME="lemana-manual-full-$$" \
|
||||
LEMANA_VPN_CREDENTIAL_SOURCE=keychain \
|
||||
LEMANA_VPN_OC_BIN="$fake_oc_bin" \
|
||||
LEMANA_VPN_OC_PYTHON=python3 \
|
||||
LEMANA_VPN_WEBENGINE_PROCESS="$fake_webengine" \
|
||||
LEMANA_VPN_AUTHENTICATOR="$fake_authenticator" \
|
||||
LEMANA_VPN_PATCH_BACKUP_DIR="$TMP_DIR/manual-full-patch-backups" \
|
||||
LEMANA_VPN_DNS_CLEANUP="$TMP_DIR/no-dns-cleanup" \
|
||||
LEMANA_VPN_CONNECT_LOG="$TMP_DIR/manual-full.log" \
|
||||
LEMANA_VPN_CAPTURE_LAUNCH="$manual_full_capture" \
|
||||
bash "$ROOT/bin/vpn-lemanapro.sh" --manual-full --json
|
||||
)"
|
||||
|
||||
printf '%s\n' "$manual_full_output" | grep -q '"event":"manual_sso","autofill":false,"submit":false'
|
||||
grep -q -- '--browser-display-mode shown' "$manual_full_capture"
|
||||
grep -q '^autofill_disable=1$' "$manual_full_capture"
|
||||
grep -q '^autofill_click=0$' "$manual_full_capture"
|
||||
|
||||
fake_oc_python="$TMP_DIR/fake-oc-python"
|
||||
captured_totp="$TMP_DIR/captured-totp"
|
||||
cat > "$fake_oc_python" <<'SH'
|
||||
|
||||
Reference in New Issue
Block a user