Add 'server_version' endpoint to admin API#4772
Add 'server_version' endpoint to admin API#4772erikjohnston merged 4 commits intomatrix-org:developfrom
Conversation
We will later need also to import 'register_servlets' from the 'login' module, so we un-pollute the namespace now to keep the logical changes separate.
This is required because the 'Server' HTTP header is not always passed through proxies.
62fcdbd to
f24721c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4772 +/- ##
===========================================
- Coverage 75.13% 67.65% -7.49%
===========================================
Files 340 340
Lines 34918 34931 +13
Branches 5722 5723 +1
===========================================
- Hits 26237 23631 -2606
- Misses 7067 9652 +2585
- Partials 1614 1648 +34 |
Codecov Report
@@ Coverage Diff @@
## develop #4772 +/- ##
===========================================
- Coverage 75.13% 75.12% -0.02%
===========================================
Files 340 340
Lines 34918 34996 +78
Branches 5722 5750 +28
===========================================
+ Hits 26237 26289 +52
- Misses 7067 7089 +22
- Partials 1614 1618 +4 |
|
It seems to have un-stuck itself |
Signed-off-by: Joseph Weston <joseph@weston.cloud>
f24721c to
d3dcb64
Compare
|
|
||
|
|
||
| class VersionServlet(ClientV1RestServlet): | ||
| PATTERNS = client_path_patterns("/admin/server_version") |
There was a problem hiding this comment.
I guess a first point to make sure we agree on is what to call this endpoint.
server_version seems better than simply version IMO, because it is more explicit
There was a problem hiding this comment.
Also I just realised I forgot to add documentation for this endpoint.
| ret = { | ||
| 'server_version': get_version_string(synapse), | ||
| 'python_version': platform.python_version(), | ||
| } |
There was a problem hiding this comment.
Then there's what should be returned. @hawkowl suggested to also return the Python version (IIRC) because we can, and because this is often a pain point for users.
There was a problem hiding this comment.
this is often a pain point for users.
i.e. that troubleshooting is harder without this information, so we may as well return it
richvdh
left a comment
There was a problem hiding this comment.
this looks great, though please could you add a file in https://github.com/matrix-org/synapse/tree/develop/docs/admin_api to document it?
For sure! I got distracted, but I'll do it now :) |
Signed-off-by: Joseph Weston <joseph@weston.cloud>
|
Thanks! |
Pull Request Checklist
Closes #3220