dns: # Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/). magic_dns:true
# Defines the base domain to create the hostnames for MagicDNS. # This domain _must_ be different from the server_url domain. # `base_domain` must be a FQDN, without the trailing dot. # The FQDN of the hosts will be # `hostname.base_domain` (e.g., _myhost.example.com_). base_domain:example.com
# Whether to use the local DNS settings of a node (default) or override the # local DNS settings and force the use of Headscale's DNS configuration. override_local_dns:false
# List of DNS servers to expose to clients. nameservers: global: -1.1.1.1 -1.0.0.1 -2606:4700:4700::1111 -2606:4700:4700::1001
# NextDNS (see https://tailscale.com/kb/1218/nextdns/). # "abc123" is example NextDNS ID, replace with yours. # - https://dns.nextdns.io/abc123
# Split DNS (see https://tailscale.com/kb/1054/dns/), # a map of domains and which DNS server to use for each. split: {} # foo.bar.com: # - 1.1.1.1 # darp.headscale.net: # - 1.1.1.1 # - 8.8.8.8
# Set custom DNS search domains. With MagicDNS enabled, # your tailnet base_domain is always the first search domain. search_domains: []
# Extra DNS records # so far only A and AAAA records are supported (on the tailscale side) # See: docs/ref/dns.md # extra_records: [] # - name: "grafana.myvpn.example.com" # type: "A" # value: "100.64.0.3" # # # you can also put it in one line # - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" } # # Alternatively, extra DNS records can be loaded from a JSON file. # Headscale processes this file on each change. extra_records_path:/var/lib/headscale/extra-records.json
# 打包完成后,使用 docker images 即可查看镜像 djc@jetron-djc:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE headscale v0.26.1-r bf66da388ca1 6 days ago 87.5MB ko.local/headscale-f40b3d8640713cd381403459ebd67e78 38aefca56cab7d9b11692c61968915fb59fdf1dce134e52fed02ae2fa3a0e871 bf66da388ca1 6 days ago 87.5MB ko.local/headscale-f40b3d8640713cd381403459ebd67e78 latest bf66da388ca1 6 days ago 87.5MB ghcr.io/juanfont/headscale v0.26.1 b9e7b75fd3b0 N/A 80.8MB
Aug 06 08:00:42 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:00:43 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:00:43 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:00:43 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:00:43 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:00:53 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:00:54 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:00:54 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:00:54 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:00:54 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:01:04 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:01:05 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:01:05 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:01:05 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:01:05 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:01:15 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:01:16 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:01:16 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:01:16 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:01:16 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:01:24 ding kernel: workqueue: drain_vmap_area_work hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND Aug 06 08:01:26 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:01:28 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:01:28 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:01:28 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:01:28 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:01:38 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:01:40 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:01:40 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:01:40 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:01:40 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial Aug 06 08:01:50 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded Aug 06 08:01:52 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false) Aug 06 08:01:52 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy= Aug 06 08:01:52 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false Aug 06 08:01:52 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
// GetRouteApprovers returns the list of autoApproving users, groups or tags for a given IPPrefix. func(autoApprovers *AutoApprovers) GetRouteApprovers( prefix netip.Prefix, ) ([]string, error) { if prefix.Bits() == 0 { return autoApprovers.ExitNode, nil// 0.0.0.0/0, ::/0 or equivalent }
approverAliases := make([]string, 0)
// Check for wildcard route approval first // Wildcard "*" approves all non-exit routes if wildcardApprovers, exists := autoApprovers.Routes["*"]; exists { approverAliases = append(approverAliases, wildcardApprovers...) }
for autoApprovedPrefix, autoApproverAliases := range autoApprovers.Routes { // Skip wildcard entry as it's already handled above if autoApprovedPrefix == "*" { continue }
# 按照官方的编译步骤,使用 nix 编译。 make test 编译成功,但是 make build 出现如下错误: djc@jetron-djc:/mnt/c/Users/DJC/Documents/develop/0me/headscale-0.26.1$ make build nix build error: … while calling the 'derivationStrict'builtin at <nix/derivation-internal.nix>:37:12: 36| 37| strict = derivationStrict drvAttrs; | ^ 38|
… while evaluating the derivation attribute 'name' at /nix/store/qmm7hgw60vp7vj9lma95hl329d0j3n6n-source/pkgs/stdenv/generic/make-derivation.nix:438:13: 437| // (optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 438| name = | ^ 439| let
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: attribute 'dirtyShortRev' missing at /nix/store/wrx2gzxp6f5sdha4kswnpn6j8sqmfbnk-source/flake.nix:15:41: 14| }: let 15| headscaleVersion = self.shortRev or self.dirtyShortRev; | ^ 16| commitHash = self.rev or self.dirtyRev; make: *** [Makefile:20: build] Error 1
解决方法:
编辑 flake.nix 文件,
将 headscaleVersion = self.shortRev or self.dirtyShortRev; 修改成:
1 2 3 4 5
headscaleVersion = if self ? shortRev then self.shortRev else if self ? dirtyShortRev then self.dirtyShortRev else "v0.26.1";
root@jetron-djc:~# nix develop path '/root' does not contain a 'flake.nix', searching up error: could not find a flake.nix file
这个错误是因为 nix develop 命令需要在包含 flake.nix 文件的目录中运行,请 cd 到你项目的目录执行 nix develop。
问题5
1 2 3 4
=== Failed === FAIL: hscontrol/db TestConstraints/no-duplicate-username-if-no-oidc-postgres (0.05s) db_test.go:404: start postgres: initdb: initdb: error: cannot be run as root initdb: hint: Please login (using, e.g., "su") as the (unprivileged) user that will own the server process.