Go to file
시골약사 f3965a67fd 머신 상세 페이지 Headscale CLI 기반 완전 재구현
- get_machine_detail 함수를 Headscale CLI 기반으로 완전 교체
- 기존 FARMQ DB 의존성에서 실시간 Headscale 데이터로 전환
- strftime 템플릿 오류 완전 해결 (datetime 객체 타입 체크 추가)
- 실제 머신 정보 표시: 호스트명, IP 주소, 온라인 상태, 사용자 정보
- 약국 정보 매핑: Headscale 사용자명을 통한 약국 연동
- 시간 정보 인간화: "N시간 전", "N분 전" 형식으로 표시
- 네트워크 정보: IPv4/IPv6 주소, 엔드포인트, 키 정보 표시
- 조건부 모니터링 데이터 표시 (향후 확장 대비)
- 전체 머신 상세 페이지 기능 정상화

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 12:07:53 +09:00
config 🎉 Working Headscale Setup with Docker Complete 2025-09-09 14:34:56 +09:00
farmq-admin 머신 상세 페이지 Headscale CLI 기반 완전 재구현 2025-09-11 12:07:53 +09:00
headplane-config 🔧 Fix Headplane UI configuration and enable external access 2025-09-09 15:10:56 +09:00
.env.example 🎉 Working Headscale Setup with Docker Complete 2025-09-09 14:34:56 +09:00
.gitignore 📝 Update .gitignore to exclude Python virtual environments and cache files 2025-09-09 15:53:11 +09:00
CLIENT_CONNECTION_TEST.md 📚 Update documentation with Headplane UI access and configuration 2025-09-09 15:12:54 +09:00
CLIENT_SETUP_GUIDE.md 🚀 Add complete client registration system for FARMQ Headscale 2025-09-09 18:23:04 +09:00
create-preauth-key.sh 🚀 Add complete client registration system for FARMQ Headscale 2025-09-09 18:23:04 +09:00
docker-compose.yml Add one-click installation script for Headscale clients 2025-09-11 00:30:47 +09:00
FARMQ_ADMIN_IMPLEMENTATION_GUIDE.md 팜큐 관리자 시스템 구현 가이드 및 설계 원칙 문서 추가 2025-09-11 10:49:48 +09:00
FARMQ_HEADPLANE_CUSTOMIZATION_PLAN.md 🏥 Add FARMQ Headplane customization business plan 2025-09-09 15:34:12 +09:00
farmq-install-en.ps1 Fix Tailscale download URLs: Use dynamic version detection 2025-09-11 08:34:43 +09:00
farmq-install.ps1 Fix Tailscale download URLs: Use dynamic version detection 2025-09-11 08:34:43 +09:00
HEADPLANE_KOREAN_LOCALIZATION_PLAN.md 📋 Add Headplane Korean localization plan 2025-09-09 15:24:04 +09:00
headscale_models.py 🗃️ Add comprehensive SQLAlchemy models for Headscale database 2025-09-09 15:47:16 +09:00
INSTALLATION_GUIDE.md 📚 Update documentation with Headplane UI access and configuration 2025-09-09 15:12:54 +09:00
PROXMOX_WEBSOCKET_INTEGRATION_PLAN.md Add one-click installation script for Headscale clients 2025-09-11 00:30:47 +09:00
QUICK_INSTALL_GUIDE.md Add support for root account execution without sudo 2025-09-11 00:44:44 +09:00
quick-install.sh Add support for root account execution without sudo 2025-09-11 00:44:44 +09:00
README.md Update documentation for PowerShell encoding fix 2025-09-11 01:01:36 +09:00
register-client.sh 🚀 Add complete client registration system for FARMQ Headscale 2025-09-09 18:23:04 +09:00
start.sh 📚 Update documentation with Headplane UI access and configuration 2025-09-09 15:12:54 +09:00
test_headscale_models.py 🗃️ Add comprehensive SQLAlchemy models for Headscale database 2025-09-09 15:47:16 +09:00
TROUBLESHOOTING_DATABASE_FOREIGN_KEY.md 🏥 Add complete FARMQ Admin Flask application 2025-09-09 17:44:56 +09:00
WINDOWS_ONE_CLICK_INSTALLATION_PLAN.md Add Windows PowerShell one-click installation script 2025-09-11 00:54:13 +09:00
WINDOWS_QUICK_START.md Update documentation for PowerShell encoding fix 2025-09-11 01:01:36 +09:00

🚀 Headscale + Headplane Docker Setup

Tailscale을 완전히 대체하는 자체 호스팅 솔루션

📁 파일 구조

headscale-setup/
├── docker-compose.yml    # Docker Compose 설정
├── .env                  # 환경변수 (복사 필요)
├── .env.example          # 환경변수 템플릿
├── start.sh             # 자동 설치 스크립트
├── README.md            # 이 문서
├── .gitignore           # Git 제외 파일
├── config/
│   └── config.yaml      # Headscale 설정
├── data/                # 데이터베이스 및 키 파일 (자동 생성)
└── run/                 # 런타임 파일 (자동 생성)

🚀 Git Repository

🚀 빠른 시작

1. 환경변수 설정

# .env.example을 .env로 복사
cp .env.example .env

2. 자동 설치 (권장)

# 실행 권한 부여 및 실행
chmod +x ./start.sh
./start.sh

3. 수동 설치

# 1. Headscale 시작
docker-compose up -d headscale

# 2. API 키 생성
docker-compose exec headscale headscale apikeys create

# 3. .env 파일에 API 키 입력 (HEADSCALE_API_KEY 값 수정)
vi .env

# 4. Headplane 시작
docker-compose up -d headplane

📋 접속 정보

👤 사용자 관리

사용자 생성

docker-compose exec headscale headscale users create myuser

Pre-auth 키 생성

docker-compose exec headscale headscale preauthkeys create --user myuser --reusable --expiration 24h

📱 클라이언트 연결

Linux/macOS

# Tailscale 클라이언트 설치 후
tailscale up --login-server=http://localhost:8080

Windows

tailscale up --login-server=http://localhost:8080

🔧 유용한 명령어

상태 확인

docker-compose ps
docker-compose logs -f

노드 목록 확인

docker-compose exec headscale headscale nodes list

사용자 목록 확인

docker-compose exec headscale headscale users list

🛠️ 트러블슈팅

컨테이너 재시작

docker-compose restart

로그 확인

docker-compose logs headscale
docker-compose logs headplane

완전 초기화

docker-compose down
sudo rm -rf data/*
docker-compose up -d

🔄 Git 관리

필요시 수동으로 Git 커밋을 진행하세요:

# 현재 상태 확인
git status

# 변경사항 커밋
git add .
git commit -m "Update: 설명"
git push origin main

새 서버 원클릭 등록

새로운 리눅스 서버를 팜큐 네트워크에 한 번의 명령으로 등록:

빠른 설치 (권장)

# 일반 사용자 계정
curl -fsSL https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/quick-install.sh | sudo bash

# root 계정 (Proxmox 등)
curl -fsSL https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/quick-install.sh | bash

기존 Tailscale 연결이 있는 경우 (강제 재등록)

# 일반 사용자
curl -fsSL https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/quick-install.sh | sudo bash -s -- --force

# root 계정
curl -fsSL https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/quick-install.sh | bash -s -- --force

지원 OS

  • Ubuntu, Debian, CentOS, RHEL, Rocky Linux, Fedora, Arch Linux
  • 자동 Tailscale 설치 + Headscale 등록
  • 방화벽 자동 설정 + 연결 검증

30초 만에 팜큐 네트워크 연결 완료! 🎉

🪟 Windows 원클릭 등록

Windows PC에서 한 번의 복사 붙여넣기로 팜큐 네트워크 연결:

기본 설치 (권장) - 인코딩 문제 해결됨

# 관리자 PowerShell에서 복사 붙여넣기 (English version - 한글 깨짐 해결)
iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/farmq-install-en.ps1'))

기존 Tailscale 있는 경우 (강제 재등록)

# 기존 연결을 자동으로 해제하고 재등록 (English version)
$Force = $true; iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/farmq-install-en.ps1'))

한글 버전 (인코딩 문제 발생 가능)

# 한글이 깨져 보일 수 있음 - 위 English 버전 권장
iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/feature/working-headscale-setup/farmq-install.ps1'))

실행 방법

  1. Windows 키 + X"Windows PowerShell(관리자)" 클릭
  2. 위 명령어 복사 → 붙여넣기 → Enter
  3. 자동 설치 진행 (2-3분)
  4. 팜큐 네트워크 연결 완료! 🎉

Windows 자동 처리 기능

  • Tailscale 자동 다운로드 및 설치
  • 관리자 권한 자동 확인
  • 기존 연결 스마트 처리 (Linux와 동일)
  • Windows Defender 방화벽 자동 설정
  • 네트워크 연결 테스트 및 확인