summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry-Joseph Audéoud2021-09-16 15:17:50 +0200
committerHenry-Joseph Audéoud2021-10-18 11:11:14 +0200
commit1ec101e93800b144de74dca9f98aa101a837b1c9 (patch)
tree2075272b625a4836a93012ed79d5404bd08052c1
parentfa2a80ea6a11e486eccfedefce6afd7a6c2a25cd (diff)
downloadaur-1ec101e93800b144de74dca9f98aa101a837b1c9.tar.gz
Add special case writable dirs
upload & _data are variable dirs, should be in /var. Piwigo is not configurable on that point, so let's symlink these directories.
-rw-r--r--PKGBUILD20
1 files changed, 20 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7f6213225a91..94697c6dc297 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,6 +24,8 @@ sha256sums=('bfecdd743c62cdb4e1936662178d019af264ea763d26c8c832da836fbe09652d'
package() {
install_path="${pkgdir}/usr/share/webapps/piwigo"
+ var_path="${pkgdir}/var/lib/piwigo"
+ http_user=33
cd "${srcdir}"
@@ -31,6 +33,24 @@ package() {
install -d "${install_path}"
cp -a piwigo/* "${install_path}/"
+ # Variable data directories. Should be in /var, but no way to change it in
+ # piwigo configuration (Bug Report?). So use symbolic links to allow that.
+ install -d "${var_path}"
+ mv "${install_path}/_data" "${var_path}/"
+ ln -s "${var_path#${pkgdir}}/_data" "${install_path}/"
+ mv "${install_path}/upload" "${var_path}/"
+ ln -s "${var_path#${pkgdir}}/upload" "${install_path}/"
+ chown -R ${http_user}:${http_user} "${var_path}"
+
# Install apache & nginx conf'
install -D -m644 apache.conf "${pkgdir}/etc/webapps/piwigo/apache.conf"
+
+ # database.inc.php should be writeable in ${install_path}/local/config,
+ # with no way to select the path of this file. Make that directory
+ # writable by http. Also, make it not readable by anyone else for
+ # security.
+ # TODO: raise a bug request to be able to set this path to go in e.g.
+ # /etc/piwigo/. It will better fit here.
+ chown ${http_user}:${http_user} "${install_path}/local/config"
+ chmod o-rwx "${install_path}/local/config/"
}