-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an endpoint to check connectivity to WOPI server #9202
Add an endpoint to check connectivity to WOPI server #9202
Conversation
9d0faa2
to
49b4465
Compare
85b67fb
to
80b6af1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first cut - glad it works; needs re-working =) Thanks!
80b6af1
to
9ed4b72
Compare
9ed4b72
to
b19d6aa
Compare
The code is now ported to use async requests, but lacks detailed error reporting, cool internal API does not surface hostname errors, connection errors. |
7f0b0ae
to
b313981
Compare
fb9350a
to
5c125b6
Compare
5c125b6
to
eed41e5
Compare
9d90ebb
to
e616a8b
Compare
c5b139f
to
94b6a90
Compare
94b6a90
to
e60b0f9
Compare
e60b0f9
to
9f6a583
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
CI still needs to pass
-
I see that the PR has many commits, with commit messages that suggest you would squash this before merging. But if you do so, you'll get a quite large commit. It would be nice to split this to pieces: A) the net/ infrastructure you add (e.g. add socket to the connect fail callback) B) add the new endpoint with a single detected problem C) add the rest of the problems
-
I see that all the sync poco network code is gone, good.
-
The sync poco DNS code is also gone, good.
-
For something as simple as a JSON dictionary with a single entry, I would suggest to use escapeJSONValue() and build the reply manually, no need to go via poco JSON.
9f6a583
to
97d94f4
Compare
Now split in three first is A, the two seconds are C (mostly optional just code improvement) and the fourth commit is B, the actual endpoint.
Taken care of. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, I think you did address the points from the previous round. I left some inline comments for nits, but it's fine to not block on those, this PR had many iterations already.
Please wait with merging till you also get a review from @mmeeks . Thanks.
97d94f4
to
c000a0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, CI is green, that's promising.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - this is a lot better, looks async - which is nice ;-) and I guess will really help if we can get the Nextcloud (and other integration) side working nicely - with some SDK documentation for the test end-point and so on :-)
There is a follow-on fix there that would be good to have.
Thanks Meven, Miklos & all.
And add Session parameter to ConnectFailCallback. Signed-off-by: Méven Car <meven.car@collabora.com> Change-Id: Ic541b379bad3beccaa867a95be298e6b807338eb
Signed-off-by: Méven Car <meven.car@collabora.com> Change-Id: I6c0005a6360bcb63a6712c395a3d7084c2bb26ce
Signed-off-by: Méven Car <meven.car@collabora.com> Change-Id: Ifa832978040ab1bfa156b0c639605a0e8a971324
c000a0f
to
16523a3
Compare
The endpoint is accessible at /hosting/wopiAccessCheck You send it a POST with input json: { "callbackUrl: "https://wopi-host/files/" } For instance: curl -ki https://localhost:9980/hosting/wopiAccessCheck --header "Content-Type: application/json" -d '{"callbackUrl":"https://cool.local"}' Returns json such as: { "details": "OK" } With status and details giving hints to what went wrong if it did. The callbackUrl needs just to be an HTTP(S) endpoint, it does not need to be the actual wopi service but can be only a healthcheck url for instance. Signed-off-by: Méven Car <meven.car@collabora.com> Change-Id: I0f08456d38738ea1195dda21f2bfd3636ae3fde7
16523a3
to
3c27c11
Compare
Documentation is my next step and informing Julius. |
Very nice to see this merged, thanks a lot. I started a first draft PR to integrate with richdocuments (nextcloud/richdocuments#4361). One thing I noticed would be that we have not reliable way to detect if the collabora server supports this check endpoint. Can we maybe expose it in /hosting/discovery similar to how it is done for capabilities: |
The endpoint is accessible at /hosting/wopiAccessCheck
You send it a POST with input json:
{
"callbackUrl: ""
}
For instance:
curl -ki https://localhost:9980/hosting/wopiAccessCheck --header "Content-Type: application/json" -d '{"callbackUrl":"https://cool.local"}'
Returns json such as:
{
"status": 0,
"details": "OK"
}
With status and details giving hints to what went wrong if it did.
The callbackUrl needs just to be an HTTPS endpoint, it does not need to be the wopi service but can be only a healthcheck url for instance.
Change-Id: Ibdef0bbf0d2fd98e3d293a06dfcfc79478d618e5
cc @juliushaertl
Superseeds #4353