- Changed docker-compose examples because of the new smtp-environment

This commit is contained in:
Philipp Holzer 2018-06-06 20:58:45 +02:00
parent e0c270dd08
commit 5e3bf7e630
No known key found for this signature in database
GPG Key ID: 58160D7D6AF942B6
15 changed files with 10 additions and 140 deletions

View File

@ -1,12 +0,0 @@
# Based on .exmples/dockerfiles/smtp/apache
FROM friendica/server:apache
# simple = using an smtp without any credentials (mostly in local networks)
# custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support)
ENV SMTP_TYPE simple
ENV SMTP_HOST smtp.example.org
COPY *.sh /
RUN chmod +x /*.sh
RUN /smtp-config.sh

View File

@ -1,45 +0,0 @@
#!/bin/sh
set -eu
IFS=\n
SMTP_TYPE=${SMTP_TYPE:-simple}
# config options
SMTP_HOST=${SMTP_HOST:-'localhost'}
SMTP_PORT=${SMTP_PORT:-'25'}
SMTP_AUTH=${SMTP_AUTH:-'A p'}
SMTP_TRUST_AUTH_MECH=${SMTP_TRUST_AUTH_MECH:-'EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'}
SMTP_AUTH_MECH=${SMTP_AUTH_MECH:-'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'}
SMTP_USERNAME=${SMTP_USERNAME:-''}
SMTP_PASSWORD=${SMTP_PASSWORD:-''}
smtp_simple() {
sed -i '/MAILER_DEFINITIONS/i define(`SMART_HOST'\'',`'$SMTP_HOST''\'')dnl/' /etc/mail/sendmail.mc
}
smtp_custom() {
cd /etc/mail
mkdir -m 700 authinfo
cd authinfo/
echo 'Authinfo: "U:www-data" "I:'$SMTP_USERNAME'" "P:'$SMTP_PASSWORD'"' > auth_file
makemap hash auth < auth_file
sed -i '/MAILER_DEFINITIONS/i \
define(`SMART_HOST'\'',`'$SMTP_HOST''\'')dnl \
define(`RELAY_MAILER_ARGS'\'', `TCP '$SMTP_HOST' '$SMTP_PORT''\'')dnl \
define(`ESMTP_MAILER_ARGS'\'', `TCP '$SMTP_HOST' '$SMTP_PORT''\'')dnl \
define(`confAUTH_OPTIONS'\'', `'$SMTP_AUTH''\'')dnl \
TRUST_AUTH_MECH(`'$SMTP_TRUST_AUTH_MECH''\'')dnl \
define(`confAUTH_MECHANISMS'\'', `'$SMTP_AUTH_MECH''\'')dnl \
FEATURE(`authinfo'\'',`hash -o /etc/mail/authinfo/auth.db'\'')dnl' /etc/mail/sendmail.mc
}
case $SMTP_TYPE in
simple) smtp_simple ;;
custom) smtp_custom ;;
*)
echo "Unknown SMTP-Type '$SMTP_TYPE'"
exit 1
esac

View File

@ -1,18 +0,0 @@
# Based on .exmples/dockerfiles/smtp/fpm-alpine
FROM friendica/server:fpm-alpine
ENV SMTP_HOST smtp.example.org
RUN set -ex; \
\
apk add --no-cache \
ssmtp \
; \
# disable the current mailhub
sed -i "s|mailhub=|#mailhub= |g" /etc/ssmtp/ssmtp.conf; \
# enable the new mailhub
echo "mailhub=${SMTP_HOST:-localhost}" >> /etc/ssmtp/ssmtp.conf;
# simple = using an smtp without any credentials (mostly in local networks)
# custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support)
ENV SMTP_TYPE simple

View File

@ -1,12 +0,0 @@
# Based on .exmples/dockerfiles/smtp/fpm
FROM friendica/server:fpm
# simple = using an smtp without any credentials (mostly in local networks)
# custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support)
ENV SMTP_TYPE simple
ENV SMTP_HOST smtp.example.org
COPY *.sh /
RUN chmod +x /*.sh
RUN /smtp-config.sh

View File

@ -1,45 +0,0 @@
#!/bin/sh
set -eu
IFS=\n
SMTP_TYPE=${SMTP_TYPE:-simple}
# config options
SMTP_HOST=${SMTP_HOST:-'localhost'}
SMTP_PORT=${SMTP_PORT:-'25'}
SMTP_AUTH=${SMTP_AUTH:-'A p'}
SMTP_TRUST_AUTH_MECH=${SMTP_TRUST_AUTH_MECH:-'EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'}
SMTP_AUTH_MECH=${SMTP_AUTH_MECH:-'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'}
SMTP_USERNAME=${SMTP_USERNAME:-''}
SMTP_PASSWORD=${SMTP_PASSWORD:-''}
smtp_simple() {
sed -i '/MAILER_DEFINITIONS/i define(`SMART_HOST'\'',`'$SMTP_HOST''\'')dnl/' /etc/mail/sendmail.mc
}
smtp_custom() {
cd /etc/mail
mkdir -m 700 authinfo
cd authinfo/
echo 'Authinfo: "U:www-data" "I:'$SMTP_USERNAME'" "P:'$SMTP_PASSWORD'"' > auth_file
makemap hash auth < auth_file
sed -i '/MAILER_DEFINITIONS/i \
define(`SMART_HOST'\'',`'$SMTP_HOST''\'')dnl \
define(`RELAY_MAILER_ARGS'\'', `TCP '$SMTP_HOST' '$SMTP_PORT''\'')dnl \
define(`ESMTP_MAILER_ARGS'\'', `TCP '$SMTP_HOST' '$SMTP_PORT''\'')dnl \
define(`confAUTH_OPTIONS'\'', `'$SMTP_AUTH''\'')dnl \
TRUST_AUTH_MECH(`'$SMTP_TRUST_AUTH_MECH''\'')dnl \
define(`confAUTH_MECHANISMS'\'', `'$SMTP_AUTH_MECH''\'')dnl \
FEATURE(`authinfo'\'',`hash -o /etc/mail/authinfo/auth.db'\'')dnl' /etc/mail/sendmail.mc
}
case $SMTP_TYPE in
simple) smtp_simple ;;
custom) smtp_custom ;;
*)
echo "Unknown SMTP-Type '$SMTP_TYPE'"
exit 1
esac

View File

@ -12,7 +12,7 @@ services:
- db.env
app:
build: ./app
image: friendica/server:apache
restart: always
volumes:
- friendica:/var/www/html
@ -21,6 +21,7 @@ services:
- MAILNAME=
- TZ=
- LANGUAGE=
- SMTP=
env_file:
- db.env
depends_on:
@ -30,7 +31,7 @@ services:
- "80:80"
cron:
build: ./app
image: friendica/server:apache
restart: always
volumes:
- friendica:/var/www/html
@ -39,6 +40,7 @@ services:
- MAILNAME=
- TZ=
- LANGUAGE=
- SMTP=
env_file:
- db.env
depends_on:

View File

@ -12,7 +12,7 @@ services:
- db.env
app:
build: ./app
image: friendica/server:fpm-alpine
restart: always
volumes:
- friendica:/var/www/html
@ -21,6 +21,7 @@ services:
- MAILNAME=
- TZ=
- LANGUAGE=
- SMTP=
env_file:
- db.env
depends_on:
@ -28,7 +29,7 @@ services:
hostname: friendica.local
cron:
build: ./app
image: friendica/server:fpm-alpine
restart: always
volumes:
- friendica:/var/www/html
@ -37,6 +38,7 @@ services:
- MAILNAME=
- TZ=
- LANGUAGE=
- SMTP=
env_file:
- db.env
depends_on:

View File

@ -12,7 +12,7 @@ services:
- db.env
app:
build: ./app
image: friendica/server:fpm
restart: always
volumes:
- friendica:/var/www/html
@ -28,7 +28,7 @@ services:
hostname: friendica.local
cron:
build: ./app
image: friendica/server:fpm
restart: always
volumes:
- friendica:/var/www/html

View File

@ -85,7 +85,6 @@ COPY config/* /usr/src/config/
COPY *.sh /
RUN chmod +x /*.sh
RUN chmod +x /usr/local/bin/*
%%INSTALL_EXTRAS%%
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -95,7 +95,6 @@ COPY config/* /usr/src/config/
COPY *.sh /
RUN chmod +x /*.sh
RUN chmod +x /usr/local/bin/*
%%INSTALL_EXTRAS%%
ENTRYPOINT ["/entrypoint.sh"]