Allow setting tun name in daemon config

This commit is contained in:
Brian Picciano 2023-09-01 16:45:21 +02:00
parent d2d25d3621
commit 0b486d5d27
4 changed files with 11 additions and 2 deletions

View File

@ -52,6 +52,10 @@ vpn:
# That's it.
tun:
# Name of the tun network device which will route VPN traffic.
device: isle-tun
storage:
# Allocations defined here are used to store data in the distributed storage

View File

@ -165,7 +165,7 @@ in rec {
};
tests = pkgs.writeShellScript "isle-tests" ''
export PATH=$PATH:${appImage}/bin
export PATH=${appImage}/bin:$PATH
test_dir=${./tests}
exec $SHELL $test_dir/entrypoint.sh "$@"
'';

View File

@ -68,7 +68,7 @@ func nebulaPmuxProcConfig(
"respond": true,
},
"tun": map[string]interface{}{
"dev": "isle-tun",
"dev": daemonConfig.VPN.Tun.Device,
},
"firewall": daemonConfig.VPN.Firewall,
}

View File

@ -2,6 +2,10 @@ package daemon
import "strconv"
type ConfigTun struct {
Device string `yaml:"device"`
}
type ConfigFirewall struct {
Conntrack ConfigConntrack `yaml:"conntrack"`
Outbound []ConfigFirewallRule `yaml:"outbound"`
@ -50,6 +54,7 @@ type Config struct {
VPN struct {
PublicAddr string `yaml:"public_addr"`
Firewall ConfigFirewall `yaml:"firewall"`
Tun ConfigTun `yaml:"tun"`
} `yaml:"vpn"`
Storage struct {
Allocations []ConfigStorageAllocation