From 1d389f0156120ce98646af8f18738545c10f10fe Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 2 Apr 2020 22:31:57 +0100 Subject: [PATCH] make tests/router.php more like .htaccess --- .htaccess | 3 +-- tests/docker-init.sh | 8 +++++++- tests/router.php | 36 ++++++++++++++++++------------------ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.htaccess b/.htaccess index e2f1ca28..26850176 100644 --- a/.htaccess +++ b/.htaccess @@ -17,8 +17,7 @@ # rather than link to images/ha/hash and have an ugly filename, # we link to images/hash/tags.ext; mod_rewrite splits things so # that shimmie sees hash and the user sees tags.ext - RewriteRule ^_images/([0-9a-f]{2})([0-9a-f]{30}).*$ data/images/$1/$1$2 [L] - RewriteRule ^_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$ data/thumbs/$1/$1$2 [L] + RewriteRule ^_(images|thumbs)/([0-9a-f]{2})([0-9a-f]{30}).*$ data/$1/$2/$2$3 [L] # any requests for files which don't physically exist should be handled by index.php RewriteCond %{REQUEST_FILENAME} !-f diff --git a/tests/docker-init.sh b/tests/docker-init.sh index b968c210..03e5e013 100644 --- a/tests/docker-init.sh +++ b/tests/docker-init.sh @@ -3,4 +3,10 @@ groupadd -g $GID shimmie useradd -ms /bin/bash -u $UID -g $GID shimmie mkdir /app/data chown shimmie:shimmie /app/data -exec /usr/local/bin/su-exec shimmie:shimmie /usr/bin/php -d upload_max_filesize=50M -d post_max_size=50M -S 0.0.0.0:8000 tests/router.php +export PHP_CLI_SERVER_WORKERS=8 +exec /usr/local/bin/su-exec shimmie:shimmie \ + /usr/bin/php \ + -d upload_max_filesize=50M \ + -d post_max_size=50M \ + -S 0.0.0.0:8000 \ + tests/router.php diff --git a/tests/router.php b/tests/router.php index f8b7bc38..8e350506 100644 --- a/tests/router.php +++ b/tests/router.php @@ -1,33 +1,33 @@