Add fully manual VPN mode

This commit is contained in:
2026-05-26 14:18:38 +03:00
parent c3d8e4b62f
commit f2d4f8e04b
10 changed files with 94 additions and 13 deletions

View File

@@ -85,14 +85,17 @@ for arg in "$@"; do
--patch-only) PATCH_ONLY_MODE=true ;;
--auto|auto) CONNECT_MODE="auto" ;;
--manual|manual|--manual-sso) CONNECT_MODE="manual" ;;
--manual-full|manual-full|--manual-no-autofill) CONNECT_MODE="manual-full" ;;
--help|-h)
cat <<'HELP'
Usage: vpn-lemanapro.sh [--auto|--manual] [--debug] [--json] [--status] [--configure-keychain] [--patch-only]
Usage: vpn-lemanapro.sh [--auto|--manual|--manual-full] [--debug] [--json] [--status] [--configure-keychain] [--patch-only]
--status Show current VPN status without connecting
--status --json Show current VPN status as JSON
--auto Hidden browser, auto-fill and auto-submit (default)
--manual Visible browser, auto-fill fields, do not press submit
--manual-full Visible browser, no auto-fill, do not press submit
--manual-no-autofill Compatibility alias for --manual-full
--manual-sso Compatibility alias for --manual
--debug Passthrough debug logs; also shows browser in auto mode
--json Emit JSON Lines events for UI wrappers
@@ -105,9 +108,9 @@ HELP
done
case "$CONNECT_MODE" in
auto|manual) ;;
auto|manual|manual-full) ;;
*)
printf 'Unknown VPN mode: %s. Use --auto or --manual.\n' "$CONNECT_MODE" >&2
printf 'Unknown VPN mode: %s. Use --auto, --manual, or --manual-full.\n' "$CONNECT_MODE" >&2
exit 2
;;
esac
@@ -953,6 +956,11 @@ if [[ "$CONNECT_MODE" == "manual" ]]; then
autofill_disable="0"
autofill_click="0"
_emit '{"event":"manual_sso","autofill":true,"submit":false}' "Manual mode: browser is visible, fields are auto-filled, submit is not pressed."
elif [[ "$CONNECT_MODE" == "manual-full" ]]; then
display_mode="shown"
autofill_disable="1"
autofill_click="0"
_emit '{"event":"manual_sso","autofill":false,"submit":false}' "Full manual mode: browser is visible, auto-fill is disabled, submit is not pressed."
fi
if $DEBUG; then
display_mode="shown"