Skip to content

Commit

Permalink
Manage default user via env
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad committed Sep 18, 2024
1 parent 0b704b2 commit 51c8664
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The architectures supported by this image are:

Web UI is accessible at http://SERVERIP:PORT. An external postgres database is required.

Default login is [email protected] with a password of demo. Once you've created your own user account be sure to login to it and delete the demo account.
Once you've run your first time setup you can safely remove the DEFAULT_ environment variables. They will overwrite any changes made to the default user in the web UI (passwords, display names, etc.) on startup if left in place.

### Migration from Official Image

Expand Down Expand Up @@ -91,6 +91,10 @@ services:
- TZ=Etc/UTC
- BASE_URL=https://planka.example.com
- DATABASE_URL=postgresql://user:password@planka-db:5432/planka
- [email protected]
- DEFAULT_ADMIN_USERNAME=demo
- DEFAULT_ADMIN_PASSWORD=demo
- "DEFAULT_ADMIN_NAME=Demo User"
- SECRET_KEY=notasecretkey
- TRUST_PROXY=0
volumes:
Expand All @@ -110,6 +114,10 @@ docker run -d \
-e TZ=Etc/UTC \
-e BASE_URL=https://planka.example.com \
-e DATABASE_URL=postgresql://user:password@planka-db:5432/planka \
-e [email protected] \
-e DEFAULT_ADMIN_USERNAME=demo \
-e DEFAULT_ADMIN_PASSWORD=demo \
-e DEFAULT_ADMIN_NAME="Demo User" \
-e SECRET_KEY=notasecretkey \
-e TRUST_PROXY=0 \
-p 1337:1337 \
Expand All @@ -130,6 +138,10 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e BASE_URL=https://planka.example.com` | The URL you will use to access planka including protocol, and port if not 80/443. |
| `-e DATABASE_URL=postgresql://user:password@planka-db:5432/planka` | Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding). |
| `-e [email protected]` | Email address for default user. |
| `-e DEFAULT_ADMIN_USERNAME=demo` | Username for default user. |
| `-e DEFAULT_ADMIN_PASSWORD=demo` | Password for default user. |
| `-e DEFAULT_ADMIN_NAME=Demo User` | Display name for default user. |
| `-e SECRET_KEY=notasecretkey` | Session encryption key, recommended 32-64 character alphanumeric. |
| `-e TRUST_PROXY=0` | Set to `1` to trust upstream proxies if reverse proxying. |
| `-v /config` | Local path for planka config files. |
Expand Down Expand Up @@ -295,4 +307,5 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **18.09.24:** - Update default user docs.
* **12.09.24:** - Initial Release.
7 changes: 6 additions & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ param_usage_include_env: true
param_env_vars:
- { env_var: "BASE_URL", env_value: "https://planka.example.com", desc: "The URL you will use to access planka including protocol, and port if not 80/443." }
- { env_var: "DATABASE_URL", env_value: "postgresql://user:password@planka-db:5432/planka", desc: "Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)." }
- { env_var: "DEFAULT_ADMIN_EMAIL", env_value: "[email protected]", desc: "Email address for default user." }
- { env_var: "DEFAULT_ADMIN_USERNAME", env_value: "demo", desc: "Username for default user." }
- { env_var: "DEFAULT_ADMIN_PASSWORD", env_value: "demo", desc: "Password for default user." }
- { env_var: "DEFAULT_ADMIN_NAME", env_value: "Demo User", desc: "Display name for default user." }
- { env_var: "SECRET_KEY", env_value: "notasecretkey", desc: "Session encryption key, recommended 32-64 character alphanumeric." }
- { env_var: "TRUST_PROXY", env_value: "0", desc: "Set to `1` to trust upstream proxies if reverse proxying." }
param_usage_include_vols: true
Expand All @@ -33,7 +37,7 @@ app_setup_block_enabled: true
app_setup_block: |
Web UI is accessible at http://SERVERIP:PORT. An external postgres database is required.
Default login is [email protected] with a password of demo. Once you've created your own user account be sure to login to it and delete the demo account.
Once you've run your first time setup you can safely remove the DEFAULT_ environment variables. They will overwrite any changes made to the default user in the web UI (passwords, display names, etc.) on startup if left in place.
### Migration from Official Image
Expand All @@ -48,4 +52,5 @@ app_setup_block: |
# changelog
changelogs:
- { date: "18.09.24:", desc: "Update default user docs." }
- { date: "12.09.24:", desc: "Initial Release." }
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-planka-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
sleep infinity
fi

[email protected] DEFAULT_ADMIN_PASSWORD=demo DEFAULT_ADMIN_NAME=demo DEFAULT_ADMIN_USERNAME=demo s6-setuidgid abc node db/init.js
s6-setuidgid abc node db/init.js

symlinks=(
/app/public/user-avatars
Expand Down

0 comments on commit 51c8664

Please sign in to comment.