Compare commits
	
		
			2 Commits
		
	
	
		
			annotated-
			...
			lambdabund
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8922150994 | |||
| 1618faa420 | 
@ -124,6 +124,45 @@ You can also access it in your configs using the following syntax:
 | 
			
		||||
{{ 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. 
 | 
			
		||||
   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
 | 
			
		||||
 | 
			
		||||
- `TYPE`: specifies the recipe name
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user