-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[installer] Make blocked repositories configurable #9867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added a couple of questions. Feel free to land without addressing them but wanted to raise them in this context.
/hold
EnableLocalApp *bool `json:"enableLocalApp"` | ||
RunDbDeleter *bool `json:"runDbDeleter"` | ||
DefaultBaseImageRegistryWhiteList []string `json:"defaultBaseImageRegistryWhitelist"` | ||
BlockedRepositories []BlockedRepository `json:"blockedRepositories,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Would it make sense to comment the usage of a particular field? I know it's slightly increasing the scope of the PR here but I believe it would make onboarding new people to the team easier if they could read something like:
BlockedRepositories []BlockedRepository `json:"blockedRepositories,omitempty"` | |
// BlockedRepositories define repositories (by regex) which can be blocked. | |
// Repositories are often blocked due to abuse or ... | |
// To block a repository foo/bar, specify: | |
// { UrlRegExp: "https://github.com/foo/bar", BlockUser: false } | |
// ... | |
BlockedRepositories []BlockedRepository `json:"blockedRepositories,omitempty"` |
This could also act as a good basis for documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least in this case, this documentation already exists in the server config:
gitpod/components/server/src/config.ts
Lines 160 to 164 in 8ce8f7a
/** | |
* List of repositories not allowed to be used for workspace starts. | |
* `blockUser` attribute to control handling of the user's account. | |
*/ | |
blockedRepositories?: { urlRegExp: string; blockUser: boolean }[]; |
and there is a pretty close mapping between fields in this struct and those config fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up, There's #8441 to generate config documentation from the struct itself! Could be done together!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/unhold Because comments have been adressed above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add new config under the `experimental.webapp.server` section. * Add the new field to the configmap struct.
d70c671
to
f434d0f
Compare
Description
One of the Webapp team's epics for Q2 is to use the Gitpod installer to deploy to Gitpod SaaS. In order to do that we will need to add additional configuration to the installer to make the output suitable for a SaaS deployment as opposed to a self-hosted deployment.
This PR makes it possible to configure blocked repositories for the server component:
blockedRepositories
field to the server configmap struct to match https://github.com/gitpod-io/gitpod/blob/main/components/server/src/config.ts#L164.experimental.webapp.server.blockedRepositories
config field to the installer to set the field in the configmap.Related Issue(s)
Part of #9097
How to test
Create an installer config file containing this
experimental
section:Get a
versions.yaml
for use with the installer:Then invoke the installer as:
The
blockedRepositories
field in the server config map will reflect the value set in the installer config.Release Notes
Documentation
None.