silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.04k stars 141 forks source link

Support for base_url? #794

Open gardiol opened 4 months ago

gardiol commented 4 months ago

Is it possible to deploy SilverBullet not on root path but using a base_url?

For example not on "mydomain.com" but on "mydomain.com/silverbullet/"?

zefhemel commented 4 months ago

No it’s not right now. The hardcoded assumption in a lot of places is that it lives at the root. This is possible to change, but would be an effort.

gardiol commented 4 months ago

Keep that in mind for the future, it's a feature quite important, specially if, like me, will need to host more than one instance on the same server... the sooner you take it into consideration, the easier will be.

zefhemel commented 4 months ago

Until then you can do this by hosting on different ports and/or subdomains. This is what other people do.

gardiol commented 4 months ago

Currently hosting on a subdomain, but consider that i use reverse proxy to add SSL and authentication, so using different ports is not an option. Using different subdomains is what i currently do, but i cannot spin 4 or 6 subdomains just to host 4 or 6 independent instances, so having base_urls in the future would be a good idea.

(also, another issue with multiple sub-domains is that an user would need to authenticate to all of them, instead of authenticating only once then access all instances under the same subdomain)

Let me say that sub-paths allows to cater for all use cases, while being bound to subdomain can be a limiting factor in adoption. Using different ports doesn't solve the issue because i will then still need to forward each one on the reverse proxy single port 443.

zefhemel commented 4 months ago

Although it may look odd, I think you can use the same SSL certificate for different ports as long as you specify them in the url, like https://sub.domain.com:4444 for instance.

montarion commented 3 months ago

@gardiol I admittedly am not very well versed in reverse proxy's, but why can't you use multiple subdomains? I've had 10 subdomains running at a time, all through nginx, with letsencrypt certs.

Authentication using Authelia also just works™ with all the subdomains after signing in once.

gardiol commented 3 months ago

I know that i can, and in fact i do because i have to. But i host over 30 services overall and would be a massive pain to have 30 subdomains for something that is not needed.

There are lots of pro's and con's on using subdomains over sub_paths and also the other way around is true. One size doesn't fit all and choice should always be available for a quality product. This does not mean that subpath support is a must, but indeed it's useful to many people.

My biggest drawback is that, since i use proxy authentication (linked to PAM to match server users) i am forced to login again once for each subdomain, while all services under the same subdomain only requires one authentication, which is a much simpler use case for me.

honnip commented 2 months ago

Related ticket #163