build(SHELLCHECK): add source paths

- add dummy mailcow.conf
- add source directives
- allows easier error checking using shellcheck
This commit is contained in:
Asif Bacchus 2021-02-05 01:08:23 -07:00
parent 32daba03b3
commit 85fae7f6c8
2 changed files with 71 additions and 2 deletions

View File

@ -83,7 +83,7 @@ cleanup() {
else
printf "%s[%s] -- [INFO] 503 error page removed --%s\n" \
"$cyan" "$(stamp)" "$norm" >> "$logFile"
fi
fi
fi
# cleanup SQL dump directory if created
if [ "$sqlDumpDirCreated" -eq 1 ]; then
@ -419,6 +419,7 @@ fi
### read mailcow.conf and set vars as needed
# shellcheck source=./mailcow.conf.shellcheck
. "$mcConfig"
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export COMPOSE_HTTP_TIMEOUT="$dockerStartTimeout"
@ -454,10 +455,12 @@ printf "%s[%s] -- [INFO] Using MAILCRYPT volume: %s --%s\n" \
case "${configDetails}" in
/*)
# absolute path, no need to rewrite variable
# shellcheck source=./backup.details
. "${configDetails}"
;;
*)
# relative path, prepend './' to create absolute path
# shellcheck source=./backup.details
. "./${configDetails}"
;;
esac
@ -794,4 +797,4 @@ exit 0
# 130: null configuration variable in details file
# 131: invalid configuration variable in details file
# 138: borg exited with a critical error
# 139: borg prune exited with a critical error
# 139: borg prune exited with a critical error

View File

@ -0,0 +1,66 @@
#
# sample mailcow configuration file
# (used by shellcheck)
#
MAILCOW_HOSTNAME=mail.example.com
DBNAME=mailcow
DBUSER=mailcow
DBPASS=verylongpassword
DBROOT=anotherlongpassword
HTTP_PORT=8080
HTTP_BIND=127.0.0.1
HTTPS_PORT=8443
HTTPS_BIND=127.0.0.1
SMTP_PORT=25
SMTPS_PORT=465
SUBMISSION_PORT=587
IMAP_PORT=143
IMAPS_PORT=993
POP_PORT=110
POPS_PORT=995
SIEVE_PORT=4190
DOVEADM_PORT=127.0.0.1:19991
SQL_PORT=127.0.0.1:13306
SOLR_PORT=127.0.0.1:18983
REDIS_PORT=127.0.0.1:7654
TZ=America/Edmonton
COMPOSE_PROJECT_NAME=mailcowdockerized
ACL_ANYONE=disallow
MAILDIR_GC_TIME=1440
ADDITIONAL_SAN=
SKIP_LETS_ENCRYPT=y
ENABLE_SSL_SNI=n
SKIP_IP_CHECK=n
SKIP_HTTP_VERIFICATION=n
SKIP_CLAMD=n
SKIP_SOGO=n
SKIP_SOLR=n
SOLR_HEAP=1024
USE_WATCHDOG=y
ALLOW_ADMIN_EMAIL_LOGIN=n
WATCHDOG_NOTIFY_EMAIL=a@example.com,b@example.com,c@example.com
WATCHDOG_NOTIFY_BAN=y
WATCHDOG_EXTERNAL_CHECKS=y
LOG_LINES=9999
IPV4_NETWORK=172.22.1
IPV6_NETWORK=fd4d:6169:6c63:6f77::/64
#SNAT_TO_SOURCE=
#SNAT6_TO_SOURCE=
#API_KEY=
#API_KEY_READ_ONLY=
#API_ALLOW_FROM=172.22.1.1,127.0.0.1
MAILDIR_SUB=Maildir
SOGO_EXPIRE_SESSION=480
DOVECOT_MASTER_USER=
DOVECOT_MASTER_PASS=
MAILCOW_PASS_SCHEME=BLF-CRYPT