loomio / loomio-deploy

Install Loomio on your own server
147 stars 60 forks source link

Storage location for user uploads? #107

Open poVoq opened 5 months ago

poVoq commented 5 months ago

It is a bit confusing where Loomio stores user image uploads.

It seems to be not in the uploads volume, and while there seems to be some stuff stored in the storage volume (but obfuscated), the size of that volume seems too small on my instance to account for the various images already uploaded.

Realistically only the main database seems to be sufficiently sized to hold the images uploaded?

But it would be nice if there was a way to redirect specifically larger image uploads to another storage location to save space on the main drive.

Thanks!

robguthrie commented 5 months ago

We use Rails ActiveStorage for files. By default with loomio-deploy you are using the ActiveStorage DiskService with files being kept in loomio-deploy/storage - their filenames are managed by ActiveStorage.

You can either move this directory somewhere else and change docker-compose where it says:

- ./storage:/loomio/storage

to something like

- /mnt/bigdisk/storage:/loomio/storage

Note there are 2 copies of this line and you need to change them both.

Alternatively you can setup S3 or an S3 compatible cloud service, but you'd need to read https://guides.rubyonrails.org/active_storage_overview.html to learn more about mirroring or migrating your storage system in the cloud.