Files
Pulse/cmd/hashpw/main.go
rcourtman 9e339957c6 fix: Update runtime config when toggling Docker update actions setting
The DisableDockerUpdateActions setting was being saved to disk but not
updated in h.config, causing the UI toggle to appear to revert on page
refresh since the API returned the stale runtime value.

Related to #1023
2026-01-03 11:14:17 +00:00

38 lines
598 B
Go

package main
import (
"fmt"
"io"
"os"
"github.com/rcourtman/pulse-go-rewrite/internal/auth"
)
var (
hashPassword = auth.HashPassword
osArgs = os.Args
osExit = os.Exit
stdout io.Writer = os.Stdout
)
func run(args []string, out io.Writer) int {
if len(args) < 2 {
fmt.Fprintln(out, "Usage: hashpw <password>")
return 1
}
password := args[1]
hash, err := hashPassword(password)
if err != nil {
fmt.Fprintf(out, "Error: %v\n", err)
return 1
}
fmt.Fprintln(out, hash)
return 0
}
func main() {
osExit(run(osArgs, stdout))
}