From fba217b8a1705a5be27e5cc0fbf62a6184e8c085 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 8 Jul 2018 15:09:54 +0200 Subject: [PATCH] Remove SSMTP and add SMTP relay container example --- Dockerfile | 3 +-- README.md | 8 +------ assets/etc/php7/conf.d/sendmail-ssmtp.ini | 1 - entrypoint.sh | 29 ----------------------- examples/compose/docker-compose.yml | 17 +++++++++++++ examples/compose/librenms.env | 7 ------ 6 files changed, 19 insertions(+), 46 deletions(-) delete mode 100644 assets/etc/php7/conf.d/sendmail-ssmtp.ini diff --git a/Dockerfile b/Dockerfile index 8cf9235..b198fb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,12 +18,11 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ RUN apk --update --no-cache add \ bash binutils ca-certificates coreutils curl fping git graphviz imagemagick mtr \ mysql-client net-snmp net-snmp-tools nginx nmap openssl python2 py-mysqldb rrdtool runit \ - shadow ssmtp supervisor tzdata util-linux whois \ + shadow supervisor tzdata util-linux whois \ php7 php7-cli php7-ctype php7-curl php7-fpm php7-gd php7-json php7-mcrypt php7-memcached php7-mbstring php7-mysqli \ php7-opcache php7-openssl php7-pdo php7-pdo_mysql php7-phar php7-posix php7-session php7-simplexml php7-snmp \ php7-tokenizer php7-xml php7-zip \ && sed -i -e "s/;date\.timezone.*/date\.timezone = UTC/" /etc/php7/php.ini \ - && cp -f /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.or \ && rm -rf /var/cache/apk/* /var/www/* /tmp/* ENV LIBRENMS_VERSION="1.41" \ diff --git a/README.md b/README.md index 797cf8b..b7577b2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * Alpine Linux 3.8, Nginx, PHP 7.2 * Cron tasks as a ["sidecar" container](#cron) -* [SSMTP](https://linux.die.net/man/8/ssmtp) for SMTP relay to send emails * OPCache enabled to store precompiled script bytecode in shared memory ### From docker-compose @@ -28,6 +27,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates * [Memcached](https://github.com/docker-library/memcached) image ready to use for better scalability * [RRDcached](https://github.com/crazy-max/docker-rrdcached) image ready to use for better scalability +* [Postfix SMTP relay](https://github.com/juanluisbaptiste/docker-postfix) image to send emails * [MariaDB](https://github.com/docker-library/mariadb) image as database instance * Cron jobs as a ["sidecar" container](#cron) @@ -50,12 +50,6 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other | `DB_NAME` | `librenms` | MySQL database name | `DB_USER` | `librenms` | MySQL user | `DB_PASSWORD` | `librenms` | MySQL password -| `SSMTP_HOST` | | SMTP server host -| `SSMTP_PORT` | `25` | SMTP server port -| `SSMTP_HOSTNAME` | `$(hostname -f)` | Full hostname -| `SSMTP_USER` | | SMTP username -| `SSMTP_PASSWORD` | | SMTP password -| `SSMTP_TLS` | `NO` | SSL/TLS | `MEMCACHED_HOST` | | Hostname / IP address of a Memcached server | `RRDCACHED_HOST` | | Hostname / IP address of a RRDcached server diff --git a/assets/etc/php7/conf.d/sendmail-ssmtp.ini b/assets/etc/php7/conf.d/sendmail-ssmtp.ini deleted file mode 100644 index 6f1b45e..0000000 --- a/assets/etc/php7/conf.d/sendmail-ssmtp.ini +++ /dev/null @@ -1 +0,0 @@ -sendmail_path=/usr/sbin/ssmtp -t diff --git a/entrypoint.sh b/entrypoint.sh index a7ea2b2..cd50aaf 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,10 +20,6 @@ DB_NAME=${DB_NAME:-"librenms"} DB_USER=${DB_USER:-"librenms"} DB_PASSWORD=${DB_PASSWORD:-"asupersecretpassword"} -SSMTP_PORT=${SSMTP_PORT:-"25"} -SSMTP_HOSTNAME=${SSMTP_HOSTNAME:-"$(hostname -f)"} -SSMTP_TLS=${SSMTP_TLS:-"NO"} - # Timezone echo "Setting timezone to ${TZ}..." ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime @@ -55,23 +51,6 @@ echo "Setting Nginx configuration..." sed -e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \ /tpls/etc/nginx/nginx.conf > /etc/nginx/nginx.conf -# SSMTP -echo "Setting SSMTP configuration..." -if [ -z "$SSMTP_HOST" ] ; then - echo "WARNING: SSMTP_HOST must be defined if you want to send emails" - cp -f /etc/ssmtp/ssmtp.conf.or /etc/ssmtp/ssmtp.conf -else - cat > /etc/ssmtp/ssmtp.conf < ${LIBRENMS_PATH}/config.d/autoupdate.php < ${LIBRENMS_PATH}/config.d/email.php < ${LIBRENMS_PATH}/config.d/memcached.php <