Commit Graph

55 Commits

Author SHA1 Message Date
Claude
59a10f48e5 Fix bash syntax error in pipe execution
read 명령의 파이프 호환성 문제 수정:
- `< /dev/tty` 제거 (파이프 환경에서 오류 발생)
- `-p` 옵션을 별도 echo로 분리
- 에러 출력 억제로 안정성 향상

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 14:20:02 +00:00
Claude
85c5f7f930 Add PBS auto restore script for VM 103 to 203
자동화된 PBS 복구 스크립트 추가:
- VM 103 백업을 VM 203으로 자동 복구
- 사용자 입력 최소화 (대부분 자동 처리)
- 고정 설정: source=103, target=203, storage=local-lvm
- 기존 VM 자동 삭제 및 재등록 지원

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 14:17:39 +00:00
Claude
aede1e9197 Fix Korean character encoding in config parsing
UTF-8 인코딩 명시적 지정:
- open() 함수에 encoding='utf-8' 추가
- 약국 이름이 잘리는 문제 해결 (예: 태령약 → 태령약국)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 14:02:42 +00:00
Claude
545ad63b50 Sort VM list by vmid for better readability
VM 목록을 vmid 순서로 정렬:
- running_vms.sort(key=lambda x: x['vmid']) 추가
- 201, 202, 203 순서로 표시되도록 개선

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 14:00:16 +00:00
Claude
5fa7812009 Improve VM selection prompts for clarity
사용자 안내 메시지 개선:
- VM 선택 시 예시 추가 (예: 201-SERVER를 선택하려면 '1' 입력)
- 프롬프트 메시지 명확화 (목록 번호 1, 2, 3 중 선택)
- VM2 선택 시 안내 강화 (VM1과 다른 번호)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:36:50 +00:00
Claude
d975723268 Fix array access for nounset mode
배열 접근 시 nounset 오류 수정:
- VM_INFO 배열 체크 시 parameter expansion 사용
- set -euo pipefail의 -u 옵션 호환성 개선

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:35:33 +00:00
Claude
eb4097e66e Update pharmq-novnc-setup.sh for Ubuntu VM installation
Proxmox API를 통한 VM 목록 조회로 변경:
- Ubuntu VM에서 실행되도록 수정
- Proxmox API를 통해 VM 목록 가져오기
- VNC 포트를 API로 조회
- 환경 자동 감지 (Proxmox Host vs Ubuntu VM)
- 기본 Proxmox 호스트 IP: 192.168.0.200

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:21:15 +00:00
Claude
1841d72ac3 Add PharmQ noVNC auto-installation script
대화형 curl 설치 스크립트 추가:
- VNC/ 폴더 생성
- pharmq-novnc-setup.sh: 대화형 설치 스크립트
  * VM 자동 감지 및 선택
  * 약국 정보 입력
  * Python 가상환경 자동 구성
  * systemd 서비스 자동 등록
  * 방화벽 설정 옵션
  * 재설치 및 업데이트 지원
- README.md: 설치 가이드 및 문서

RDP 스크립트와 동일한 패턴으로 구현
사용법: curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/VNC/pharmq-novnc-setup.sh | bash

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:17:16 +00:00
Claude
86e34d6916 Fix PBS API namespace: Add ns=PQ parameter to all API calls
모든 PBS API 호출에 ns=PQ 파라미터를 추가하여 PQ 네임스페이스의 백업만 조회하도록 수정

- groups API에 ns=PQ 추가
- snapshots API에 ns=PQ 추가 (get_snapshot_comment 함수)
- snapshots API에 ns=PQ 추가 (get_latest_snapshot 함수)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 01:35:43 +00:00
root
05a063eb1e Add PQ namespace to PBS storage registration
PBS 스토리지 등록 시 자동으로 PQ 네임스페이스를 지정하도록 개선했습니다.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 11:38:34 +09:00
Claude
267d262eb3 Simplify RDP config editor: auto-set local user to rdpuser
Changes:
- Remove local user prompt from config editor
- Auto-set local_user to "rdpuser" (default value)
- Display "(자동 설정)" label for local user in confirmation
- Fix "알 수 없음" display: show "설정되지 않음" for unset values
- Improve prompts: show "(Enter=유지)" or example values

This simplifies the config editing process since local_user
is always rdpuser by default in our setup.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 04:29:31 +00:00
Claude
fbea9419c3 Add RDP config editor to all-in-one installer rerun menu
When rerunning the installer on existing setup:
- Display current RDP configuration (server, username, local user)
- Add option 2: "RDP 설정 수정" to modify settings
- Allow editing: RDP server, username, password, local user
- Show current values as defaults (press Enter to keep)
- Update both /var/lib/rdp-toggle/config.json and .xinitrc
- After update, show toggle menu to apply changes

Menu options on rerun:
1. RDP toggle menu
2. Edit RDP settings (NEW)
3. Reinstall
4. Exit

This allows users to easily change RDP target without reinstalling.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 04:27:30 +00:00
Claude
86eb7ea806 Fix: Save user-input RDP config to API instead of using hardcoded values
Problem:
- All-in-one installer collected RDP connection info from user
- But API was using hardcoded DEFAULT_CONFIG values
- User's input was ignored by the API

Solution:
- Save user's RDP configuration to /var/lib/rdp-toggle/config.json
- API loads this config instead of hardcoded defaults
- Config includes: rdp_server, rdp_username, rdp_password, local_user

Now the API will use the actual RDP settings the user entered during installation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 04:26:31 +00:00
Claude
d02883256f Add rerun detection and toggle menu to all-in-one RDP installer
When script is rerun on already-installed system:
- Detect existing RDP setup (API + getty config)
- Show menu with 3 options:
  1) RDP toggle menu - Interactive RDP/Shell switching
  2) Reinstall - Overwrite existing setup
  3) Exit

Toggle menu features:
- Switch between RDP and Shell modes
- Check current status
- Loop until user exits
- Uses same API as standalone installer

This turns the installer into a convenient RDP control tool on rerun.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 03:05:29 +00:00
Claude
e7d5dd02d2 Improve RDP API installer with rerun detection
Changes:
- Detect if RDP Toggle API is already installed and running
- Show test menu immediately on rerun (no reinstallation)
- Add option 3 (status check) and option 4 (exit) to test menu
- Extract test menu to reusable function show_test_menu()
- Both fresh install and rerun show same interactive test menu

Now users can easily test RDP toggle by simply rerunning the installer script.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 03:00:55 +00:00
Claude
1977d21a9b Add interactive testing menu to RDP API installer
Add post-installation testing menu with options to:
1) Test RDP mode activation
2) Test Shell mode activation
3) Skip testing

This allows users to immediately test API functionality after installation
without manually typing curl commands. The menu uses the installed API
to toggle modes and displays current status after each action.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 02:32:14 +00:00
Claude
2bf3754d62 Improve IP detection: prioritize Headscale VPN IP
- Added get_primary_ip() helper function
- Prioritize Headscale VPN IP (100.64.x.x) detection
- Fallback to local IP if Headscale not available
- Applied to both proxmox-auto-rdp-setup.sh and install-rdp-api.sh
- More reliable IP display for API endpoint

This ensures VPN IP is shown when available, making remote access
more reliable and predictable.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 01:58:43 +00:00
Claude
41e9fa1056 README 업데이트: RDP 올인원 설정 강조 및 통합 방식 설명
- 기존 '초기 설정'을 '올인원 설정 (권장)'으로 변경
- API 자동 설치 및 API 기반 활성화 명시
- 주요 특징 강조:
  * API 작동 = RDP 제어 가능 보장
  * 즉시 적용 옵션 (재부팅 불필요)
  * 원격 Shell/RDP 모드 전환 가능
- API 단독 설치는 이미 초기 설정 완료된 경우만 사용하도록 안내
2025-11-17 01:41:30 +00:00
Claude
9c952449d9 RDP 초기 설정에 API 자동 설치 및 API 기반 활성화 추가
- install_rdp_api() 함수 추가 (자동 API 설치)
- RDP 활성화 시 API를 통해 모드 전환 (curl POST /toggle)
- API 작동 = RDP 제어 가능 보장
- API 실패 시 자동으로 직접 활성화 fallback
- 설정 요약에 API 설치 상태 표시
- 수동 적용 안내에 API 명령어 포함

장점:
- API 없이 RDP만 켜지는 상황 방지
- 항상 원격 제어 가능한 상태 보장
- 사용자가 두 스크립트 따로 실행할 필요 없음
2025-11-17 01:40:59 +00:00
Claude
85c5e1ec29 RDP 초기 설정 스크립트 재부팅 대신 즉시 적용 옵션 추가
- 재부팅 없이 getty@tty1 서비스 재시작으로 즉시 적용 가능
- 사용자에게 3가지 선택 옵션 제공:
  1) 즉시 적용 (systemctl restart getty@tty1, 권장)
  2) 시스템 재부팅
  3) 나중에 수동 적용
- systemd daemon-reload 추가로 설정 파일 변경사항 즉시 반영
- 사용자 경험 개선 (불필요한 재부팅 방지)
2025-11-17 01:19:46 +00:00
Claude
13b1da4ee0 RDP 초기 설정 스크립트 패키지 확인 로직 개선
- dpkg 기반 확인에서 command -v 기반 확인으로 변경
- 실제 실행 파일 존재 여부로 설치 확인
- 패키지 이름 매칭 문제 해결
- 확인 실패 시 에러 대신 경고 후 계속 진행
- 검증 대상: startx, openbox, xfreerdp3, unclutter

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 01:06:18 +00:00
Claude
ccd34c7f54 RDP 초기 설정 스크립트 입력 처리 수정 (curl | bash 지원)
- 모든 read 명령에 </dev/tty 추가
- curl | bash 실행 시 표준 입력 문제 해결
- 파이프로 실행해도 사용자 입력 정상 작동
- 5개 입력 포인트 모두 수정:
  - RDP 서버 주소
  - RDP 사용자명
  - RDP 패스워드 (2회)
  - 로컬 사용자명
  - 설정 확인
  - 네트워크 연결 실패 시 계속 진행 여부
  - 재부팅 확인

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 01:02:31 +00:00
Claude
d0c8b26138 RDP 초기 설정 스크립트 버전 체크 로직 개선
- Proxmox 버전 확인 시 에러 처리 강화
- pveversion 명령 출력 형식 다양하게 지원
- 버전 확인 실패 시 경고 후 계속 진행
- 정규표현식으로 버전 번호 추출 개선
- 숫자 검증 로직 추가

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 00:53:11 +00:00
Claude
4934b0a8f9 RDP 자동화 시스템 문서 및 설치 스크립트 개선
- install-rdp-api.sh: curl 원라이너 설치 지원
  - requirements.txt 의존성 제거 (패키지 버전 스크립트 내장)
  - rdp-toggle-api.py Gitea에서 자동 다운로드
  - 상세한 설치 완료 메시지 추가

- RDP/README.md: 완전히 재구성
  - curl 원라이너 설치 가이드 추가
  - API 엔드포인트 상세 설명 및 응답 예시
  - React 프론트엔드 연동 예시 개선
  - 문제 해결 섹션 추가
  - 네트워크 설정 및 방화벽 가이드

- README.md: RDP 자동화 섹션 추가
  - Proxmox RDP 초기 설정 스크립트 소개
  - RDP Toggle API 설치 가이드
  - API 사용 예시 추가

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 00:42:19 +00:00
c6919abf1c Add RDP Toggle API with venv support
RDP 관련 파일들을 RDP 폴더로 정리하고 API 시스템 추가

주요 변경사항:
- FastAPI 기반 RDP/Shell 모드 전환 API 서버 추가
- venv 환경을 사용하는 자동 설치 스크립트
- requirements.txt로 패키지 의존성 관리
- systemd 서비스로 자동 시작 설정
- CORS 지원으로 외부 프론트엔드 연동 가능
- 실시간 상태 모니터링 API
- 웹 기반 컨트롤 패널 포함

파일 구성:
- rdp-toggle-api.py: FastAPI REST API 서버
- install-rdp-api.sh: venv 환경 자동 설치
- requirements.txt: Python 패키지 의존성
- rdp-toggle-web.html: 웹 컨트롤 패널
- README.md: 사용 가이드

API 기능:
- GET /status: 현재 모드 확인
- POST /toggle: RDP/Shell 모드 전환
- GET /config: 설정 확인
- PUT /config: 설정 업데이트

리액트 프론트엔드에서 토글로 화면 모드 제어 가능

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 09:14:41 +09:00
1f926d6b35 Add Proxmox Auto RDP Setup script
- Automated RDP connection setup for Proxmox VE hosts
- Full-screen RDP client with auto-login configuration
- X11 and FreeRDP3 integration
2025-11-17 08:52:28 +09:00
f5a7c7f695 Add 시간교정.md 2025-11-15 19:26:05 +09:00
Claude
4f7929fc61 약국 생성 시 장비 자동 등록 기능 추가
## 주요 변경사항

### 1. 장비 타입 자동 감지 (detect_device_info)
- Proxmox Host, Windows PC (WSL), macOS, Linux Server 자동 구분
- 호스트명 자동 수집
- 장비명 자동 생성 (예: "테스트약국 Proxmox Host")

### 2. API 호출 개선
- farmq-admin API(/api/pharmacy)에 장비 정보 전송
  - device_type: proxmox_host/windows_pc/mac/linux_server
  - device_name: 자동 생성된 장비명
  - hostname: 시스템 호스트명
- 응답에서 device_registered 확인 및 사용자 피드백

### 3. 출력 개선
- 장비 감지 정보 실시간 출력
- 최종 완료 메시지에 장비 정보 추가

## 백엔드 연동
- farmq-admin/app.py에서 pharmacy_devices 테이블 자동 등록
- 첫 장비는 자동으로 is_primary=TRUE 설정
- device_role: main_server로 고정

## 테스트
- 문법 검사 완료 (bash -n)
- Proxmox Host 환경에서 테스트 준비 완료

🤖 Generated with Claude Code
2025-11-15 10:20:38 +00:00
02137c50a8 Fix stdin issue for curl | bash execution
pbs_allinone.sh 입력 문제 수정:
- 모든 read -p 명령어에 < /dev/tty 추가
- curl | bash 실행 시 stdin 소진 문제 해결
- 사용자 입력이 정상적으로 작동하도록 수정

수정된 read 명령어:
- PBS 스토리지 재등록 확인
- 백업 타입 입력 (vm/ct)
- 백업 ID 입력
- 복구 VM/CT ID 입력
- 저장 스토리지 입력
- 복구 확인
- 기존 VM/CT 삭제 확인
- VM/CT 시작 확인

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 00:37:27 +00:00
Claude
1c6e6dcf56 pbs_allinone.sh: 스토리지 선택 개선
- 복구 시 사용 가능한 스토리지 목록 자동 표시
- 스토리지 존재 여부 및 VM/CT 이미지 저장 가능 여부 검증
- 잘못된 스토리지 입력 시 재입력 요청
- 스토리지 용량 및 사용률 정보 표시 (GB 단위)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 23:32:23 +09:00
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
ae1782a6de fix: P001, P002 약국 보호 로직 추가
문제:
- cleanup 스크립트가 P0003 이후 삭제 시 P001, P002도 함께 삭제됨
- 문자열 비교 'P001' >= 'P0003'이 true로 평가됨

원인:
- SQLite 문자열 비교에서 'P001' < 'P0003'이지만
- 'P002' >= 'P0003'은 false인데, 기존 조건이 잘못됨

해결:
- LENGTH(pharmacy_code) = 5 조건 추가
- P0003 <= pharmacy_code <= P9999 범위 명시
- P001, P002 (4자), P0001, P0002 (5자) 모두 보호

변경 파일:
- cleanup-test-data.sh: 삭제 쿼리 수정
- CLEANUP_TEST_DATA.md: 문서 업데이트

보호되는 약국:
- P001: default 약국 (4자)
- P002: 새서울약국 (4자)
- P0002: 청춘약국 (5자, 범위 밖)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:53:59 +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
a3fd18b1b0 docs: 테스트 데이터 정리 가이드 및 자동화 스크립트 추가
테스트 후 생성된 데이터를 쉽게 정리할 수 있도록 문서와 스크립트 추가

추가 파일:
- CLEANUP_TEST_DATA.md: 상세한 정리 가이드
  * farmq.db 약국 삭제 방법
  * gateway.db 사용자 삭제 방법
  * Headscale 노드 삭제 방법
  * 백업 및 복구 가이드

- cleanup-test-data.sh: 대화형 정리 스크립트
  * P0003 이후 약국 자동 삭제
  * ID 5 이후 사용자 자동 삭제
  * Headscale 노드 선택 삭제
  * 백업 생성 옵션
  * 안전 확인 프롬프트

변경 파일:
- README.md: Headscale 섹션 업데이트
  * 자동 등록 스크립트 설명 추가
  * 테스트 데이터 정리 가이드 링크 추가

사용 예시:
```bash
# 대화형 정리
bash cleanup-test-data.sh

# 원격 실행
curl -fsSL https://.../cleanup-test-data.sh | bash
```

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:44:05 +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
Claude
9d4142ddb6 feat: Headscale 자동 등록 시 약국 및 계정 자동 생성
주요 변경사항:
- 약국 정보 수집 함수 추가 (collect_pharmacy_info)
- VPN IP 자동 확인 함수 추가 (get_assigned_vpn_ip)
- farmq-admin API 호출 함수 추가 (create_pharmacy_via_api)
- gateway API 호출 함수 추가 (create_gateway_user_via_api)
- 로그인 정보 출력 함수 추가 (display_login_credentials)

플로우:
1. Headscale VPN 등록
2. VPN IP 자동 확인 (최대 10초 대기)
3. 약국 정보 수집 (약국명 필수, 나머지 선택)
4. farmq.db에 약국 생성 (https://demo.pharmq.kr/api/pharmacy)
5. gateway.db에 admin 계정 생성 (https://gateway.pharmq.kr/api/auth/register)
6. 로그인 정보 출력 (아이디: p{pharmacy_code}, 비밀번호: 1234)

API 엔드포인트:
- farmq-admin: https://demo.pharmq.kr/api/pharmacy
- gateway: https://gateway.pharmq.kr/api/auth/register

백업 파일: headscale-quick-install.sh.backup

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:45:15 +00:00
Claude
60be9daff4 docs: headscale 자동 등록 개선 계획 문서 추가
추가된 문서:
- SCRIPT_IMPROVEMENT_PLAN.md: 스크립트 개선 계획
- FARMQ_ADMIN_INTEGRATION_ANALYSIS.md: farmq-admin API 분석
- HEADSCALE_AUTO_REGISTER_PLAN.md: 초기 계획

주요 내용:
- Headscale VPN 등록 시 자동 DB 생성
- API 엔드포인트: demo.pharmq.kr, gateway.pharmq.kr

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:40:54 +00:00
7a793ea77d Update README with PVE hostname changer guide
README 문서 업데이트:
- Proxmox VE 호스트명/FQDN 변경 섹션 추가
- 빠른 실행 명령어 제공
- 주요 기능 및 주의사항 안내
- 대화형 호스트명 변경 도구 소개

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 06:01:10 +00:00
ffa955a64f Add Proxmox VE hostname/FQDN changer script
Proxmox VE 호스트명/FQDN 안전 변경 스크립트 추가:
- 현재 설정 확인 및 백업 기능
- 호스트명/도메인 입력 검증
- /etc/hostname, /etc/hosts 자동 수정
- hostnamectl 적용
- Proxmox 서비스 재시작
- 인증서 자동 재발급
- 변경사항 검증 및 롤백 가이드
- 대화형 UI로 안전한 변경 지원

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 06:00:31 +00:00
912410ba90 Update README with Headscale and PBS installation guides
README 문서 업데이트:
- Headscale 빠른 설치 섹션 추가
- PBS 올인원 설치 섹션 추가
- 각 스크립트별 빠른 설치 명령어 제공
- 설치 내용 및 사용 방법 안내

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 04:50:59 +00:00
a45be35543 Add headscale quick installation script
헤드스케일 빠른 설치 스크립트 추가:
- Tailscale 대체 헤드스케일 클라이언트 등록
- PBS 서버 등록 전 필수 네트워크 설정
- Proxmox 환경을 위한 헤드스케일 통합

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 04:46:42 +00:00
187c90e29e Add PBS all-in-one installation script
Proxmox Backup Server 올인원 설치 스크립트 추가:
- PBS 저장소 설정
- PBS 패키지 설치
- PBS 저장소 생성 및 마운트
- 방화벽 설정
- Proxmox VE PBS 통합

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 04:37:03 +00:00
e309524709 Add Tailscale_TUN_Fix_25_11_02.md 2025-11-03 23:22:41 +09:00