flatnotes icon indicating copy to clipboard operation
flatnotes copied to clipboard

Allow root URL path to be configured via environment variable

Open dullage opened this issue 2 years ago • 5 comments

Suggested in this Reddit post.

dullage avatar Feb 26 '23 06:02 dullage

Hey, thanks for that - would love to see it implemented.

My use case would be to use reverse proxy (e.g. via nginx) in order to have clean url in my local self-hosted home server

Tomasz64 avatar Feb 26 '23 08:02 Tomasz64

I'm sure you've already considered this but my workaround suggestion would be to use a different sub-domain e.g. flatnotes.example.com. This is what I do.

dullage avatar Mar 02 '23 18:03 dullage

I'm sure you've already considered this but my workaround suggestion would be to use a different sub-domain e.g. flatnotes.example.com. This is what I do.

Right, this is a way, but currently I'm using notatnion like: "myserver.local/jenkins, myserver.local/portainer" etc.

Thanks!

Tomasz64 avatar Mar 03 '23 21:03 Tomasz64

I went insane trying to make this work since my setup also has each service running on a subpath reverse proxy.

This seems to be a FastAPI-related problem however even setting up the root-path variable correctly doesn't seem to be enough, I tried many ways to setup both fastapi's root path and my nginx configuation as suggested here and here but to no avail.

I hope someone can get this working one day 🙏

pbogre avatar Jul 02 '23 16:07 pbogre

Related PR Comment

dullage avatar Feb 06 '24 19:02 dullage

I'm pleased to say that I now have a working build that supports a custom path prefix 🎉. I would appreciate some beta testers if anyone would like to give it a go. You just need to use the docker tag dullage/flatnotes:custom-path-prefix and set the FLATNOTES_PATH_PREFIX environment variable to something like /flatnotes.

⚠️Note: New image attachments will embed a URL that works even if the path prefix is changed. Unfortunately, existing attachment URLs will need to be manually updated (but only for existing users that want to use a path prefix). You'll need to change, for example, /attachments/foo.png to attachments/foo.png.

See this comment on a duplicate suggestion for more detail.

dullage avatar Jun 14 '24 11:06 dullage

Now available in 5.1.0.

dullage avatar Jun 20 '24 12:06 dullage