servus icon indicating copy to clipboard operation
servus copied to clipboard

Cannot parse event from content

Open sch1z00 opened this issue 10 months ago • 13 comments

when I start servus it finds sites, themes and templates, it starts server, but it Cannot parse event from content (pages and posts, those who previously worked)

servus::site Cannot parse event from /.../_content/posts/test.md.
servus::site Cannot parse event from /.../_content/pages/posts.md.
servus::site Cannot parse event from /.../_content/pages/index.md.

metadata on those pages:

---
title: 'title'
author: 'author'
---

or

---
title: 'title'
date: 'YYYY-m-d'
---

sch1z00 avatar Mar 06 '25 12:03 sch1z00

Right, so I recently made this breaking change... I though nobody will notice since nobody is using this, but seems I am wrong. :)

Basically I used to allow pages/posts to be anything as long as they had a title/date.

But now they need to have all the fields to be valid Nostr events, including a signature.

So the way to post now is by using a Nostr client, such as Yakihonne, unsigned content will not work anymore.

I am thinking I might just make a command line tool to sign pages such as the ones you show above, in case somebody wants to post by editing the text files. But I also think that will not happen, there are better tools at posting this way (like Zola), I don't see why somebody would use Servus to do what can be better done with Zola.

What is your use case? Do you actually want to post by editing the files? Or are you just wondering why it worked and now it doesn't?

ibz avatar Mar 07 '25 20:03 ibz

Nooo! I was able to generate valid pages using emacs and org-mode before and it was great! An editor and some simple text to generate pages for a site that was distributed p2p, seemed to me the exceptionality of servus. If you can only use a nostr client I don't find it very useful

sch1z00 avatar Mar 07 '25 22:03 sch1z00

How about I make it such that you can still post like before, but in that case the posts / pages will be automatically signed (using some key in your config, perhaps).

The problem is... you need a key if you want other Nostr clients to be able to read your content.

What I had before was a bit misleading actually, you could generate posts from org-mode indeed, and they would show up on your website, but they would not be served to other Nostr clients requesting them, because the content was unsigned.

Basically there were 2 kinds of content - Nostr content (signed) and regular content that was only visible on the web. I simplified by dropping unsigned content. You maybe even didn't notice that, and that was a problem, you were thinking your content is available to Nostr clients, but it was not, since it was unsigned.

ibz avatar Mar 13 '25 08:03 ibz

I have my pubkey in config.toml but unfortunetly servus still cannot parse pages and now I also get this error:

tide::log::middleware Client error --> Response sent
    message Failed to render 'index.html'

Caused by:
    Variable `config.extra.hyde_theme` not found in context while rendering 'index.html'

(hyde theme is in config.toml)

sch1z00 avatar Mar 14 '25 15:03 sch1z00

same error creating a new site from scratch (through servus)

sch1z00 avatar Mar 17 '25 10:03 sch1z00

If you can only use a nostr client I don't find it very useful

@sch1z00 Another idea - how if I make a simple command line Nostr event signer, so you pipe the content from org-mode into the signer, which outputs signed content, which you then save to a file? Would that cover your use case?

I am trying to avoid supporting both signed and unsigned content in the server itself.

ibz avatar Mar 18 '25 17:03 ibz

Would that cover your use case?

that's what i'm doing with a simple elisp script that uses nak to sign and publish anything :)

sch1z00 avatar Mar 18 '25 18:03 sch1z00

OK, so I think I came up with a nice way to do it. Have a look at unsigned content.

ibz avatar Mar 23 '25 21:03 ibz

Having an issue with the release build though... If you build from source, it should be fine.

ibz avatar Mar 23 '25 22:03 ibz

... If you build from source...

I always build from source but it still doesn't parse my old pages

sch1z00 avatar Mar 31 '25 12:03 sch1z00

but it still doesn't parse my old pages

Same error? Did you pass --sign-content?

ibz avatar Mar 31 '25 22:03 ibz

Same error?

Yes

Did you pass --sign-content?

Yes

sch1z00 avatar Apr 03 '25 16:04 sch1z00

Then it should just work. Did you try whether it works, using the browser? See the terminal output after the error message, it should say something like Generated new event... it generates an event on-the-fly from the (incomplete, unsigned) data and uses that to serve a resource over HTTP and Nostr protocol.

ibz avatar Apr 06 '25 13:04 ibz