Move socket to configuration directory.

This commit is contained in:
GRMrGecko 2025-01-07 22:02:02 -06:00
parent 5dd0717085
commit 0e11c52c80
2 changed files with 5 additions and 5 deletions

View File

@ -77,10 +77,10 @@ type MACEntryConfig struct {
} }
// Applies common filters to the read configuration. // Applies common filters to the read configuration.
func (c *Config) ApplyFilters() { func (c *Config) ApplyFilters(configDir string) {
// If the RPC path isn't set, set it to temp dir. // If the RPC path isn't set, set it to temp dir.
if c.RPCPath == "" { if c.RPCPath == "" {
c.RPCPath = filepath.Join(os.TempDir(), "virtual-vxlan.sock") c.RPCPath = filepath.Join(configDir, "virtual-vxlan.sock")
} }
// Check if the RPC socket already exists. // Check if the RPC socket already exists.
_, err := os.Stat(c.RPCPath) _, err := os.Stat(c.RPCPath)
@ -140,7 +140,7 @@ func ReadMinimalConfig() *Config {
} }
// Apply config filters. // Apply config filters.
config.ApplyFilters() config.ApplyFilters(fileDir)
// Apply any log configurations loaded from file. // Apply any log configurations loaded from file.
config.Log.Apply() config.Log.Apply()
@ -163,7 +163,7 @@ func ReadConfig() *Config {
} }
// Apply config filters. // Apply config filters.
config.ApplyFilters() config.ApplyFilters(fileDir)
// Apply any log configurations loaded from file. // Apply any log configurations loaded from file.
config.Log.Apply() config.Log.Apply()

View File

@ -6,7 +6,7 @@ const (
serviceDisplayName = "Virtual VXLAN" serviceDisplayName = "Virtual VXLAN"
serviceVendor = "com.mrgeckosmedia" serviceVendor = "com.mrgeckosmedia"
serviceDescription = "Virtual VXLAN using TUN interfaces" serviceDescription = "Virtual VXLAN using TUN interfaces"
serviceVersion = "0.1.3" serviceVersion = "0.1.4"
defaultConfigFile = "config.yaml" defaultConfigFile = "config.yaml"
) )