Odhiambo Washington writes:
And I don't like this, so I think I will put all my configs into /opt/mailman/mm/etc/ and link /etc/mailman3 to this path instead.
Unfortunately by definition it's impossible to make the search path for the configuration file be configurable. Hm ... I think I know how to do this. ;-) Specifically, we could have a "install_defaults.py" file that lives next to bin/mailman or maybe in site-packages/mailman directory. bin/mailman would import specific variables from it, something like
try:
from .install_defaults import CONFIG_SEARCH_PATH, USE_CONF_D
except ModuleNotFoundError:
CONFIG_SEARCH_PATH = ['./mailman.cfg', ...]
USE_CONF_D = False # this variable is probably a bad idea
except ImportError:
log'"your bootstrap.py is missing required variables'")
raise
Important: mailman info
would report its location.
What bite me is probably related to this experience by Turnbull: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... I am on FreeBSD where user applications should have config files in /usr/local/etc/ and not /etc/ so having /etc/mailman3 and not /usr/local/etc/mailman3 kinda makes me feel weird.
I sympathize. While I have no problem with the /etc/mailman3 approach, I think the *BSD approach of putting locally built configs in /usr/local/etc is equally reasonable. More than either, for third party and locally built software, I'm a fan of the /opt approach (ie, a self-contained tree for $APP, with /opt/$APP/bin, /opt/$APP/usr, /opt/$APP/var, /opt/$APP/etc or similar subdirectories).
FWIW, Mailman 3's search path looks for mailman.cfg in the following places, in this order:
- the value of the -C option # run-time option
- $MAILMAN_CONFIG_FILE # login-time option
- ./mailman.cfg # run-time option
- ./var/etc/mailman.cfg # /opt-like
- $HOME/.mailman.cfg # for developers?
- /etc/mailman.cfg # traditional
- /etc/mailman3/mailman.cfg # distro-friendly (Linux, at least) # good place for conf.d (see issue#424)
- ../../etc/mailman.cfg # /opt-like # (relative to Mailman 3's bin directory)
IMO this list is way too long, and ./var/etc is kind of strange. But the thing about creating the file even though it finds one of the other ones is really annoying.
BTW the config file creation issue was reported about two years ago: https://gitlab.com/mailman/mailman/-/issues/797 and there are a couple of loosed related issues (ie, if we're going to thoroughly review the configuration files):
- Separate config for secrets: https://gitlab.com/mailman/mailman/-/issues/466
- Support conf.d directory: https://gitlab.com/mailman/mailman/-/issues/424
Comments welcome, not really sure what I want to do here.
Steve