[PR #1132] [MERGED] feat: Support loading passwords from docker secrets #1198

Closed
opened 2026-02-04 21:56:29 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/plankanban/planka/pull/1132
Author: @iosabi
Created: 5/15/2025
Status: Merged
Merged: 5/15/2025
Merged by: @meltyshev

Base: masterHead: docker_secrets


📝 Commits (2)

  • 63c073e feat: Support loading passwords from docker secrets
  • b8c62d2 chore: Prettify env variables, add more secrets

📊 Changes

4 files changed (+96 additions, -16 deletions)

View changed files

📝 docker-compose-dev.yml (+10 -5)
📝 docker-compose.yml (+28 -5)
📝 server/.env.sample (+10 -5)
📝 server/start.sh (+48 -1)

📄 Description

Docker secrets are exposed as files in /run/secrets/ inside the container instead of as environment variables. To support deployments where the passwords are stored in secrets, this patch adds support for loading the SMTP_PASSWORD, SECRET_KEY and the database password from files, using the __FILE suffix convention found in many docker images.

The database password is part of the DATABASE_URL environment variable, if a password is used at all. To support injecting the password into the DATABASE_URL without having to use the whole URL as the secret, the start.sh replaces the string ${DATABASE_PASSWORD} in the DATABASE_URL environment variable by the contents of the DATABASE_PASSWORD variable, which can now also be loaded from the corresponding file passed in DATABASE_PASSWORD__FILE.

These changes are backwards compatible since they only load the __FILE suffix version if the original variable was not set the __FILE one is set.

Added comments in docker-compose.yml with examples for discoverability of the feature. Tested this on top of 2.0.0-rc.2.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/plankanban/planka/pull/1132 **Author:** [@iosabi](https://github.com/iosabi) **Created:** 5/15/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@meltyshev](https://github.com/meltyshev) **Base:** `master` ← **Head:** `docker_secrets` --- ### 📝 Commits (2) - [`63c073e`](https://github.com/plankanban/planka/commit/63c073e31e2c89d239a152ef6dc18894adbfd4f5) feat: Support loading passwords from docker secrets - [`b8c62d2`](https://github.com/plankanban/planka/commit/b8c62d2dcca302d35cd57acc675652e6cd1390da) chore: Prettify env variables, add more secrets ### 📊 Changes **4 files changed** (+96 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docker-compose-dev.yml` (+10 -5) 📝 `docker-compose.yml` (+28 -5) 📝 `server/.env.sample` (+10 -5) 📝 `server/start.sh` (+48 -1) </details> ### 📄 Description Docker secrets are exposed as files in `/run/secrets/` inside the container instead of as environment variables. To support deployments where the passwords are stored in secrets, this patch adds support for loading the `SMTP_PASSWORD`, `SECRET_KEY` and the database password from files, using the `__FILE` suffix convention found in many docker images. The database password is part of the `DATABASE_URL` environment variable, if a password is used at all. To support injecting the password into the DATABASE_URL without having to use the whole URL as the secret, the `start.sh` replaces the string `${DATABASE_PASSWORD}` in the `DATABASE_URL` environment variable by the contents of the `DATABASE_PASSWORD` variable, which can now also be loaded from the corresponding file passed in `DATABASE_PASSWORD__FILE`. These changes are backwards compatible since they only load the `__FILE` suffix version if the original variable was not set the `__FILE` one is set. Added comments in docker-compose.yml with examples for discoverability of the feature. Tested this on top of 2.0.0-rc.2. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 21:56:29 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#1198