-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-config.py
More file actions
64 lines (61 loc) · 1.73 KB
/
update-config.py
File metadata and controls
64 lines (61 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
import yaml
config = {
'server_url': 'http://127.0.0.1:18557',
'listen_addr': '0.0.0.0:18557',
'grpc_listen_addr': '127.0.0.1:50444',
'grpc_allow_insecure': False,
'noise': {
'private_key_path': '/var/lib/headscale-custom/noise_private.key'
},
'prefixes': {
'v4': '100.64.0.0/10',
'v6': 'fd7a:115c:a1e0::/48',
'allocation': 'sequential'
},
'derp': {
'server': {
'enabled': True,
'region_id': 999,
'region_code': 'headscale',
'region_name': 'Headscale Embedded DERP',
'stun_listen_addr': '0.0.0.0:3478',
'verify_clients': False,
'private_key_path': '/var/lib/headscale-custom/derp.key'
},
'urls': [
'https://controlplane.tailscale.com/derpmap/default'
]
},
'database': {
'type': 'postgres',
'postgres': {
'host': '127.0.0.1',
'port': 15432,
'name': 'headscale_admin',
'user': 'headscale_admin',
'pass': 'HsAdmin@2026PG',
'ssl': False,
'max_open_conns': 10,
'max_idle_conns': 10,
'conn_max_idle_time_secs': 3600
}
},
'dns': {
'base_domain': 'hs.admin.pro',
'override_local_dns': True,
'nameservers': {
'global': ['1.1.1.1', '8.8.8.8']
}
},
'log': {
'level': 'info',
'format': 'text'
},
'policy': {
'mode': 'database'
}
}
with open('/etc/headscale-custom/config.yaml', 'w') as f:
yaml.dump(config, f, default_flow_style=False, sort_keys=False)
print('Config updated successfully with policy.mode: database')