Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-modifiable templates need work #269

Open
s3x-jay opened this issue Mar 25, 2023 · 0 comments
Open

User-modifiable templates need work #269

s3x-jay opened this issue Mar 25, 2023 · 0 comments

Comments

@s3x-jay
Copy link

s3x-jay commented Mar 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant