mirror of
https://github.com/friendica/docker
synced 2024-06-22 04:34:41 +02:00
Merge pull request #120 from nupplaphil/debian_buster
Switch to Debian Buster
This commit is contained in:
commit
b5a54c3296
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
FROM php:7.3-apache-stretch
|
FROM php:7.3-apache-buster
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -10,7 +10,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
# For tini installation
|
# For tini installation
|
||||||
gnupg dirmngr \
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
|
@ -35,7 +35,7 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
|
@ -109,7 +109,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -7,7 +7,7 @@ RUN set -ex; \
|
||||||
rsync \
|
rsync \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
shadow \
|
shadow \
|
||||||
tini;
|
tini;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ RUN set -ex; \
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
$PHPIZE_DEPS \
|
$PHPIZE_DEPS \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
@ -84,7 +84,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
FROM php:7.3-fpm-stretch
|
FROM php:7.3-fpm-buster
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -10,7 +10,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
# For tini installation
|
# For tini installation
|
||||||
gnupg dirmngr \
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
|
@ -35,7 +35,7 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
|
@ -109,7 +109,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
FROM php:7.3-apache-stretch
|
FROM php:7.3-apache-buster
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -10,7 +10,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
# For tini installation
|
# For tini installation
|
||||||
gnupg dirmngr \
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
|
@ -35,7 +35,7 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
|
@ -109,7 +109,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -7,7 +7,7 @@ RUN set -ex; \
|
||||||
rsync \
|
rsync \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
shadow \
|
shadow \
|
||||||
tini;
|
tini;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ RUN set -ex; \
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
$PHPIZE_DEPS \
|
$PHPIZE_DEPS \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
@ -84,7 +84,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
FROM php:7.3-fpm-stretch
|
FROM php:7.3-fpm-buster
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -10,7 +10,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
# For tini installation
|
# For tini installation
|
||||||
gnupg dirmngr \
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
|
@ -35,7 +35,7 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
|
@ -109,7 +109,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
|
@ -6,7 +6,7 @@ RUN set -ex; \
|
||||||
rsync \
|
rsync \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
shadow \
|
shadow \
|
||||||
tini;
|
tini;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ RUN set -ex; \
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
$PHPIZE_DEPS \
|
$PHPIZE_DEPS \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
@ -83,7 +83,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM php:%%PHP_VERSION%%-%%VARIANT%%-stretch
|
FROM php:%%PHP_VERSION%%-%%VARIANT%%-buster
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -9,7 +9,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
msmtp \
|
||||||
# For tini installation
|
# For tini installation
|
||||||
gnupg dirmngr \
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
|
@ -34,7 +34,7 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
mysql-client \
|
mariadb-client \
|
||||||
bash \
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
|
@ -108,7 +108,7 @@ RUN set -ex; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
{ \
|
{ \
|
||||||
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
echo sendmail_path = "/usr/bin/msmtp -t"; \
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
|
|
@ -107,13 +107,13 @@ A valid SMTP-MTA would be, for example, `mx.example.org`.
|
||||||
The following environment variables are possible for the SMTP examples.
|
The following environment variables are possible for the SMTP examples.
|
||||||
|
|
||||||
- `SMTP` Address of the SMTP Mail-Gateway. (**required**)
|
- `SMTP` Address of the SMTP Mail-Gateway. (**required**)
|
||||||
|
- `SMTP_PORT` Port of the SMTP Mail-Gateway. (Default: 587)
|
||||||
- `SMTP_DOMAIN` The sender domain. (**required** - e.g. `friendica.local`)
|
- `SMTP_DOMAIN` The sender domain. (**required** - e.g. `friendica.local`)
|
||||||
- `SMTP_FROM` Sender user-part of the address. (Default: `no-reply` - e.g. no-reply@friendica.local)
|
- `SMTP_FROM` Sender user-part of the address. (Default: `no-reply` - e.g. no-reply@friendica.local)
|
||||||
- `SMTP_TLS` Use TLS for connecting the SMTP Mail-Gateway. (Default: empty)
|
- `SMTP_TLS` Use TLS for connecting the SMTP Mail-Gateway. (Default: empty)
|
||||||
- `SMTP_STARTTLS` Use STARTTLS for connecting the SMTP Mail-Gateway. (Default: empty)
|
- `SMTP_STARTTLS` Use STARTTLS for connecting the SMTP Mail-Gateway. (Default: empty)
|
||||||
- `SMTP_AUTH_USER` Username for the SMTP Mail-Gateway. (Default: empty)
|
- `SMTP_AUTH_USER` Username for the SMTP Mail-Gateway. (Default: empty)
|
||||||
- `SMTP_AUTH_PASS` Password for the SMTP Mail-Gateway. (Default: empty)
|
- `SMTP_AUTH_PASS` Password for the SMTP Mail-Gateway. (Default: empty)
|
||||||
- `SMTP_AUTH_METHOD` Authentication method for the SMTP Mail-Gateway. (Default: empty/plain text)
|
|
||||||
|
|
||||||
## Database settings
|
## Database settings
|
||||||
|
|
||||||
|
|
|
@ -7,49 +7,54 @@ run_as() {
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh "$@"
|
su - www-data -s /bin/sh "$@"
|
||||||
else
|
else
|
||||||
sh "$@"
|
sh "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
version_greater() {
|
version_greater() {
|
||||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ssmtp() {
|
setup_msmtp() {
|
||||||
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" ]; then
|
||||||
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
SITENAME="${FRIENDICA_SITENAME:-Friendica Social Network}"
|
||||||
echo "Setup SSMTP for '$SITENAME' with '$SMTP' ..."
|
echo "Setup MSMTP for '$SITENAME' with '$SMTP' ..."
|
||||||
|
|
||||||
smtp_from=${SMTP_FROM:-no-reply}
|
smtp_from="${SMTP_FROM:=no-reply}"
|
||||||
|
|
||||||
# Setup SSMTP
|
# Setup MSMTP
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root
|
||||||
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" www-data
|
||||||
|
|
||||||
# add possible mail-senders
|
# add possible mail-senders
|
||||||
{
|
{
|
||||||
echo "www-data:$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "www-data: $smtp_from@$SMTP_DOMAIN"
|
||||||
echo "root::$smtp_from@$SMTP_DOMAIN:$SMTP"
|
echo "root: $smtp_from@$SMTP_DOMAIN"
|
||||||
} > /etc/ssmtp/revaliases
|
} >/etc/aliases
|
||||||
|
|
||||||
# replace ssmtp.conf settings
|
# create msmtp settings
|
||||||
{
|
{
|
||||||
echo "root=:$smtp_from@$SMTP_DOMAIN"
|
echo "account default"
|
||||||
echo "hostname=$SMTP_DOMAIN"
|
echo "host $SMTP_DOMAIN"
|
||||||
echo "mailhub=$SMTP"
|
if [ -n "${SMTP_PORT+x}" ]; then echo "port $SMTP_PORT"; else echo "port 587"; fi
|
||||||
echo "FromLineOverride=YES"
|
echo "from $smtp_from@$SMTP_DOMAIN"
|
||||||
if [ -n "${SMTP_TLS+x}" ]; then echo "UseTLS=$SMTP_TLS"; fi
|
echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames
|
||||||
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "UseSTARTTLS=$SMTP_STARTTLS"; fi
|
if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "AuthUser=$SMTP_AUTH_USER"; fi
|
if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi
|
||||||
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "AuthPass=$SMTP_AUTH_PASS";fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth on"; fi
|
||||||
if [ -n "${SMTP_AUTH_METHOD+x}" ]; then echo "AuthMethod=$SMTP_AUTH_METHOD"; fi
|
if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user $SMTP_AUTH_USER"; fi
|
||||||
} > /etc/ssmtp/ssmtp.conf
|
if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password $SMTP_AUTH_PASS"; fi
|
||||||
|
echo "logfile /var/log/msmtp.log"
|
||||||
|
echo "aliases /etc/aliases"
|
||||||
|
} >/etc/msmtprc
|
||||||
|
|
||||||
echo "Setup finished"
|
echo "Setup finished"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_msmtp
|
||||||
|
|
||||||
# just check if we execute apache or php-fpm
|
# just check if we execute apache or php-fpm
|
||||||
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
|
@ -65,8 +70,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_ssmtp
|
|
||||||
|
|
||||||
# check it just in case the version is greater or if we force the upgrade
|
# check it just in case the version is greater or if we force the upgrade
|
||||||
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
if version_greater "$image_version" "$installed_version" || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
|
||||||
echo "Initializing Friendica $image_version ..."
|
echo "Initializing Friendica $image_version ..."
|
||||||
|
|
Loading…
Reference in a new issue