Hacker News new | ask | show | jobs
by gnur 2096 days ago
Over the last year I got frustrated with the complexity projects like traefik and caddy have gained recently. While I do love Caddy still, it seems like it wants to do too much, which I understand because they have a commercial offering, but I wanted something simpler.

So I set out to build a truly simple proxy that can do the following:

* automatic certificates with letsencrypt (using the library created by the awesome caddy team)

* authenticate users (currently only sign in with google is supported, but the underlying library should make it trivial to extend this)

* authorize users based on simple glob matching

* allow creating (and modifying) routes by CLI and API

Building this I truly started to appreciate the meaning of standing on the shoulders of giants, the Go libraries I've used are extensive and made this application a lot easier to create.

While tobab is by no means finished, if you are looking for a easy to use reverse proxy that will handle certificates and auth for you, this could be the tool you are looking for.

2 comments

Thanks for sharing.

Very nice:

- Secure by default (automatic https with letsencrypt, secure cookies)

- Sane defaults (No public access unless explicitly added)

Curious (not nit picking). What's the high level possibility of allowing keycloak (or another self hosted auth provider)?

Looks like you are leveraging goth... fairly simple for someone to extend down the road via a contribution, correct? https://github.com/gnur/tobab/blob/2d1fa1227d1f56ee332d3d83b...

Ref - https://github.com/markbates/goth/issues/319

If keycloak provides an openID connect endpoint it should be fairly trivial to extend tobab to use it.

Goth might actually have specific support for keycloak, but I'm not sure about that to be honest.

I'd only ever used Caddy for a hobby project a few years ago. Just recently I needed something quickly for a reverse proxy. I looked at traefik because I'd heard a lot about it and quickly came to the same conclusion as you - too rich. I thought I'd have a look at the docs for the new-ish Caddy v2.

After a bit of reading, I was shocked that I had set up a reverse proxy with just a single 2 line "caddyfile":

  subdomain.mydomain.ltd

  reverse_proxy 127.0.0.1:5000
For my humble use case it couldn't be any simpler.
I can make it simpler:

    $ caddy reverse-proxy --from subdomain.mydomain.tld --to 127.0.0.1:5000
Is equivalent, no config file needed :)