diff --git a/conf/nginx.conf b/conf/nginx.conf index c8dc0d4..36b3862 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,17 @@ location __PATHTOCHANGE__ { - proxy_pass http://127.0.0.1:6680/mopidy; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - #--PRIVATE--# Include SSOWAT user panel. - #--PRIVATE--include conf.d/yunohost_panel.conf.inc; + proxy_pass http://127.0.0.1:6680/mopidy; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + +} + +location /musicbox_webclient { + + proxy_pass http://127.0.0.1:6680/musicbox_webclient; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } diff --git a/scripts/.fonctions b/scripts/.fonctions index 32278c4..9987538 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -82,13 +82,6 @@ REMOVE_FPM_CONF () { # Suppression de la configuration du pool php-fpm sudo service php5-fpm reload } -REMOVE_LOGROTATE_CONF () { # Suppression de la configuration de logrotate - if [ -e "/etc/logrotate.d/$app" ]; then - echo "Delete logrotate config" - sudo rm "/etc/logrotate.d/$app" - fi -} - SECURE_REMOVE () { # Suppression de dossier avec vérification des variables chaine="$1" # L'argument doit être donné entre quotes simple '', pour éviter d'interpréter les variables. no_var=0 @@ -172,6 +165,7 @@ EOF cat ${app}-logrotate | sudo tee -a /etc/logrotate.d/$app > /dev/null # Append this config to the others for this app. If a config file already exist } + # Remove the app's logrotate config. # # usage: ynh_remove_logrotate diff --git a/scripts/install b/scripts/install index d87b1f1..7677f09 100644 --- a/scripts/install +++ b/scripts/install @@ -113,6 +113,7 @@ sudo systemctl status mopidy # Copy library.json sudo cp /root/.local/share/mopidy/local/library.json.gz /var/lib/mopidy/local/ +sudo chown $app:audio /var/lib/mopidy/local/library.json.gz # Running Mopidy again sudo systemctl restart mopidy @@ -131,6 +132,9 @@ sudo git clone https://github.com/pimusicbox/mopidy-musicbox-webclient pushd mopidy-musicbox-webclient sudo python setup.py install +# Go to script install directory +pushd /var/cache/yunohost/from_file/scripts + # Access public for curl ynh_app_setting_set $app unprotected_uris "/" diff --git a/scripts/remove b/scripts/remove index 289c9da..8098443 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,23 +19,22 @@ sudo apt-get remove --purge -y mopidy-spotify # Delete stupid file # Normally a root directory is delete with install app -if [ -d "/root/.config/$app" ]; then - SECURE_REMOVE '/root/.config/$app' -fi -if [ -d "/root/.cache/$app" ]; then - SECURE_REMOVE '/root/.cache/$app' -fi -if [ -d "/root/.local/share/$app" ]; then - SECURE_REMOVE '/root/.local/share/$app' -fi - +SECURE_REMOVE '/root/.config/$app' +SECURE_REMOVE '/root/.cache/$app' +SECURE_REMOVE '/root/.local/share/$app' SECURE_REMOVE '/usr/local/bin/$app' SECURE_REMOVE '/usr/share/$app' SECURE_REMOVE '/var/lib/$app' SECURE_REMOVE '/etc/apt/sources.list.d/$app.list' SECURE_REMOVE '/opt/$app-musicbox-webclient' SECURE_REMOVE '/var/www/$app' -sudo rm -fr '/usr/local/lib/python2.7/dist-packages/Mopidy_MusicBox_Webclient-2.3.0-py2.7.egg' +SECURE_REMOVE '/var/log/$app' +if [ -e "/usr/local/lib/python2.7/dist-packages/Mopidy_MusicBox_Webclient-2.3.0-py2.7.egg" ]; then + sudo rm -fr '/usr/local/lib/python2.7/dist-packages/Mopidy_MusicBox_Webclient-2.3.0-py2.7.egg' +fi +if [ -e "/etc/apt/sources.list.d/mopidy.list" ]; then + sudo rm -fr '/etc/apt/sources.list.d/mopidy.list' +fi REMOVE_NGINX_CONF # Suppression de la configuration nginx