after reading / learning from the following sources:
https://manual.grid.tf/labs/documentation/developers/flist/flist_case_studies/flist_nextcloud_case_study
https://github.com/threefoldtech/zinit/blob/master/docs/services.md
https://github.com/threefoldtech/tf-images/blob/development/tfgrid3/nextcloud
it still not clear for me how/when/where the environment variables are actually set that the zinit process and /scripts/*.sh use.
In the case of the official nexcloud-aio flist/lab for example i see
# cat /etc/zinit/caddy.yaml
exec: /scripts/caddy.sh
oneshot: true
no varialbe is set with the env parameter in the zinit yaml file.
but the referenced script (/scripts/caddy.sh) uses several env vars like $NEXTCLOUD_DOMAIN, $IPV4, $GATEWAY
so where are these values actually defined?
The file within the lab deployment (/etc/caddy/Caddyfile) also has {$DOMAIN}:{$PORT} in it.

