Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect upload URL when self hosting #301

Open
whatevercauseeverythingistaken opened this issue Sep 29, 2024 · 1 comment
Open

Incorrect upload URL when self hosting #301

whatevercauseeverythingistaken opened this issue Sep 29, 2024 · 1 comment

Comments

@whatevercauseeverythingistaken

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.

@stophecom
Copy link
Owner

stophecom commented Sep 29, 2024

Hi there,
actually, I had a fair amount of trouble with settings up S3 as well. I just checked and noticed that I even added some comment in https://github.com/stophecom/sharrr-svelte/blob/main/src/lib/s3.ts - but I don't recall the exact problem.
Maybe it relates to anacronw/multer-s3#192 ?

As for the CORS issue. Maybe you have some custom config on Amazon? https://docs.aws.amazon.com/AmazonS3/latest/userguide/cors.html

In my setup I use another S3 provider so I can't really help with that I'm afraid.

Hope that helps at least a bit.
Best
Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants