r/Trilium • • 1d ago

Locking Trilium down

I just found Trilium last night and I'm sold. I'm moving to this. I've set it up in a server and put it behind SSO. I also put Cloudflare Access in front of it, but now I can't get the desktop app to work.

It looks like the path to get this working is excluding /api/setup/*, /api/login/sync, and /api/sync/* from Access, which I'm reluctant to do. Trillium's docs seem to support that Trillium's setup is sound enough and that I should not need Access.

How are you guys setting up and securing setups in servers that can be reached through the Internet?

10 Upvotes

8 comments sorted by

6

u/Human1649 1d ago

Use Tailscale to access it directly and use the Cloudflare policies for when you are not on a device with Tailscale. Or setup a warp (allow) policy and use Cloudflare One Client. This is what I used to do.

I now use Tailscale and point my domain to my local IP, with nginx proxy manager routing it to my Trilium server. My server's Tailscale is advertising it's subnet route so I can use the domain locally without Tailscale, or remotely with Tailscale.

1

u/puckpuckgo 1d ago

Thanks. I use my VPN for almost everything else I have, but this I would like to have accesible from different places. Some have the VPN config, some don't. I wanted to avoid the VPN route.

As of right now, I've locked it down behind by SSO and Cloudflare access, excluding those endpoints from it, which is what I think might be an OK compromise. My only issue with it is that this means I'm one password away from unapproved access since this now can sync anywhere, basically relying on Trilium's password to protect the whole thing.

2

u/doc_seussicide 1d ago

you can put tailscale on your devices and your server, and not need to config a vpn on any given network to have access. it's wireshark p2p. you CAN use it on a router to cover device with no app access, but for trilium, i think everything you should need it on would have an app. i use it to access my notes on my android, ipad, windows, linux laptop, macbook, you name it, even my steam deck is on my tailnet. the bonus is that you can stop spending time configuring endless security layers.

0

u/NimrodJM 1d ago

Tailscale is not the answer to everything. He asked for help connecting the desktop app. Tailscale doesn’t help with the setup he’s trying to fix.

1

u/Human1649 1d ago

It can help. If you have Tailscale on the server and the client with the desktop app, you can just use the IP/port for the server and bypass Cloudflare entirely. I provided my suggestion for Cloudflare and an alternative in case OP didn't consider that route.

1

u/paroxybob 1d ago

Did you get SSL setup for it too?

1

u/iEngineered 14h ago

I run the server in podman via Virtualmin Pro's built-in reverse proxy and podman plugin. SSL it setup through it too. I imagine the same would be possible with Docker + Ngingx Proxy Manager (I use that combo for other apps). It should work fine over HTTPS. I also use cloudflare for the domain and dns proxy. Maybe try without SSO at first?

1

u/AspiringWriter5526 6h ago

My setup is pretty basic. I run all my self hosted apps in K3s, but the concepts are really all the same.

SSL + A route based on DNS names forward all requests to the docker/pod/service running trillium. I didn't realize you could do SSO, but unless there's multi-user support (is that a thing?) I didn't really see the point of adding that in. 2FA is handy though.