vpn 디버그 otp-only 옵션 추가
This commit is contained in:
@@ -38,6 +38,10 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
description: "true면 seed 검증용으로 생성된 OTP를 로그에 출력합니다. 확인 후 즉시 false로 되돌리세요."
|
description: "true면 seed 검증용으로 생성된 OTP를 로그에 출력합니다. 확인 후 즉시 false로 되돌리세요."
|
||||||
|
debug-otp-only:
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
description: "true면 생성된 OTP만 출력하고 VPN 로그인은 시도하지 않습니다."
|
||||||
|
|
||||||
resource-name:
|
resource-name:
|
||||||
required: false
|
required: false
|
||||||
@@ -114,6 +118,7 @@ runs:
|
|||||||
OTP_SEED: ${{ inputs.otp-seed }}
|
OTP_SEED: ${{ inputs.otp-seed }}
|
||||||
OTP_SEED_FORMAT: ${{ inputs.otp-seed-format }}
|
OTP_SEED_FORMAT: ${{ inputs.otp-seed-format }}
|
||||||
DEBUG_OTP: ${{ inputs.debug-otp }}
|
DEBUG_OTP: ${{ inputs.debug-otp }}
|
||||||
|
DEBUG_OTP_ONLY: ${{ inputs.debug-otp-only }}
|
||||||
RESOURCE_NAME: ${{ inputs.resource-name }}
|
RESOURCE_NAME: ${{ inputs.resource-name }}
|
||||||
TIMEOUT: ${{ inputs.timeout }}
|
TIMEOUT: ${{ inputs.timeout }}
|
||||||
run: |
|
run: |
|
||||||
@@ -186,6 +191,13 @@ runs:
|
|||||||
curl -k -sS --http1.1 -A "$UA" "$@"
|
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() {
|
summarize_html() {
|
||||||
page="$1"
|
page="$1"
|
||||||
if [ ! -f "$page" ]; then
|
if [ ! -f "$page" ]; then
|
||||||
@@ -220,6 +232,12 @@ runs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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="${VPN_HOST#https://}"
|
||||||
host_no_scheme="${host_no_scheme#http://}"
|
host_no_scheme="${host_no_scheme#http://}"
|
||||||
host_no_scheme="${host_no_scheme%%/*}"
|
host_no_scheme="${host_no_scheme%%/*}"
|
||||||
|
|||||||
Reference in New Issue
Block a user