65 lines
4.8 KiB
Markdown
65 lines
4.8 KiB
Markdown
[](https://simongreenwood.me.uk/)
|
|
|
|
# [Simon Greenwood](https://simongreenwood.me.uk/)
|
|
|
|
Gracefully degrading
|
|
|
|
- [About Me](https://simongreenwood.me.uk/pages/about-me.html#about-me)
|
|
- [Contact info](https://simongreenwood.me.uk/pages/contact.html#contact)
|
|
- [My CV](https://simongreenwood.me.uk/pages/curriculum-vitae.html#curriculum-vitae)
|
|
- [CV Part 2](https://simongreenwood.me.uk/pages/cv-part-2.html#cv-part-2)
|
|
- [Social](https://gotosocial.grnwds.uk/@simon)
|
|
|
|
[Home](https://simongreenwood.me.uk/) [Technical](/category/technical.html) [Listening Diary](/category/listening-diary.html) [Tags](/tags.html) [Archives](/archives.html) [Atom](https://simongreenwood.me.uk/feeds/all.atom.xml)
|
|
|
|
# Adding S3-compatible cloud storage to Pixelfed
|
|
|
|
Posted on Mon 11 September 2023 in [Technical](https://simongreenwood.me.uk/category/technical.html)
|
|
|
|
[Pixelfed](https://pixelfed.org) is a [federated](https://en.wikipedia.org/wiki/Fediverse) photo sharing service that is an alternative to [Instagram](https://instagram.com) and uses [ActivityPub](https://www.w3.org/TR/activitypub/) to share posts across other services such as [Mastodon](https://joinmastodon.com), [Pleroma](https://pleroma.social/) and indeed WordPress. It is one of the more mature Fediverse apps and has been in continuous development for several years.
|
|
|
|
As with Mastodon and other apps that can share images and other larger media files, it supports saving attachments to S3-compatible cloud storage. However, this isn't well documented so far, so here's a few notes on getting it to work, specifically with [iDrive E2](https://www.idrive.com/object-storage-e2/), a low cost E2 storage provider.
|
|
|
|
Pixelfed is a [Laravel](https://laravel.build) application and its user config is stored in a `.env` file in the application root. The S3 section looks like this:
|
|
|
|
```
|
|
## S3 Configuration (Post-Installer)
|
|
PF_ENABLE_CLOUD=true
|
|
FILESYSTEM_CLOUD=s3
|
|
AWS_ACCESS_KEY_ID=
|
|
AWS_SECRET_ACCESS_KEY=
|
|
AWS_DEFAULT_REGION=
|
|
AWS_BUCKET=
|
|
AWS_URL=
|
|
AWS_ENDPOINT=
|
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
|
|
|
```
|
|
|
|
IDrive E2 appears to be based on [Minio](https://mini.io) but the priniciple is broadly similar for all S3 compatible services:
|
|
|
|
1. Create a bucket
|
|
2. Create credentials for that bucket
|
|
3. Configure the application with those credentials
|
|
|
|
I think they're fairly self-explanatory in that the service will usually present them in the same way. The default region can be a bit of odd one but the naming seems to be arbitrary - I'm using iDrive's London region, which is labelled LDN, so go with what the service gives you.
|
|
|
|
`AWS_URL` is as it says, a standard URL, so it's https:// `AWS_ENDPOINT` / `AWS_BUCKET`. `AWS_ENDPOINT` is an important thing though - IDrive has the option of public and private endpoints with different hostnames. I'm not entirely clear on how a private endpoint works in this context - I would think it's a location that needs to be accessed with a shared key - but as you're publishing images online that's not going to be possible, and in testing I couldn't get Pixelfed to write to a private endpoint. In addition they're going to need to be public on an open server, so following the principle of least privilege, public and read-only works.
|
|
|
|
I had to comment `AWS_USE_PATH_STYLE_ENDPOINT` out as setting it to false didn't work for some reason. There's probably something in the code that assumes it's going to be an AWS URL or similar.
|
|
|
|
The Horizon dashboard was very useful for debugging. Again, this is a Laravel tool and part of the admin suite. I'm not that familiar with Laravel and but it basically appears to be the application manager. It writes to a log but that doesn't say much, and all the useful information is in the dashboard.
|
|
|
|
If you want to share images in the Fediverse, Pixelfed is the application you need. Its author, [Daniel Supernault](https://mastodon.social/@dansup) has been steadily improving it for years, and he's also currently working on a secure and federated messaging system intended as a drop-in replacement for direct messages. Cloud storage reduces your hosting costs as it's usually cheaper in bulk than VPS, and it's portable, so now you can replace Instagram with something under your control.
|
|
|
|
[tech](https://simongreenwood.me.uk/tag/tech.html) [fediverse](https://simongreenwood.me.uk/tag/fediverse.html) [pixelfed](https://simongreenwood.me.uk/tag/pixelfed.html) [s3](https://simongreenwood.me.uk/tag/s3.html)
|
|
|
|
© 2025 - This work is licensed under a [Creative Commons Attribution-ShareAlike](http://creativecommons.org/licenses/by-sa/4.0/deed.en_US)
|
|
|
|
Built with [Pelican](http://getpelican.com) using [Flex](http://bit.ly/flex-pelican) theme
|
|
\|
|
|
Switch to the [dark](javascript:void(0)) \| [light](javascript:void(0)) \| [browser](javascript:void(0)) theme
|
|
|
|
|
|
[](http://creativecommons.org/licenses/by-sa/4.0/)
|
|
|