This commit is contained in:
12600k-rog-d4
2025-08-13 11:58:50 +08:00
parent cb8fe9f52e
commit 9832bc14cf
4 changed files with 91 additions and 63 deletions

View File

@@ -4,14 +4,18 @@
# - `~/.headscale`
# - 当前工作目录
#
# https://myheadscale.example.com:443
#
# 服务端URL客户端将连接到的地址
server_url: http://0.0.0.0:8080
# 服务监听地址
listen_addr: 0.0.0.0:8080
## 1. 更新Headscale配置启用HTTPS
# 修改server_url为HTTPS
server_url: https://47.239.121.24:3009
# 启用HTTPS监听
listen_addr: 0.0.0.0:8443
# 添加TLS配置
tls_cert_path: "/var/lib/headscale/server.crt"
tls_key_path: "/var/lib/headscale/server.key"
# 指标监听地址(建议保持内网访问)
metrics_listen_addr: 127.0.0.1:9090
@@ -123,7 +127,7 @@ database:
# # in the 'ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1.
# ssl: false
### TLS configuration
### TLS configuration - 已注释掉,调试后再启用
#
## Let's encrypt / ACME
#
@@ -131,31 +135,31 @@ database:
# TLS for a domain with Let's Encrypt.
#
# URL to ACME directory
acme_url: https://acme-v02.api.letsencrypt.org/directory
# acme_url: https://acme-v02.api.letsencrypt.org/directory
# Email to register with ACME provider
acme_email: ""
# acme_email: ""
# Domain name to request a TLS certificate for:
tls_letsencrypt_hostname: ""
# tls_letsencrypt_hostname: ""
# Path to store certificates and metadata needed by
# letsencrypt
# For production:
tls_letsencrypt_cache_dir: /var/lib/headscale/cache
# tls_letsencrypt_cache_dir: /var/lib/headscale/cache
# Type of ACME challenge to use, currently supported types:
# HTTP-01 or TLS-ALPN-01
# See: docs/ref/tls.md for more information
tls_letsencrypt_challenge_type: HTTP-01
# tls_letsencrypt_challenge_type: HTTP-01
# When HTTP-01 challenge is chosen, letsencrypt must set up a
# verification endpoint, and it will be listening on:
# :http = port 80
tls_letsencrypt_listen: ":http"
# tls_letsencrypt_listen: ":http"
## Use already defined certificates:
tls_cert_path: ""
tls_key_path: ""
# tls_cert_path: ""
# tls_key_path: ""
log:
# Output formatting for logs: text or json
@@ -181,7 +185,7 @@ policy:
#
# - https://tailscale.com/kb/1054/dns/
# - https://tailscale.com/kb/1081/magicdns/
# - https://tailscale.com/blog/2021-09-private-dns-with-magicdns/
# - https://tailscale.com/blog/2021-09-private-dns-withmagicdns/
#
# Please note that for the DNS configuration to have any effect,
# clients must have the `--accept-dns=true` option enabled. This is the
@@ -210,8 +214,7 @@ dns:
nameservers:
global:
- 114.114.114.114
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
# "abc123" is example NextDNS ID, replace with yours.
# - https://dns.nextdns.io/abc123
@@ -249,7 +252,7 @@ dns:
# Note: for production you will want to set this to something like:
unix_socket: /var/run/headscale/headscale.sock
unix_socket_permission: "0770"
#
# headscale supports experimental OpenID connect support,
# it is still being tested and might have some bugs, please
# help us test it.