diff --git a/Dockerfile b/Dockerfile index 89b6ec0..8d6f75f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM alpine:3.12 +FROM alpine:3.13 LABEL description="PostfixAdmin is a web based interface used to manage mailboxes" \ maintainer="Hardware " -ARG VERSION=3.2.4 -ARG SHA256_HASH="f61a64b32052c46f40cba466e5e384de0efab8c343c91569bcc5ebfd3694811e" +ARG VERSION=3.3.4 +ARG SHA256_HASH="8720ab6945d6526abffb18e8c5cb0f33a4fe884aa03749d55f0707e45f92b7eb" RUN set -eux; \ apk add --no-cache \ @@ -12,14 +12,17 @@ RUN set -eux; \ dovecot \ tini \ \ - php7 \ - php7-fpm \ - php7-imap \ - php7-mbstring \ - php7-mysqli \ - php7-pgsql \ - php7-phar \ - php7-session \ + php8 \ + php8-fpm \ + php8-imap \ + php8-mbstring \ + php8-mysqli \ + php8-pdo \ + php8-pdo_mysql \ + php8-pdo_pgsql \ + php8-pgsql \ + php8-phar \ + php8-session \ ; \ \ PFA_TARBALL="postfixadmin-${VERSION}.tar.gz"; \ @@ -28,7 +31,8 @@ RUN set -eux; \ \ mkdir /postfixadmin; \ tar -xzf ${PFA_TARBALL} --strip-components=1 -C /postfixadmin; \ - rm -f ${PFA_TARBALL} + rm -f ${PFA_TARBALL}; \ + chmod 644 /etc/ssl/dovecot/server.key COPY bin /usr/local/bin RUN chmod +x /usr/local/bin/* diff --git a/README.md b/README.md index 9fe2685..3d7d7cd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![postfixadmin](http://i.imgur.com/UCtvKHR.png "postfixadmin") -### What is this ? +### What is this? PostfixAdmin is a web based interface used to manage mailboxes, virtual domains and aliases. It also features support for vacation/out-of-the-office messages. @@ -10,9 +10,9 @@ PostfixAdmin is a web based interface used to manage mailboxes, virtual domains - Lightweight & secure image (no root process) - Based on Alpine Linux -- Latest Postfixadmin version (3.2) +- Latest Postfixadmin version (3.3.4) - MariaDB/PostgreSQL driver -- With PHP7 +- With PHP8 ### Built-time variables diff --git a/bin/run.sh b/bin/run.sh index 0819524..55638aa 100644 --- a/bin/run.sh +++ b/bin/run.sh @@ -90,5 +90,7 @@ cat > /postfixadmin/config.local.php < EOF +# Upgrade +php8 /postfixadmin/public/upgrade.php # RUN ! -exec su-exec $UID:$GID php7 -S 0.0.0.0:8888 -t /postfixadmin/public +exec su-exec $UID:$GID php8 -S 0.0.0.0:8888 -t /postfixadmin/public diff --git a/bin/setup b/bin/setup index 11bc20d..d27ea8f 100644 --- a/bin/setup +++ b/bin/setup @@ -7,10 +7,12 @@ CGREEN="${CSI}1;32m" read -rp "> Postfixadmin setup hash : " HASH -# MD5(salt) : SHA1( MD5(salt) : PASSWORD ); -# 32 1 40 -# Exemple : ffdeb741c58db80d060ddb170af4623a:54e0ac9a55d69c5e53d214c7ad7f1e3df40a3caa -while [ ${#HASH} -ne 73 ]; do +# postfixadmin uses the function password_hash with PASSWORD_DEFAULT since version 3.3.0. +# password_hash() creates a new password hash using a strong one-way hashing algorithm. +# PASSWORD_DEFAULT - Use the bcrypt algorithm (default as of PHP 5.5.0). Note that this constant is designed to change over time as new and stronger algorithms are added to PHP. +# PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH algorithm to create the hash. This will produce a standard crypt() compatible hash using the "$2y$" identifier. The result will always be a 60 character string, or false on failure. +# See also: https://www.php.net/manual/en/function.password-hash.php +while [ ${#HASH} -ne 60 ]; do echo -e "${CRED}\n/!\ Invalid HASH !${CEND}" 1>&2 read -rp "> Postfixadmin setup hash : " HASH echo "" @@ -18,4 +20,4 @@ done sed -i "s|\($CONF\['setup_password'\].*=\).*|\1 '${HASH}';|" /postfixadmin/config.inc.php -echo -e "${CGREEN}Setup done.${CEND}" \ No newline at end of file +echo -e "${CGREEN}Setup done.${CEND}"