mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
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
38 lines
598 B
Go
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))
|
|
}
|