sharrr-svelte icon indicating copy to clipboard operation
sharrr-svelte copied to clipboard

Incorrect upload URL when self hosting

Open whatevercauseeverythingistaken opened this issue 4 months ago • 1 comments

Greetings,

So this is my first S3 integration like this so please bear with me because I've been thrown straight into an ocean.

I'm getting CORS errors when trying to upload something despite the public access being fully enabled in my Amazon S3 Bucket settings. Also the URL that throws CORS errors doesn't seem to be correct, it's https://bucket_name.s3.eu-north-1.amazonaws.com//bucket_name, why is that so?

Why bucket_name occurs twice in the URL and why when it's used for the second time there are double slashes before it?

Here is my env structure:

Postgres

POSTGRES_PRISMA_URL='postgres://user_name@localhost:5432/user_name' POSTGRES_URL_NON_POOLING='postgres://user_name@localhost:5432/user_name' # Direct Connection

S3 compatible object storage e.g. AWS

S3_ENDPOINT='s3.eu-north-1.amazonaws.com' S3_ACCESS_KEY='access_key' S3_SECRET_KEY='secret_access_key' PUBLIC_S3_BUCKET='bucket_name'

Vercel specific, but can be easily replaced.

VERCEL_URL='http://localhost:3000' PUBLIC_ENV='development' # preview/production

Only used for cron jobs that run using Github Actions.

API_SECRET_KEY=''

Thank you in advance.