Allow to configure a config extension per repo#3349
Conversation
There was a problem hiding this comment.
What about putting this into an external package? Then we and gitea can use this package.
There was a problem hiding this comment.
I've created a package / repo, now we only need the Gitea team to use their extracted version. I would move it to the gitea org, it's using my user atm.
There was a problem hiding this comment.
@6543 you're still a gitea maintainer, right? Could you check this out?
There was a problem hiding this comment.
We can extract it later on if we get a go from Gitea Maintainers.
There was a problem hiding this comment.
uh got a ping - Im out of the loop of this pull atm ... let me reread it
There was a problem hiding this comment.
if it's about that package ... what exact is the request?!?
to let it replace giteas internal one?
|
|
||
| To prevent extensions from calling local services by default only external hosts / ip-addresses are allowed. You can change this behavior by setting the `WOODPECKER_EXTENSIONS_ALLOWED_HOSTS` environment variable. You can use a comma separated list of: | ||
|
|
||
| - Built-in networks: |
There was a problem hiding this comment.
What would be the benefit? Disabling it completely?
There was a problem hiding this comment.
If that's really needed we could add it in an upcoming PR. As external would not be a security issue IMO and there seems no concrete risk of having the possibility, I would skip it for this PR.
There was a problem hiding this comment.
it's the same atack vector as custom agents ... one could create an repo on a public forge+ci and then infite the victim to somehow to create a pull to it. now netrc/token extraction is possible.
we should address this in the long run to generate tokens from forges that are onlv valid for the repo it is currently in use ...
There was a problem hiding this comment.
u might be right ... let me check how oauth2 tokens are used exactly again
anyway having the feat. to derive scope limited tokens for dayli usage and only let wp-server handle the original token would be a good hardening exercize ... is there already an open issue for that?
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Doesn't work. The netrc data is from the "repo user", which is the user who enabled a repo. It's always this. And never the credentials from the PR opener. |
|
Besides my point about separating the hostmatcher I actually think this looks good. I didn't test yet, but the code seems fine. |
qwerty287
left a comment
There was a problem hiding this comment.
I'd merge this also if my point is not resolved we can easily do that later as well.
(@6543 can you checkout #3349 (comment))
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
|
Surge PR preview deployment was removed |
qwerty287
left a comment
There was a problem hiding this comment.
Code lgtm, but untested
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3349 +/- ##
==========================================
+ Coverage 19.52% 19.67% +0.14%
==========================================
Files 416 419 +3
Lines 39567 39782 +215
==========================================
+ Hits 7726 7827 +101
- Misses 31144 31249 +105
- Partials 697 706 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I was just wondering: This is breaking right? Because you cannot host a global endpoint on |
|
@anbraten Can you please take a look, this breaks the UI. Can we stop merging such big changes untested?
|
|
Will have a look at it. It was tested. |
|
I found it already. |
|
Seems it missing a few changes, maybe they got lost in my merge 🤔 |

closes #783
Allow users to set / use service extensions (for this PR just config, secrets / registries could be added later on) 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