Question

Issues connecting Mastodon droplet to spaces

I’m new at this, and I’ve been going around in circles trying to setup a mastodon droplet to use a digitalocean space.

(As an aside, it would be helpful to have a DO tutorial on this… everything I’ve found online seems dated and they all disagree with each other.)

At the moment I have my env.production file set like this:

S3_ENABLED=true

S3_PROTOCOL=https

S3_BUCKET=bucketname

S3_HOSTNAME=nyc3.digitaloceanspaces.com S3_ENDPOINT=https://bucketname.nyc3.digitaloceanspaces.com S3_ACCESS_KEY_ID=xxxxxxxxxx S3_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYY S3_ALIAS_HOST=images.mysite.com S3_REGION=nyc.3

“bucketname” is the name of my space. I’ve scrambled the access key and secret, and changed the website url to a generic.

I created a let’s encrypt certificate for the subdomain “images.”

At the moment there is no avatar or header, and I can’t upload new ones. I just get the elephant pounding on the keyboard when I try.

If I right click on my avatar and open it in a new tab I get “AccessDeniedbucketnamestx000000000000173315c3a-00636c3b7b-3f2ad568-nyc3c3f2ad568-nyc3c-nyc3-zg03”

I’ve tried using the edge endpoint as well.

I’m clearly missing something.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 10, 2022
Accepted Answer

Hi there,

I believe that your S3_ENDPOINT variable needs to be changed to:

S3_ENDPOINT=https://nyc3.digitaloceanspaces.com

The complete config should look as follows:

S3_ENABLED=true
S3_PROTOCOL=https
S3_BUCKET=your-bucket
S3_REGION=us-east-1
S3_HOSTNAME=your-bucket.sfo3.digitaloceanspaces.com
S3_ENDPOINT=https://sfo3.digitaloceanspaces.com
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
S3_ALIAS_HOST=your.aliashost

Let me know how it goes.

Best,

Bobby

Ok, I have it mostly correct. The first time I transferred my public folder over, I didn’t put it in root, so mastodon was looking in the right place but the media wasn’t where mastodon thought it should be.

I am having a similar problem. I got the spaces files to load correctly thanks to above. Now how do I point the resources to the CDN nyc3.cdn.digitaloceanspaces.com?

CDN_HOST? I tried and the site refused to load.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.