use config/mox.conf as default path for the config file

this matches how the quickstart recommends setting up mox.
i've been running "./mox -config/mox.conf" from there for admin commands, but
"mox" is enough now.
This commit is contained in:
Mechiel Lukkien 2023-02-13 22:40:45 +01:00
parent 4a58b8f434
commit 23b530ae36
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

2
doc.go
View File

@ -12,7 +12,7 @@ low-maintenance self-hosted email.
# Commands # Commands
mox [-config mox.conf] ... mox [-config config/mox.conf] ...
mox serve mox serve
mox quickstart user@domain mox quickstart user@domain
mox restart mox restart

View File

@ -322,7 +322,7 @@ Used to generate documentation.
func usage(l []cmd, unlisted bool) { func usage(l []cmd, unlisted bool) {
var lines []string var lines []string
if !unlisted { if !unlisted {
lines = append(lines, "mox [-config mox.conf] ...") lines = append(lines, "mox [-config config/mox.conf] ...")
} }
for _, c := range l { for _, c := range l {
c.gather() c.gather()
@ -374,7 +374,7 @@ func main() {
return return
} }
flag.StringVar(&mox.ConfigStaticPath, "config", envString("MOXCONF", "mox.conf"), "configuration file, other config files are looked up in the same directory, defaults to $MOXCONF with a fallback to mox.conf") flag.StringVar(&mox.ConfigStaticPath, "config", envString("MOXCONF", "config/mox.conf"), "configuration file, other config files are looked up in the same directory, defaults to $MOXCONF with a fallback to mox.conf")
flag.StringVar(&loglevel, "loglevel", "", "if non-empty, this log level is set early in startup") flag.StringVar(&loglevel, "loglevel", "", "if non-empty, this log level is set early in startup")
flag.Usage = func() { usage(cmds, false) } flag.Usage = func() { usage(cmds, false) }