Skip to content

Commit 9a59654

Browse files
committed
docs: expand secrets dir guidance
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
1 parent b913a8c commit 9a59654

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

docs/usage/configuration/environment.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,25 @@ Configuration precedence is:
1717
2. `.env`
1818
3. `SECRETS_DIR`
1919

20-
If `SECRETS_DIR` is set, each file in that directory should be named after the
21-
setting, and the file contents should be the value. For example:
20+
If `SECRETS_DIR` is set, it should point to a directory containing one file per
21+
secret. Each filename should match a setting name, and the file contents should
22+
be the value. This is useful for production deployments where you prefer
23+
OS-managed secret files instead of storing sensitive values in a `.env` file.
24+
Common locations include `/etc/myapp/secrets` on Linux servers,
25+
`/run/secrets` in containers, `./secrets` for local testing, or a custom path
26+
on Windows. For example:
2227

2328
```text
2429
/run/secrets/DB_PASSWORD
2530
/run/secrets/SECRET_KEY
2631
```
2732

33+
The directory should be readable only by the account running the application
34+
and protected with appropriate filesystem permissions. This improves separation
35+
of secrets from source code and deployment files, but it does not replace
36+
proper host security: an attacker with full system access may still be able to
37+
obtain them.
38+
2839
!!! info
2940
The Database (and test database if you are running the tests) and User must
3041
already exist in your Postgres system!

0 commit comments

Comments
 (0)