For a small git helper script, based on this blog post, I'd like to be able to "discover" in which Git hosting app, a given remote URL ([email protected]:namespace/project.git) points to (e.g. GitLab CE/EE, Gitea, GHE, etc).
Using curl --head I found a wide range of "some identifying strings" to "none". So, that seems inaccurate, if fed into a heuristic. Going by the page body may provide more data for the heuristic, but seems equally crude.
Is there a more elegant or standardised way to find the app type? Something like a "server_agent"?
I understand that for security reasons, detailed info like the app version, will likely not be served. Also, I noticed that in Shodan, there is no "product" search for those apps. Does that mean it's fundamentally not possible to reliably identify them without HTML parsing?
I do not think there is any "standardized" approach to finding the hosting application. The Git protocol itself does not provide any such thing. In HTTP (which most Git hosting apps use as the transfer protocol), the
Serverheader is probably the best match - but of course, as you noted, there is no requirement for it to be meaningful (or even present).Yes, if the server chooses not to identify via the
Serverheader, you can only guess (based on other headers, HTML responses, whatever).So it seems there is no reliable way to do what you want. Maybe it helps to see it as a X-Y problem? If you describe what you want to do with the information, you may find a different solution.
Maybe you can try probing the server? Or ask the user?