fix: Tailscale HTTPS 프로브로 전환 — mixed content 해결 #56

Merged
xhh merged 1 commit from fix/tailscale-probe-https into main 2026-04-24 19:52:10 +09:00
Owner

v0.3.3 까지의 /API_Keys 빈 화면 버그 해결.

  • ADMIN_PROBE_URL env 로 HTTPS 프로브 URL 주입 (예: https://ugreen-nas.<tailnet>.ts.net:8501/_stcore/health)
  • JS 가 window.parent.location 조작해 부모 URL 에 ?tailscale=0|1 세팅 (이전 iframe 격리 버그 수정)
  • 프로브 URL 미설정 시 사이드바 수동 토글 fallback
  • 보안 게이트는 변함없이 서버측 require_private_origin + write 키가 담당

운영자 작업: Tailscale admin DNS 탭에서 tailnet 이름 확인 후 Secrets 에 ADMIN_PROBE_URL 추가 → v0.3.4 재배포.

v0.3.3 까지의 /API_Keys 빈 화면 버그 해결. - `ADMIN_PROBE_URL` env 로 HTTPS 프로브 URL 주입 (예: `https://ugreen-nas.<tailnet>.ts.net:8501/_stcore/health`) - JS 가 `window.parent.location` 조작해 부모 URL 에 `?tailscale=0|1` 세팅 (이전 iframe 격리 버그 수정) - 프로브 URL 미설정 시 사이드바 수동 토글 fallback - 보안 게이트는 변함없이 서버측 `require_private_origin` + write 키가 담당 운영자 작업: Tailscale admin DNS 탭에서 tailnet 이름 확인 후 Secrets 에 `ADMIN_PROBE_URL` 추가 → v0.3.4 재배포.
fix: Tailscale HTTPS 프로브로 전환 — mixed content 차단 해결
All checks were successful
Tests (PR) / pytest (pull_request) Successful in 27s
84dbd4f671
v0.3.3 까지의 문제: 공개 URL(HTTPS) 에서 `/API_Keys` 접속 시 빈 화면.
원인 2개:

1. Mixed content: HTTPS 페이지에서 `http://100.100.100.100/` fetch 는
   브라우저가 원천 차단 → 프로브가 항상 실패 방향으로 떨어짐.
2. iframe 격리: `components.html()` 이 만드는 iframe 안에서
   `window.location.replace(...)` 호출해도 iframe 만 이동, 부모 URL 에
   `?tailscale=0|1` 세팅이 안 돼 probe_and_store 가 무한 `st.stop()` 호출.

Tailscale HTTPS Certificates (Let's Encrypt 자동 발급) 활성화를 전제로
프로브 URL 을 env 로 주입받는 방식으로 변경:

- `ADMIN_PROBE_URL` 환경변수 (예:
  `https://ugreen-nas.<tailnet>.ts.net:8501/_stcore/health`)
- JS 는 이 URL 로 no-cors fetch — HTTPS → HTTPS 라 mixed content OK
- Tailscale on: DNS 해석 + 100.x.x.x 도달 + 유효 cert → 성공
- Tailscale off: DNS 는 풀리지만 라우팅 안 됨 → 타임아웃
- 성공/실패 결과를 `window.parent.location` 의 query param 으로 세팅
  (부모 창 이동 — iframe 버그 수정)
- 소비한 `?tailscale=...` 은 파싱 후 URL 에서 제거 (새로고침 시 재프로브)

프로브 URL 미설정 시 fallback:
- 사이드바에 "🔓 Tailscale 사용 중" 수동 체크박스 노출
- 체크해도 실제 admin API 는 서버측 `require_private_origin` 이 차단하므로
  공개 네트워크에서 UI 만 보일 뿐 실제 조작 불가

운영자 작업
----------
1. Tailscale admin console → HTTPS Certificates 활성 (이미 완료)
2. `<tailnet>` 이름 확인 (Tailscale admin DNS 탭)
3. Forgejo Secrets 에 `ADMIN_PROBE_URL` 추가:
   `https://ugreen-nas.<tailnet>.ts.net:8501/_stcore/health`
4. v0.3.4 태그 → 재배포

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xhh merged commit ef27db5caf into main 2026-04-24 19:52:10 +09:00
xhh deleted branch fix/tailscale-probe-https 2026-04-24 19:52:11 +09:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xhh/financial-data-platform!56
No description provided.