Files
headscale/create_headscale_preauthkey.sh
Timmy 1410ba6630 Initial commit: Headscale management scripts and configuration
- Add headscale binary and configuration files
- Include management scripts for API keys, nodes, and authentication
- Add Docker setup with docker-compose
- Include backup and restore functionality
- Add example scripts for creating API keys and pre-auth keys

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-24 10:08:28 +08:00

14 lines
546 B
Bash
Executable File

#!/bin/bash
# 預認證金鑰就像是裝置的 VIP 通行證,讓它們能在進入網路前就被認證。
# 有了這個金鑰,裝置一接上網就能被識別為自家人,免去手動認證的麻煩。
# 對於要管理一大堆裝置或想自動化加入流程的人來說,這是個超方便的工具。
# 在名為 headscale 的執行中容器內執行 headscale 指令,建立一個預認證金鑰
docker exec -it headscale headscale preauthkeys create \
--user 1 \
--reusable \
--ephemeral=false \
--expiration 87600h