docs/maintainers/handbook.md aktualisiert #278

Open
lambdabundesverband wants to merge 2 commits from lambdabundesverband-patch-1 into main

View File

@ -124,6 +124,45 @@ You can also access it in your configs using the following syntax:
{{ env "FOO" }} {{ env "FOO" }}
``` ```
### Example: Adding environment variables to existing recipe
Here is a four step example how to add a new environment variable to a recipe without breaking existing deployments.
1. add env-var to the `compose.yml` in section `environment`:
```yaml
environment:
# ... existing envs
- REQUIRE_AUTH_FOR_PROFILE_REQUESTS=${REQUIRE_AUTH_FOR_PROFILE_REQUESTS:-false}
# ... other existing envs
```
With `${REQUIRE_AUTH_FOR_PROFILE_REQUESTS:-false}` you set a default value (`false`), ensuring not to break existing deployments.
decentral1se marked this conversation as resolved
Review

I think the only missing point here is that you know sometimes you are breaking stuff. In that case, you can let the rest know they need to take action with a release note. I think that would be a good addition to add somewhere.

I think the only missing point here is that you know sometimes you are breaking stuff. In that case, you can let the rest know they need to take action with [a release note](https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-write-version-release-notes). I think that would be a good addition to add somewhere.
If you're sure that it won't cause problems, if operators of existing deployments don't set the variable, you could also just put:
```yaml
environment:
# ... existing envs
- REQUIRE_AUTH_FOR_PROFILE_REQUESTS
# ... other exisitng envs
```
Note: If you need to break something, make sure to add a [release note](/maintainers/handbook/#how-do-i-write-version-release-notes) explaining to operators what they should change before upgrading.
2. add env-var to the `.env.sample`
```yaml
#REQUIRE_AUTH_FOR_PROFILE_REQUESTS=true
```
3. now you can use the environment-variable in your `.tmpl` files, e.g. add to `homserver.yaml.tmpl`
```yaml
require_auth_for_profile_requests: {{ env "REQUIRE_AUTH_FOR_PROFILE_REQUESTS" }}
```
4. increase number of YAML-version in `abra.sh` (e.g. from `v30` to `v31`), only then it will be deployed.
```yaml
export HOMESERVER_YAML_VERSION=v31
```
Note: If during development and testing you have to increase it several times, you can just "flatten" it in the end. Only make sure that you `undeploy`/`deploy` your existing instance.
### Global environment variables ### Global environment variables
- `TYPE`: specifies the recipe name - `TYPE`: specifies the recipe name