Go to file
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
RDP Simplify RDP config editor: auto-set local user to rdpuser 2025-11-17 04:29:31 +00:00
VNC Fix Korean character encoding in config parsing 2025-11-21 14:02:42 +00:00
CLEANUP_TEST_DATA.md fix: P001, P002 약국 보호 로직 추가 2025-11-14 10:53:59 +00:00
cleanup-test-data.sh fix: P001, P002 약국 보호 로직 추가 2025-11-14 10:53:59 +00:00
code-server.sh feat: Add code-server installation and setup script 2025-11-03 23:14:31 +09:00
FARMQ_ADMIN_INTEGRATION_ANALYSIS.md docs: headscale 자동 등록 개선 계획 문서 추가 2025-11-14 09:40:54 +00:00
fix-pve9-repos.sh 초기 커밋: Proxmox VE 9.0 저장소 설정 수정 스크립트 2025-10-28 08:14:06 +00:00
HEADSCALE_AUTO_REGISTER_PLAN.md docs: headscale 자동 등록 개선 계획 문서 추가 2025-11-14 09:40:54 +00:00
headscale-auto-register.sh 약국 생성 시 장비 자동 등록 기능 추가 2025-11-15 10:20:38 +00:00
headscale-quick-install.sh feat: 자동 등록 스크립트를 별도 파일로 분리 2025-11-14 09:46:51 +00:00
headscale-quick-install.sh.backup docs: 테스트 데이터 정리 가이드 및 자동화 스크립트 추가 2025-11-14 10:44:05 +00:00
install-claude-code.sh feat: Add Claude Code CLI installation script 2025-11-03 23:13:41 +09:00
pbs_allinone.sh Fix PBS API namespace: Add ns=PQ parameter to all API calls 2025-11-21 01:35:43 +00:00
pbs_auto_restore_103_to_203.sh Fix bash syntax error in pipe execution 2025-11-21 14:20:02 +00:00
pve-host-changer.sh Add Proxmox VE hostname/FQDN changer script 2025-11-14 06:00:31 +00:00
README.md README 업데이트: RDP 올인원 설정 강조 및 통합 방식 설명 2025-11-17 01:41:30 +00:00
SCRIPT_IMPROVEMENT_PLAN.md docs: headscale 자동 등록 개선 계획 문서 추가 2025-11-14 09:40:54 +00:00
Tailscale_TUN_Fix_25_11_02.md Add Tailscale_TUN_Fix_25_11_02.md 2025-11-03 23:22:41 +09:00
시간교정.md Add 시간교정.md 2025-11-15 19:26:05 +09:00

Proxmox VE 9.0 Repository Fix

Proxmox VE 9.0 (Debian 13 Trixie 기반)에서 apt update가 제대로 작동하지 않는 문제를 해결하는 스크립트입니다.

문제 상황

  • Proxmox VE 8.0의 post-install 스크립트가 9.0에서 제대로 작동하지 않음
  • Enterprise repository 설정 문제로 apt update 실패
  • No-subscription repository가 올바르게 구성되지 않음

해결 방법

이 스크립트는 자동으로 다음 작업을 수행합니다:

  • No-subscription repository 활성화 (deb822 형식)
  • Enterprise repository 비활성화
  • Ceph no-subscription repository 설정 (기본 비활성)
  • 중복되거나 잘못된 repository 항목 정리
  • Package list 업데이트

빠른 설치

Proxmox VE 9.0 shell에서 다음 명령어를 실행하세요:

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/fix-pve9-repos.sh | bash

또는 다운로드 후 실행

wget https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/fix-pve9-repos.sh
chmod +x fix-pve9-repos.sh
./fix-pve9-repos.sh

수동 실행

스크립트를 검토한 후 실행하고 싶다면:

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/fix-pve9-repos.sh -o fix-pve9-repos.sh
cat fix-pve9-repos.sh  # 스크립트 내용 확인
chmod +x fix-pve9-repos.sh
sudo ./fix-pve9-repos.sh

설정 내용

생성/수정되는 파일

  • /etc/apt/sources.list.d/proxmox.sources - PVE no-subscription repository (활성화)
  • /etc/apt/sources.list.d/ceph.sources - Ceph no-subscription repository (비활성화)
  • Enterprise repository 항목들 자동 비활성화

Repository 구성

활성화됨:

Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription

비활성화됨:

  • Enterprise repositories (enterprise.proxmox.com)
  • Ceph repository (필요시 수동으로 활성화 가능)

실행 후 확인

스크립트 실행 후 다음 명령어로 정상 작동을 확인하세요:

apt update
apt list --upgradable

주의사항

  • 이 스크립트는 Proxmox VE 9.0 (Debian 13 Trixie) 전용입니다
  • Enterprise subscription이 있다면 이 스크립트를 사용하지 마세요
  • Root 권한이 필요합니다

Ceph 활성화 (선택사항)

Ceph를 사용한다면 다음 명령어로 활성화하세요:

sed -i 's/Enabled: no/Enabled: yes/' /etc/apt/sources.list.d/ceph.sources
apt update

문제 해결

apt update가 여전히 실패하는 경우

# Repository 설정 확인
cat /etc/apt/sources.list.d/proxmox.sources

# 키링 재설치
apt-get install --reinstall proxmox-archive-keyring

# 다시 업데이트
apt-get update

Enterprise repository 경고가 계속 나오는 경우

# Enterprise repository 완전 비활성화 확인
grep -r "enterprise.proxmox.com" /etc/apt/sources.list.d/

💻 개발 환경 설정 (code-server)

서버에서 웹 기반 VS Code 개발 환경을 빠르게 구축:

기본 설치 (포트 8080)

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/code-server.sh | bash

포트 지정 설치

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/code-server.sh | PORT=8443 bash

무인 설치 (비밀번호 환경변수)

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/code-server.sh | PASSWORD="your-secure-password" SKIP_CONFIRM=1 bash

자동 설치 기능

  • code-server 자동 설치 (미설치 시)
  • 설정 파일 자동 생성 및 구성
  • 기존 프로세스 정리 (중복 실행 방지)
  • 0.0.0.0 바인딩 (외부 접속 가능)
  • nohup 백그라운드 실행 (세션 종료 후에도 유지)

설치 후 접속

# 브라우저에서 접속
http://<서버IP>:8080

🤖 Claude Code CLI 설치

AI 기반 개발 도구를 서버에 설치:

기본 설치

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/install-claude-code.sh | bash

수동 설치 (스크립트 확인 후 실행)

wget https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/install-claude-code.sh
chmod +x install-claude-code.sh
./install-claude-code.sh

설치 내용

  • Node.js 20.x LTS 자동 설치
  • npm 포함 설치
  • Claude Code CLI 글로벌 설치
  • 설치 확인 및 버전 출력

사용 방법

claude-code        # Claude Code 시작
claude-code --help # 도움말 보기

🌐 Headscale VPN 등록 및 약국 자동 생성

Headscale VPN 등록 + 약국/계정 자동 생성 올인원 스크립트:

자동 등록 스크립트 (권장)

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/headscale-auto-register.sh | bash

기능:

  • Headscale VPN 자동 등록
  • farmq.db에 약국 자동 생성 (P0003, P0004...)
  • gateway.db에 관리자 계정 자동 생성
  • 즉시 프론트엔드 로그인 가능
  • 로그인 정보 자동 출력

VPN만 등록 (계정 생성 없이)

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/headscale-quick-install.sh | bash

기능:

  • Headscale 클라이언트 등록만 수행
  • PBS 서버 등록 전 필수 네트워크 설정
  • Proxmox 환경 통합

테스트 데이터 정리

스크립트 테스트 후 생성된 데이터 정리:

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/cleanup-test-data.sh | bash

또는:

bash /srv/install_scripts/pve9-repo-fix/cleanup-test-data.sh

정리 내용:

  • 🗑️ farmq.db에서 P0003 이후 테스트 약국 삭제
  • 🗑️ gateway.db에서 ID 5 이후 테스트 사용자 삭제
  • 🗑️ Headscale 테스트 노드 삭제 (선택)
  • 💾 백업 생성 옵션

📖 자세한 정리 가이드: CLEANUP_TEST_DATA.md

💾 Proxmox Backup Server 올인원 설치

PBS 서버 구축 및 Proxmox VE 통합을 한 번에:

빠른 설치

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/pbs_allinone.sh | bash

수동 설치

wget https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/pbs_allinone.sh
chmod +x pbs_allinone.sh
./pbs_allinone.sh

설치 내용

  • PBS 저장소 설정 (no-subscription)
  • PBS 패키지 설치
  • 백업 저장소 생성 및 마운트
  • 방화벽 설정 (포트 8007)
  • Proxmox VE PBS 통합

설치 후 접속

# 브라우저에서 PBS 웹 인터페이스 접속
https://<서버IP>:8007

🏷️ Proxmox VE 호스트명/FQDN 변경

Proxmox 설치 후 안전하게 호스트명 및 FQDN 변경:

빠른 실행

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/pve-host-changer.sh | bash

수동 실행

wget https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/pve-host-changer.sh
chmod +x pve-host-changer.sh
./pve-host-changer.sh

주요 기능

  • 현재 설정 확인 및 백업
  • 호스트명/도메인 입력 검증
  • 자동 설정 파일 수정 (/etc/hostname, /etc/hosts)
  • Proxmox 서비스 재시작
  • 인증서 자동 재발급
  • 변경사항 검증 및 롤백 가이드

주의사항

  • 단독 노드(Single node)에서는 안전하게 변경 가능
  • 클러스터 구성 시 신중하게 진행 필요
  • 변경 후 시스템 재부팅 권장

🖥️ Proxmox RDP 자동화

Proxmox 호스트에서 RDP 자동 연결 및 원격 제어:

RDP 올인원 설정 (권장)

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/RDP/proxmox-auto-rdp-setup.sh | bash

설치 내용:

  • X Window + Openbox 윈도우 매니저
  • FreeRDP3 클라이언트 설치
  • 자동 로그인 및 X 시작 설정
  • RDP 서버 연결 정보 구성
  • RDP Toggle API 자동 설치 (포트 8090)
  • API를 통한 RDP 모드 활성화

특징:

  • 🔒 API 작동 = RDP 제어 가능 보장
  • 🚀 즉시 적용 옵션 (재부팅 불필요)
  • 🎛️ 원격 Shell/RDP 모드 전환 가능

RDP Toggle API 단독 설치

이미 RDP 초기 설정이 완료된 경우에만 사용:

curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/RDP/install-rdp-api.sh | bash

기능:

  • REST API로 RDP/Shell 모드 전환
  • FastAPI 기반 서버 (포트 8090)
  • 프론트엔드 통합 가능 (CORS 지원)
  • 실시간 상태 모니터링
  • 설정 동적 변경 (API로 RDP 서버 정보 변경)

API 사용 예시

# 현재 상태 확인
curl http://localhost:8090/status

# RDP 모드로 전환
curl -X POST http://localhost:8090/toggle \
  -H 'Content-Type: application/json' \
  -d '{"mode":"rdp"}'

# Shell 모드로 전환
curl -X POST http://localhost:8090/toggle \
  -H 'Content-Type: application/json' \
  -d '{"mode":"shell"}'

📖 자세한 가이드: RDP/README.md

라이선스

MIT License

기여

Issues 및 Pull Requests는 언제나 환영합니다!