-
Notifications
You must be signed in to change notification settings - Fork 60
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
Redirect anonymous bare url to /share page #658
Comments
As written above, this would be a major change in out of the box Trilium behaviour, so not to be approached lightly. With my recent learning success in adding a whitelist of html tags to the Options page I think I see a path to how to make this an optional setting too. We'll see how well that goes! I don't know if this is a good approach architecturally speaking, and welcome comments from experienced minds. |
Redirect works. Must share at least one note and make it `#shareRoot` Todo: - explore making this an optional setting in UI - make the share and login urls customizable - think about if/where/how to put login link in default share theme
Would this change require a user to have a root Share note already set up?: {
"message": "Share root note not found"
} I understand the reason why, but IMO since this is firstly a note-taking platform (and not a microblog), I'm not sure if this is the best idea. I understand that your suggestion is what platforms like Wordpress do where the root URL redirects to the website, and You could do exactly what you're suggesting with access to the webserver and changing its configuration, but since you're on Pikapods I don't believe you have access to that. |
Yes shareRoot needs to be defined, thanks for the reminder! I've added that note to the helper text in the PR |
First off, I think this is a neat idea, and I can see it's use case, however if it were to be implemented, it would certainly need to be a non-default option. I would also suspect that there could be some unexpected side effects of a change like this (Elian would have a better understanding on that). |
Thanks for the feedback @meichthys. Yes it's off by default. |
Discussed in https://github.com/orgs/TriliumNext/discussions/596
Originally posted by maphew November 15, 2024
How to setup Trilium to redirect bare url to the share page, unless the user is logged in? So an anonymous browser arriving at
www.example.net
is redirected towww.example.net/share
instead of being greeted with the login page.Or perhaps better, make the share url
www.example.net/
and the "I'm editing" urlwww.example.net/edit
?preferably using a docker config (so it can be used on PikaPods)
At the technical level, it's actually easy to redirect bare domain to share:
#shareRoot
../src/services/auth.ts
change line 20 fromres.redirect("login")
tores.redirect("share")
.To login, edit url in address bar and replace path with '/login', ex:
https://my.trilium.net/login
...
This won't work for PikaPods since they only use the lates release stable release from Docker Hub, and making this change in stable needs more thought, work, and documentation.
The text was updated successfully, but these errors were encountered: