You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-4.7/deployments/configuration.md
+156-1Lines changed: 156 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,161 @@ To use a custom configuration file to set values on install, use the CLI/ENV var
54
54
55
55
To install Harper overtop of an existing configuration file, set `HDB_CONFIG` to the root path of your install `<ROOTPATH>/harperdb-config.yaml`
56
56
57
+
## Environment Variable-Based Configuration
58
+
59
+
Harper provides two special environment variables for managing configuration: `HARPER_DEFAULT_CONFIG`and `HARPER_SET_CONFIG`. These variables allow you to configure Harper instances through environment variables using JSON-formatted configuration objects.
60
+
61
+
### Overview
62
+
63
+
Both environment variables accept JSON-formatted configuration that mirrors the structure of `harperdb-config.yaml`:
`HARPER_DEFAULT_CONFIG`provides default configuration values while respecting user modifications. This is ideal for scenarios where you want to provide sensible defaults without preventing administrators from customizing their instances.
83
+
84
+
#### Behavior
85
+
86
+
**At installation time:**
87
+
88
+
- Overrides template default values
89
+
- Respects values set by `HARPER_SET_CONFIG`
90
+
- Respects values from existing config files (when using `HDB_CONFIG`)
91
+
92
+
**At runtime:**
93
+
94
+
- Only updates values it originally set
95
+
- Automatically detects and respects manual user edits to the config file
96
+
- When a key is removed from the environment variable, the original value is restored
# The port will be restored to its original template default (9925)
116
+
```
117
+
118
+
### HARPER_SET_CONFIG
119
+
120
+
`HARPER_SET_CONFIG`forces configuration values that must never be changed by users. This is designed for security policies, compliance requirements, or critical operational settings that need to be enforced across all instances.
121
+
122
+
#### Behavior
123
+
124
+
**At runtime:**
125
+
126
+
- Always overrides all other configuration sources
127
+
- Takes precedence over user edits, file values, and `HARPER_DEFAULT_CONFIG`
128
+
- When a key is removed from the environment variable, it's deleted from the config (no restoration)
129
+
130
+
#### Example: Enforce Security Settings
131
+
132
+
```bash
133
+
# Force authentication and specific logging for compliance
For HTTP clients that support (Brotli) compression encoding, responses that are larger than than this threshold will be compressed (also note that for clients that accept compression, any streaming responses from queries are compressed as well, since the size is not known beforehand).
231
+
For HTTP clients that support (Brotli) compression encoding, responses that are larger than this threshold will be compressed (also note that for clients that accept compression, any streaming responses from queries are compressed as well, since the size is not known beforehand).
0 commit comments