diff --git a/LICENSE b/LICENSE index e2e29bc..cfc3c1f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024-2025 Randall Winkhart +Copyright (c) 2024-2026 Randall Winkhart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/config/cfg.go b/config/cfg.go index 218b6a9..28d86ab 100644 --- a/config/cfg.go +++ b/config/cfg.go @@ -21,7 +21,7 @@ type CfgT struct { SSHKeyProtected *bool `json:"sshKeyProtected"` SSHIsWindows *bool `json:"sshIsWindows"` } `json:"libmutton"` - ThirdParty *map[string]any `json:"thirdParty"` + ClientSpecific *map[string]any `json:"clientSpecific"` } // Load loads libmuttoncfg.json and returns the configuration. diff --git a/core/init.go b/core/init.go index 588ca58..e359966 100644 --- a/core/init.go +++ b/core/init.go @@ -14,14 +14,14 @@ import ( ) // LibmuttonInit creates the libmutton config structure based on user input. -// rcwPassword and clientSpecificIniData can be left blank if not needed. -func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData map[string]any, rcwPassword []byte, preserveOldCfgDir bool, forceOfflineMode bool) error { - // handle clientSpecificIniData +// rcwPassword and clientSpecificCfg can be left blank/nil if not needed. +func LibmuttonInit(inputCB func(prompt string) string, clientSpecificCfg map[string]any, rcwPassword []byte, appendMode, forceOfflineMode bool) error { + // handle clientSpecificCfg newCfg := &config.CfgT{} - if clientSpecificIniData != nil { - newThirdPartyMap := make(map[string]any) - maps.Copy(newThirdPartyMap, clientSpecificIniData) - newCfg.ThirdParty = &newThirdPartyMap + if clientSpecificCfg != nil { + newClientSpecificMap := make(map[string]any) + maps.Copy(newClientSpecificMap, clientSpecificCfg) + newCfg.ClientSpecific = &newClientSpecificMap } var r string @@ -32,7 +32,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData map } if len(r) > 0 && r[0] == 'n' { // initialize libmutton directories - _, err := global.DirInit(preserveOldCfgDir) + _, err := global.DirInit(appendMode) if err != nil { return errors.New("unable to initialize libmutton directories: " + err.Error()) } @@ -65,7 +65,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData map // perform operations based on collected user input //// initialize libmutton directories - oldDeviceID, err := global.DirInit(preserveOldCfgDir) + oldDeviceID, err := global.DirInit(appendMode) if err != nil { return errors.New("unable to initialize libmutton directories: " + err.Error()) } @@ -77,7 +77,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData map newCfg.Libmutton.SSHPort = &sshPort newCfg.Libmutton.SSHKeyPath = &sshKeyPath newCfg.Libmutton.SSHKeyProtected = &sshKeyProtected - err = config.Write(newCfg, false) + err = config.Write(newCfg, appendMode) // pass appendMode to allow not completely destroying existing (client-specific) config if err != nil { return err } diff --git a/docs/release-notes-archive/2026.md b/docs/release-notes-archive/2026.md new file mode 100644 index 0000000..e853c66 --- /dev/null +++ b/docs/release-notes-archive/2026.md @@ -0,0 +1,4 @@ +**libmutton v0.5.0** +Release date TBD + +This release adds password age tracking support and improves the robustness of core functionality. diff --git a/libmuttonserver.go b/libmuttonserver.go index 1c84933..f53a49c 100644 --- a/libmuttonserver.go +++ b/libmuttonserver.go @@ -153,7 +153,7 @@ func main() { } func helpServer() { - fmt.Print(back.AnsiBold + "\nlibmuttonserver | Copyright (c) 2024-2025 Randall Winkhart\n" + back.AnsiReset + ` + fmt.Print(back.AnsiBold + "\nlibmuttonserver | Copyright (c) 2024-2026 Randall Winkhart\n" + back.AnsiReset + ` This software exists under the MIT license; you may redistribute it under certain conditions. This program comes with absolutely no warranty; type "libmuttonserver version" for details. @@ -192,5 +192,5 @@ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.` + "\n\n---------------------------------------------------------") - fmt.Print(back.AnsiBold + "\n\n libmuttonserver" + back.AnsiReset + " Version " + global.LibmuttonVersion + "\n\n Copyright (c) 2024-2025: Randall Winkhart" + "\n\n") + fmt.Print(back.AnsiBold + "\n\n libmuttonserver" + back.AnsiReset + " Version " + global.LibmuttonVersion + "\n\n Copyright (c) 2024-2026: Randall Winkhart" + "\n\n") } diff --git a/wiki/developers.md b/wiki/developers.md index 6c7e17a..86e8646 100644 --- a/wiki/developers.md +++ b/wiki/developers.md @@ -28,7 +28,7 @@ libmutton-based password manager clients should all share the same JSON configur On UNIX-like systems, this is located at `~/.config/libmutton/libmuttoncfg.json`. On Windows, it is located at `~\AppData\Local\libmutton\config\libmuttoncfg.json`. -If creating a third-party client that requires extra configuration to be stored, please use the `ThirdParty` map in the `cfg.ConfigT` type (as used by `cfg.WriteConfig()`) to save your application-specific configuration. +If creating a third-party client that requires extra configuration to be stored, please use the `ClientSpecific` map in the `cfg.ConfigT` type (as used by `cfg.WriteConfig()`) to save your application-specific configuration. This ensures that a user can use multiple client applications with the same configuration while avoiding conflicts.