woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.88k stars 345 forks source link

Set user-agent for HTTP Requests from Woodpecker #3778

Open kfdm opened 3 weeks ago

kfdm commented 3 weeks ago

Clear and concise description of the problem

Currently Woodpecker uses the default http user-agent that comes form the go libraries, so all requests from Woodpecker agents shows up as Go-http-client in web access logs.

Suggested solution

By adding a Woodpecker specific user-agent to outgoing HTTP request, it will help when diagnosing where a connection is coming from.

Alternative

No response

Additional context

Obviously this is a low priority request, though something that might be good for a first-time-issue for the right developer. Is this a feature addition the Woodpecker developers would consider? Any suggestions on the best way to implement this addition?

Validations

zc-devs commented 3 weeks ago

all requests from Woodpecker agents shows up as Go-http-client in web access logs web access logs

Do you connect Agent with Server through a proxy?

By adding a Woodpecker specific user-agent to outgoing HTTP request, it will help when diagnosing where a connection is coming from.

Server listens separate port (default 9000), which Agent connects to. So, it should not be a problem to diagnose Agent connections (in default/standard deployment/configuration).

kfdm commented 3 weeks ago

I believe this is the connect from Woodpecker Server/Agent -> Forge.

Though as I write that, I'm also checking to see if this might be the plugins -> forge (like https://github.com/woodpecker-ci/plugin-git )

These are in the fixtures file so

I'm not certain if these are correct, but these are some of the URLs I see in my Forge's logs, and they're all queried with with Go-http-client as the user-agent.