YunoHost-Apps / roundcube_ynh

Roundcube package for YunoHost
https://roundcube.net/
GNU Affero General Public License v3.0
11 stars 22 forks source link

Fix CardDAV plugin setup #97

Closed tituspijean closed 3 years ago

tituspijean commented 3 years ago

Problem

Solution

PR Status

Validation


Minor decision

tituspijean commented 3 years ago

Tested with Nextcloud, and working.

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?
ericgaspar commented 3 years ago

Do we still need to care about ownCloud ? (I removed ownCloud references in my PR 😁)

tituspijean commented 3 years ago

I think we can forget about it yes. 😇 Done in the last commits ↓