Skip to content

Commit

Permalink
update docs around POSTFIXADMIN_SETUP_PASSWORD (variable quoting/doll…
Browse files Browse the repository at this point in the history
…ar signs etc) see #63
  • Loading branch information
DavidGoodwin committed Dec 20, 2024
1 parent fe2c83f commit 53fccde
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You can configure this through the following environment variables when running
* POSTFIXADMIN\_DB\_PORT=... - port for the database (optional)
* POSTFIXADMIN\_DB\_PASSWORD=... - mysqli/pgsql only (db server user password)
* POSTFIXADMIN_ENCRYPT=... - database password encryption (e.g. md5crypt, SHA512-CRYPT)
* POSTFIXADMIN\_SETUP\_PASSWORD=... - generated from setup.php or `php -r "echo password_hash('mysecretpassword', PASSWORD_DEFAULT);"`
* POSTFIXADMIN\_SETUP\_PASSWORD=... - generated from setup.php or `php -r "echo password_hash('mysecretpassword', PASSWORD_DEFAULT);"`

Note: An SQLite database is probably not recommended for production use, but is a quick and easy way to try out the software without dependencies.

Expand Down Expand Up @@ -88,6 +88,8 @@ docker run -e POSTFIXADMIN_DB_USER_FILE=/run/secrets/postfix-db-user

All environment vars are supporting the secret's docker strategy.

Note, the POSTFIXADMIN_SETUP_PASSWORD varaible contains dollar signs, so needs quoting to avoid variable expansion. See also #63

### Example docker run

```bash
Expand All @@ -96,6 +98,7 @@ docker run -e POSTFIXADMIN_DB_TYPE=mysqli \
-e POSTFIXADMIN_DB_USER=user \
-e POSTFIXADMIN_DB_PASSWORD=changeme \
-e POSTFIXADMIN_DB_NAME=postfixadmin \
-e POSTFIXADMIN_SETUP_PASSWORD='$2y$10$3ycavDC7g.JQrxZRRDZ5IuS2O2Y6Rpl79XWTDnbI5nPREYfUIf6dK' \
-e POSTFIXADMIN_SMTP_SERVER=postfix \
-e POSTFIXADMIN_SMTP_PORT=25 \
-e POSTFIXADMIN_ENCRYPT=md5crypt \
Expand Down Expand Up @@ -133,14 +136,22 @@ Once the container is running, try visiting :

Try something like the below in a **docker-compose.yml** file; changing the usernames/passwords as required.

Then run : `docker-compose up`
This is using a POSTFIXADMIN_SETUP_PASSWORD of 'mysecretpassword'. Note a $ is changed to $$ to get around variable expansion issues ( see #63 )

## Steps

1. `docker compose up`
2. `docker compose logs -f postfixadmin` (it may take about 30s for the database to build, and the web ui to be ready)
3. Point your web browser at http://localhost:8000/setup.php - login with your setup password (mysecretpassword).
4. Add a super admin account ....
5. Visit http://localhost:8000/login.php and login with your new admin account, add mailboxes etc.


```yaml
version: '3'

services:
db:
image: mysql:5.7
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: notSecureChangeMe
Expand All @@ -162,6 +173,7 @@ services:
POSTFIXADMIN_DB_NAME: postfixadmin
POSTFIXADMIN_DB_PASSWORD: postfixadminPassword
POSTFIXADMIN_SMTP_SERVER: postfix
POSTFIXADMIN_SETUP_PASSWORD: $$2y$$10$$8./sbCrwpLGeWv/6auLtC.ROq/pRpm573QNdISESNqZ9p0uoL3eq6
POSTFIXADMIN_SMTP_PORT: 25
POSTFIXADMIN_ENCRYPT: md5crypt

Expand Down

0 comments on commit 53fccde

Please sign in to comment.