From fa3ac73fbec487e10c701a6ddbffa65242b4eac0 Mon Sep 17 00:00:00 2001 From: "kihwan.song" Date: Mon, 13 Jul 2026 17:22:36 +0900 Subject: [PATCH] =?UTF-8?q?vpn=20=EB=94=94=EB=B2=84=EA=B7=B8=20otp-only=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect-vpn/action.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/connect-vpn/action.yml b/connect-vpn/action.yml index aa7ccea..c49337d 100644 --- a/connect-vpn/action.yml +++ b/connect-vpn/action.yml @@ -38,6 +38,10 @@ inputs: required: false default: "false" description: "true면 seed 검증용으로 생성된 OTP를 로그에 출력합니다. 확인 후 즉시 false로 되돌리세요." + debug-otp-only: + required: false + default: "false" + description: "true면 생성된 OTP만 출력하고 VPN 로그인은 시도하지 않습니다." resource-name: required: false @@ -114,6 +118,7 @@ runs: OTP_SEED: ${{ inputs.otp-seed }} OTP_SEED_FORMAT: ${{ inputs.otp-seed-format }} DEBUG_OTP: ${{ inputs.debug-otp }} + DEBUG_OTP_ONLY: ${{ inputs.debug-otp-only }} RESOURCE_NAME: ${{ inputs.resource-name }} TIMEOUT: ${{ inputs.timeout }} run: | @@ -186,6 +191,13 @@ runs: curl -k -sS --http1.1 -A "$UA" "$@" } + debug_print_otps() { + echo "DEBUG OTP 확인용 코드 (unix-time=$(date +%s))" + for otp_offset in 0 -1 1; do + echo "DEBUG generated OTP offset=${otp_offset}: $(totp "$otp_offset")" + done + } + summarize_html() { page="$1" if [ ! -f "$page" ]; then @@ -220,6 +232,12 @@ runs: exit 1 fi + if [ "$DEBUG_OTP_ONLY" = "true" ]; then + debug_print_otps + echo "debug-otp-only=true 이므로 VPN 로그인 시도 없이 종료합니다." + exit 0 + fi + host_no_scheme="${VPN_HOST#https://}" host_no_scheme="${host_no_scheme#http://}" host_no_scheme="${host_no_scheme%%/*}"