mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:42:59 +03:00
[PR #799] [MERGED] feat: support reading secret env vars from _FILE #619
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/799
Author: @ItalyPaleAle
Created: 7/30/2025
Status: ✅ Merged
Merged: 7/30/2025
Merged by: @kmendell
Base:
main← Head:secret-files📝 Commits (6)
e820431feat: support reading secret env vars from _FILE5efa7c1Merge branch 'main' into secret-filesc5e22aatrim white space from env filesd12c1a0make helper for parsing strings or file based env variablesbae3e5eonly trim the endings of strings, new lines, returns, and spacesd5ba5e7Do not trim spaces for the encryption key📊 Changes
4 files changed (+103 additions, -47 deletions)
View changed files
📝
backend/internal/common/env_config.go(+82 -25)📝
backend/internal/model/app_config.go(+2 -2)📝
backend/internal/service/app_config_service.go(+16 -5)📝
backend/internal/utils/jwk/utils.go(+3 -15)📄 Description
Fixes #685
Env vars that contain secret values now can be read from file. To do that, pass the env var
*_FILEcontaining the path to a file on disk. This works with Docker (and K8s) secrets too, since they are mounted as files.These env vars are currently supported:
DB_CONNECTION_STRING_FILEMAXMIND_LICENSE_KEY_FILEENCRYPTION_KEY_FILEwas already availablesensitivetag in the struct, which currently includes:SMTP_PASSWORD_FILELDAP_BIND_PASSWORD_FILE🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.