diff --git a/internal/config/export.go b/internal/config/export.go index 66ee26426..e01a1ea56 100644 --- a/internal/config/export.go +++ b/internal/config/export.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "io" + "os" "time" "github.com/rcourtman/pulse-go-rewrite/internal/alerts" @@ -63,9 +64,12 @@ func (c *ConfigPersistence) ExportConfig(passphrase string) (string, error) { return "", fmt.Errorf("failed to load system settings: %w", err) } - // Load guest metadata (stored in data directory, not config directory) - // Default to /var/lib/pulse if not specified - dataPath := "/var/lib/pulse" + // Load guest metadata (stored in data directory) + // Use PULSE_DATA_DIR if set, otherwise use /etc/pulse for backwards compatibility + dataPath := os.Getenv("PULSE_DATA_DIR") + if dataPath == "" { + dataPath = "/etc/pulse" + } guestMetadataStore := NewGuestMetadataStore(dataPath) guestMetadata := guestMetadataStore.GetAll() @@ -149,7 +153,11 @@ func (c *ConfigPersistence) ImportConfig(encryptedData string, passphrase string // Import guest metadata if present if exportData.GuestMetadata != nil && len(exportData.GuestMetadata) > 0 { - dataPath := "/var/lib/pulse" + // Use PULSE_DATA_DIR if set, otherwise use /etc/pulse for backwards compatibility + dataPath := os.Getenv("PULSE_DATA_DIR") + if dataPath == "" { + dataPath = "/etc/pulse" + } guestMetadataStore := NewGuestMetadataStore(dataPath) // Import each guest metadata entry diff --git a/pulse-linux-amd64 b/pulse-linux-amd64 new file mode 100755 index 000000000..e79a49ffe Binary files /dev/null and b/pulse-linux-amd64 differ