Compare commits

...

3 Commits

Author SHA1 Message Date
Asif Bacchus
2b5f8a0887 fix(BACKUP): initialize sqlDumpDirCreated
- initialize sqlDumpDirCreated to avoid 'unary operator expected' error

Closes 7
2021-02-05 01:11:16 -07:00
Asif Bacchus
85fae7f6c8 build(SHELLCHECK): add source paths
- add dummy mailcow.conf
- add source directives
- allows easier error checking using shellcheck
2021-02-05 01:08:23 -07:00
Asif Bacchus
32daba03b3 build(RIDER): add rider environment files 2021-02-05 01:07:12 -07:00
4 changed files with 95 additions and 2 deletions

View File

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/.idea.MailcowBackup.iml
/projectSettingsUpdater.xml
/modules.xml
/contentModel.xml
# Datasource local storage ignored files
/../../../../../../../../../:\Users\AsifB\Documents\RiderProjects\MailcowBackup\.idea\.idea.MailcowBackup.dir\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="BodyLimit" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="SubjectBodySeparation" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="SubjectLimit" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>
</project>

View File

@ -251,6 +251,7 @@ logFile="$scriptPath/${scriptName%.*}.log"
warnCount=0
configDetails="$scriptPath/${scriptName%.*}.details"
err503Copied=0
sqlDumpDirCreated=0
exclusions=0
# borg output verbosity -- normal
borgCreateParams='--stats'
@ -419,6 +420,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 +456,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

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