-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Allow to configure config extensions for repos #3349
base: main
Are you sure you want to change the base?
Conversation
server/model/repo.go
Outdated
SecretExtensionEndpoint string `json:"secret_extension_endpoint" xorm:"varchar(500) 'secret_extension_endpoint'"` | ||
ConfigExtensionEndpoint string `json:"config_extension_endpoint" xorm:"varchar(500) 'config_extension_endpoint'"` |
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.
These are sent to all requests, including unauthorized.
Since you should use signing anyways that should be fine, but I just want to make sure this is expected?
} | ||
|
||
var blockedError error | ||
if blockList.MatchHostOrIP(host, tcpAddr.IP) { |
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.
Is the blocklist used somewhere?
web/src/assets/locales/en.json
Outdated
"extensions": "Extensions", | ||
"extensions_description": "Extensions are HTTP services that can be called by Woodpecker instead of using the builtin ones.", | ||
"secrets_extension_endpoint": "Secrets extension endpoint", | ||
"secrets_extension_alpha_state": "The secret extension is in alpha state and might change in the future.", | ||
"extension_endpoint_placeholder": "e.g. https://my-extension-endpint.tld/api", | ||
"config_extension_endpoint": "Config extension endpoint", | ||
"extensions_signatures_public_key": "Public key for signatures", | ||
"extensions_signatures_public_key_description": "This public key should be used by your extensions to verify webhook calls from Woodpecker.", | ||
"extensions_configuration_saved": "Extensions configuration saved" |
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.
Can you put them into their own object?
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
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.
I'm worried about #4341 (comment). Do not see changes in this regards. I might miss something, therefore double-check, please. See also #4341 (comment).
@@ -0,0 +1,164 @@ | |||
# Configuration extension | |||
|
|||
The configuration extension can be used to modify or generate Woodpeckers pipeline configurations. You can configure a HTTP |
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.
The configuration extension can be used to modify or generate Woodpeckers pipeline configurations. You can configure a HTTP | |
The configuration extension can be used to modify or generate Woodpeckers pipeline configurations. You can configure an HTTP |
Using such an extension can be useful if you want to: | ||
|
||
<!-- cSpell:words templating,Starlark,Jsonnet --> | ||
- Preprocess the original configuration file with something like go templating |
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.
- Preprocess the original configuration file with something like go templating | |
- Preprocess the original configuration file with something like Go template |
- [netrc model](https://github.com/woodpecker-ci/woodpecker/blob/main/server/model/netrc.go) | ||
|
||
:::tip | ||
The `netrc` data is pretty powerful as it contains credentials to access the repository. You can use this to clone the repository or even use the forge (Github or Gitlab, ...) api to get more information about the repository. |
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.
The `netrc` data is pretty powerful as it contains credentials to access the repository. You can use this to clone the repository or even use the forge (Github or Gitlab, ...) api to get more information about the repository. | |
The `netrc` data is pretty powerful as it contains credentials to access the repository. You can use this to clone the repository or even use the forge (Github or Gitlab, ...) API to get more information about the repository. |
When a pipeline is triggered Woodpecker will fetch the pipeline configuration from the repository, then make a HTTP POST request to the configured extension with a JSON payload containing some data like the repository, pipeline information and the current config files retrieved from the repository. The extension can then send back modified or even new pipeline configurations following Woodpeckers official yaml format that should be used. | ||
|
||
:::tip | ||
The netrc data is pretty powerful as it contains credentials to access the repository. You can use this to clone the repository or even use the forge (Github or Gitlab, ...) api to get more information about the repository. |
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.
Duplicate?
|
||
### Response | ||
|
||
The extension should respond with a JSON payload containing the new configuration files in Woodpeckers official yaml format. |
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.
The extension should respond with a JSON payload containing the new configuration files in Woodpeckers official yaml format. | |
The extension should respond with a JSON payload containing the new configuration files in Woodpecker's official YAML format. |
### Response | ||
|
||
The extension should respond with a JSON payload containing the new configuration files in Woodpeckers official yaml format. | ||
If the extension wants to keep the existing configuration files, it can respond with **HTTP 204**. |
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.
If the extension wants to keep the existing configuration files, it can respond with **HTTP 204**. | |
If the extension wants to keep the existing configuration files, it can respond with HTTP `204 No Content`. |
|
||
There are currently two types of extensions available: | ||
|
||
- [Configuration extension](./40-configuration-extension.md) to modify or generate Woodpeckers pipeline configurations. |
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.
- [Configuration extension](./40-configuration-extension.md) to modify or generate Woodpeckers pipeline configurations. | |
- [Configuration extension](./40-configuration-extension.md) to modify or generate Woodpecker pipeline configurations. |
|
||
Woodpecker allows you to replace internal logic with external extensions by using pre-defined http endpoints. | ||
|
||
There are currently two types of extensions available: |
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.
What is the second one? Is it possible to configure it globally like config extension?
There are 3 types on screenshot.
closes #783
Allow users to set / use service extensions (config) on a per repo basis. Those extensions are little external webservice which can implement a set of endpoints to replace woodpeckers internal functionality like:
TODO