Announcement

#1 2022-06-17 21:40:13

kinsham
Member
2017-09-05
15

Hosting photos on a cloud storage

Hello/Hi/Greetings,

(Here your message)
I currently run piwigo on my own Debian server that also provides the storage. I'd like to move my storage to a cloud storage provider so that the server can then be an AWS instance. Piwigo stores its photos in the galleries subdirectory which means storage is on the piwigo host. A low cost AWS instance doesn't offer enough storage to hold my library.

Can piwigo be configured to store its photos in some external cloud storage?

The cloud storage can be mounted on the host with rclone or s3fs so the problem boils down to configuring piwigo to take its files from the mount instead of the default galleries directory on the host.

(Copy here your environment details, found on your Piwigo page [Administration > Tools > Maintenance])

Piwigo URL: http://

Offline

 

#2 2022-06-18 01:16:15

matthewh
Member
2022-06-18
1

Re: Hosting photos on a cloud storage

I just so happen to be looking into this as well.  From what I have learned in these forums, the two important folders are galleries for ftp uploads, and upload for http uploads.  Not very intuiative! 

For applications designed for Linux and not S3 I would recommend using EFS.  EFS is backwards compatible with NFS.  I have my /etc/fstab configured to mount EFS to /data/.  Then I use the following script to persist the data there...

#!/bin/bash
mkdir -p /data/piwigo

for folder in galleries upload ; do

    orig=/var/www/html/piwigo/$folder
    persist=/data/piwigo/$folder

    if [ ! -d $persist ] ; then
        echo "Moving $folder folder to persistent storage (EFS)"
        sudo mv -v -f $orig $persist
    fi
   
    if [ -d $orig ] ; then
        echo "Moving $folder folder out of the way"
        sudo mv -v -f $orig $orig.backup
    fi

    echo "Linking $folder folder to persistent storage (EFS)"
    sudo ln -s $persist $orig

done

sudo chown www-data:www-data -R /data/piwigo
sudo chmod 755 -R /data/piwigo

Good luck!

Last edited by matthewh (2022-06-18 01:18:46)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact