woodpecker-ci / example-config-service Goto Github PK
View Code? Open in Web Editor NEWExample for a basic configuration service
Example for a basic configuration service
https://woodpecker-ci.org/docs/administration/external-configuration-api Is 404
need to update the Readme.md
I added some debugging logs to the the signature verification code:
keyID, err := verifier.Verify(r)
if err != nil {
log.Printf("config: invalid or missing signature in http.Request %s", err)
http.Error(w, "Invalid or Missing Signature", http.StatusBadRequest)
return
}
Which shows:
Aug 11 18:12:42 kfbox woodpecker-flake-pipeliner[171813]: 2023/08/11 18:12:42 config: invalid or missing signature in http.Request no params present
To check if a signature was present I piped the POST request coming from Woodpecker to a request bin:
I tracked down the error is coming from here, but as you can see in the image above there is actually a signature. I suspect the cause is this commit which seems to have changed the header in which the verifier expects the signature. If I'm not mistaken the header shold be "Signature" with a capital "S" as shown [here]
https://github.com/go-ap/httpsig/blob/3647b4d88fdf75dc8b4202e119a582db1690fe9d/verify.go#L159-L161
at the moment:
WOODPECKER_CONFIG_SERVICE_PUBLIC_KEY_FILE=public-key.pem
what would be nice:
WOODPECKER_URL=http(s)://your-woodpecker-server:123
that will download key from http(s)://your-woodpecker-server:123/api/signature/public-key
seems like the httpsig package needs an update....
It broke for me when I updated woody server today and I had to update the package in the config service too to get it back to work...
also the repo has ben archived by the owner... I can do that later this week...
I don't see any mention of CONFIG_SERVICE_SECRET in the code. Is this variable deprecated, can it be removed?
If woodpecker-ci/woodpecker#916 lands, this repo need some adjustments ...
@s00500 your feedback would be welcome there too ;)
For some reason I cant make this work... when I fetch the key I get a file with
-----BEGIN PUBLIC KEY-----
base64 string
-----END PUBLIC KEY-----
This will not load with hex.DecodeString
I tried decoding the base64 before but only get an invalid key length error later....
What have I misunderstood ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.