From 85fae7f6c8f34fb06cd1f6aea070c4d663f6501e Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 5 Feb 2021 01:08:23 -0700 Subject: [PATCH] build(SHELLCHECK): add source paths - add dummy mailcow.conf - add source directives - allows easier error checking using shellcheck --- backup/backup.sh | 7 ++-- backup/mailcow.conf.shellcheck | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 backup/mailcow.conf.shellcheck diff --git a/backup/backup.sh b/backup/backup.sh index 98707fe..8d77bb3 100755 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -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 \ No newline at end of file +# 139: borg prune exited with a critical error diff --git a/backup/mailcow.conf.shellcheck b/backup/mailcow.conf.shellcheck new file mode 100644 index 0000000..c599969 --- /dev/null +++ b/backup/mailcow.conf.shellcheck @@ -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