Skip to content

Commit ec0f9e7

Browse files
authored
Update postfixadmin 3.3.4, update alpine:3.13 and php8 (#9)
* update to alpine:3.13 and php8 * update postfixadmin to 3.3.4 * install new dependency: php8-pdo, php8-pdo_pgsql and php8-pdo_mysql * temporary workaround for doveadm pw reading server.key. See also postfixadmin/postfixadmin#398. * run upgrade.php at start * Update HASH lenght check. The HASH generated by setup.php is now 60 characters long.
1 parent a5cabda commit ec0f9e7

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed

Dockerfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
FROM alpine:3.12
1+
FROM alpine:3.13
22

33
LABEL description="PostfixAdmin is a web based interface used to manage mailboxes" \
44
maintainer="Hardware <[email protected]>"
55

6-
ARG VERSION=3.2.4
7-
ARG SHA256_HASH="f61a64b32052c46f40cba466e5e384de0efab8c343c91569bcc5ebfd3694811e"
6+
ARG VERSION=3.3.4
7+
ARG SHA256_HASH="8720ab6945d6526abffb18e8c5cb0f33a4fe884aa03749d55f0707e45f92b7eb"
88

99
RUN set -eux; \
1010
apk add --no-cache \
1111
su-exec \
1212
dovecot \
1313
tini \
1414
\
15-
php7 \
16-
php7-fpm \
17-
php7-imap \
18-
php7-mbstring \
19-
php7-mysqli \
20-
php7-pgsql \
21-
php7-phar \
22-
php7-session \
15+
php8 \
16+
php8-fpm \
17+
php8-imap \
18+
php8-mbstring \
19+
php8-mysqli \
20+
php8-pdo \
21+
php8-pdo_mysql \
22+
php8-pdo_pgsql \
23+
php8-pgsql \
24+
php8-phar \
25+
php8-session \
2326
; \
2427
\
2528
PFA_TARBALL="postfixadmin-${VERSION}.tar.gz"; \
@@ -28,7 +31,8 @@ RUN set -eux; \
2831
\
2932
mkdir /postfixadmin; \
3033
tar -xzf ${PFA_TARBALL} --strip-components=1 -C /postfixadmin; \
31-
rm -f ${PFA_TARBALL}
34+
rm -f ${PFA_TARBALL}; \
35+
chmod 644 /etc/ssl/dovecot/server.key
3236

3337
COPY bin /usr/local/bin
3438
RUN chmod +x /usr/local/bin/*

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
![postfixadmin](http://i.imgur.com/UCtvKHR.png "postfixadmin")
44

5-
### What is this ?
5+
### What is this?
66

77
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.
88

99
### Features
1010

1111
- Lightweight & secure image (no root process)
1212
- Based on Alpine Linux
13-
- Latest Postfixadmin version (3.2)
13+
- Latest Postfixadmin version (3.3.4)
1414
- MariaDB/PostgreSQL driver
15-
- With PHP7
15+
- With PHP8
1616

1717
### Built-time variables
1818

bin/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,7 @@ cat > /postfixadmin/config.local.php <<EOF
9090
?>
9191
EOF
9292

93+
# Upgrade
94+
php8 /postfixadmin/public/upgrade.php
9395
# RUN !
94-
exec su-exec $UID:$GID php7 -S 0.0.0.0:8888 -t /postfixadmin/public
96+
exec su-exec $UID:$GID php8 -S 0.0.0.0:8888 -t /postfixadmin/public

bin/setup

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ CGREEN="${CSI}1;32m"
77

88
read -rp "> Postfixadmin setup hash : " HASH
99

10-
# MD5(salt) : SHA1( MD5(salt) : PASSWORD );
11-
# 32 1 40
12-
# Exemple : ffdeb741c58db80d060ddb170af4623a:54e0ac9a55d69c5e53d214c7ad7f1e3df40a3caa
13-
while [ ${#HASH} -ne 73 ]; do
10+
# postfixadmin uses the function password_hash with PASSWORD_DEFAULT since version 3.3.0.
11+
# password_hash() creates a new password hash using a strong one-way hashing algorithm.
12+
# 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.
13+
# 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.
14+
# See also: https://www.php.net/manual/en/function.password-hash.php
15+
while [ ${#HASH} -ne 60 ]; do
1416
echo -e "${CRED}\n/!\ Invalid HASH !${CEND}" 1>&2
1517
read -rp "> Postfixadmin setup hash : " HASH
1618
echo ""
1719
done
1820

1921
sed -i "s|\($CONF\['setup_password'\].*=\).*|\1 '${HASH}';|" /postfixadmin/config.inc.php
2022

21-
echo -e "${CGREEN}Setup done.${CEND}"
23+
echo -e "${CGREEN}Setup done.${CEND}"

0 commit comments

Comments
 (0)