feat: drop github.com/a8m/envsubst in favor of gookit/config (#9028)

This commit is contained in:
Thomas Müller
2024-04-30 18:05:58 +02:00
committed by GitHub
parent e1a259e2aa
commit 4f7480d322
16 changed files with 64 additions and 819 deletions
+16 -1
View File
@@ -44,7 +44,7 @@ Let's explore with examples this approach.
- docker images: `/etc/ocis/`
- binary releases: `$HOME/.ocis/config/`
followed by the `<extension name>.yaml`, eg `proxy.yaml` for the extension configuration. You also can put an `ocis.yaml` config file to the expected loading location to use a single config file.
followed by the `<extension name>.yaml`, e.g. `proxy.yaml` for the extension configuration. You also can put an `ocis.yaml` config file to the expected loading location to use a single config file.
You can set another directory as config path in the environment variable `OCIS_CONFIG_DIR`. It will then pick the same file names, but from the folder you configured.
@@ -99,6 +99,21 @@ log:
level: info
```
#### Substitute ENV variables in configuration files
Environment variables can be used in the configurations files and will be replaced by oCIS when loading these.
Default values can be specified after a `|` character - see below.
```yaml
proxy:
http:
addr: ${PROXY_HTTP_ADDR|localhost:4321}
log:
pretty: true
color: true
level: info
```
### Workflows
Since one can run an extension using the runtime (supervised) or not (unsupervised), we ensure correct behavior in both modes, expecting the same outputs.