Headscale Manager Web UI
Find a file
2026-12-01 09:25:40 +07:00
scripts Add full source: setup scripts, config, nginx template, CLI manager, README 2026-12-01 09:25:40 +07:00
setup Add full source: setup scripts, config, nginx template, CLI manager, README 2026-12-01 09:25:40 +07:00
web Add full source: setup scripts, config, nginx template, CLI manager, README 2026-12-01 09:25:40 +07:00
.gitignore Add full source: setup scripts, config, nginx template, CLI manager, README 2026-12-01 09:25:40 +07:00
README.md Add full source: setup scripts, config, nginx template, CLI manager, README 2026-12-01 09:25:40 +07:00

headscale-web

ชุดติดตั้งและเครื่องมือจัดการ Headscale v0.29.7 (self-hosted Tailscale control server) บนเซิร์ฟเวอร์ testlab

โครงสร้าง

setup/
  install.sh                     ติดตั้ง headscale (.deb) + config + systemd + user default
  config.yaml                    config ที่ใช้งานจริง (= /etc/headscale/config.yaml)
  config-example.yaml            config ตัวอย่างต้นฉบับจาก upstream v0.29.7
  nginx-headscale.conf.template  vhost สำหรับ reverse proxy เมื่อ map โดเมน
scripts/
  headscale-manager.sh           CLI wrapper จัดการ users / nodes / preauth keys
web/
  index.html                     หน้าเว็บจัดการ (สถานะ, nodes, สร้าง key, gc key)

ค่าที่ตั้งไว้

รายการ ค่า
server_url http://192.168.1.101:8090
listen_addr 0.0.0.0:8090
metrics 127.0.0.1:9091
MagicDNS base_domain hs.lan

ติดตั้ง

cd setup
sudo bash install.sh      # ดาวน์โหลด .deb ให้อัตโนมัติถ้ายังไม่มี

ใช้งาน CLI

scripts/headscale-manager.sh status
scripts/headscale-manager.sh users
scripts/headscale-manager.sh preauthkeys-create -u 1 -r -e 24h
scripts/headscale-manager.sh preauthkeys-gc

เชื่อม client:

tailscale up --login-server http://192.168.1.101:8090 --authkey <KEY>

หมายเหตุ

  • ไฟล์ .deb, private key (*.key) และฐานข้อมูล (*.sqlite) ไม่ถูกเก็บใน repo
  • web/index.html เรียก REST API ของ headscale ตรงจากเบราว์เซอร์ ต้องมี API key (headscale apikeys create) เก็บใน localStorage.hs_token และต้องเสิร์ฟผ่าน origin เดียวกับ headscale (เช่นผ่าน nginx) เพราะ headscale ไม่เปิด CORS