Nextcloud opens html files in code

Hi all,

I have some dokument made in the TagSpace application which tagspace makes as .html.

when i view these files tagspace shows them with text and not all the HTML code. But when i click them in nextcloud web interface they are showen with HTML code.

I can’t figure out what app it uses to open the html files

is there a app or some other trick to make nextcloud open the html not as code but as if it was a homepage instead?

i would love to be able to edit these files in nextcloud as well, can this be done?

any suggestion would be gladly appriciated!!

Nope, that’s dangerous since you can execute abitrary code from these pages. You absolutely should not use Nextcloud as a web hosting platform because not only is it unsafe but also terribly slow.

i would love to be able to edit these files in nextcloud as well, can this be done?

There is an editor app GitHub - nextcloud/files_texteditor: đź“„ Text editor for plaintext files which is probably included in your download.

1 Like

my problem is when i brows to these files that are html nextcloud open them in code… I assume i need to tell nextcloud to use the editor you point to as standard for html files - but i don’t know how?

Hi Offerlam,

I have the exact same need: I want to use Tagspaces on my desktop and on my Android, but also be able to access it and edit it in a browser anywhere. For that, a wysiwyg is needed.

What have you been doing instead since then?

Ich habe das gleiche Problem, gibt es eine Möglichkeit html-Dateien in einem neuen Browserfenster zu öffnen

These are my html files, where is the danger? I find this a weak argument.

If Nextcloud unable or unfit to also serve as my a web hosting platform I will simply look for an alternative to Nextcloud.

This reminds me of Microsoft iShare - have e good day.

Dude, seriously: It´s not like the devs are wrong with what they develop. One could consider you beeing wrong with the assumtions you jump to. Serving HTML with it may be tempting, but it is clearly not built for that. You are likley to have an apache Webserver benaeth NC. If you want to serve html, why not use that instead of cracking nuts with a sledge hammer? See how .htaccess files are excluded from Syncing? Same reason: Security.

The Duderinos here have to make design choices which work for all NC Users, not just for you. Can you imagine that there are instances out there, which have a ton of users who are able and ready to upload any malformed document? And such documents should never be able to harm the underlying system. That’s a design philosophy mandatory for everybody in designing such webapps, and its not stupid, just because you never have thought of this.

2 Likes

I found that Pico CMS fits my bill.

1 Like

I was rude and now can only offer my apology

3 Likes

You’re welcome :slight_smile:

There’s a solution for using Nextcloud as a UI to manage your webhosting. It’s not exactly what you might expect, but it is an interesting option, I think.

  1. Get a webhosting that can serve HTML files and has a sftp account available. Or run your own simple webserver.
  2. Connect your hosting’s sftp account as an external storage in Nextcloud.
  3. Upload files to your external storage by using Nextcloud web UI or desktop clients. Edit them, rename them, whatever you do with your files.
  4. View your html pages served by your dedicated webhosting that you created in step 1.

HTML scripts can be filtered easily.
In addition, external references can be also disabled / deleted.

These steps can be done on the server (and probably cached) for the purpose of viewing-only.

Another preprocessing option: convert HTML to Markdown.

Is this route - considered?

1 Like

Hello! Pls, I really need a good advice!
The idea is that user should be able to edit HTML-files with Libreoffice and Nc (Readme.md app or another).

In admin setting HTML content rendering is on.

But here’s how opened file looks like.

Maybe it’s Yunohost intervence. I have no idea on how its script tag even got there. On upload? Should they modify my files?