Skip to content

Commit

Permalink
Fixed install for install as root of domain
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Aug 24, 2015
1 parent b713d08 commit c730a08
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,26 @@ location PATHTOCHANGE {
fastcgi_param PATH_INFO $fastcgi_path_info;
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]+)/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 ) {
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 conf.d/yunohost_panel.conf.inc;

Expand Down
5 changes: 4 additions & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ admin_ampache=$3

debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}')

# Remove trailing "/" for next commands
path=${path%/}

# Check domain/path availability
sudo yunohost app checkurl $domain$path -a ampache
if [[ ! $? -eq 0 ]]; then
Expand Down Expand Up @@ -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')
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

# Modify Nginx configuration file and copy it to Nginx conf directory
Expand Down

0 comments on commit c730a08

Please sign in to comment.