Commit Graph

10 Commits

Author SHA1 Message Date
Claude
269350c1d2 Fix: Success check failing due to JSON formatting with spaces
- 'success:true' → 'success' AND 'true' 검사로 변경
- pretty-printed JSON (공백/줄바꿈 포함) 대응
- 실제로는 성공했는데 실패로 표시되던 버그 수정

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 11:38:07 +00:00
Claude
d8ce36b8a4 Fix: Improve pharmacy_code extraction with better error messages
- grep + sed 조합으로 pharmacy_code 추출 개선
- [[:space:]]로 공백 처리 추가
- 추출 실패 시 상세한 디버깅 정보 출력
  - 원인 표시
  - JSON 응답 내용 출력
  - 추출 시도 결과 표시
- 에러 메시지 명확화 (약국 생성 API 실패 vs pharmacy_code 추출 실패)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 11:35:48 +00:00
Claude
8a391cabd8 Improve: Headscale auto-register script with better JSON parsing and output
주요 개선 사항:
- Python 없이 순수 bash(tr + sed)로 JSON 파싱
- 다중 라인 JSON 응답 대응 (tr -d '\n')
- pharmacy_code 추출 로직 개선
- 결과 요약 포맷 개선 (약국 코드, 약국명, 계정 정보 명확히 표시)
- VPN 정보 섹션 분리

기술적 변경:
- sed 's/.*"pharmacy_code": "\([^"]*\)".*/\1/' 패턴 사용
- Python 의존성 제거로 더 많은 환경에서 실행 가능
- 결과 출력 포맷 사용자 친화적으로 개선

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 11:31:51 +00:00
Claude
987662f95b fix: pharmacy_code 추출 정규식 수정 (\K 미지원 환경 대응)
문제:
- grep -oP '\K' 패턴이 일부 환경에서 미지원
- pharmacy_code 추출 실패로 gateway 계정 생성 안 됨

해결:
- cut -d'"' -f4로 변경하여 호환성 향상
- 모든 grep 버전에서 작동

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:58:03 +00:00
Claude
e7485983cc fix: pharmacy_code 추출 로직 수정
문제:
- farmq API 응답에서 pharmacy_code 추출 실패
- 약국은 생성되었지만 코드를 못 가져와서 gateway 계정 생성 불가

원인:
- JSON 구조가 {"pharmacy": {"pharmacy_code": "P0005"}}인데
- 기존 패턴은 최상위 레벨만 검색

해결:
- grep -oP '"pharmacy_code":"\K[^"]+' 패턴 사용
- \K를 사용하여 매칭된 부분 이전은 제외하고 pharmacy_code 값만 추출
- success 체크 먼저 수행

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:49:55 +00:00
Claude
c2b810c6fc debug: gateway API 호출 디버깅 정보 추가
전송 데이터와 응답을 화면에 출력하여 문제 확인

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:46:01 +00:00
Claude
38c6257180 fix: 기본 비밀번호를 8자로 변경 (gateway 최소 길이 요구사항)
Gateway API의 비밀번호 최소 길이 검증(8자) 때문에
기존 "1234"에서 "12341234"로 변경

변경 사항:
- PASSWORD 변수: "1234" → "12341234"
- display_login_credentials 출력도 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:31:03 +00:00
Claude
c0973c622a fix: stdin 리다이렉션 문제 수정 (curl 파이프 실행 지원)
curl | bash 방식으로 실행 시 read 명령어가 stdin을 읽을 수 없는 문제 수정
모든 사용자 입력을 /dev/tty에서 읽도록 변경

변경 사항:
- collect_pharmacy_info() 함수의 모든 read 명령어에 </dev/tty 추가
- 이제 스크립트를 파이프로 실행해도 사용자 입력 가능

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:22:59 +00:00
Claude
9c9a25218e fix: VPN IP 확인 명령어 수정 (tailscale ip -4 사용)
문제:
- tailscale status --json으로 파싱 시도했으나 동작하지 않음
- VPN IP 할당 대기 중 10초 타임아웃 발생

해결:
- 기존 스크립트와 동일하게 'tailscale ip -4' 명령어 사용
- JSON 파싱 불필요, 직접 IPv4 주소 반환

테스트:
- tailscale ip -4 명령어로 즉시 IP 확인 가능
- 100.64.0.14 형식의 IP 정상 출력

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:15:48 +00:00
Claude
7020339867 feat: 자동 등록 스크립트를 별도 파일로 분리
변경사항:
- headscale-quick-install.sh: 기존 스크립트 유지 (단순 VPN 등록만)
- headscale-auto-register.sh: 새로운 자동 등록 스크립트 (NEW!)

headscale-auto-register.sh 기능:
- Headscale VPN 자동 등록
- VPN IP 자동 확인 (10초 재시도)
- 약국 정보 수집 (약국명 필수)
- farmq.db에 약국 자동 생성 (demo.pharmq.kr)
- gateway.db에 admin 계정 자동 생성 (gateway.pharmq.kr)
- 로그인 정보 출력 (아이디: p{code}, 비밀번호: 1234)

사용법:
# 기존 방식 (VPN만 등록)
curl -fsSL https://git.0bin.in/.../headscale-quick-install.sh | bash

# 새로운 방식 (VPN + 약국 + 계정 자동 생성)
curl -fsSL https://git.0bin.in/.../headscale-auto-register.sh | bash

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:46:51 +00:00