2017-06-21 11:34:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# See comments in install script
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2018-11-02 18:03:53 +01:00
|
|
|
source _common.sh
|
2017-06-21 11:34:24 +02:00
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
2018-11-02 18:03:53 +01:00
|
|
|
password=$(ynh_app_setting_get "$app" password)
|
2017-06-21 11:34:24 +02:00
|
|
|
is_public=$(ynh_app_setting_get "$app" is_public)
|
2018-11-02 18:03:53 +01:00
|
|
|
nextclouddomain=$(ynh_app_setting_get "$app" nextclouddomain)
|
2017-06-21 11:34:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Set permissions to app files
|
|
|
|
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
|
|
|
sudo chown -R root: $src_path
|
|
|
|
|
2018-11-02 18:03:53 +01:00
|
|
|
#=================================================
|
|
|
|
# UPGRADE COLLABORA
|
|
|
|
#=================================================
|
|
|
|
ynh_package_update
|
|
|
|
ynh_install_app_dependencies loolwsd code-brand
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# UPGRADE CONFIG
|
|
|
|
#=================================================
|
|
|
|
cp -a ../conf/loolwsd.xml /etc/loolwsd
|
|
|
|
ynh_replace_string "__NEXTCLOUDDOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml"
|
|
|
|
ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml"
|
|
|
|
systemctl restart loolwsd
|
|
|
|
|
|
|
|
|
2017-06-21 11:34:24 +02:00
|
|
|
|
|
|
|
# If app is public, add url to SSOWat conf as skipped_uris
|
|
|
|
if [[ $is_public -eq 1 ]]; then
|
|
|
|
# See install script
|
|
|
|
ynh_app_setting_set "$app" unprotected_uris "/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Reload nginx service
|
2018-11-02 18:03:53 +01:00
|
|
|
systemctl restart nginx
|
|
|
|
systemctl restart loolwsd
|
|
|
|
|