feat(api): load API key through systemd credentials with env fallback#2150
feat(api): load API key through systemd credentials with env fallback#2150blackxored wants to merge 2 commits intoseerr-team:developfrom
Conversation
2a44e55 to
4a395c8
Compare
If provided, API key is read through systemd credential `api-key` passed to the service and preferred, will fallback to environment var if not present. See: https://systemd.io/CREDENTIALS systemd.system-credentials(7)
4a395c8 to
7b21613
Compare
|
Hi @blackxored, Instead of creating a new Additionally, since this feature is similar to Docker secrets, it would be great to support both approaches simultaneously. By default, Docker secrets are mounted at |
|
I agree, it would work nicely to place the systemd credentials into /run/secrets, then we can access them using _FILE appended to the DB username, password and name. This would integrate cleanly into the default postgres behavior as well |
|
Any news @blackxored ? |
|
This PR is stale because it has been open 30 days with no activity. Please address the feedback or provide an update to keep it open. |
Description
On Linux systems, be a well-behaved daemon and prefer systemd credential
api-keyif passed to the service. This is done through a file, access is checked by the kernel, and there's no process inheritance, TL;DR is more secure than env vars. See: systemd Credentials.It would still fallback to the
API_KEYenv var as there's no need for this to be a breaking change.To-Dos
pnpm buildpnpm i18n:extract