summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Sarboni2015-07-17 16:30:23 +0200
committerThomas Sarboni2015-07-17 16:30:23 +0200
commit7504b3bc15a8a8bc9e1898832d7a2228df71283d (patch)
treef30ddb81d0e7876e5a4c6b09c96dae988b7faf7c
parent8c5b67602f0ade9fee963b37515ee84c7e5a4071 (diff)
downloadaur-7504b3bc15a8a8bc9e1898832d7a2228df71283d.tar.gz
Updated to fit ampache-git package
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD8
-rw-r--r--nginx-example.conf80
3 files changed, 88 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5b16f0af484c..24538e8d4c10 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ampache
pkgdesc = A PHP-based tool for managing and playing your audio/video files via a web interface
pkgver = 3.8.0
- pkgrel = 1
+ pkgrel = 2
url = http://www.ampache.org/
install = ampache.install
arch = i686
@@ -17,7 +17,9 @@ pkgbase = ampache
conflicts = ampache-git
conflicts = ampache-development
source = https://github.com/ampache/ampache/archive/3.8.0.tar.gz
+ source = nginx-example.conf
sha256sums = 10a167b162af9b0f2c17a6cf0d92bbc6fc3c80b4be802d77defcfe761f177304
+ sha256sums = 4781fd154cd9654e89a528cecf2906a51acdd5cd9a96412107b3fc3b51943d0d
pkgname = ampache
diff --git a/PKGBUILD b/PKGBUILD
index 86da58a6b1e0..76491288428b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
#Contributor: Diego <cdprincipe@gmail.com
pkgname=ampache
pkgver=3.8.0
-pkgrel=1
+pkgrel=2
pkgdesc="A PHP-based tool for managing and playing your audio/video files via a web interface"
arch=('i686' 'x86_64')
url="http://www.ampache.org/"
@@ -17,8 +17,10 @@ optdepends=('lame: all transcoding/downsampling'
'mp3splt: mp3 and ogg transcoding/downsampling')
conflicts=('ampache-git' 'ampache-development')
install=${pkgname}.install
-source=(https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz)
-sha256sums=('10a167b162af9b0f2c17a6cf0d92bbc6fc3c80b4be802d77defcfe761f177304')
+source=(https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz
+ 'nginx-example.conf')
+sha256sums=('10a167b162af9b0f2c17a6cf0d92bbc6fc3c80b4be802d77defcfe761f177304'
+ '4781fd154cd9654e89a528cecf2906a51acdd5cd9a96412107b3fc3b51943d0d')
build() {
echo "" > /dev/null
diff --git a/nginx-example.conf b/nginx-example.conf
new file mode 100644
index 000000000000..ced954925819
--- /dev/null
+++ b/nginx-example.conf
@@ -0,0 +1,80 @@
+server {
+ listen 80;
+ server_name FQDN;
+ charset utf-8;
+
+ root PATH;
+ index index.php;
+
+ # Rewrite rule for Subsonic backend
+ if ( !-d $request_filename ) {
+ rewrite ^/rest/(.*).view$ /rest/index.php?action=$1 last;
+ rewrite ^/rest/fake/(.+)$ /play/$1 last;
+ }
+
+ # Rewrite rule for Plex backend
+ if ( !-d $request_filename ) {
+ rewrite ^/plex/(.*)$ /plex/index.php?action=$1 last;
+ }
+
+ # Rewrite rule for Channels
+ if (!-d $request_filename){
+ rewrite ^/channel/([0-9]+)/(.*)$ /channel/index.php?channel=$1&target=$2 last;
+ }
+
+ # Beautiful URL Rewriting
+ rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last;
+ rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 last;
+ location /play {
+ if (!-e $request_filename) {
+ rewrite ^/play/art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /image.php?object_type=$2&object_id=$3&auth=$1;
+ break;
+ }
+
+ rewrite ^/([^/]+)/([^/]+)(/.*)?$ /play/$3?$1=$2;
+ rewrite ^/(/[^/]+|[^/]+/|/?)$ /play/index.php last;
+ break;
+ }
+
+ location /rest {
+ limit_except GET POST {
+ deny all;
+ }
+ }
+
+ location /plex {
+ limit_except GET POST {
+ deny all;
+ }
+ }
+
+ location ^~ /bin/ {
+ deny all;
+ return 403;
+ }
+
+ location ^~ /config/ {
+ deny all;
+ return 403;
+ }
+
+ location / {
+ limit_except GET POST HEAD{
+ deny all;
+ }
+ }
+
+ location ~ ^/.*.php {
+ # PHP config...
+ }
+
+ # Rewrite rule for WebSocket
+ location /ws {
+ rewrite ^/ws/(.*) /$1 break;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header Host $host;
+ proxy_pass http://127.0.0.1:8100/;
+ }
+}