Closed liamwhite closed 1 year ago
openresty
, pick an object storage provider (we recommend Cloudflare R2, or if you want to use your local filesystem - use s3proxy as shown in our docker-compose.yml
), optionally also pick a backup object storage provider (which will be used for failover in case main one goes offline, and will also replicate all images written to the main one for backup purposes, we recommend Backblaze B2), create buckets and S3 access tokens for themmix upload_to_s3 --concurrency $(nproc) --adverts --avatars --badges --tags --images 2010-01-01T00:00:00Z
(replace $(nproc)
with a desired number is lower concurrency is desired)opm install jkeys089/lua-resty-hmac
docker/web/nginx.conf
, make sure that it's aware of your object storage key and host (AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
, S3_HOST
, S3_BUCKET
and S3_SCHEME
env vars need to be set for the user which runs openresty), restart openresty
Important note: for development instances using the default docker-compose.yml settings, no action is required to deploy this update. Both past and future uploads will continue to work without any custom configuration.
Decouples Philomena from using the filesystem directly to store uploaded files, instead going through an object storage server to host objects. The development instance includes S3Proxy, which can handle connection to arbitrary storage backends. This frontend has been tested to work with S3Proxy's filesytem storage and Cloudflare R2 storage.
A replication mode is also implemented, to live-replicate all storage operations to a second backend for higher durability. This is currently expected to be used with Backblaze B2's S3 bindings (but could be used with any S3-compatible provider).
For users who desire to migrate an existing site to an external object storage backend, a mix task has been provided which uploads all requested models which have been modified after the given time:
mix upload_to_s3 --adverts --avatars --badges --tags --images --concurrency 100 1970-01-01T00:00:00Z
The S3 interface is configured via environment variables, which should be mostly self-explanatory:
All environment variables also have an ALT_-prefixed version (like
ALT_S3_HOST
) which specifies parameters for the replica instance, if present. A replica is not required and will not be used if these environment variables are not present.Note 1:
To use Backblaze B2 you must currently modify this regex toNo explicit configuration required any longer with latest changes.~r/^(us|eu|af|ap|sa|ca|me)\-\w+\-\d$/
to avoid the Backblaze endpoint being detected as AWS.