diff --git a/generate_config.sh b/generate_config.sh index 702c2540..2450bf80 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -207,8 +207,8 @@ if [[ "${CONTAINER_ENGINE}" == "podman" ]]; then MAILCOW_HTTP_BIND="127.0.0.1" MAILCOW_HTTPS_BIND="127.0.0.1" - # Patch the docker-compose.yml for usage with Podman - bash ./patch-docker-compose-for-podman.sh + # Apply patches for usage with Podman + bash ./patches-for-podman.sh else MAILCOW_HTTP_BIND="" MAILCOW_HTTPS_BIND="" diff --git a/patch-docker-compose-for-podman.sh b/patches-for-podman.sh similarity index 59% rename from patch-docker-compose-for-podman.sh rename to patches-for-podman.sh index 70236a2e..711e470a 100755 --- a/patch-docker-compose-for-podman.sh +++ b/patches-for-podman.sh @@ -3,6 +3,8 @@ # This script patches the docker-compose.yml for usage with podman. # This is necessary because not all options (e.g. DNS) can be overwritten by docker-compose, see # https://github.com/docker/compose/issues/3729 +# +# Next to that because IPv6 does not work (yet), patch the MySQL configuration file to bind to IPv4 set -e @@ -16,5 +18,14 @@ cp docker-compose.yml docker-compose.yml.${TIMESTAMP}.bak if ! patch -R -s -f --dry-run docker-compose.yml < ${PATCH_FILE} > /dev/null 2>&1; then patch docker-compose.yml < ${PATCH_FILE} else - echo "Patch file already applied or custom changes prevent applying the patch" + echo "docker-compose.yml already patched (or custom changes prevent applying the patch)" +fi + +# Patch the MySQL configuration file +MYCNF_PATH="data/conf/mysql/my.cnf" +if ! grep "bind_address" ${MYCNF_PATH} > /dev/null 2>&1; then + echo "patching file my.cnf" + echo "bind_address = 0.0.0.0" >> ${MYCNF_PATH} +else + echo "my.cnf already patched" fi