binderhub icon indicating copy to clipboard operation
binderhub copied to clipboard

Document how to ban repositories in binderhub

Open choldgraf opened this issue 6 years ago • 4 comments

In a recent discourse thread someone asked how they could allow only one repository to run with binderhub. In answering, I realized that we don't document how to ban a repository. We should do so.

For reference, this is where we ban repos in mybinder.org:

https://github.com/jupyterhub/mybinder.org-deploy/blob/master/mybinder/values.yaml#L45

choldgraf avatar May 15 '19 20:05 choldgraf

To allow access to only one repo, update the config with the following:

config:
  GitHubRepoProvider:
    banned_specs:
      - ^(?!org\/repo).*$ 

where org and repo are the ones you want to allow.

sgibson91 avatar May 16 '19 13:05 sgibson91

Is it possible, or do we want it to be possible, to ban repos from other providers? For example, I assume my snippet above won't affect GitLab, BitBucket, etc. providers?

sgibson91 avatar May 16 '19 13:05 sgibson91

Correct, this config only bans repositories for the GitHub provider. You'd have to add the same or similar config for all of the other providers.

I think already the providers are different enough that we can't set a global regular expression on the base class.

Maybe another good first contribution would be to add a whitelist in addition to the black list we have now. So you don't have to do the gymnastics of writing an "inverse" regular expression.

betatim avatar May 20 '19 06:05 betatim

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/building-a-the-littlest-binderhub/9824/4

meeseeksmachine avatar Jul 01 '21 19:07 meeseeksmachine