freescout
freescout copied to clipboard
Custom storage path?
Hi there,
I have a set up where the attachments folder at /var/www/freescout/storage/app/attachment is becoming quite large and I'd like to specify storing attachments on a different disk, instead of the root disk where /var/www resides (which is only a few GB and is getting full with quite a few attachments).
I see there's a symlink at /var/www/freescout/public/storage that points to /var/www/storage/app/public and one can also be set up with the artisan command, but the attachments folder is not a child of that path (it's up one parent):
$ ll
total 36K
drwxrwxr-x+ 8 www-data www-data 4.0K Oct 10 10:09 ./
drwxrwxr-x+ 6 www-data www-data 4.0K Nov 7 2023 ../
drwxrwxr-x+ 12 www-data www-data 4.0K Nov 7 2023 attachment/
drwxrwxr-x+ 2 www-data www-data 4.0K Oct 8 13:09 extendedattachments/
-rwxrwxr-x+ 1 www-data www-data 23 Sep 1 10:37 .gitignore*
drwxrwxr-x+ 5 www-data www-data 4.0K Dec 10 2023 public/
drwxrwxr-x+ 5 www-data www-data 4.0K Nov 7 2023 purifier/
drwxrwxr-x+ 2 www-data www-data 4.0K Nov 7 2023 spamfilter/
drwxrwxr-x+ 2 www-data www-data 4.0K Sep 1 10:37 updater/
$ pwd
/var/www/freescout/storage/app
Is it possible to configure Freescout storage to somewhere other than inside /var/www/freescout? For example, it'd be great if I could use something like /mnt/largedisk/foobar just for the large attachments folder.
$ du -d 1 -h
1.7G ./attachment
304K ./purifier
4.0K ./extendedattachments
152K ./public
212K ./spamfilter
4.0K ./updater
PHP version: 8.2.24 FreeScout version: 1.8.152 Database: MySQL mariadb 15.1 Are you using CloudFlare: Yes Are you using non-official modules: No
Try to create a symlink leading to your destination folder instead of attachments folder.
Thanks for getting back. Should I do this with artisan? Does that command take args? The --help for it doesn't really say much.
sudo -u www-data php /var/www/freescout/artisan storage:link /mnt/bigstorage/somepath
?
I tried running this on a test install first:
ln -s /mnt/somedisk/freescout /var/www/freescout/public/storage
And restarted PHP, but Freescout seems to always overwrite that symlink:
lrwxrwxrwx 1 www-data www-data 37 Oct 16 20:20 storage -> /var/www/freescout/storage/app/public/
So you'll need to dig into the code to disable overriding of the symlink.
Um... any clues/help?
Unfortunately not. It will require going into the source code of the framework.