From 135f6edbd9389bc4783f13c26aed0a74d3c8aca0 Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Fri, 22 May 2026 16:17:55 -0400 Subject: refactor: unify path management and complete profile management system - Create internal/paths package for unified config and runtime directory resolution - Implement robust WireGuard config parsing in pkg/wgconf - Implement profile management subcommands: list, import, configure, delete, stop - Fix namespace pinning path collisions (separating .ns files from pids directories) - Implement and verify namespace unpinning logic - Fix linting errors and improve error handling across the project --- internal/config/config.go | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'internal/config') diff --git a/internal/config/config.go b/internal/config/config.go index d81a1f6..5aa8462 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,25 +1,7 @@ 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") -} -- cgit v1.2.3