headscale icon indicating copy to clipboard operation
headscale copied to clipboard

add flags for headscale serve to provide initial api key

Open GrigoriyMikhalkin opened this issue 2 years ago • 3 comments

Just played around to check one of the possible solutions to https://github.com/juanfont/headscale/issues/662.

Here i introduced 3 new flags for headscale serve command: api-key-prefix, api-key-pass and api-key-expiration. Together they allow to save pre-generated API key into DB to use it later for authentication.

GrigoriyMikhalkin avatar Jun 26 '22 18:06 GrigoriyMikhalkin

Another, probably better, idea is to introduce new command: headscale apikeys save --prefix<> --password<> --expiration<>. That would be more flexible.

GrigoriyMikhalkin avatar Jun 27 '22 09:06 GrigoriyMikhalkin

Another, probably better, idea is to introduce new command: headscale apikeys save --prefix<> --password<> --expiration<>. That would be more flexible.

I agree. I think the place to create predefined api keys is in the apikeys subcommand. serve is... well... to serve the server.

juanfont avatar Jul 29 '22 08:07 juanfont

I dont think we should implement this, comment in the issue.

kradalby avatar Jul 31 '22 12:07 kradalby

Going to close this one, as we need to rethink a bit how to do it.

juanfont avatar Aug 09 '22 13:08 juanfont