mirror of
https://github.com/YunoHost-Apps/collabora_ynh.git
synced 2024-09-03 18:16:25 +02:00
Add upgrade
This commit is contained in:
parent
c633f250bd
commit
c795c578d7
1 changed files with 28 additions and 30 deletions
|
@ -8,46 +8,42 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
source _common.sh
|
||||
|
||||
# Retrieve app settings
|
||||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
path_url=$(ynh_app_setting_get "$app" path_url)
|
||||
admin=$(ynh_app_setting_get "$app" admin)
|
||||
password=$(ynh_app_setting_get "$app" password)
|
||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||
language=$(ynh_app_setting_get "$app" language)
|
||||
nextclouddomain=$(ynh_app_setting_get "$app" nextclouddomain)
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path_url=${path_url%/}
|
||||
|
||||
# Copy source files
|
||||
src_path=/var/www/$app
|
||||
sudo mkdir -p $src_path
|
||||
sudo cp -a ../sources/. $src_path
|
||||
|
||||
# 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
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
nginx_conf=../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_PATH@$path_url@g" $nginx_conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
|
||||
# If a dedicated php-fpm process is used:
|
||||
#
|
||||
# sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf
|
||||
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
#=================================================
|
||||
# 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
|
||||
|
||||
|
||||
### PHP (remove if not used) ###
|
||||
# If a dedicated php-fpm process is used:
|
||||
# # Modify PHP-FPM pool configuration and copy it to the pool directory
|
||||
# sed -i "s@YNH_WWW_APP@$app@g" ../conf/php-fpm.conf
|
||||
# sed -i "s@YNH_WWW_ALIAS@$src_path/@g" ../conf/php-fpm.conf
|
||||
# finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
||||
# sudo cp ../conf/php-fpm.conf $finalphpconf
|
||||
# sudo chown root: $finalphpconf
|
||||
# sudo chmod 644 $finalphpconf
|
||||
# sudo service php5-fpm restart
|
||||
### PHP end ###
|
||||
|
||||
# If app is public, add url to SSOWat conf as skipped_uris
|
||||
if [[ $is_public -eq 1 ]]; then
|
||||
|
@ -56,4 +52,6 @@ if [[ $is_public -eq 1 ]]; then
|
|||
fi
|
||||
|
||||
# Reload nginx service
|
||||
sudo service nginx reload
|
||||
systemctl restart nginx
|
||||
systemctl restart loolwsd
|
||||
|
||||
|
|
Loading…
Reference in a new issue