updated headscale state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2025-03-09 13:34:51 +01:00
parent fe6d9ab425
commit 1ad496aec9
4 changed files with 41 additions and 14 deletions

View File

@ -28,3 +28,22 @@ headscale-config-derp:
- template: jinja
- watch_in:
- service: headscale-service
headscale-policy:
file.managed:
- name: {{ headscale.config_path }}/policy.json
- source: salt://headscale/templates/policy.json.j2
- user: {{ headscale.user.uid }}
- group: {{ headscale.group.gid }}
- template: jinja
- watch_in:
- service: headscale-service
headscale-policy-update:
file.managed:
- name: {{ headscale.config_path }}/update_policy.sh
- source: salt://headscale/templates/update_policy.sh
- user: {{ headscale.user.uid }}
- group: {{ headscale.group.gid }}
- watch_in:
- service: headscale-service

View File

@ -90,17 +90,18 @@ headscale:
enabled: false
randomize_client_port: false
derp_config:
regions:
900:
regionid: 900
regioncode: custom
regionname: My Region
nodes:
- name: 900a
regionid: 900
hostname: myderp.mydomain.no
ipv4: 123.123.123.123
ipv6: "2604:a880:400:d1::828:b001"
stunport: 0
stunonly: false
derpport: 0
regions: {}
#900:
# regionid: 900
# regioncode: custom
# regionname: My Region
# nodes:
# - name: 900a
# regionid: 900
# hostname: myderp.mydomain.no
# ipv4: 123.123.123.123
# ipv6: "2604:a880:400:d1::828:b001"
# stunport: 0
# stunonly: false
# derpport: 0
policy: {}

View File

@ -0,0 +1,3 @@
{%- from "headscale/map.jinja" import headscale with context -%}
{{ headscale.policy|json }}

View File

@ -0,0 +1,4 @@
#!/usr/bin/env zsh
FILENAME=/etc/headscale/policy.json
headscale policy get | jq > $FILENAME; vim $FILENAME; headscale policy set -f $FILENAME