Page 1 of 1

Host editable .ods on a website

PostPosted: Fri Jan 17, 2020 12:39 pm
by a-t-0
Scenario:
Hi, I've built a password protected .ods file(https://github.com/a-t-0/CoursePlanningTemplate/blob/master/CoursePlanningTemplate/PlanningData-Form-Temp.ods). And I'd like to host it on a website(https://github.com/a-t-0/living-lab-app-repo) so that people can edit it, in the browser, much like an embedded googlesheets.

The options I found were:
0. Convert to google sheet and publish and embed.
1. Use Microsoft Excel Sharepoint to get a link, and embed that link.

However, the following 3 factors push me to pursue a self-hosted, opensource alternative:
0. I think the google sheet and Microsoft Sharepoint both require accounts, and I would prefer not to built a dependency on external services in my system.
1. I would like to host my own data, rather than put in in the computer of someone else/cloud.
2. I think the two listed systems are not opensource, and I am trying to make all my (software) systems opensource.

Question:
Hence my question: (how) could I host an `.ods` in a node-express website (as shown in git link above), such that users are able to "fill it in" in their browser, without requiring them to download and upload the file?

Strategy:
It appears libreoffice-online is developed for this purpose https://www.libreoffice.org/download/libreoffice-online/. I am looking into whether- and how it is applicable to complete the requested intention. From: https://nextcloud.com/collaboraonline/ it appears if I host collabora in docker, and combine it with nextcloud, I could integrate/host the .ods calc file on my website with for example:

Code: Select all   Expand viewCollapse view
<iframe src="https://cloud.nextcloud.com/s/9p2vrEvYDVF..<an equivalent of the link published in the video at 0:45>">
</iframe>

Or, with offidocs, using for example:
Code: Select all   Expand viewCollapse view
<iframe width="500" height="200" frameborder="0" scrolling="no" src="https://www.offidocs.com/loleaflet/dist/loleaflet.html?service=owncloudservice01&file_path=file:///var/www/html/weboffice/mydata/jonhie/NewDocuments/test-example.xls&username=jonhie&ext=yes">
      </iframe>


Implementation:
0. First installed docker for windows
1. Then installed wsl ubuntu 18.04 (this step was not necessary)
2. Verified by typing
Code: Select all   Expand viewCollapse view
docker info

3. Then on the icon in the windows taskbar>rmb>switch to Linux containers
4. To execute step 3succesfully
4.1 I followed https://stackoverflow.com/questions/431 ... r#45816385 downloaded rammap,
4.2 clicked "empty working sets"
4.3 In docker clicked "reset factory settings"
4.4 Rebooted pc
4.5 Closed as much programs as possible at login of windows
4.6 Retried switching to Linux containers, that time it worked.
6. Then I tried:
6.1. https://hub.docker.com/r/libreoffice/online/ (manifest unknown)
Code: Select all   Expand viewCollapse view
docker pull libreoffice/online

But according to https://stackoverflow.com/questions/54125807/libreoffice-online-on-debian-with-docker
Code: Select all   Expand viewCollapse view
docker pull libreoffice/online:master

That worked
6.2. https://hub.docker.com/r/collabora/code (worked)
Code: Select all   Expand viewCollapse view
docker pull collabora/code

6.3. https://hub.docker.com/r/cibsoftware/libreoffice-online (couldnt find manifest file)
Code: Select all   Expand viewCollapse view
docker pull cibsoftware/libreoffice-online
docker pull cibsoftware/libreoffice-online:master

Then I started the nextcloud docker with command:
Code: Select all   Expand viewCollapse view
docker run -d -p 8080:80 nextcloud
docker run -t -d -p 9980:9980 -e "extra_params=--o:ssl.enable=false" collabora/code

Next I went into next cloud, by visiting not localhost but:
Code: Select all   Expand viewCollapse view
http://<my local ip-adress>:9980

Logging in, creating a pw and username.
Next, searched for app: collabora, clicked install and enable. After that was completed, I visited:
Code: Select all   Expand viewCollapse view
http://<my local ip-adress>:8080/settings/admin/richdocuments

That worked the first time, but it didnt work the 2nd time I did this, so I went to:
Code: Select all   Expand viewCollapse view
localhost:8080/settings/admin/richdocuments

and entered for: "URL (and Port) of Collabora Online-server":
Code: Select all   Expand viewCollapse view
http://<my local ip adres>:9980

next I was able to edit about.ods file using my my own hosting of nextcloud and collabora.

However, when I try to embed it using an iframe, I get error message: "too many redirects." and I have not yet been able to solve that.

Re: Host editable .ods on a website

PostPosted: Tue Jul 07, 2020 7:19 pm
by lancerkind
I don't have an answer for you. But I love what you're trying to do!

You probably have a configuration issue:
* Too many redirects happens when something is redirecting to an address, but upon loading *that address* it's redirected again (or even back to the first address). So I suggest go back and look at those IP addresses carefully to ensure you haven't created an infinite loop of redirects.
* put something else in the iframe and see if that works. If nothing works, then perhaps your website configuration is causing it to happen.
* Try in a different browser and see if you learn something different.