Skip to content

healthcheck 블록에 TLS 프론트 내부 검증 옵션 추가 - #40

Merged
m-a-king merged 1 commit into
mainfrom
feat/healthcheck-tls-host
Aug 11, 2026
Merged

healthcheck 블록에 TLS 프론트 내부 검증 옵션 추가#40
m-a-king merged 1 commit into
mainfrom
feat/healthcheck-tls-host

Conversation

@m-a-king

@m-a-king m-a-king commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Situation

  • core 의 전환 후 프론트 검증은 박스 안에서 https://127.0.0.1/health 를 두드려야 하는데(cert 는 도메인 앞, Host 헤더 필요), healthcheck.sh 가 -k·Host 를 지원하지 않아 호출부에 raw curl 배선이 생길 참이었다 - 방금 트랙에서 없앤 복제 배선의 재발이다.

Action

  • --insecure(curl -k)·--host-header 옵션 추가. 값은 종전대로 호출부 소유, 미지정 시 기존 동작과 동일(additive).
  • 테스트 3케이스: 자가서명 TLS 인라인 서버로 insecure 부재 실패 / host-header 일치 200(헤더 전송 증명) / 미지정 421 소진.

Result

  • core 의 verify-cmd 가 extractor 와 같은 "healthcheck 블록 호출" 한 줄이 된다. 폴링·재시도·종료코드 배선의 정본은 블록 한 곳 유지.

연관 이슈

Summary by CodeRabbit

  • 새 기능
    • 헬스체크 명령에 TLS 인증서 검증을 생략할 수 있는 --insecure 옵션을 추가했습니다.
    • 요청에 사용자 지정 Host 헤더를 지정할 수 있는 --host-header <값> 옵션을 지원합니다.
    • HTTPS 환경 및 사용자 지정 호스트 설정을 포함한 헬스체크 시나리오를 검증했습니다.

- core 의 전환 후 프론트 검증(https://127.0.0.1/health, cert 는 도메인 앞)이 이 블록으로 안 돼 raw curl 배선이 호출부에 생길 참이었다. 폴링·재시도·종료코드 배선을 블록 한 곳에 유지하려 TLS 검증 생략(-k)과 Host 헤더 지정을 옵션으로 더한다
- 테스트 3케이스 추가: 자가서명 TLS 서버(인라인 핸들러)를 띄워 insecure 없이는 실패, host-header 는 서버가 Host 일치 때만 200 을 주게 해 헤더가 실제 전송됨을 증명
@m-a-king m-a-king added the feat 외부 가시적 새 기능 label Aug 11, 2026
@m-a-king m-a-king self-assigned this Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

healthcheck.sh--insecure--host-header 옵션을 추가했다. curl 요청을 배열로 구성해 옵션을 적용한다. 테스트는 자가서명 HTTPS 서버에서 인증서 검증과 Host 헤더 조건을 확인한다.

Changes

헬스체크 HTTPS 옵션 및 검증

Layer / File(s) Summary
HTTPS 요청 옵션 처리
blocks/healthcheck.sh
사용자 안내와 인자 파서에 --insecure, --host-header를 추가했다. curl 요청 배열에 TLS 검증 생략과 사용자 지정 Host 헤더를 조건부로 포함한다. 기존 URL, 타임아웃, 응답 판정 흐름은 유지한다.
자가서명 HTTPS 테스트
blocks/healthcheck.test.sh
자가서명 인증서를 사용하는 HTTPS 서버를 시작하고 종료 시 정리한다. 인증서 검증 실패, 올바른 옵션 조합 성공, Host 헤더 누락 실패를 검증한다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Healthcheck as healthcheck.sh
  participant Curl as curl
  participant Server as HTTPS test server
  Caller->>Healthcheck: --insecure 및 --host-header 전달
  Healthcheck->>Curl: 요청 옵션과 URL 전달
  Curl->>Server: HTTPS 요청
  Server-->>Curl: HTTP 상태와 응답 본문
  Curl-->>Healthcheck: 요청 결과
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 healthcheck 블록에 TLS 검증 옵션을 추가하는 주요 변경 사항을 명확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@blocks/healthcheck.sh`:
- Line 50: 인자를 받는 옵션 처리 로직에서 값 누락을 명시적으로 검증하십시오. `--host-header`를 포함한 `--url`,
`--interval`, `--attempts`, `--timeout`, `--expect-body` 각 분기에서 먼저 인자가 두 개 이상인지
확인하고, 부족하면 `exit 2`로 종료한 뒤에만 값을 설정하고 `shift 2`를 수행하도록 수정하십시오.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7ce7e6d-9be1-4d63-8044-7e6989b493d6

📥 Commits

Reviewing files that changed from the base of the PR and between 7c9c0a8 and 2519543.

📒 Files selected for processing (2)
  • blocks/healthcheck.sh
  • blocks/healthcheck.test.sh

Comment thread blocks/healthcheck.sh
--timeout) TIMEOUT="${2:-}"; shift 2;;
--expect-body) EXPECT_BODY="${2:-}"; shift 2;;
--insecure) INSECURE=1; shift 1;;
--host-header) HOST_HEADER="${2:-}"; shift 2;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# `--host-header`만 전달한 경우의 Bash shift 동작을 확인한다.
set +e
bash -c '
  set -euo pipefail
  set -- --host-header
  case "$1" in
    --host-header) HOST_HEADER="${2:-}"; shift 2;;
  esac
' 
status=$?
set -e

printf 'parser exit status: %s\n' "$status"
test "$status" -ne 2

Repository: TeamPiKi/infra

Length of output: 174


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- blocks/healthcheck.sh ---'
nl -ba blocks/healthcheck.sh | sed -n '1,130p'

printf '%s\n' '--- required-value option handlers ---'
rg -n -C 2 -- '--host-header|--url|--timeout|shift 2|requires a value|argument' blocks/healthcheck.sh

Repository: TeamPiKi/infra

Length of output: 222


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- blocks/healthcheck.sh ---'
awk '{printf "%5d %s\n", NR, $0}' blocks/healthcheck.sh | sed -n '1,130p'

printf '%s\n' '--- required-value option handlers ---'
grep -n -C 2 -E -- '--host-header|--url|--timeout|shift 2|requires a value|argument' blocks/healthcheck.sh || true

Repository: TeamPiKi/infra

Length of output: 4980


값을 받는 옵션의 인자 누락을 처리하십시오.

--host-header만 전달하면 shift 2가 실패하고 종료 코드 1을 반환합니다. --url, --interval, --attempts, --timeout, --expect-body도 같은 문제가 있습니다. 각 옵션에서 $# -ge 2를 검사하고, 값이 없으면 exit 2로 종료하십시오.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@blocks/healthcheck.sh` at line 50, 인자를 받는 옵션 처리 로직에서 값 누락을 명시적으로 검증하십시오.
`--host-header`를 포함한 `--url`, `--interval`, `--attempts`, `--timeout`,
`--expect-body` 각 분기에서 먼저 인자가 두 개 이상인지 확인하고, 부족하면 `exit 2`로 종료한 뒤에만 값을 설정하고
`shift 2`를 수행하도록 수정하십시오.

@m-a-king
m-a-king merged commit 9359ba2 into main Aug 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 외부 가시적 새 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant