mirror of
https://github.com/friendica/docker
synced 2024-09-28 00:44:20 +02:00
- Changed docker-compose examples because of the new smtp-environment
This commit is contained in:
parent
e0c270dd08
commit
5e3bf7e630
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -12,7 +12,7 @@ services:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: friendica/server:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
||||||
|
@ -21,6 +21,7 @@ services:
|
||||||
- MAILNAME=
|
- MAILNAME=
|
||||||
- TZ=
|
- TZ=
|
||||||
- LANGUAGE=
|
- LANGUAGE=
|
||||||
|
- SMTP=
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -30,7 +31,7 @@ services:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: friendica/server:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
||||||
|
@ -39,6 +40,7 @@ services:
|
||||||
- MAILNAME=
|
- MAILNAME=
|
||||||
- TZ=
|
- TZ=
|
||||||
- LANGUAGE=
|
- LANGUAGE=
|
||||||
|
- SMTP=
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
|
@ -12,7 +12,7 @@ services:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: friendica/server:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
||||||
|
@ -21,6 +21,7 @@ services:
|
||||||
- MAILNAME=
|
- MAILNAME=
|
||||||
- TZ=
|
- TZ=
|
||||||
- LANGUAGE=
|
- LANGUAGE=
|
||||||
|
- SMTP=
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -28,7 +29,7 @@ services:
|
||||||
hostname: friendica.local
|
hostname: friendica.local
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: friendica/server:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
||||||
|
@ -37,6 +38,7 @@ services:
|
||||||
- MAILNAME=
|
- MAILNAME=
|
||||||
- TZ=
|
- TZ=
|
||||||
- LANGUAGE=
|
- LANGUAGE=
|
||||||
|
- SMTP=
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
|
@ -12,7 +12,7 @@ services:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: friendica/server:fpm
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
||||||
|
@ -28,7 +28,7 @@ services:
|
||||||
hostname: friendica.local
|
hostname: friendica.local
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: friendica/server:fpm
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- friendica:/var/www/html
|
- friendica:/var/www/html
|
|
@ -85,7 +85,6 @@ COPY config/* /usr/src/config/
|
||||||
COPY *.sh /
|
COPY *.sh /
|
||||||
RUN chmod +x /*.sh
|
RUN chmod +x /*.sh
|
||||||
RUN chmod +x /usr/local/bin/*
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
%%INSTALL_EXTRAS%%
|
%%INSTALL_EXTRAS%%
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
|
@ -95,7 +95,6 @@ COPY config/* /usr/src/config/
|
||||||
COPY *.sh /
|
COPY *.sh /
|
||||||
RUN chmod +x /*.sh
|
RUN chmod +x /*.sh
|
||||||
RUN chmod +x /usr/local/bin/*
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
%%INSTALL_EXTRAS%%
|
%%INSTALL_EXTRAS%%
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
Loading…
Reference in a new issue