Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Feat]: Is there a way to disable referrers api? #1487

Closed
JeyJeyGao opened this issue May 31, 2023 · 4 comments
Closed

[Feat]: Is there a way to disable referrers api? #1487

JeyJeyGao opened this issue May 31, 2023 · 4 comments
Labels
feature New feature or request rm-external Roadmap item submitted by non-maintainers

Comments

@JeyJeyGao
Copy link

Is your feature request related to a problem? Please describe.

I'm a developer of notaryproject/notation. We build our end to end testing based on Zot registry. We are going to test the scenario that the registry doesn't support referrers api, so is there a way to disable referrers api feature for Zot registry?

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@JeyJeyGao JeyJeyGao added the feature New feature or request label May 31, 2023
@rchincha rchincha added the rm-external Roadmap item submitted by non-maintainers label May 31, 2023
@rchincha
Copy link
Contributor

rchincha commented May 31, 2023

@JeyJeyGao would you consider the option of building your own patched zot? We can provide the patch.
Note that this is still pending opencontainers/image-spec#1068 which I would imagine has implications for the notation project.

@rchincha
Copy link
Contributor

Perhaps, another more CI-friendly option would be to front a reverse-proxy such as nginx or haproxy and block APIs?

@JeyJeyGao
Copy link
Author

Perhaps, another more CI-friendly option would be to front a reverse-proxy such as nginx or haproxy and block APIs?

That's an interesting idea. Let me try it.

@JeyJeyGao
Copy link
Author

Hi @rchincha, thanks for your suggestions! I've successfully set up an Nginx reverse proxy configuration that emulates a registry which doesn't support the referrers API. This might be helpful for others encountering similar scenarios.

The Nginx reverse proxy listens on port 5001, and all requests are forwarded to Zot, which is running on localhost:5000. A specific rule is added to return a 404 status code for any request matching the schema <scheme>://<registry>/v2/<repository>/referrers.

Here's the configuration:

events {
    worker_connections 1024;
}

http {
    # for emulating a registry that doesn't support referrers api
    server {
        listen 5001;

        location ~ ^/v2/.+/referrers {
            return 404;
        }

        location / {
            proxy_pass http://localhost:5000;
        }
    }
}

@project-zot project-zot locked and limited conversation to collaborators Jun 1, 2023
@rchincha rchincha converted this issue into discussion #1494 Jun 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature New feature or request rm-external Roadmap item submitted by non-maintainers
Projects
None yet
Development

No branches or pull requests

2 participants