freescout icon indicating copy to clipboard operation
freescout copied to clipboard

Custom storage path?

Open nooblag opened this issue 1 year ago • 4 comments

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

nooblag avatar Oct 09 '24 23:10 nooblag

Try to create a symlink leading to your destination folder instead of attachments folder.

freescout-help avatar Oct 13 '24 06:10 freescout-help

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

?

nooblag avatar Oct 13 '24 06:10 nooblag

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/

nooblag avatar Oct 16 '24 09:10 nooblag

So you'll need to dig into the code to disable overriding of the symlink.

freescout-help avatar Oct 17 '24 05:10 freescout-help

Um... any clues/help?

nooblag avatar Oct 20 '24 23:10 nooblag

Unfortunately not. It will require going into the source code of the framework.

freescout-help avatar Oct 26 '24 11:10 freescout-help