CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.78k stars 680 forks source link

Introduce WOPI endpoints for local file access #110

Closed kendy closed 2 years ago

kendy commented 3 years ago

This is an Easy Hack. Potential mentors: @kendy

When the Collabora Online is built with --enable-debug, it is possible to open local files for easy testing. The problem with the current implementation is that it is a separate code path from what is later used in the real world - which always integrates through WOPI.

This task has two parts:

1) Introduce serving the local files via WOPI endpoints directly from loolwsd. 2) Kill the implementation of the local file storage, and do appropriate changes in the loolwsd.xml setting.

Ad 1) - this can be done in wsd/FileServer.cpp, see the FileServerRequestHandler::handleRequest - which would implement the GET and POST methods appropriately. For an inspiration what endpoints have to be implemented, have a look at test/WopiTestServer.hpp, method handleHttpRequest() that does the same thing for unit tests.

Ad 2) - git grep LocalStorage and kill all the uses. Then update the message that outputs the URL to be issued locally with the right one (git grep LOOLWSD_TEST_DOCUMENT_RELATIVE_PATH) and also check the setting in loolwsd.xml.in (the filesystem option).

pedropintosilva commented 2 years ago

fixed by #3226