diff --git a/scripts/upgrade b/scripts/upgrade index 639d2fe..e233114 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,34 +5,28 @@ set -eu # See comments in install script app=$YNH_APP_INSTANCE_NAME +final_path=/opt/yunohost/$app # Source YunoHost helpers source /usr/share/yunohost/helpers -source _common.sh -# Retrieve app settings -domain=$(ynh_app_setting_get "$app" domain) -password=$(ynh_app_setting_get "$app" password) -is_public=$(ynh_app_setting_get "$app" is_public) -nextclouddomain=$(ynh_app_setting_get "$app" nextclouddomain) - - -# 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 +# Stop streama service +systemctl stop streama #================================================= -# UPGRADE COLLABORA +# DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_package_update -ynh_install_app_dependencies loolwsd code-brand + +ynh_app_setting_set $app final_path $final_path +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION #================================================= # Create a dedicated nginx config -ynh_add_nginx_config +#ynh_add_nginx_config #================================================= @@ -44,12 +38,27 @@ ynh_add_nginx_config #systemctl restart loolwsd +#================================================= +# GENERIC FINALIZATION +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= +### For security reason, any app should set the permissions to root: before anything else. +### Then, if write authorization is needed, any access should be given only to directories +### that really need such authorization. + +# Set permissions to app files +mkdir -p $final_path/data/streama +ln -s $final_path/data/streama /home/yunohost.app/streama +chown -R $app: $final_path +cp -a "../conf/convert.sh" /usr/bin/convert_movies +chmod +x /usr/bin/convert_movies # If app is public, add url to SSOWat conf as skipped_uris -if [[ $is_public -eq 1 ]]; then +#if [[ $is_public -eq 1 ]]; then # See install script - ynh_app_setting_set "$app" unprotected_uris "/" -fi +# ynh_app_setting_set "$app" unprotected_uris "/" +#fi -# Reload nginx service -systemctl restart nginx +# Start streama service +systemctl start streama