Dash-Industry-Forum / livesim2

DASH Live Source Simulator v2 in Go
Other
34 stars 4 forks source link

Livesim2 /version getter? #185

Closed Murmur closed 1 month ago

Murmur commented 1 month ago

Url command to get Livesim2 version number would be nice in case need to know an exact version for troubleshooting. /livesim2/version

From Slack:

Small wish, print Livesim2 version(+ maybe git branch id used if possible) in livesim2/config json reply. 
Main page /livesim2 has "Version:" line in the bottom but our master branch compilation always has an empty value.

Torbjörn Einarsson:  The version is constructed in the Makefile line:
https://github.com/Dash-Industry-Forum/livesim2/blob/f09c960727e52ffe0e0d3a07f4b2c8d2179fdc1f/Makefile#L12C1-L13C1
if you build the binary that way. If you just run "go build ." it will get a fixed value from an internal file.
Regarding inclusion in the configuration file, it is not really part of the configuration, and that JSON is automatically generated so it is not just adding it. I need to look into how easy it is. Would it be good enough to be able to get it from a "/version" endpoint?
tobbee commented 1 month ago

I made a PR, but as I wrote there, you get the version as an HTTP header in every response, so it is already present almost everywhere.

You even get it as a header in the /version response.

Murmur commented 1 month ago

Excellent this makes things easier for an automatic logging scripts to collect relevant information from the Livesim2 instance.