opnsense-ports/security/certmgr/files/patch-certmgr_cmd_root.go
Franco Fichtner 6c54ab69a0 */*: sync with upstream
Taken from: HardenedBSD
2021-07-21 08:08:56 +02:00

20 lines
1.2 KiB
Go

--- certmgr/cmd/root.go.orig 2021-07-05 13:42:49 UTC
+++ certmgr/cmd/root.go
@@ -133,7 +133,7 @@ func Execute() {
func init() {
cobra.OnInitialize(initConfig)
- RootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "f", "", "config file (default is /etc/certmgr/certmgr.yaml)")
+ RootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "f", "", "config file (default is %%ETCDIR%%/certmgr.yaml)")
RootCmd.PersistentFlags().StringP("dir", "d", "", "either the directory containing certificate specs, or the path to the spec file you wish to operate on")
RootCmd.PersistentFlags().StringP("svcmgr", "m", "", fmt.Sprintf("service manager, must be one of: %s", strings.Join(storage.SupportedServiceBackends, ", ")))
RootCmd.PersistentFlags().DurationP("before", "t", cert.DefaultBefore, "how long before certificates expire to start renewing (in duration format)")
@@ -161,7 +161,7 @@ func initConfig() {
viper.SetConfigFile(cfgFile)
} else {
viper.SetConfigName("certmgr") // name of config file (without extension)
- viper.AddConfigPath("/etc/certmgr") // adding home directory as first search path
+ viper.AddConfigPath("%%ETCDIR%%") // adding home directory as first search path
}
viper.SetEnvPrefix("CERTMGR")