From 15cf545c9f33e3c0d85d9cfc3f33ba2c1995649b Mon Sep 17 00:00:00 2001 From: Eric Daras Date: Wed, 21 Nov 2018 18:36:04 +0100 Subject: [PATCH] Updated for version 0.03.3 + support for mail notifications sent from the server --- Dockerfile | 12 +++++++++--- README.md | 3 +++ lufi.conf | 7 +++++++ startup | 4 ++++ 4 files changed, 23 insertions(+), 3 deletions(-) mode change 100644 => 100755 startup diff --git a/Dockerfile b/Dockerfile index 7105831..067eebd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.8 -ARG LUFI_VERSION=0.02.2 +ARG LUFI_VERSION=0.03.3 ENV GID=991 \ UID=991 \ @@ -12,7 +12,11 @@ ENV GID=991 \ MAX_DELAY=0 \ THEME=default \ ALLOW_PWD_ON_FILES=1 \ - POLICY_WHEN_FULL=warn + MAIL_SENDER=no-reply@lufi.io \ + POLICY_WHEN_FULL=warn \ + MAIL_HOW=smtp \ + MAIL_HOWARGS=smtp \ + REPORT=report@example.com LABEL description="lufi based on alpine" \ tags="latest" \ @@ -28,6 +32,7 @@ RUN BUILD_DEPS="build-base \ perl-dev \ libidn-dev \ postgresql-dev \ + mariadb-dev \ wget" \ && apk add --no-cache ${BUILD_DEPS} \ libressl \ @@ -39,6 +44,7 @@ RUN BUILD_DEPS="build-base \ tini \ su-exec \ postgresql-libs \ + mariadb-dev \ && echo | cpan \ && cpan install Carton \ && git clone https://git.framasoft.org/luc/lufi.git /usr/lufi \ @@ -48,7 +54,7 @@ RUN BUILD_DEPS="build-base \ && rm -rf cpanfile.snapshot \ && carton install \ && apk del --no-cache ${BUILD_DEPS} \ - && rm -rf /var/cache/apk/* /root/.cpan* /usr/lufi/local/cache/* /usr/lufi/utilities + && rm -rf /var/cache/apk/* /root/.cpan* /usr/lufi/local/cache/* VOLUME /usr/lufi/files /usr/lufi/data diff --git a/README.md b/README.md index c422cd8..c15e7af 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ docker build -t xataz/lufi github.com/xataz/dockerfiles.git#master:lufi * MAX_DELAY : number of days after which the images will be deleted (default : 0 for unlimited) * THEME : theme for lufi (default : default) * ALLOW_PWD_ON_FILES : Enable download password (default : 1 (0 => disable, 1 => enable)) +* REPORT : recipient for the report file feature (default : report@example.com) +* MAIL_HOW : valid values are 'sendmail' and 'smtp' (default : smtp) +* MAIL_HOWARGS : if smtp, smtp host (default : smtp) Tips : you can use the following command to generate SECRET. `date +%s | md5sum | head -c 32` diff --git a/lufi.conf b/lufi.conf index ecbb48d..5c14e0e 100644 --- a/lufi.conf +++ b/lufi.conf @@ -20,4 +20,11 @@ upload_dir => '/usr/lufi/files', allow_pwd_on_files => , policy_when_full => '', + mail => { + # Valid values are 'sendmail' and 'smtp' + how => '', + howargs => [''] + }, + mail_sender => '', + report => '', }; diff --git a/startup b/startup old mode 100644 new mode 100755 index b81d29e..e29d739 --- a/startup +++ b/startup @@ -13,6 +13,10 @@ sed -i -e 's||'${SECRET}'|' \ -e 's||'${MAX_DELAY}'|' \ -e 's||'${THEME}'|' \ -e 's||'${ALLOW_PWD_ON_FILES}'|' \ + -e 's||'${MAIL_SENDER}'|' \ + -e 's||'${MAIL_HOW}'|' \ + -e 's||'${MAIL_HOWARGS}'|' \ + -e 's||'${REPORT}'|' \ -e 's||'${POLICY_WHEN_FULL}'|' /usr/lufi/lufi.conf if [ -e /themes ]; then