From 6e85276878d90ce7f2f0fc73dccb419c233a9545 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 27 Mar 2025 09:51:37 +0000 Subject: [PATCH] Bug 39466: Add plugins/js folder, add access in Apache Content-Type: text/plain; charset=utf-8 Test plan: Run the adjusted koha-create-dirs (or copy it to sbin and run koha-create) and verify folder creation. Remove the folders (manually or use koha-remove in case you used koha-create). Create the js folder in your own /var/lib/koha/YOUR_INSTANCE/plugins folder. (Optionally, chmod 550 it.) Copy the change in the apache-shared file into your /etc/koha counterpart. Restart Apache. Touch /var/lib/koha/YOUR_INSTANCE/plugins/js/test.txt. Verify that you can reach it with URL /plugins/js/test.txt. --- debian/scripts/koha-create-dirs | 2 ++ debian/templates/apache-shared-intranet.conf | 5 +++++ debian/templates/apache-shared-opac.conf | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/debian/scripts/koha-create-dirs b/debian/scripts/koha-create-dirs index 822d808db4..f6002025ac 100755 --- a/debian/scripts/koha-create-dirs +++ b/debian/scripts/koha-create-dirs @@ -54,6 +54,8 @@ do userdir "$name" "/var/lib/koha/$name/biblios/shadow" userdir "$name" "/var/lib/koha/$name/biblios/tmp" userdir "$name" "/var/lib/koha/$name/plugins" + userdir "$name" "/var/lib/koha/$name/plugins/js" + chmod 550 "/var/lib/koha/$name/plugins/js" userdir "$name" "/var/lib/koha/$name/uploads" userdir "$name" "/var/lib/koha/$name/tmp" userdir "$name" "/var/lock/koha/$name" diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf index 49b742f868..00c46b9b77 100644 --- a/debian/templates/apache-shared-intranet.conf +++ b/debian/templates/apache-shared-intranet.conf @@ -36,3 +36,8 @@ Alias "/api" "/usr/share/koha/api" RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L] + +Alias "/plugins/js" "/var/lib/koha/${instance}/plugins/js" + + Require all granted + diff --git a/debian/templates/apache-shared-opac.conf b/debian/templates/apache-shared-opac.conf index 2568e0c966..cd9f1735e2 100644 --- a/debian/templates/apache-shared-opac.conf +++ b/debian/templates/apache-shared-opac.conf @@ -35,3 +35,8 @@ Alias "/api" "/usr/share/koha/api" RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L] + +Alias "/plugins/js" "/var/lib/koha/${instance}/plugins/js" + + Require all granted + -- 2.39.5