From 08c724219e7dacb9f4224d9f9b88359e5c51d8b9 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Thu, 26 Feb 2026 10:30:50 -0800 Subject: [PATCH 1/2] generate random password for use --- cmd/authdaemon/authdaemon.go | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/cmd/authdaemon/authdaemon.go b/cmd/authdaemon/authdaemon.go index 803a719..cd96465 100644 --- a/cmd/authdaemon/authdaemon.go +++ b/cmd/authdaemon/authdaemon.go @@ -28,10 +28,11 @@ var ( func AuthDaemonCmd() *cobra.Command { opts := struct { - PreSharedKey string - Port int - PrincipalsFile string - CACertPath string + PreSharedKey string + Port int + PrincipalsFile string + CACertPath string + GenerateRandomPassword bool }{} cmd := &cobra.Command{ @@ -57,6 +58,7 @@ func AuthDaemonCmd() *cobra.Command { cmd.Flags().IntVar(&opts.Port, "port", defaultPort, "TCP listen port for the HTTPS server") cmd.Flags().StringVar(&opts.PrincipalsFile, "principals-file", defaultPrincipalsPath, "Path to the principals file") cmd.Flags().StringVar(&opts.CACertPath, "ca-cert-path", defaultCACertPath, "Path to the CA certificate file") + cmd.Flags().BoolVar(&opts.GenerateRandomPassword, "generate-random-password", false, "Generate a random password for authenticated users") cmd.AddCommand(PrincipalsCmd()) @@ -112,17 +114,19 @@ func runPrincipals(principalsPath, username string) { } func runAuthDaemon(opts struct { - PreSharedKey string - Port int - PrincipalsFile string - CACertPath string + PreSharedKey string + Port int + PrincipalsFile string + CACertPath string + GenerateRandomPassword bool }) { cfg := authdaemonpkg.Config{ - Port: opts.Port, - PresharedKey: opts.PreSharedKey, - PrincipalsFilePath: opts.PrincipalsFile, - CACertPath: opts.CACertPath, - Force: true, + Port: opts.Port, + PresharedKey: opts.PreSharedKey, + PrincipalsFilePath: opts.PrincipalsFile, + CACertPath: opts.CACertPath, + Force: true, + GenerateRandomPassword: opts.GenerateRandomPassword, } srv, err := authdaemonpkg.NewServer(cfg) From f5f8a23e62949670aa0ab99f8cedfee01577e190 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 26 Feb 2026 20:56:26 -0800 Subject: [PATCH 2/2] Bump newt --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4b38f90..7724558 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/charmbracelet/huh v0.8.0 github.com/charmbracelet/lipgloss v1.1.0 github.com/creack/pty v1.1.24 - github.com/fosrl/newt v1.10.0 + github.com/fosrl/newt v1.10.1 github.com/fosrl/olm v1.4.3 github.com/mattn/go-isatty v0.0.20 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c diff --git a/go.sum b/go.sum index 6f4f670..4dc5be1 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= -github.com/fosrl/newt v1.10.0 h1:k4bJGcUvGcyoO8QNBi5/RGbLpLC1ZUdau3Hecic+71A= -github.com/fosrl/newt v1.10.0/go.mod h1:d1+yYMnKqg4oLqAM9zdbjthjj2FQEVouiACjqU468ck= +github.com/fosrl/newt v1.10.1 h1:3RZqYhJDDBWZHViVeDl4hWwWVJFtvFJB+wL+AF99neA= +github.com/fosrl/newt v1.10.1/go.mod h1:d1+yYMnKqg4oLqAM9zdbjthjj2FQEVouiACjqU468ck= github.com/fosrl/olm v1.4.3 h1:hmAWfrJzpiwtvzw/B6xmCmeqK1OW0BJ2FUbEa7ztlmU= github.com/fosrl/olm v1.4.3/go.mod h1:aC1oieI0tadd66zY7RDjXT3PPsR54mYS0FYMsHqFqs8= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=