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

unconfigured CORS policy on s3 bucket causes failure #193

Closed
JKDingwall opened this issue May 21, 2021 · 2 comments
Closed

unconfigured CORS policy on s3 bucket causes failure #193

JKDingwall opened this issue May 21, 2021 · 2 comments

Comments

@JKDingwall
Copy link

Hi, I use this docker registry UI version 2.0.2 and I have an issue...

Bug description

I have a server which runs the docker registry and the registry UI. The registry images are stored in CEPH and accessible via another host running radosgw configured with the s3 interface. The UI is able to list / browse the images stored in the registry but requests directly to the rados gw server fail with a CORS error.

This is the error recorded in the Firefox developer console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://rgw.example.com/docker/docker/registry/v2/blobs/sha256/etc/etc. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

No CORS policy was configured on the bucket:

# s3cmd info s3://docker
s3://docker/ (bucket):
   Location:  country
   Payer:     BucketOwner
   Expiration Rule: none
   Policy:    none
   CORS:      none
   ACL:       Docker Registry (Country/City): FULL_CONTROL

After applying a policy to the bucket the issue with the UI was resolved. I'm making a mention of this here in case it is a useful tip to add to documentation.

@Joxit Joxit closed this as completed in ee1f173 Oct 21, 2022
@Joxit
Copy link
Owner

Joxit commented Oct 21, 2022

Hi, thank you for using my project and submitting issues with tips 😄 I added a section in the FAQ and your name in my contribution list

@Joxit Joxit reopened this Oct 21, 2022
@Joxit Joxit closed this as completed Oct 21, 2022
@nolanholden
Copy link

nolanholden commented Sep 13, 2024

EDIT:

adding storage.redirect.disable: true config to registry seems to have fixed the issue.
as described in: https://github.com/Joxit/docker-registry-ui/tree/a36e3aac57b957260c87fdb387ef0a425ac6e3ee/examples/issue-75#example-for-issue-75


I saw this issue using Cloudflare R2, but after setting appropriate CORS, experienced a different failure:
Failed to load resource: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
on the follow-on request.

Presumably because the basic auth credentials are being sent to the 307 url (cloudflare), rather than being omited

Does that sound right? Do you know where this adjustment can be added?

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

3 participants