mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-03-10 08:41:23 +00:00
Compare commits
13 Commits
feat/rspam
...
2026-03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b84ba8ded1 | ||
|
|
8f883f3d37 | ||
|
|
709117fe19 | ||
|
|
82ea418423 | ||
|
|
fd24163c6e | ||
|
|
3caef45a12 | ||
|
|
4845928e7a | ||
|
|
4ccfedd6b3 | ||
|
|
e8d9315d4a | ||
|
|
d977ddb501 | ||
|
|
e76f5237ed | ||
|
|
c11ed5dd1e | ||
|
|
4ef65fc382 |
@@ -64,7 +64,7 @@ adapt_new_options() {
|
||||
|
||||
sed -i --follow-symlinks '$a\' mailcow.conf
|
||||
for option in ${CONFIG_ARRAY[@]}; do
|
||||
if grep -q "${option}" mailcow.conf; then
|
||||
if grep -q "^#\?${option}=" mailcow.conf; then
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -302,7 +302,7 @@ adapt_new_options() {
|
||||
;;
|
||||
ACME_DNS_PROVIDER)
|
||||
echo '# DNS provider for DNS-01 challenge (e.g. dns_cf, dns_azure, dns_gd, etc.)' >> mailcow.conf
|
||||
echo '# See the dns-101 provider documentation for more information.' >> mailcow.conf
|
||||
echo '# See the dns-01 provider documentation for more information.' >> mailcow.conf
|
||||
echo 'ACME_DNS_PROVIDER=dns_xxx' >> mailcow.conf
|
||||
;;
|
||||
ACME_ACCOUNT_EMAIL)
|
||||
|
||||
@@ -7,7 +7,7 @@ else
|
||||
__dns_loader_standalone=0
|
||||
fi
|
||||
|
||||
CONFIG_PATH="${ACME_DNS_CONFIG_FILE:-/etc/acme/dns-101.conf}"
|
||||
CONFIG_PATH="${ACME_DNS_CONFIG_FILE:-/etc/acme/dns-01.conf}"
|
||||
|
||||
if [[ ! -f "${CONFIG_PATH}" ]]; then
|
||||
if [[ $__dns_loader_standalone -eq 1 ]]; then
|
||||
|
||||
@@ -12,7 +12,7 @@ CERT_DOMAINS=(${DOMAINS[@]})
|
||||
CERT_DOMAIN=${CERT_DOMAINS[0]}
|
||||
ACME_BASE=/var/lib/acme
|
||||
|
||||
# Load optional DNS provider secrets from /etc/acme/dns-101.conf
|
||||
# Load optional DNS provider secrets from /etc/acme/dns-01.conf
|
||||
if [[ -f /srv/load-dns-config.sh ]]; then
|
||||
source /srv/load-dns-config.sh
|
||||
if declare -F log_f >/dev/null; then
|
||||
|
||||
@@ -299,7 +299,7 @@ ACME_DNS_CHALLENGE=n
|
||||
ACME_DNS_PROVIDER=dns_xxx
|
||||
ACME_ACCOUNT_EMAIL=me@example.com
|
||||
# You will need to pass provider-specific environment variables to the acme-mailcow container.
|
||||
# See the dns-101 provider documentation for more information.
|
||||
# See the dns-01 provider documentation for more information.
|
||||
# for example for Azure DNS:
|
||||
#AZUREDNS_SUBSCRIPTIONID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
#AZUREDNS_TENANTID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
|
||||
65
update.sh
65
update.sh
@@ -19,30 +19,48 @@ if [ ! -f "${PWD}/mailcow.conf" ]; then
|
||||
fi
|
||||
BRANCH="$(cd "${SCRIPT_DIR}" && git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
# Check for --dev flag early to skip _modules update
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" == "--dev" || "$arg" == "-d" ]]; then
|
||||
echo -e "\e[32mRunning in Developer mode...\e[0m"
|
||||
DEV=y
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
MODULE_DIR="${SCRIPT_DIR}/_modules"
|
||||
# Calculate hash before fetch
|
||||
if [[ -d "${MODULE_DIR}" && -n "$(ls -A "${MODULE_DIR}" 2>/dev/null)" ]]; then
|
||||
MODULES_HASH_BEFORE=$(find "${MODULE_DIR}" -type f -exec sha256sum {} \; 2>/dev/null | sort | sha256sum | awk '{print $1}')
|
||||
|
||||
if [ ! "$DEV" ]; then
|
||||
# Calculate hash before fetch
|
||||
if [[ -d "${MODULE_DIR}" && -n "$(ls -A "${MODULE_DIR}" 2>/dev/null)" ]]; then
|
||||
MODULES_HASH_BEFORE=$(find "${MODULE_DIR}" -type f -exec sha256sum {} \; 2>/dev/null | sort | sha256sum | awk '{print $1}')
|
||||
else
|
||||
MODULES_HASH_BEFORE="EMPTY"
|
||||
fi
|
||||
|
||||
echo -e "\e[33mFetching latest _modules from origin/${BRANCH}…\e[0m"
|
||||
git fetch origin "${BRANCH}"
|
||||
git checkout "origin/${BRANCH}" -- _modules
|
||||
|
||||
if [[ ! -d "${MODULE_DIR}" || -z "$(ls -A "${MODULE_DIR}")" ]]; then
|
||||
echo -e "\e[31mError: _modules is still missing or empty after fetch!\e[0m"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Calculate hash after fetch
|
||||
MODULES_HASH_AFTER=$(find "${MODULE_DIR}" -type f -exec sha256sum {} \; 2>/dev/null | sort | sha256sum | awk '{print $1}')
|
||||
|
||||
# Check if modules changed
|
||||
if [[ "${MODULES_HASH_BEFORE}" != "${MODULES_HASH_AFTER}" ]]; then
|
||||
echo -e "\e[33m_modules have been updated. Please restart the update script.\e[0m"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
MODULES_HASH_BEFORE="EMPTY"
|
||||
fi
|
||||
|
||||
echo -e "\e[33mFetching latest _modules from origin/${BRANCH}…\e[0m"
|
||||
git fetch origin "${BRANCH}"
|
||||
git checkout "origin/${BRANCH}" -- _modules
|
||||
|
||||
if [[ ! -d "${MODULE_DIR}" || -z "$(ls -A "${MODULE_DIR}")" ]]; then
|
||||
echo -e "\e[31mError: _modules is still missing or empty after fetch!\e[0m"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Calculate hash after fetch
|
||||
MODULES_HASH_AFTER=$(find "${MODULE_DIR}" -type f -exec sha256sum {} \; 2>/dev/null | sort | sha256sum | awk '{print $1}')
|
||||
|
||||
# Check if modules changed
|
||||
if [[ "${MODULES_HASH_BEFORE}" != "${MODULES_HASH_AFTER}" ]]; then
|
||||
echo -e "\e[33m_modules have been updated. Please restart the update script.\e[0m"
|
||||
exit 2
|
||||
echo -e "\e[33mDeveloper mode: Skipping _modules update from git\e[0m"
|
||||
if [[ ! -d "${MODULE_DIR}" || -z "$(ls -A "${MODULE_DIR}")" ]]; then
|
||||
echo -e "\e[31mError: _modules directory is missing or empty!\e[0m"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
source _modules/scripts/core.sh
|
||||
@@ -151,8 +169,7 @@ while (($#)); do
|
||||
FORCE=y
|
||||
;;
|
||||
-d|--dev)
|
||||
echo -e "\e[32mRunning in Developer mode...\e[0m"
|
||||
DEV=y
|
||||
# Already handled at the top of the script before _modules update
|
||||
;;
|
||||
--legacy)
|
||||
CURRENT_BRANCH="$(cd "${SCRIPT_DIR}"; git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
Reference in New Issue
Block a user