radicle: Add Version to User Agent

The main motivation behind this change is to get just a little
telemetry information from nodes on the network, namely the version
of Radicle they are running.

This is achieved by rewriting `impl Default for UserAgent` which now
uses the version information provided by the build script also used
in other crates.

Also, a new configuration option `node.userAgent` is added, which
allows users to override the user agent if they so please, or set
the value `null`, which will in turn send the user agent
`/radicle/`, which is not really helpful, and the default prior to
this commit.

Creations of `UserAgent` in the whole workspace is cleaned up. In
order to do that `UserAgent::test` is introduced.
This commit is contained in:
Lorenz Leutgeb
2026-04-02 16:26:46 +01:00
committed by Fintan Halpenny
parent 48551cde93
commit 22b2871f64
15 changed files with 182 additions and 44 deletions
+9
View File
@@ -15,6 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
using `--verbose`, and the full OID when using `--verbose`.
These ranges make using `git range-diff` a lot easier, since you can copy
the range from each revision you want to compare.
- Nodes will now advertise the version of Radicle they are running in the node
announcement as part of the "user agent", which is shared among the network.
For example, the value that will be shared by Radicle 1.9.0 will be
`/radicle:1.9.0/`. This value is also customizable by node operators via the
configuration value `node.userAgent`. Refer to `rad config schema` for more
information on the possible values. Operators that choose to set a custom
value are asked to keep the substring `/radicle:{YOUR_VERSION}/` which allows
for better telemetry regarding version distribution on the network.
To opt-out of sending any meaningful user agent, set `node.userAgent = null`.
## 1.8.0