Rename 'state' and 'runtime' directives to 'state_dir' and 'runtime_dir'

maddy(1) was incorrect calling them 'statedir' and 'runtimedir'.
Name with 'dir' is preferred since it is more explicit. Use of
underscores is consistent with other directives.
This commit is contained in:
fox.cpp 2019-12-26 15:12:32 +03:00
parent c0a73bc3d0
commit 850ef87247
No known key found for this signature in database
GPG key ID: E76D97CCEDE90B6C
3 changed files with 6 additions and 6 deletions

View file

@ -18,8 +18,8 @@ func findBlockInCfg(path, cfgBlock string) (root, block *config.Node, err error)
defer f.Close() defer f.Close()
globals := config.NewMap(nil, &config.Node{Children: nodes}) globals := config.NewMap(nil, &config.Node{Children: nodes})
globals.String("state", false, false, maddy.DefaultStateDirectory, &config.StateDirectory) globals.String("state_dir", false, false, maddy.DefaultStateDirectory, &config.StateDirectory)
globals.String("runtime", false, false, maddy.DefaultRuntimeDirectory, &config.RuntimeDirectory) globals.String("runtime_dir", false, false, maddy.DefaultRuntimeDirectory, &config.RuntimeDirectory)
// We don't care about other directives, but permit them. // We don't care about other directives, but permit them.
globals.AllowUnknown() globals.AllowUnknown()

View file

@ -127,13 +127,13 @@ can be used.
These directives applied for all configuration blocks that don't override it. These directives applied for all configuration blocks that don't override it.
*Syntax*: statedir _path_ ++ *Syntax*: state_dir _path_ ++
*Default*: /var/lib/maddy *Default*: /var/lib/maddy
The path to the state directory. This directory will be used to store all The path to the state directory. This directory will be used to store all
persistent data and should be writable. persistent data and should be writable.
*Syntax*: runtimedir _path_ ++ *Syntax*: runtime_dir _path_ ++
*Default*: /run/maddy *Default*: /run/maddy
The path to the runtime directory. Used for Unix sockets and other temporary The path to the runtime directory. Used for Unix sockets and other temporary

View file

@ -242,8 +242,8 @@ func ensureDirectoryWritable(path string) error {
func moduleMain(cfg []config.Node) error { func moduleMain(cfg []config.Node) error {
globals := config.NewMap(nil, &config.Node{Children: cfg}) globals := config.NewMap(nil, &config.Node{Children: cfg})
globals.String("state", false, false, DefaultStateDirectory, &config.StateDirectory) globals.String("state_dir", false, false, DefaultStateDirectory, &config.StateDirectory)
globals.String("runtime", false, false, DefaultRuntimeDirectory, &config.RuntimeDirectory) globals.String("runtime_dir", false, false, DefaultRuntimeDirectory, &config.RuntimeDirectory)
globals.String("hostname", false, false, "", nil) globals.String("hostname", false, false, "", nil)
globals.String("autogenerated_msg_domain", false, false, "", nil) globals.String("autogenerated_msg_domain", false, false, "", nil)
globals.Custom("tls", false, false, nil, config.TLSDirective, nil) globals.Custom("tls", false, false, nil, config.TLSDirective, nil)