- Complete PowerShell script with colorful output and error handling
- Auto-detect existing Tailscale installations
- Smart handling of existing connections (like Linux version)
- Administrator privilege checking with clear instructions
- Automatic Tailscale download and silent installation
- Windows Defender firewall configuration
- Network connectivity testing and verification
- Comprehensive final status report
Features:
- One-line web execution support
- Force reinstall option (-Force parameter)
- Detailed system information display
- Graceful error handling and cleanup
- Windows-native user experience
🚀 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
12 KiB
12 KiB
🪟 Windows용 팜큐 Headscale 원클릭 설치 패키지 기획서
🎯 목표
Windows 클라이언트에서 단 한 번의 실행으로 Tailscale 설치부터 팜큐 Headscale 네트워크 연결까지 완전 자동화
🔍 현재 Windows 상황 분석
기존 연결된 Windows 클라이언트들
100.79.125.82 upharm-1 thug0bin@ windows offline
100.76.226.63 upharm thug0bin@ windows offline
100.93.4.146 prox-win10-kiosk thug0bin@ windows offline
100.109.121.8 desktop-06t3j0m thug0bin@ windows offline
100.70.5.37 desktop-9a1aurp thug0bin@ windows offline
100.126.213.6 desktop-m445evd thug0bin@ windows offline
Windows 특성
- 관리자 권한 필요 (UAC)
- PowerShell 스크립트 실행 정책
- GUI 설치 마법사 선호
- 레지스트리 설정 관리
- 서비스 자동 시작 설정
💡 Windows 설치 패키지 방안 (5가지)
방안 1: PowerShell 원클릭 스크립트 (권장)
개념도
[사용자] → [PowerShell 스크립트] → [Tailscale MSI 설치] → [Headscale 등록] → [완료]
우클릭 "관리자로 실행" 자동 다운로드/설치 자동 서버 설정
구현 방법
1.1 PowerShell 스크립트 생성
# farmq-headscale-installer.ps1
param(
[switch]$Force,
[string]$HeadscaleServer = "https://head.0bin.in",
[string]$PreAuthKey = "8b3df41d37cb158ea39f41fc32c9af46e761de817ad06038"
)
# 관리자 권한 확인
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "❌ 관리자 권한이 필요합니다." -ForegroundColor Red
Write-Host "우클릭 → '관리자로 실행'을 사용해주세요." -ForegroundColor Yellow
pause
exit 1
}
Write-Host "🚀 팜큐 Headscale Windows 설치 시작..." -ForegroundColor Green
1.2 웹 실행 방법
# 관리자 PowerShell에서
iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/.../farmq-install.ps1'))
# 또는 강제 재등록
iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/.../farmq-install.ps1?force=1'))
장점
- ✅ 단일 명령어로 실행 가능
- ✅ 기존 Linux 스크립트와 유사한 UX
- ✅ 웹에서 바로 실행 가능
- ✅ 버전 관리 용이
단점
- ❌ PowerShell 실행 정책 문제
- ❌ 일반 사용자에게 복잡함
- ❌ UAC 프롬프트 필요
방안 2: MSI 설치 패키지 (GUI 방식)
개념도
[사용자] → [farmq-headscale-installer.msi 실행] → [설치 마법사] → [완료]
더블클릭 GUI 단계별 진행
구현 방법
2.1 WiX Toolset으로 MSI 제작
<!-- farmq-installer.wxs -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="팜큐 Headscale 클라이언트" Language="1042"
Version="1.0.0" Manufacturer="팜큐" UpgradeCode="...">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<!-- Tailscale MSI 번들링 -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="FarmQ Headscale"/>
</Directory>
</Directory>
<!-- 사용자 정의 액션 -->
<CustomAction Id="InstallTailscale"
FileKey="TailscaleMSI"
ExeCommand="msiexec /i tailscale-windows.msi /quiet"/>
<CustomAction Id="RegisterHeadscale"
FileKey="RegisterScript"
ExeCommand="powershell.exe -ExecutionPolicy Bypass -File register-headscale.ps1"/>
</Product>
</Wix>
2.2 설치 마법사 UI
┌─────────────────────────────────┐
│ 팜큐 Headscale 클라이언트 설치 │
├─────────────────────────────────┤
│ [ ] 기본 설치 (권장) │
│ [ ] 기존 연결 해제 후 재설치 │
│ │
│ 서버: https://head.0bin.in │
│ 네트워크: 100.64.0.0/10 │
│ │
│ [< 이전] [다음 >] [취소] │
└─────────────────────────────────┘
장점
- ✅ Windows 사용자에게 친숙한 GUI
- ✅ 제어판에서 제거 가능
- ✅ 디지털 서명 가능
- ✅ 그룹 정책 배포 가능
단점
- ❌ 개발 복잡도 높음
- ❌ 코드 서명 인증서 필요
- ❌ 업데이트 배포 복잡
방안 3: 실행 파일 (EXE) + 내장 리소스
개념도
[사용자] → [farmq-installer.exe 실행] → [콘솔/GUI 선택] → [완료]
단일 실행 파일 모든 리소스 내장
구현 방법
3.1 Go/C#으로 네이티브 실행파일
// farmq-installer.go
package main
import (
"embed"
"fmt"
"os"
"os/exec"
)
//go:embed resources/tailscale-windows.msi
//go:embed resources/register-script.ps1
var resources embed.FS
func main() {
fmt.Println("🚀 팜큐 Headscale Windows 설치")
// 관리자 권한 확인
if !isAdmin() {
fmt.Println("❌ 관리자 권한으로 다시 실행해주세요")
return
}
// Tailscale MSI 추출 및 설치
installTailscale()
// Headscale 등록
registerHeadscale()
}
3.2 배포 형태
- farmq-installer.exe (단일 파일, ~50MB)
- Tailscale MSI 포함
- PowerShell 스크립트 포함
- 모든 의존성 내장
장점
- ✅ 단일 파일로 배포 간편
- ✅ 오프라인 설치 가능
- ✅ 의존성 문제 없음
- ✅ 콘솔/GUI 하이브리드 가능
단점
- ❌ 파일 크기 큼 (50MB+)
- ❌ 네이티브 개발 필요
- ❌ Tailscale 업데이트 시 재빌드
방안 4: 웹 기반 설치 (브라우저)
개념도
[사용자] → [웹페이지 방문] → [원클릭 다운로드] → [자동 실행] → [완료]
설치 가이드 페이지 맞춤형 설치파일 브라우저 실행
구현 방법
4.1 웹 설치 페이지
<!-- https://install.farmq.network -->
<!DOCTYPE html>
<html>
<head>
<title>팜큐 Headscale Windows 설치</title>
</head>
<body>
<h1>🪟 Windows용 팜큐 네트워크 설치</h1>
<div class="install-options">
<button onclick="downloadInstaller('basic')">
🚀 기본 설치
</button>
<button onclick="downloadInstaller('force')">
🔄 강제 재설치
</button>
</div>
<script>
function downloadInstaller(type) {
const url = `https://install.farmq.network/download?type=${type}`;
window.location.href = url;
}
</script>
</body>
</html>
4.2 동적 설치파일 생성
# Flask 서버에서 실시간 생성
@app.route('/download')
def download_installer():
install_type = request.args.get('type', 'basic')
# 사용자 맞춤형 PowerShell 스크립트 생성
script = generate_powershell_script(
force=install_type=='force',
preauth_key=get_current_preauth_key(),
server_url="https://head.0bin.in"
)
response = make_response(script)
response.headers['Content-Type'] = 'application/octet-stream'
response.headers['Content-Disposition'] = 'attachment; filename=farmq-install.ps1'
return response
장점
- ✅ 최신 설정 항상 반영
- ✅ 사용자별 맞춤 설치
- ✅ 통계 수집 가능
- ✅ 웹 기반으로 접근성 좋음
단점
- ❌ 인터넷 연결 필수
- ❌ 웹 서버 인프라 필요
- ❌ 브라우저 보안 정책 제약
방안 5: 배치 파일 (BAT) 스크립트
개념도
[사용자] → [farmq-install.bat 실행] → [Windows CMD 명령] → [완료]
우클릭 "관리자로 실행" 전통적인 배치 방식
구현 방법
5.1 배치 스크립트
@echo off
:: farmq-install.bat
title 팜큐 Headscale Windows 설치
:: 관리자 권한 확인
net session >nul 2>&1
if %errorLevel% neq 0 (
echo ❌ 관리자 권한이 필요합니다.
echo 우클릭으로 "관리자로 실행"해주세요.
pause
exit /b 1
)
echo 🚀 팜큐 Headscale Windows 설치 시작...
:: Tailscale 다운로드 및 설치
echo 📦 Tailscale 다운로드 중...
powershell -Command "Invoke-WebRequest -Uri 'https://pkgs.tailscale.com/stable/tailscale-setup.exe' -OutFile 'tailscale-setup.exe'"
echo 🔧 Tailscale 설치 중...
tailscale-setup.exe /S
:: Headscale 등록
echo 🌐 Headscale 서버 등록 중...
"C:\Program Files\Tailscale\tailscale.exe" up --login-server=https://head.0bin.in --authkey=8b3df41d37cb158ea39f41fc32c9af46e761de817ad06038
echo ✅ 설치 완료!
pause
장점
- ✅ 개발 간단
- ✅ Windows 네이티브 지원
- ✅ 의존성 없음
- ✅ 디버깅 용이
단점
- ❌ 기능 제한적
- ❌ 에러 처리 복잡
- ❌ 사용자 경험 떨어짐
🎯 권장 구현 우선순위
1단계: PowerShell 스크립트 (즉시 구현 가능)
기간: 1-2일
난이도: 하
# 사용자 실행 방법
# 1. 관리자 PowerShell 열기
# 2. 다음 명령 실행
iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/.../farmq-install.ps1'))
2단계: 실행 파일 (EXE) 방식
기간: 3-5일
난이도: 중
- Go언어로 크로스 컴파일
- 단일 실행파일로 배포
- GUI 옵션 포함
3단계: MSI 설치 패키지
기간: 1주일 난이도: 상
- 전문적인 설치 경험
- 제어판 등록
- 그룹 정책 배포 지원
📋 PowerShell 스크립트 구현 명세서
기본 기능
# 1. 시스템 확인
- Windows 버전 체크 (Windows 10/11 지원)
- 관리자 권한 확인
- 인터넷 연결 확인
# 2. Tailscale 설치
- 기존 설치 확인
- 최신 버전 다운로드
- 자동 설치 (Silent Install)
- 서비스 시작
# 3. Headscale 등록
- 기존 연결 확인 및 해제
- Pre-auth key로 자동 등록
- 연결 상태 확인
# 4. 방화벽 설정
- Windows Defender 예외 추가
- 필요한 포트 허용
# 5. 완료 확인
- IP 주소 할당 확인
- 네트워크 연결 테스트
- 상태 출력
사용자 시나리오
1. 약국 직원이 새 PC 설정
2. 관리자 PowerShell 실행
3. 원클릭 명령어 붙여넣기
4. 자동 설치 진행 (2-3분)
5. 팜큐 네트워크 연결 완료
🔧 즉시 구현 가능한 MVP
파일 구조
farmq-windows-installer/
├── farmq-install.ps1 # 메인 설치 스크립트
├── modules/
│ ├── system-check.ps1 # 시스템 확인
│ ├── tailscale-installer.ps1 # Tailscale 설치
│ ├── headscale-register.ps1 # Headscale 등록
│ └── network-verify.ps1 # 네트워크 확인
├── resources/
│ └── farmq-logo.ico # 아이콘
└── README-windows.md # Windows 설치 가이드
웹 실행 명령어
# 기본 설치
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/main/farmq-install.ps1'))
# 강제 재설치
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://git.0bin.in/thug0bin/headscale-tailscale-replacement/raw/branch/main/farmq-install.ps1?force=1'))
📊 예상 사용 통계
대상 사용자
- 팜큐 약국: ~100개 약국 × 2-3대 PC = 200-300대
- 신규 PC: 월 10-20대 추가
- 재설치: 월 5-10건
성공 지표
- ✅ 설치 성공률: 95% 이상
- ✅ 설치 시간: 3분 이내
- ✅ 사용자 만족도: 5점 만점 4점 이상
- ✅ 지원 요청: 월 5건 이하
🚀 결론 및 추천
즉시 구현 권장: PowerShell 원클릭 스크립트
- 개발 용이성 ⭐⭐⭐⭐⭐
- 사용자 편의성 ⭐⭐⭐⭐
- 유지보수성 ⭐⭐⭐⭐⭐
- 배포 편의성 ⭐⭐⭐⭐⭐
다음 단계: PowerShell 스크립트 구현 → EXE 파일 → MSI 패키지 순으로 단계적 발전
목표: "Linux처럼 Windows에서도 한 줄 명령어로 팜큐 네트워크 연결!" 🎯