appsv2: add notes about new, simplified change_url stuff

This commit is contained in:
Alexandre Aubin 2023-02-20 18:46:11 +01:00
parent 505354302e
commit 50bc1dec25
2 changed files with 3 additions and 0 deletions

View file

@ -68,6 +68,8 @@ Special variables are automatically defined in the context of a script:
- During install, answers to install questions are automatically available as bash variables. For example, the `$domain` setting corresponds to the `domain` question, same for `$prefered_pet`, etc... Note that - apart from special questions such as `init_main_permission` or user-provided passwords - they are also automatically saved as settings (cf next section).
- During other scripts, all app settings are also loaded and automatically available.
- Note that some settings are automatically created/updated by app ressources. For example, the `install_dir` setting will automatically be available too and corresponds to typically `/var/www/$app`
- In the `change_url` context, variables called `new_domain`, `new_path`, `old_domain`, `old_path` will be available, as well as `change_domain` and `change_path` equal to `0` (false) or `1` (true) depending if the domain / path changed
## Setting system

View file

@ -42,6 +42,7 @@ This will edit the file in place and you should then carefully review and iterat
- **All settings are now automatically loaded in app script environments** (so e.g. directly define `$domain`, etc.)
- **Auto-enable `set -eu`** a.k.a. `ynh_abort_if_errors` in appropriate scripts
- **The safety-backup-before-upgrade is now automatically handled by the core**
- **Simplify writing change-url scripts**: old the `new`/`old`/`change` `domain`/`path` are now automatically available in the context and a new helper `ynh_change_url_nginx_config` takes care of tweaking the nginx conf. Your script should essentially just call that helper and possibly tweak the app's conf and possibly restart the app's service
- **Introduce a new `resource` mechanism**
- Resources are declared in the `manifest.toml`.
- They are meant to formalize recurring app needs that are to be provisioned/deprovisioned by the core.