public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Compose] Expose SQL to 13306 on 127.0.0.1
61180858
docker-compose.yml | 2 ++
generate_config.sh | 4 ++++
update.sh | 7 +++++++
3 files changed, 13 insertions(+)
Diff
diff --git a/docker-compose.yml b/docker-compose.yml
index 23d16949..5188bde8 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -32,6 +32,8 @@ services:
restart: always
dns:
- ${IPV4_NETWORK}.254
+ ports:
+ - "${SQL_PORT:-127.0.0.1:13306}:3306"
sysctls:
- net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
networks:
diff --git a/generate_config.sh b/generate_config.sh
index b3a71f2c..c65f658b 100755
--- a/generate_config.sh
+++ b/generate_config.sh
@@ -74,6 +74,7 @@ POP_PORT=110
POPS_PORT=995
SIEVE_PORT=4190
DOVEADM_PORT=127.0.0.1:19991
+SQL_PORT=127.0.0.1:13306
# Your timezone
TZ=${TZ}
@@ -108,6 +109,9 @@ IPV4_NETWORK=172.22.1
# Internal IPv6 subnet in fc00::/7
IPV6_NETWORK=fd4d:6169:6c63:6f77::/64
+# Use this IP for outgoing connections (SNAT)' >> mailcow.conf
+#SNAT_TO_SOURCE=" >> mailcow.conf
+
# Disable IPv6
# mailcow-network will still be created as IPv6 enabled, all containers will be created
# without IPv6 support.
diff --git a/update.sh b/update.sh
index 37acbdce..56ec3ab9 100755
--- a/update.sh
+++ b/update.sh
@@ -43,6 +43,7 @@ CONFIG_ARRAY=(
"LOG_LINES"
"SNAT_TO_SOURCE"
"SYSCTL_IPV6_DISABLED"
+ "SQL_PORT"
)
sed -i '$a\' mailcow.conf
@@ -94,6 +95,12 @@ for option in ${CONFIG_ARRAY[@]}; do
echo '# Internal IPv6 subnet in fc00::/7' >> mailcow.conf
echo "IPV6_NETWORK=fd4d:6169:6c63:6f77::/64" >> mailcow.conf
fi
+ elif [[ ${option} == "SQL_PORT" ]]; then
+ if ! grep -q ${option} mailcow.conf; then
+ echo "Adding new option \"${option}\" to mailcow.conf"
+ echo '# Bind SQL to 127.0.0.1 on port 13306' >> mailcow.conf
+ echo "SQL_PORT=127.0.0.1:13306" >> mailcow.conf
+ fi
elif [[ ${option} == "SNAT_TO_SOURCE" ]]; then
if ! grep -q ${option} mailcow.conf; then
echo "Adding new option \"${option}\" to mailcow.conf"