Skip to content

Commit a1c30c7

Browse files
committed
docs: Add docs for passwords available through env variables
1 parent 6ec9860 commit a1c30c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/06-concepts/07-configuration.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ Secrets are declared in the `passwords.yaml` file. The password file is structur
7979
| SERVERPOD_SERVICE_SECRET | serviceSecret | - | The token used to connect with insights must be at least 20 chars |
8080
| SERVERPOD_REDIS_PASSWORD | redis | - | The password for the Redis server |
8181

82+
In addition to the predefined secrets above, you can define custom passwords using environment variables with the `SERVERPOD_PASSWORD_` prefix. For example, `SERVERPOD_PASSWORD_myApiKey` will be available in your code as `myApiKey` (the prefix is stripped) through the `Session.passwords` map. These environment variables will override any passwords defined in the [passwords file](#passwords-file-example) if the name (after stripping the prefix) matches. Like the `shared` section in the passwords file, these environment variables are available in all run modes.
83+
84+
| Environment variable format | Description |
85+
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
86+
| SERVERPOD_PASSWORD\_\* | Custom password that will be available in the Session.passwords map. The prefix `SERVERPOD_PASSWORD_` will be stripped from the key name. |
87+
8288
#### Secrets for first party packages
8389

8490
- [serverpod_cloud_storage_gcp](https://pub.dev/packages/serverpod_cloud_storage_gcp): Google Cloud Storage

0 commit comments

Comments
 (0)