Serving html files from Nextcloud Files?

Hi,

I’m wondering, if it’s possible to serve html-files I have stored in my Nextcloud Files, just like I would with a normal web server? Or would it be totally crazy to configure a folder in my Nextcloud Files as www-root for an Apache running on the same machine? (Protected with htaccess or something?)

My Use Case is, that I’m managing all my personal Notes using Markdown Files on my Nextcloud. But I like using docsifyjs to render them nicely as html for reading (with search, menu etc.). To do this, I just have to put an index.html with some javascript in the same folder as my Markdown files and consume it over a Webserver.

To do this, currently I have to keep my notes in Sync on my Apache and on my Nextcloud Folder, which doesn’t work quite well. If I could serve the html right from the Nextcloud Folder somehow, this would solve my problem, I quess.

Thanks!

3 Likes

Viewing .html inside a PHP/JS system is just a huge security no-go. You are in session at that moment and can do anything via HTML5/Javascript you like to do … Somebody shares a preperated file with you, you view it and anything could be done with your data. Therefor this is blocked. Only way would be to send it to a different server, render the .html there and send the screen back … somewhat complex but a possible setup.

2 Likes