2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2025-04-17 16:22:15 +02:00

Improvements and Examples

- Adding `sendmail` feature to `apache` and `fpm`
- Adding section `.examples/dockerfiles`
- Adding section `.examples/dockerfiles/cron` to combine app & external cron-jobs
- Adding section `.examples/dockerfiles/smtp` for further SMTP-settings
This commit is contained in:
Philipp Holzer 2018-05-20 15:44:03 +02:00
parent 57afa34813
commit 0826aaefa9
No known key found for this signature in database
GPG key ID: 58160D7D6AF942B6
35 changed files with 434 additions and 26 deletions

View file

@ -0,0 +1,17 @@
FROM friendica:apache
ENV AUTOINSTALL true
ENV MARIADB_VERSION 10.3
RUN set -ex; \
; \
apt-get update; \
apt-get install -y --no-install-recommends \
supervisor \
; \
rm -rf /var/lib/apt/lists/*; \
mkdir /var/log/supervisord /var/run/supervisord
COPY ./supervisord.conf /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord"]

View file

@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error
[program:apache2]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=apache2-foreground
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/cron.sh

View file

@ -0,0 +1,17 @@
FROM friendica:fpm
ENV AUTOINSTALL true
ENV MARIADB_VERSION 10.3
RUN set -ex; \
; \
apt-get update; \
apt-get install -y --no-install-recommends \
supervisor \
; \
rm -rf /var/lib/apt/lists/*; \
mkdir /var/log/supervisord /var/run/supervisord
COPY ./supervisord.conf /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord"]

View file

@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error
[program:apache2]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=apache2-foreground
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/cron.sh

View file

@ -0,0 +1,24 @@
# 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`)

View file

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

View file

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

View file

@ -0,0 +1,15 @@
FROM friendica:develop-fpm-alpine
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=${:-localhost}" >> /etc/ssmtp/ssmtp.conf;SMTP_HOST
# simple = using an smtp without any credentials (mostly in local networks)
# custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support)
ENV SMTP_TYPE simple

View file

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

View file

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

View file

@ -4,19 +4,25 @@ This repository holds the official Docker Image for [Friendica](https://friendi.
# What is Friendica?
Friendica is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services.
Friendica is a decentralised communications platform that integrates social communication.
Our platform links to independent social projects and corporate services.
![logo](https://cdn.rawgit.com/nupplaphil/friendica-docker/c59f235f/friendica.svg)
# How to use this image
The images are designed to be used in a micro-service environment. There are two types of the image you can choose from.
The images are designed to be used in a micro-service environment.
There are two types of the image you can choose from.
The `apache` tag contains a full Friendica installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the `latest` tag and version tags that are not further specified.
The `apache` tag contains a full Friendica installation including an apache web server.
It is designed to be easy to use and gets you running pretty fast.
This is also the default for the `latest` tag and version tags that are not further specified.
The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container.
The second option is a `fpm` container.
It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server.
To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container.
## Using the apache image
You need at least one other mariadb/mysql-container to link it to Friendica
You need at least one other mariadb/mysql-container to link it to Friendica.
The apache image contains a webserver and exposes port 80. To start the container type:
```console
@ -26,23 +32,53 @@ $ docker run -d -p 8080:80 --link some-mysql:mysql friendica
Now you can access the Friendica installation wizard at http://localhost:8080/ from your host system.
## Using the fpm image
To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases you might want use another container or your host as proxy.
If you use your host you can address your Friendica container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network <NAME> ...` or a `docker-compose` file).
To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000.
In most cases you might want use another container or your host as proxy.
If you use your host you can address your Friendica container directly on port 9000.
If you use another container, make sure that you add them to the same docker network (via `docker run --network <NAME> ...` or a `docker-compose` file).
In both cases you don't want to map the fpm port to you host.
```console
$ docker run -d friendica:fpm
```
As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the docker-compose section.
As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files.
This can be achieved with the `volumes-from` option.
You can find more information in the docker-compose section.
## Using the cron job
There are three options to enable the cron-job for Friendica:
- Using the default Image and activate the cron-job (see [Installation](https://friendi.ca/resources/installation/), sector `Activating scheduled tasks`)
- Using the default image (apache, fpm, fpm-alpine) and use **two** container (one for cron and one for the main app)
- Using one of the additional, prepared [`dockerfiles`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles)
## Using sendmail for E-Mail support
You have to set the `--hostname/-h` parameter correctly to make the `mail()` command use the right domainname of it's e-mail.
Currently, the command `sendmail` will be used for the `mail()` support of Friendica.
Be aware that in production environment, you normally have an external MTA (or a SmartHost) for correctly signing and routing your e-mails.
See the Dockerfiles at [`smtp`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/smtp) for examples how to configure it.
### `apache` and `fpm` image
`sendmail` is used as a SMTP MTA for standalone usage and it works out-of-the-box.
### `fpm-alpine` image
For alpine, there is no "standalone" mail-service available.
Therefore you **have** to setup a SMTP MTA.
## Using an external database
By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. More info is in the docker-compose section.
By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database.
You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup.
## Persistent data
The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted.
The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`.
The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`.
That means your data is saved even if the container crashes, is stopped or deleted.
To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. To achieve this you need one volume for your database container and Friendica.
To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder.
To achieve this you need one volume for your database container and Friendica.
Friendica:
- `/var/www/html/` folder where all Friendica data lives
@ -61,7 +97,8 @@ mariadb
```
## Auto configuration via environment variables
The Friendica image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run.
The Friendica image supports auto configuration via environment variables.
You can preconfigure everything that is asked on the install page on first run.
- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`)

View file

@ -13,6 +13,8 @@ RUN set -ex; \
bzip2 \
busybox-static \
git \
# For mail() support
sendmail \
; \
rm -rf /var/lib/apt/lists/*; \
\
@ -93,6 +95,10 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION develop
ENV ADDONS_VERSION develop

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"

View file

@ -73,6 +73,10 @@ RUN chown -R www-data:root /var/www; \
VOLUME /var/www/html
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION develop
ENV ADDONS_VERSION develop

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"

View file

@ -13,6 +13,8 @@ RUN set -ex; \
bzip2 \
busybox-static \
git \
# For mail() support
sendmail \
; \
rm -rf /var/lib/apt/lists/*; \
\
@ -84,6 +86,10 @@ RUN chown -R www-data:root /var/www; \
VOLUME /var/www/html
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION develop
ENV ADDONS_VERSION develop

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"

View file

@ -13,6 +13,8 @@ RUN set -ex; \
bzip2 \
busybox-static \
git \
# For mail() support
sendmail \
; \
rm -rf /var/lib/apt/lists/*; \
\
@ -93,6 +95,10 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION 3.6
ENV ADDONS_VERSION 3.6
@ -116,4 +122,4 @@ RUN chmod +x /*.sh
RUN chmod +x /usr/local/bin/*
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]
CMD ["apache2-foreground"]

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"

View file

@ -73,6 +73,10 @@ RUN chown -R www-data:root /var/www; \
VOLUME /var/www/html
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION 3.6
ENV ADDONS_VERSION 3.6

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"

View file

@ -13,6 +13,8 @@ RUN set -ex; \
bzip2 \
busybox-static \
git \
# For mail() support
sendmail \
; \
rm -rf /var/lib/apt/lists/*; \
\
@ -84,6 +86,10 @@ RUN chown -R www-data:root /var/www; \
VOLUME /var/www/html
RUN {\
echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\
} > /usr/local/etc/php/conf.d/sendmail.ini;
ENV FRIENDICA_VERSION 3.6
ENV ADDONS_VERSION 3.6
@ -107,4 +113,4 @@ RUN chmod +x /*.sh
RUN chmod +x /usr/local/bin/*
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]
CMD ["php-fpm"]

View file

@ -30,6 +30,9 @@ clone_develop() {
echo "Cloning Friendica '${friendica}' with Addons '${addons}' into '${dir}'"
# Removing the whole directory first
rm -fr ${dir}/friendica
git clone -b ${friendica} https://github.com/friendica/friendica ${dir}/friendica
chmod 777 ${dir}/friendica/view/smarty3
mkdir ${dir}/friendica/addon
@ -139,6 +142,20 @@ update() {
console "dbstructure update"
}
sendmail() {
if [ ! -f /etc/init.d/sendmail ]; then
# If sendmail isn't installed, exit this method
return
fi
line=$(head -n 1 /etc/hosts)
line2=$(echo $line | awk '{print $2}')
echo "$line $line2.localdomain" >> /etc/hosts
echo "Starting sendmail for Mail-Support"
/etc/init.d/sendmail start
}
if [ $# -eq 0 ]; then
friendica_help
fi
@ -148,5 +165,6 @@ case "$1" in
update) shift; update "$@" ;;
console) shift; console "$@" ;;
composer) shift; composer "$@" ;;
sendmail) shift; sendmail "$@" ;;
*) friendica_help ;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
exec busybox crond -f -l 0 -L /dev/stdout

View file

@ -3,5 +3,6 @@ set -eu
# Check if Friendica needs to get installed
friendica install
friendica sendmail
exec "$@"
exec "$@"