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. # That's it.
tun:
# Name of the tun network device which will route VPN traffic.
device: isle-tun
storage: storage:
# Allocations defined here are used to store data in the distributed 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" '' tests = pkgs.writeShellScript "isle-tests" ''
export PATH=$PATH:${appImage}/bin export PATH=${appImage}/bin:$PATH
test_dir=${./tests} test_dir=${./tests}
exec $SHELL $test_dir/entrypoint.sh "$@" exec $SHELL $test_dir/entrypoint.sh "$@"
''; '';

View File

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

View File

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