1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ampache_ynh.git synced 2024-09-03 18:15:55 +02:00

Fixed install for install as root of domain

This commit is contained in:
Steven Roose 2015-08-24 15:06:32 +02:00
parent 60e1880a8f
commit 68c53e761b
2 changed files with 19 additions and 1 deletions

View file

@ -16,11 +16,26 @@ location PATHTOCHANGE {
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
} }
location ^~ /bin/ {
deny all;
return 403;
}
rewrite ^PATHTOCHANGE/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ PATHTOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last; rewrite ^PATHTOCHANGE/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ PATHTOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last;
rewrite ^PATHTOCHANGE/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ PATHTOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 last;
#enable subsonic api
if ( !-d $request_filename ) { if ( !-d $request_filename ) {
rewrite ^PATHTOCHANGE/rest/(.*)\.view$ PATHTOCHANGE/rest/index.php?action=$1 last; rewrite ^PATHTOCHANGE/rest/(.*)\.view$ PATHTOCHANGE/rest/index.php?action=$1 last;
rewrite ^PATHTOCHANGE/rest/fake/(.+)$ PATHTOCHANGE/play/$1 last;
} }
location /rest {
limit_except GET POST {
deny all;
}
}
# Include SSOWAT user panel. # Include SSOWAT user panel.
# include conf.d/yunohost_panel.conf.inc; # include conf.d/yunohost_panel.conf.inc;

View file

@ -7,6 +7,9 @@ admin_ampache=$3
debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}') debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}')
# Remove trailing "/" for next commands
path=${path%/}
# Check domain/path availability # Check domain/path availability
sudo yunohost app checkurl $domain$path -a ampache sudo yunohost app checkurl $domain$path -a ampache
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
@ -49,7 +52,7 @@ sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php
random_key=db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') random_key=db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.php sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.php
# Set permissions to roundcube directory # Set permissions to ampache directory
sudo chown -R www-data: $final_path sudo chown -R www-data: $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory