mirror of
https://github.com/friendica/docker
synced 2025-04-01 08:37:23 +02:00
Bugfixings SMTP /
- changed sendmail to ssmtp support - deleted smtp-examples (not necessary anymore) - added vendor libraries in stable-docker images ("full" package) - changed stack.yml to new SMTP behavior
This commit is contained in:
parent
4043b7901d
commit
fec33c98be
39 changed files with 442 additions and 330 deletions
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -16,7 +16,6 @@ The Dockerfiles use the default images as base image and build on top of it.
|
||||||
Examples | Descriptions
|
Examples | Descriptions
|
||||||
-------- | -------
|
-------- | -------
|
||||||
[cron](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed).
|
[cron](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed).
|
||||||
[smtp](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/smtp) | adds dependencies required to use SMTP as mail relay/smarthost
|
|
||||||
|
|
||||||
## docker-compose
|
## docker-compose
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@ RUN set -ex; \
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
mkdir /var/log/supervisord /var/run/supervisord
|
mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
COPY ./supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
CMD ["/usr/bin/supervisord"]
|
|
@ -9,6 +9,6 @@ RUN set -ex; \
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
mkdir /var/log/supervisord /var/run/supervisord
|
mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
COPY ./supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
CMD ["/usr/bin/supervisord"]
|
|
@ -1,24 +0,0 @@
|
||||||
# SMTP section
|
|
||||||
|
|
||||||
In this subfolder are examples how to add SMTP support to the Friendica docker images.
|
|
||||||
|
|
||||||
Each directory represents the image-version of the Dockerfile.
|
|
||||||
It uses the stable-branches of the Friendica Dockerfiles out-of-the-box.
|
|
||||||
So if you want to use the develop-branch, you have to add the prefix `develop-` at the `FROM`clause (e.g. `FROM friendica:apache` -> `FROM friendica:develop-apache`)
|
|
||||||
|
|
||||||
- `SMTP_HOST` The host/IP of the SMTP-MTA
|
|
||||||
|
|
||||||
## Custom SMTP Settings
|
|
||||||
|
|
||||||
Currently, only `apache` and `fpm` supports custom SMTP settings.
|
|
||||||
You **have** to set `SMTP_TYPE` to `custom` for other settings than `SMTP_HOST` (default: `simple`)
|
|
||||||
|
|
||||||
### SMTP Authentication
|
|
||||||
- `SMTP_USERNAME` Username for the SMTP-MTA user to authenticate.
|
|
||||||
- `SMTP_PASSWORD` Password for the SMTP-MTA user to authenticate.
|
|
||||||
|
|
||||||
### Additional settings
|
|
||||||
- `SMTP_PORT` The port of the SMTP-MTA (default: `25`)
|
|
||||||
- `SMTP_AUTH` The authentication string for the SMTP-MTA (default: `A p`)
|
|
||||||
- `SMTP_TRUST_AUTH_MECH` The trusted authentication mechanism for the SMTP-MTA (default: `EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN`)
|
|
||||||
- `SMTP_AUTH_MECH` The authentication mechanism for the SMTP-MTA (default: `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN`)
|
|
|
@ -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 @@
|
||||||
FROM friendica/server:fpm-alpine
|
|
||||||
|
|
||||||
# at least you HAVE to set one SMTP_HOST (normally something like mail.example.org)
|
|
||||||
ENV SMTP_HOST mail
|
|
||||||
|
|
||||||
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,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
|
|
|
@ -11,7 +11,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
sendmail \
|
ssmtp \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
@ -93,10 +93,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.05
|
ENV FRIENDICA_VERSION 2018.05
|
||||||
ENV FRIENDICA_ADDONS 2018.05
|
ENV FRIENDICA_ADDONS 2018.05
|
||||||
|
|
||||||
|
COPY bin/* /usr/local/bin/
|
||||||
|
COPY config/* /usr/src/config/
|
||||||
|
COPY *.sh /
|
||||||
|
RUN chmod +x /*.sh
|
||||||
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
curl -fsSL -o friendica.tar.gz \
|
curl -fsSL -o friendica.tar.gz \
|
||||||
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
||||||
|
@ -108,13 +117,8 @@ RUN set -ex; \
|
||||||
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
||||||
mkdir /usr/src/friendica/addon; \
|
mkdir /usr/src/friendica/addon; \
|
||||||
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
||||||
rm friendica_addons.tar.gz;
|
rm friendica_addons.tar.gz; \
|
||||||
|
friendica composer install;
|
||||||
COPY bin/* /usr/local/bin/
|
|
||||||
COPY config/* /usr/src/config/
|
|
||||||
COPY *.sh /
|
|
||||||
RUN chmod +x /*.sh
|
|
||||||
RUN chmod +x /usr/local/bin/*
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -4,10 +4,11 @@ LABEL maintainer="Philipp Holzer <admin@philipp.info>"
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
rsync \
|
rsync \
|
||||||
git;
|
git \
|
||||||
|
# For mail() support
|
||||||
|
ssmtp;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
@ -74,10 +75,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.05
|
ENV FRIENDICA_VERSION 2018.05
|
||||||
ENV FRIENDICA_ADDONS 2018.05
|
ENV FRIENDICA_ADDONS 2018.05
|
||||||
|
|
||||||
|
COPY bin/* /usr/local/bin/
|
||||||
|
COPY config/* /usr/src/config/
|
||||||
|
COPY *.sh /
|
||||||
|
RUN chmod +x /*.sh
|
||||||
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
curl -fsSL -o friendica.tar.gz \
|
curl -fsSL -o friendica.tar.gz \
|
||||||
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
||||||
|
@ -89,13 +99,8 @@ RUN set -ex; \
|
||||||
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
||||||
mkdir /usr/src/friendica/addon; \
|
mkdir /usr/src/friendica/addon; \
|
||||||
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
||||||
rm friendica_addons.tar.gz;
|
rm friendica_addons.tar.gz; \
|
||||||
|
friendica composer install;
|
||||||
COPY bin/* /usr/local/bin/
|
|
||||||
COPY config/* /usr/src/config/
|
|
||||||
COPY *.sh /
|
|
||||||
RUN chmod +x /*.sh
|
|
||||||
RUN chmod +x /usr/local/bin/*
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -11,7 +11,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
sendmail \
|
ssmtp \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
@ -85,10 +85,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.05
|
ENV FRIENDICA_VERSION 2018.05
|
||||||
ENV FRIENDICA_ADDONS 2018.05
|
ENV FRIENDICA_ADDONS 2018.05
|
||||||
|
|
||||||
|
COPY bin/* /usr/local/bin/
|
||||||
|
COPY config/* /usr/src/config/
|
||||||
|
COPY *.sh /
|
||||||
|
RUN chmod +x /*.sh
|
||||||
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
curl -fsSL -o friendica.tar.gz \
|
curl -fsSL -o friendica.tar.gz \
|
||||||
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
"https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \
|
||||||
|
@ -100,13 +109,8 @@ RUN set -ex; \
|
||||||
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
"https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \
|
||||||
mkdir /usr/src/friendica/addon; \
|
mkdir /usr/src/friendica/addon; \
|
||||||
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \
|
||||||
rm friendica_addons.tar.gz;
|
rm friendica_addons.tar.gz; \
|
||||||
|
friendica composer install;
|
||||||
COPY bin/* /usr/local/bin/
|
|
||||||
COPY config/* /usr/src/config/
|
|
||||||
COPY *.sh /
|
|
||||||
RUN chmod +x /*.sh
|
|
||||||
RUN chmod +x /usr/local/bin/*
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -11,7 +11,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
sendmail \
|
ssmtp \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
@ -93,16 +93,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.08-dev
|
ENV FRIENDICA_VERSION 2018.08-dev
|
||||||
ENV FRIENDICA_ADDONS 2018.08-dev
|
ENV FRIENDICA_ADDONS 2018.08-dev
|
||||||
|
|
||||||
|
|
||||||
COPY bin/* /usr/local/bin/
|
COPY bin/* /usr/local/bin/
|
||||||
COPY config/* /usr/src/config/
|
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/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -4,10 +4,11 @@ LABEL maintainer="Philipp Holzer <admin@philipp.info>"
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
rsync \
|
rsync \
|
||||||
git;
|
git \
|
||||||
|
# For mail() support
|
||||||
|
ssmtp;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
@ -74,16 +75,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.08-dev
|
ENV FRIENDICA_VERSION 2018.08-dev
|
||||||
ENV FRIENDICA_ADDONS 2018.08-dev
|
ENV FRIENDICA_ADDONS 2018.08-dev
|
||||||
|
|
||||||
|
|
||||||
COPY bin/* /usr/local/bin/
|
COPY bin/* /usr/local/bin/
|
||||||
COPY config/* /usr/src/config/
|
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/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -11,7 +11,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
sendmail \
|
ssmtp \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
@ -85,16 +85,19 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION 2018.08-dev
|
ENV FRIENDICA_VERSION 2018.08-dev
|
||||||
ENV FRIENDICA_ADDONS 2018.08-dev
|
ENV FRIENDICA_ADDONS 2018.08-dev
|
||||||
|
|
||||||
|
|
||||||
COPY bin/* /usr/local/bin/
|
COPY bin/* /usr/local/bin/
|
||||||
COPY config/* /usr/src/config/
|
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/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
FRIENDICA_VERSION=${FRIENDICA_VERSION:-develop}
|
SMTP=${SMTP:-localhost}
|
||||||
FRIENDICA_ADDONS=${FRIENDICA_ADDONS:-develop}
|
SMTP_FROM=${SMTP_FROM:-no-reply}
|
||||||
AUTOINSTALL=${AUTOINSTALL:-false}
|
|
||||||
|
|
||||||
SOURCEDIR=/usr/src
|
SOURCEDIR=${SOURCEDIR:-/usr/src}
|
||||||
WORKDIR=/var/www/html
|
WORKDIR=${WORKDIR:-/var/www/html}
|
||||||
|
|
||||||
|
SMTP_TLS=${SMTP_TLS:-}
|
||||||
|
SMTP_STARTTLS=${SMTP_STARTTLS:-}
|
||||||
|
SMTP_AUTH_USER=${SMTP_AUTH_USER:-}
|
||||||
|
SMTP_AUTH_PASS=${SMTP_AUTH_PASS:-}
|
||||||
|
SMTP_AUTH_METHOD=${SMTP_AUTH_METHOD:-}
|
||||||
|
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quit)
|
-q|--quit)
|
||||||
if [ "$VERBOSE" -eq "2" ]; then
|
if [ "$VERBOSE" -eq 2 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +25,7 @@ for arg; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
if [ "$VERBOSE" -eq "0" ]; then
|
if [ "$VERBOSE" -eq 0 ]; then
|
||||||
echo 'You cannot use verbose and quiet at the same time'
|
echo 'You cannot use verbose and quiet at the same time'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -32,7 +37,7 @@ done
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "$1"
|
su - www-data -s /bin/sh -c "$1"
|
||||||
else
|
else
|
||||||
sh -c "$1"
|
sh -c "$1"
|
||||||
|
@ -42,7 +47,7 @@ run_as() {
|
||||||
# log event
|
# log event
|
||||||
log() {
|
log() {
|
||||||
currVerb=1
|
currVerb=1
|
||||||
if [ $# -eq 2 ]; then
|
if [ "$#" -eq 2 ]; then
|
||||||
currVerb=$2
|
currVerb=$2
|
||||||
fi
|
fi
|
||||||
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
if [ "$VERBOSE" -ge "$currVerb" ]; then
|
||||||
|
@ -105,6 +110,9 @@ console() {
|
||||||
composer() {
|
composer() {
|
||||||
if [ -f $WORKDIR/bin/composer.phar ]; then
|
if [ -f $WORKDIR/bin/composer.phar ]; then
|
||||||
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
run_as "cd $WORKDIR;$WORKDIR/bin/composer.phar $@ -d $WORKDIR"
|
||||||
|
elif [ -f $SOURCEDIR/friendica/bin/composer.phar ]; then
|
||||||
|
cd $SOURCEDIR/friendica
|
||||||
|
$SOURCEDIR/friendica/bin/composer.phar "$@" -d $SOURCEDIR/friendica
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +141,7 @@ copy_sources() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
rsync_options="-rlDog --chown=www-data:root"
|
rsync_options="-rlDog --chown=www-data:root"
|
||||||
else
|
else
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
|
@ -163,7 +171,7 @@ install() {
|
||||||
|
|
||||||
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
if [ ! -f ${WORKDIR}/.htconfig.php ] &&
|
||||||
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
[ -f ${SOURCEDIR}/config/htconfig.php ] &&
|
||||||
"$AUTOINSTALL" == "true"; then
|
[ "$AUTOINSTALL" = "true" ]; then
|
||||||
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php"
|
||||||
console autoinstall -f .htconfig.php
|
console autoinstall -f .htconfig.php
|
||||||
# TODO Workaround because of a strange permission issue
|
# TODO Workaround because of a strange permission issue
|
||||||
|
@ -186,21 +194,37 @@ update() {
|
||||||
console dbstructure update
|
console dbstructure update
|
||||||
}
|
}
|
||||||
|
|
||||||
sendmail() {
|
configmail() {
|
||||||
if [ ! -f /etc/init.d/sendmail ]; then
|
if [ "$SMTP" = "localhost" ]; then
|
||||||
# If sendmail isn't installed, exit this method
|
# SMTP is a required setting
|
||||||
|
# do nothing if it is "localhost" (= not changed)
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(head -n 1 /etc/hosts)
|
sed -i "s/:root:/:${SITENAME}:/g" /etc/passwd
|
||||||
line2=$(echo $line | awk '{print $2}')
|
sed -i "s/Linux\ User/${SITENAME}/g" /etc/passwd
|
||||||
echo "$line $line2.localdomain" >> /etc/hosts
|
|
||||||
|
|
||||||
log 'Starting sendmail for Mail-Support'
|
# add possible mail-senders
|
||||||
nohup /etc/init.d/sendmail start > /dev/null 2>&1 &
|
echo "www-data:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
echo "root:$SMTP_FROM@$HOSTNAME:$SMTP" >> /etc/ssmtp/revaliases
|
||||||
|
|
||||||
|
# replace ssmtp.conf settings
|
||||||
|
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||||
|
# /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
root=$SMTP_FROM@$HOSTNAME
|
||||||
|
hostname=$HOSTNAME
|
||||||
|
mailhub=$SMTP
|
||||||
|
FromLineOverride=YES
|
||||||
|
EOF
|
||||||
|
[ -z "$SMTP_TLS" ] || echo "UseTLS=$SMTP_TLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_STARTTLS" ] || echo "UseSTARTTLS=$SMTP_STARTTLS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_USER" ] || echo "AuthUser=$SMTP_AUTH_USER" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_PASS" ] || echo "AuthPass=$SMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
[ -z "$SMTP_AUTH_METHOD" ] || echo "AuthMethod=$SMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
friendica_help
|
friendica_help
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -210,6 +234,6 @@ case "$1" in
|
||||||
update) shift; update $@ ;;
|
update) shift; update $@ ;;
|
||||||
console) shift; console $@ ;;
|
console) shift; console $@ ;;
|
||||||
composer) shift; composer $@ ;;
|
composer) shift; composer $@ ;;
|
||||||
sendmail) shift; sendmail $@ ;;
|
configmail) shift; configmail $@ ;;
|
||||||
*) friendica_help ;;
|
*) friendica_help ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -106,3 +106,8 @@ $a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid'
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
// Authentication cookie lifetime, in days
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
$a->config['system']['auth_cookie_lifetime'] = 7;
|
||||||
|
|
||||||
|
if (!empty(getenv('VALIDATION'))) {
|
||||||
|
$a->config['system']['disable_url_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
$a->config['system']['disable_email_validation'] = strtolower(getenv('VALIDATION'));
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -3,10 +3,11 @@ LABEL maintainer="Philipp Holzer <admin@philipp.info>"
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
rsync \
|
rsync \
|
||||||
git;
|
git \
|
||||||
|
# For mail() support
|
||||||
|
ssmtp;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
@ -73,10 +74,11 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION %%VERSION%%
|
ENV FRIENDICA_VERSION %%VERSION%%
|
||||||
ENV FRIENDICA_ADDONS %%VERSION%%
|
ENV FRIENDICA_ADDONS %%VERSION%%
|
||||||
%%INSTALL_EXTRAS%%
|
|
||||||
|
|
||||||
COPY bin/* /usr/local/bin/
|
COPY bin/* /usr/local/bin/
|
||||||
COPY config/* /usr/src/config/
|
COPY config/* /usr/src/config/
|
||||||
|
@ -84,5 +86,7 @@ COPY *.sh /
|
||||||
RUN chmod +x /*.sh
|
RUN chmod +x /*.sh
|
||||||
RUN chmod +x /usr/local/bin/*
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
|
%%INSTALL_EXTRAS%%
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["%%CMD%%"]
|
CMD ["%%CMD%%"]
|
|
@ -10,7 +10,7 @@ RUN set -ex; \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
sendmail \
|
ssmtp \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
@ -84,10 +84,11 @@ RUN {\
|
||||||
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
} > /usr/local/etc/php/conf.d/sendmail.ini;
|
||||||
|
|
||||||
ENV AUTOINSTALL false
|
ENV AUTOINSTALL false
|
||||||
|
ENV VALIDATION true
|
||||||
|
ENV SITENAME "Friendica Social Network"
|
||||||
|
|
||||||
ENV FRIENDICA_VERSION %%VERSION%%
|
ENV FRIENDICA_VERSION %%VERSION%%
|
||||||
ENV FRIENDICA_ADDONS %%VERSION%%
|
ENV FRIENDICA_ADDONS %%VERSION%%
|
||||||
%%INSTALL_EXTRAS%%
|
|
||||||
|
|
||||||
COPY bin/* /usr/local/bin/
|
COPY bin/* /usr/local/bin/
|
||||||
COPY config/* /usr/src/config/
|
COPY config/* /usr/src/config/
|
||||||
|
@ -95,5 +96,7 @@ COPY *.sh /
|
||||||
RUN chmod +x /*.sh
|
RUN chmod +x /*.sh
|
||||||
RUN chmod +x /usr/local/bin/*
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
|
%%INSTALL_EXTRAS%%
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["%%CMD%%"]
|
CMD ["%%CMD%%"]
|
||||||
|
|
15
README.md
15
README.md
|
@ -121,6 +121,14 @@ You can preconfigure everything that is asked on the install page on first run.
|
||||||
|
|
||||||
- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`)
|
- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`)
|
||||||
|
|
||||||
|
**SMTP/Mail Settings**:
|
||||||
|
|
||||||
|
- `SMTP` **required** address of the SMTP Mail-Gateway (Default: `localhost`)
|
||||||
|
- `SMTP_FROM` sender user-part of the address (Default: `no-reply` - e.g. no-reply@friendica.local)
|
||||||
|
- `SMTP_AUTH_USER` Username 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)
|
||||||
|
|
||||||
**MYSQL/MariaDB**:
|
**MYSQL/MariaDB**:
|
||||||
|
|
||||||
- `MYSQL_USERNAME` Username for the database user using mysql.
|
- `MYSQL_USERNAME` Username for the database user using mysql.
|
||||||
|
@ -133,9 +141,10 @@ You can preconfigure everything that is asked on the install page on first run.
|
||||||
You can also predefine the following `.htconfig.php` values:
|
You can also predefine the following `.htconfig.php` values:
|
||||||
|
|
||||||
- `MAILNAME` E-Mail address of the administrator
|
- `MAILNAME` E-Mail address of the administrator
|
||||||
- `TZ` The default localization of the Friendica server
|
- `TZ` The default localization of the Friendica server (Default: `America/Los_Angeles`)
|
||||||
- `LANGUAGE` The default language of the Friendica server
|
- `LANGUAGE` The default language of the Friendica server (Default: `en`)
|
||||||
- `SITENAME` The default name of the Friendica server
|
- `SITENAME` The default name of the Friendica server (Default: `Friendica Social Network` )
|
||||||
|
- `VALIDATION` The default setting if url/emails are getting validated (Default: `true`)
|
||||||
|
|
||||||
## Updating to a newer version
|
## Updating to a newer version
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
friendica install -q
|
friendica install -q
|
||||||
friendica sendmail -q
|
friendica configmail -q
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -27,6 +27,8 @@ services:
|
||||||
- MYSQL_PASSWORD=friendica
|
- MYSQL_PASSWORD=friendica
|
||||||
- MYSQL_DATABASE=friendica
|
- MYSQL_DATABASE=friendica
|
||||||
- MAILNAME=root@friendica.local
|
- MAILNAME=root@friendica.local
|
||||||
|
- SITENAME=Friendica PWD Test Node
|
||||||
|
- VALIDATION=false
|
||||||
hostname: friendica.local
|
hostname: friendica.local
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
@ -44,6 +46,7 @@ services:
|
||||||
- MYSQL_PASSWORD=friendica
|
- MYSQL_PASSWORD=friendica
|
||||||
- MYSQL_DATABASE=friendica
|
- MYSQL_DATABASE=friendica
|
||||||
- MAILNAME=root@friendica.local
|
- MAILNAME=root@friendica.local
|
||||||
|
- SITENAME=Friendica PWD Test Node
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ declare -A pecl_versions=(
|
||||||
)
|
)
|
||||||
|
|
||||||
declare -A install_extras=(
|
declare -A install_extras=(
|
||||||
['stable']='\nRUN set -ex; \\\n curl -fsSL -o friendica.tar.gz \\\n "https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \\\n tar -xzf friendica.tar.gz -C /usr/src/; \\\n rm friendica.tar.gz; \\\n mv -f /usr/src/friendica-${FRIENDICA_VERSION}/ /usr/src/friendica; \\\n chmod 777 /usr/src/friendica/view/smarty3; \\\n curl -fsSL -o friendica_addons.tar.gz \\\n "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \\\n mkdir /usr/src/friendica/addon; \\\n tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \\\n rm friendica_addons.tar.gz;'
|
['stable']='\nRUN set -ex; \\\n curl -fsSL -o friendica.tar.gz \\\n "https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \\\n tar -xzf friendica.tar.gz -C /usr/src/; \\\n rm friendica.tar.gz; \\\n mv -f /usr/src/friendica-${FRIENDICA_VERSION}/ /usr/src/friendica; \\\n chmod 777 /usr/src/friendica/view/smarty3; \\\n curl -fsSL -o friendica_addons.tar.gz \\\n "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \\\n mkdir /usr/src/friendica/addon; \\\n tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \\\n rm friendica_addons.tar.gz; \\\n friendica composer install;'
|
||||||
['develop']=''
|
['develop']=''
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue