Here’s my mastodon .env config:
S3_ENABLED=true
S3_PROTOCOL=https
S3_REGION=global
S3_ENDPOINT=https://gateway.storjshare.io
S3_HOSTNAME=gateway.storjshare.io
S3_BUCKET=freakuniversity
AWS_ACCESS_KEY_ID=jvzohkaclwulrmq6irokuu7vp7ya
AWS_SECRET_ACCESS_KEY=[redacted]
S3_ALIAS_HOST=media.freak.university
and here’s my nginx config for media.freak.university
:
server {
include snippets/fu.conf;
server_name media.freak.university;
root /home/mastodon-fu/app/public/system;
keepalive_timeout 30;
location / {
try_files $uri @s3;
}
set $s3_backend 'https://link.storjshare.io/raw/jvwex5p4jrei5awapwcsjb2htdnq/freakuniversity';
location @s3 {
limit_except GET {
deny all;
}
resolver 8.8.8.8;
proxy_set_header Host 'link.storjshare.io';
proxy_set_header Connection '';
proxy_set_header Authorization '';
proxy_hide_header Set-Cookie;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_hide_header x-amz-bucket-region;
proxy_hide_header x-amzn-requestid;
proxy_ignore_headers Set-Cookie;
proxy_hide_header Content-Disposition;
proxy_pass $s3_backend$uri;
proxy_intercept_errors off;
proxy_cache CACHE;
proxy_cache_valid 200 48h;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
expires 1y;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin '*';
add_header X-Cache-Status $upstream_cache_status;
}
}
i generated the share URL using uplink share --url --register --public --readonly=true --disallow-lists --not-after=none sj://freakuniversity
. and I generated the access token and secret key on the Storj website.
Here’s what’s going on now: I can successfully upload files, and the object count in the Storj UI increases, but on media.freak.university the images 404 always. And when I use uplink ls sj://freakuniversity
only a test file that I uploaded manually shows up. What’s going on here?