diff --git a/conf/nginx.conf b/conf/nginx.conf index a4db686..fb8429e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,10 +11,10 @@ location / { } -location = /api/config { - default_type text/javascript; - rewrite ^.*$ /customize/api/config break; -} +# location = /api/config { +# default_type text/javascript; +# rewrite ^.*$ /customize/api/config break; +#} if ($uri = /pad/inner.html) { set $scriptSrc "'self' 'unsafe-eval' 'unsafe-inline'"; @@ -25,6 +25,6 @@ location ~ ^/(register|login|settings|user|pad|drive|poll|slide|code|whiteboard) rewrite ^(.*)$ $1/ redirect; } -try_files /www/$uri /www/$uri/index.html /customize/$uri; +try_files $uri $uri/index.html; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/scripts/install b/scripts/install index ae47dc8..028135c 100644 --- a/scripts/install +++ b/scripts/install @@ -78,7 +78,8 @@ sudo apt-get install -yy -qq nodejs final_path=/var/www/$app ynh_app_setting_set $app final_path $final_path -SETUP_SOURCE # Télécharge la source, décompresse et copie dans $final_path +# SETUP_SOURCE # Télécharge la source, décompresse et copie dans $final_path +sudo git clone https://github.com/xwiki-labs/cryptpad.git $final_path #================================================= # CREATE A SQL BDD @@ -129,15 +130,18 @@ sudo chown admin -R $install_log ynh_use_logrotate #================================================= -# INSTALL ETHERPAD +# INSTALL CRYPTPAD #================================================= script_dir="$PWD" -pushd "$final_path" -sudo chown -R $app: $final_path -sudo su $app -c "cd $final_path && npm install" -sudo npm install -g bower -sudo su $app -c "cd $final_path && bower install && bower install chainpad#^0.4.0" +pushd "${final_path}" +sudo chown -R $app: "${final_path}" +#sudo su admin -c "cd $final_path && npm install && npm install bower" +# sudo npm install -g bower +# sudo su admin -c "cd $final_path && bower install && bower install chainpad#^0.4.0" +sudo su $app -c "npm install" +sudo su $app -c "npm install bower" +sudo su $app -c "bower install" popd #================================================= diff --git a/scripts/remove b/scripts/remove index 90393e0..b7b6646 100644 --- a/scripts/remove +++ b/scripts/remove @@ -5,7 +5,7 @@ source /usr/share/yunohost/helpers # Exit on command errors and treat unset variables as an error set -u -set -eu + app=$YNH_APP_INSTANCE_NAME # Retrieve app settings @@ -14,13 +14,13 @@ domain=$(ynh_app_setting_get $app domain) sudo systemctl stop $app.service # Remove sources -sudo rm -rf /var/www/$app +ynh_secure_remove /var/www/$app # Remove nginx configuration file [[ -n $domain ]] && sudo rm -f /etc/nginx/conf.d/${domain}.d/${app}.conf -# Remove haste user and data -sudo userdel -r $app +# Delete system user dedicace for this app +ynh_system_user_delete $app # Remove init script sudo systemctl disable $app.service