binderhub
binderhub copied to clipboard
Document how to ban repositories in binderhub
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
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.
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?
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.
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