Question about handling multiple apps for CardDAV
The `head -n 1` bit makes it work only with the first instance of the server. We *could* add a loop there to add the setup for as many instances there are.
I guess we could do this:
```bash
cp $final_path/plugins/carddav/config.inc.php{.dist,}
for carddav_app in "owncloud" "nextcloud" "baikal"
do
carddav_app_ids=$(yunohost app list | grep "id: $carddav_app" | grep -Po 'id: \K(.*)')
for carddav_app_id in $carddav_app_ids
do
carddav_server=1
# Append preset configuration to the config file
cat "../conf/${carddav_app}.inc" >> $final_path/plugins/carddav/config.inc.php
# Retrieve app settings and replace the placeholders
carddav_domain=$(ynh_app_setting_get --app=$carddav_app_id --key=domain)
carddav_path=$(ynh_app_setting_get --app=$carddav_app_id --key=path)
carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string --match_string="{${carddav_app}_url}" --replace_string="$carddav_url" --target_file="$carddav_tmp_config"
fi
done
```
and split `conf/carddav.config.inc.php` into `conf/owncloud.inc`, `conf/nextcloud.inc`, and `conf/baikal.inc` with the code already uncommented.
What do you think?
Problem
Solution
upgrade
, but not ininstall
script)PR Status
Validation
Minor decision