-
Notifications
You must be signed in to change notification settings - Fork 726
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
Check endpoint to validate WOPI configuration from integrators #4353
Conversation
Signed-off-by: Julius Härtl <jus@bitgrid.net> Change-Id: I760ca8d99a6e9bce4371354139b46468f317545f
Let me check this early next week again before reviewing , since i think i already have a rebased and slightly revisited implementation next on my other machine. |
@juliushaertl @Ashod any chance of re-basing this and getting it in - it's a common failure mode I'd love to patch. |
@meven this is rather an important thing to have included to help people get setup - can you chase it ? |
Wopi Hosts can already do some validation on their own, check COOL is accessible to them and that the browser can access COOL. A simple design could be: Having an endpoint in COOL, like
COOL would then try to make a HTTPS request to the wopiHostUrl.
And then the response would be like:
This would be exposed in
Discussed with @juliushaertl |
Sounds perfect - lets hack it up =) |
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.
Code is much better, we still have a synchrous request there - that needs fixing =)
LOG_DBG("Checking remote host: " << addressToCheck); | ||
try | ||
{ | ||
if (!StorageBase::allowedWopiHost(addressToCheck) && !net::isLocalhost(addressToCheck)) |
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.
We should not assume that localhost or 127.0.0.x are route-able and reachable locally - this is often not the case in containers - and the main problem we have with setups.
http::Request wopiRequest(remoteServerURI.getPathAndQuery()); | ||
|
||
const std::shared_ptr<const http::Response> httpResponse = | ||
httpSession->syncRequest(wopiRequest); |
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.
Sync is synchronous - this will block the server and the main thread until that request completes. We have to do async requests.
Summary
The idea of this is that integrators like Nextcloud can easily verify potential setup issues like Collabora not being able to connect back to the storage during configuration, so that we can give the admin more helpful hints on why the setup is not working properly
TODO
This is an early draft PR so there might be additional things
Checklist
make check
make run
and manually verified that everything looks okay