Skip to content

User-modifiable templates need work #269

Closed

Description

@s3x-jay

This issue is part bug report and part enhancement request.

IMHO, the goal should be that there are user-modifiable templates for:

  • The home page (index.html)
  • Possibly a new template named get-invoice.html (explained below)
  • The result of posting the invoice form (currently invoices.html, but would be clearer if named post-invoice.html)
  • Terms of service (terms.html)
  • Privacy policy (no current template - "privacy.html" would fit with the naming scheme)

The problem is currently when someone goes to the home page of the site there's a 301 (permanent) redirect to /invoices - even though that URL serves index.html, not invoices.html

To me the 301 is a bug and in the interim that redirect should be changed to a 302 (line 70 in rootRequestHandler.ts) otherwise when things are finally fixed/improved there will be a period when some people can't get to the home page of the relay since their browser remembers the 301 and takes them to /invoices.

The other issue with the home page is that you only get a home page if some form of payments is turned on. Otherwise there's just a text message saying "Please use a Nostr client to connect." Those webmasters need a home page and legal documents as well.

But while that's under consideration there's another use case that hasn't really been supported so far - the case of a private relay with no payments and everyone is added via whitelisting. Those webmasters would want to use a no payments home page. I suppose they could strip the payment section out of index.html, but how how do they configure settings.yaml?

I see two possible approaches to the issues above:

  1. Continue to have the "get invoice" on the home page of the relay (but either omitted when payments aren't active - or using separate templates for with and without payments)
  2. Have a dedicated template for the home page and "get invoice" on a separate, page/template (webmasters who don't take payments would simply omit the link to the "get invoice" page).

Next, terms.html doesn't seem to be used at all. I'm guessing that's because when issue #160 came to light terms.html was probably merged with index.html (all the terms seem to have been replicated into index.html at some point). IMHO, terms should be one of those longish legal documents - a CYA document for the website owner. Personally my plan is to have a fairly short, readable run-down of what the rules are on the home page, and then link to the legalese.

Similarly, many jurisdictions require a privacy policy page in addition to a terms of service page, so that would be a good add.

invoices.html is fine as far as I can tell. The only issue with it is the confusion with the /invoices url which doesn't serve invoices.html. invoices.html is really post-invoice while /invoices is get-invoice. Perhaps rename it "post-invoice.html" and then have the get invoice functionality on a "get-invoice.html" template (which would be in line with option 2 above).

If you do nothing else with this, please change the 301 redirect to a 302 redirect. It should be quick and simple and it will eliminate headaches down the road.

Activity

  1. CKodidela commented on Apr 8, 2026

    @CKodidela
    Contributor

    Hey @cameri
    I’d like to work on this issue could you assign it to me?

    Here’s what I’m thinking:

    1. First I’ll change the root redirect from 301 to 302 as a quick safe fix
    2. Then separate the pages properly (home, get-invoice, post-invoice)
    3. Keep terms as its own page and add a privacy page
    4. Make sure relays without payments (like whitelist ones) still get a proper homepage instead of just text
    5. Add/update tests and docs for the new routing and templates
  2. cameri commented on Apr 8, 2026

    @cameri
    Owner

    @CKodidela sounds like a solid plan.

  3. cameri commented on Apr 18, 2026

    @cameri
    Owner

    @CKodidela thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions