summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 5aa8462..d81a1f6 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -1,7 +1,25 @@
package config
+import (
+ "os"
+ "path/filepath"
+)
+
type Config struct {
Profile string
DNSServer string
Command []string
}
+
+// GetDefaultProfilesDir returns the standard XDG path for wg-wrap profiles.
+func GetDefaultProfilesDir() string {
+ configHome := os.Getenv("XDG_CONFIG_HOME")
+ if configHome == "" {
+ home, err := os.UserHomeDir()
+ if err != nil {
+ return "etc/wg-wrap/profiles" // Fallback
+ }
+ configHome = filepath.Join(home, ".config")
+ }
+ return filepath.Join(configHome, "wg-wrap", "profiles")
+}