docs: Remove ENV ONE_DIR (#3840)

* docs: Better document DMS volumes

* docs: Remove any mention of `ONE_DIR` ENV

* chore: Remove `ONE_DIR` ENV from scripts

Only `ONE_DIR=0` has any effect. As the actual feature is now dependent upon the `/var/mail-state` location existing.

It is advised not mounting anything there instead if wanting to avoid runtime state consolidation.

* docs: Adjust link ref convention

This is more search friendly / organized to find references to all DMS volumes.

* lint: Ensure final newline is present

VSCode by default excludes this if the last line rendered is removed (rendered as a separate blank line).

A separate setting can enforce adding the final newline upon save regardless.
This commit is contained in:
Brennan Kinney 2024-01-29 10:35:19 +13:00 committed by GitHub
parent 11c508cd11
commit 3b11a8305e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 102 additions and 67 deletions

View file

@ -7,7 +7,7 @@ function _setup_save_states() {
STATEDIR='/var/mail-state'
if [[ ${ONE_DIR} -eq 1 ]] && [[ -d ${STATEDIR} ]]; then
if [[ -d ${STATEDIR} ]]; then
_log 'debug' "Consolidating all state onto ${STATEDIR}"
# Always enabled features:
@ -111,9 +111,7 @@ function _setup_save_states() {
# Ref: https://github.com/docker-mailserver/docker-mailserver/pull/3625
chmod 730 "${STATEDIR}/spool-postfix/maildrop"
chmod 710 "${STATEDIR}/spool-postfix/public"
elif [[ ${ONE_DIR} -eq 1 ]]; then
_log 'warn' "'ONE_DIR=1' but no volume was mounted to '${STATEDIR}'"
else
_log 'debug' 'Not consolidating state (because it has been disabled)'
_log 'debug' "'${STATEDIR}' is not present; Not consolidating state"
fi
}

View file

@ -127,9 +127,9 @@ expand_keys = true;
EOF
# Here we adjust the Redis default configuration that we supply to Redis
# when starting it. Note that `/var/lib/redis/` is linked to
# `/var/mail-state/redis/` (for persisting it) if `ONE_DIR=1`.
# Here we adjust the Redis default configuration that we supply to Redis when starting it.
# NOTE: `/var/lib/redis/` is symlinked to `/var/mail-state/redis/` when DMS is started
# with a volume mounted to `/var/mail-state/` for data persistence.
sedfile -i -E \
-e 's|^(bind).*|\1 127.0.0.1|g' \
-e 's|^(daemonize).*|\1 no|g' \

View file

@ -141,7 +141,6 @@ function __environment_variables_general_setup() {
VARS[LOGWATCH_INTERVAL]="${LOGWATCH_INTERVAL:=none}"
VARS[LOGWATCH_RECIPIENT]="${LOGWATCH_RECIPIENT:=${REPORT_RECIPIENT}}"
VARS[LOGWATCH_SENDER]="${LOGWATCH_SENDER:=${REPORT_SENDER}}"
VARS[ONE_DIR]="${ONE_DIR:=1}"
VARS[PERMIT_DOCKER]="${PERMIT_DOCKER:=none}"
VARS[PFLOGSUMM_RECIPIENT]="${PFLOGSUMM_RECIPIENT:=${REPORT_RECIPIENT}}"
VARS[PFLOGSUMM_SENDER]="${PFLOGSUMM_SENDER:=${REPORT_SENDER}}"