Hacker News new | ask | show | jobs
by traverseda 1901 days ago
The smaller scale homelab/selfhosting people really need a better solution. I think open source developers do as well.

What we really need is a small easy to set up solution that provides a clear way for us to integrate our app into it.

My ideal would be something that

* Supports ldap and OIDC

* Can be deployed to docker using one compose file

* Only needs to support hundreds of users (keep it simple, easy to deploy, and able to run on a raspberry pi)

* Provides basic user management, I want to be able to put users into groups and (if the app supports it) use those groups for in-app ACL.

If that service worked well in my homelab (a single-pc docker swarm that runs a few private web services like jellyfin) I'd very likely end up deploying it on my employers infrastructure. My employer is a small business with maybe ~30 users.

I'm not sure how to convert something like that into sales though. Still, starting with an open-source solution that solves problems for the little guys often has a "trickle up" effect.

Right now I'm looking towards https://github.com/sonicnkt/glauth-ui/ to solve that problem, but it's definitely not anywhere near there yet.

2 comments

Uhm, keycloak does all the things you name and more.

I have it in production at work. Three instances, clustered (infinispan), running in docker containers orchestrated by kubernetes.

Each instance (pod) is upper-limited to 2gb ram (or 3, can't recall the details now).

It works very well and very reliably, serving about 750 users (as in, real people).

If you have 2GB to spare and a physical core, you can run keycloak with no problems at all.

After all, it all depends on the amount of traffic. Little traffic = little cpu load.

Don't dismiss keycloak because it's written in Java... Quite the contrary, you can tune the JVM to work with little memory (-Xms -Xmx iirc).

Ten years ago it was very common to see tips and tricks to make grails web apps work on as little as 64mb of ram on chap VPSes.

Can you provide an example docker compose to deploy keycloak+ldap in docker (not kubernetes)?
Okaaay, now I have a keycloak server and an ldap server running. I guess my next step is to shell in to the ldap host, wget https://github.com/ivangfr/springboot-keycloak-openldap/blob..., edit it to my needs, look up how to generate openldap password hashes, go back in to keycloak, and try to configure that to talk to my ldap server.

So now I need to look up the default values for

Vendor, Username LDAP attribute, RDN LDAP attribute, UUID LDAP attribute, User Object Classes, Connection URL, Users DN, Custom User LDAP Filter, Search Scope, Bind Type, Bind DN, Bind Credential

If I knew what vendor openldap was considered setting the Vendor would fill a bunch of of those in. Well let's try following through this this random blog post and hope it works: https://geek-cookbook.funkypenguin.co.nz/recipes/keycloak/au...

Compare that to the experience of deploying say, wordpress. And hey look, it already comes with an authentication backed!

Sure, you can build something that does more or less the same thing but you have to do a fair bit of work to get to that point. Realistically if you haven't done it before, and if you don't have any ldap experience, you're looking at a solid couple of hours to get that set up.

And it's still apparently going to use 100s of MB of ram.

Where as wordpress goes up in a few minutes, handles user account but uses less ram, I don't really need to do any extra work, and I'm confident it's going to work.

I'm not looking to build a skill, I'm looking to just have an auth server I can use and that I can link my own apps against easily.

As an aside I had seen that one before and it is workable, it's just a lot of work to get from there to an actual working deployment I can use on my home server.

Keycloak does have integrated authentication and user storage if you don‘t really need LDAP and want that Wordpress experience. I agree that setting LDAP up is a little involved.

Regarding RAM, Wildfly uses 650MB. Keycloak.X is a new, more lightweight approach using Quarkus.

I think Keycloak ticks all those boxed rather nicely. While it does support more than a few hundred users, I doubt that this will be a serious issue.

Perhaps you could enlighten us with a few key differentiators of your ideal solution to other common ones?

Wait, does keycloak have an integrated LDAP server?
No. You can use any LDAP server as a backing store for your users.