GetConfigDir returns the user's config directory for docker agent. If an override has been set via [SetConfigDir] it is returned instead. If the home directory cannot be determined, it falls back to a directory under the system temporary directory. This is a best-effort fallback and not intended t
()
| 94 | // under the system temporary directory. This is a best-effort fallback and |
| 95 | // not intended to be a security boundary. |
| 96 | func GetConfigDir() string { |
| 97 | return configDirOverride.get(func() string { |
| 98 | homeDir, err := os.UserHomeDir() |
| 99 | if err != nil { |
| 100 | return filepath.Clean(filepath.Join(os.TempDir(), ".cagent-config")) |
| 101 | } |
| 102 | return filepath.Clean(filepath.Join(homeDir, ".config", "cagent")) |
| 103 | }) |
| 104 | } |
| 105 | |
| 106 | // GetDataDir returns the user's data directory for docker agent (caches, content, logs). |
| 107 | // |