diff --git a/cmd/maddyctl/config.go b/cmd/maddyctl/config.go index 42558c9..aab5f78 100644 --- a/cmd/maddyctl/config.go +++ b/cmd/maddyctl/config.go @@ -18,8 +18,8 @@ func findBlockInCfg(path, cfgBlock string) (root, block *config.Node, err error) defer f.Close() globals := config.NewMap(nil, &config.Node{Children: nodes}) - globals.String("state", false, false, maddy.DefaultStateDirectory, &config.StateDirectory) - globals.String("runtime", false, false, maddy.DefaultRuntimeDirectory, &config.RuntimeDirectory) + globals.String("state_dir", false, false, maddy.DefaultStateDirectory, &config.StateDirectory) + globals.String("runtime_dir", false, false, maddy.DefaultRuntimeDirectory, &config.RuntimeDirectory) // We don't care about other directives, but permit them. globals.AllowUnknown() diff --git a/docs/man/maddy.1.scd b/docs/man/maddy.1.scd index 307fece..d7b4c2a 100644 --- a/docs/man/maddy.1.scd +++ b/docs/man/maddy.1.scd @@ -127,13 +127,13 @@ can be used. These directives applied for all configuration blocks that don't override it. -*Syntax*: statedir _path_ ++ +*Syntax*: state_dir _path_ ++ *Default*: /var/lib/maddy The path to the state directory. This directory will be used to store all persistent data and should be writable. -*Syntax*: runtimedir _path_ ++ +*Syntax*: runtime_dir _path_ ++ *Default*: /run/maddy The path to the runtime directory. Used for Unix sockets and other temporary diff --git a/maddy.go b/maddy.go index 369da34..405872d 100644 --- a/maddy.go +++ b/maddy.go @@ -242,8 +242,8 @@ func ensureDirectoryWritable(path string) error { func moduleMain(cfg []config.Node) error { globals := config.NewMap(nil, &config.Node{Children: cfg}) - globals.String("state", false, false, DefaultStateDirectory, &config.StateDirectory) - globals.String("runtime", false, false, DefaultRuntimeDirectory, &config.RuntimeDirectory) + globals.String("state_dir", false, false, DefaultStateDirectory, &config.StateDirectory) + globals.String("runtime_dir", false, false, DefaultRuntimeDirectory, &config.RuntimeDirectory) globals.String("hostname", false, false, "", nil) globals.String("autogenerated_msg_domain", false, false, "", nil) globals.Custom("tls", false, false, nil, config.TLSDirective, nil)