diff --git a/scripts/install b/scripts/install index fd549a2..6fc072b 100644 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,7 @@ ynh_print_info "Validating installation parameters..." ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" -final_path=/opt/yunohost/$app +final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" # Normalize the url path syntax @@ -92,6 +92,13 @@ ynh_app_setting_set $app port $port #================================================= ynh_print_info "Installing dependencies..." +### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. +### Those deb packages will be installed as dependencies of this package. +### If you're not using this helper: +### - Remove the section "REMOVE DEPENDENCIES" in the remove script +### - As well as the section "REINSTALL DEPENDENCIES" in the restore script +### - And the section "UPGRADE DEPENDENCIES" in the upgrade script + ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server #================================================= @@ -137,40 +144,36 @@ ynh_add_nginx_config "nextclouddomain" ynh_print_info "Configuring system user..." # Create a system user -ynh_system_user_create $app +ynh_system_user_create $app $final_path #================================================= # SPECIFIC SETUP -#============================================== +#================================================= # DEFINE PORT -#============================================== +#================================================= echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections -#=============================================== +#================================================= # ADD ONLYOFFICE REPOSITORY -#=============================================== +#================================================= apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list ynh_package_update -#============================================== +#================================================= # INSTALL ONLYOFFICE -#============================================== +#================================================= -sudo apt-get install -y onlyoffice-documentserver +ynh_package_install onlyoffice-documentserver + +#================================================= # MODIFY A CONFIG FILE #================================================= # Fix https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues/172#issuecomment-411746394 -cp -a ../conf/default.json /etc/onlyoffice/documentserver/default.json - -# Fix Nextcloud http://dev.onlyoffice.org/viewtopic.php?f=53&t=10001 -#sed -i "/# Add headers to serve security.*/a \ \ \ \ add_header X-Frame-Options \"ALLOW-FROM https://$domain/\";" /etc/nginx/conf.d/$nextcloud_domain.d/nextcloud.conf - -# Fix OnlyOffice http://dev.onlyoffice.org/viewtopic.php?f=53&t=10001 -#sed -i "/# Add headers to serve security.*/a \ \ \ \ add_header X-Frame-Options \"ALLOW-FROM https://$domain/\";" /etc/nginx/conf.d/$domain.d/onlyoffice.conf +#cp -a ../conf/default.json /etc/onlyoffice/documentserver/default.json #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -195,8 +198,7 @@ cp -a ../conf/default.json /etc/onlyoffice/documentserver/default.json ### that really need such authorization. # Set permissions to app files -#chown -R root: /etc/loolwsd - +chown -R $app: $final_path #================================================= # SETUP SSOWAT @@ -216,7 +218,8 @@ fi ynh_print_info "Reloading nginx web server..." systemctl reload nginx -supervisorctl restart all +supervisorctl stop all +supervisorctl start all #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index fc4b6de..d0f1814 100644 --- a/scripts/remove +++ b/scripts/remove @@ -42,6 +42,8 @@ ynh_psql_drop_user $db_name ynh_print_info "Removing dependencies" # Remove metapackage and its dependencies +ynh_package_remove onlyoffice-documentserver +ynh_package_remove nodejs ynh_remove_app_dependencies #=================================================