user/freescout: moved writable directories to /var/lib #341

Merged
ayakael merged 1 commit from freescout/permission-fixes into edge 2024-01-06 05:27:25 +00:00
2 changed files with 23 additions and 15 deletions
Showing only changes of commit c62e9cc1ce - Show all commits

View file

@ -2,7 +2,7 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=freescout
pkgver=1.8.115
pkgrel=0
pkgrel=1
pkgdesc="Free self-hosted help desk & shared mailbox"
arch="noarch"
url="freescout.net"
@ -26,25 +26,41 @@ build() {
package() {
local logdir="/var/log/$pkgname"
local datadir="/var/lib/$pkgname"
local wwwdir="/usr/share/webapps/$pkgname"
local confdir="/etc/$pkgname"
# Make directories
install -dm 755 \
"$pkgdir"/$wwwdir \
"$pkgdir"/$confdir
"$pkgdir"/$confdir \
"$pkgdir"/$logdir \
"$pkgdir"/$datadir
# Copy and ln operations
cp $builddir/* -R "$pkgdir"/$wwwdir/.
for i in storage/app storage/framework bootstrap/cache \
public/css/builds public/js/builds public/modules Modules; do
if [ -d "$pkgdir"$wwwdir/$i ]; then
if [ ! -d "$pkgdir"/$datadir/${i%/*} ]; then
mkdir -p "$pkgdir"/$datadir/${i%/*}
fi
mv "$pkgdir"$wwwdir/$i "$pkgdir"/$datadir/$i
else
mkdir -p "$pkgdir"/$datadir/$i
fi
ln -s $datadir/$i "$pkgdir"/$wwwdir/$i
done
ln -s /etc/freescout/freescout.conf "$pkgdir"/usr/share/webapps/freescout/.env
rm -R "$pkgdir"/$wwwdir/storage/logs
ln -s "$logdir" "$pkgdir"/$wwwdir/storage/logs
ln -s $wwwdir/storage/app/public "$pkgdir"/$wwwdir/public/storage
# log dir
rm -R "$pkgdir"/$wwwdir/storage/logs
ln -s "$logdir" "$pkgdir"/$wwwdir/storage/logs
# Permission settings
chown -R root:www-data "$pkgdir"/"$wwwdir"
find "$pkgdir/$wwwdir" -type f -exec chmod 664 {} \;
find "$pkgdir/$wwwdir" -type d -exec chmod 775 {} \;
chown -R freescout:www-data "$pkgdir"/$datadir "$pkgdir"/$logdir
# config files
install -Dm644 "$srcdir"/freescout.nginx \

View file

@ -18,10 +18,6 @@ if [ "${0##*.}" = 'post-upgrade' ]; then
*
* freescout-manage migrate
*
* You may need to adjust permissions:
* find /usr/share/webapps/freescout -type f -exec chmod 664 {} \;
* find /usr/share/webapps/freescout -type d -exec chmod 775 {} \;
*
EOF
else
cat >&2 <<-EOF
@ -47,10 +43,6 @@ else
*
* freescout-manage freescout:create-user
*
* You may need to adjust permissions:
* find /usr/share/webapps/freescout -type f -exec chmod 664 {} \;
* find /usr/share/webapps/freescout -type d -exec chmod 775 {} \;
*
EOF
fi