mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +00:00
Simple CLI utility to generate bcrypt password hashes for admin users. Usage: hashpw <password> This utility helps administrators generate properly hashed passwords for use in configuration files or manual user setup.
24 lines
345 B
Go
24 lines
345 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/auth"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
fmt.Println("Usage: hashpw <password>")
|
|
os.Exit(1)
|
|
}
|
|
|
|
password := os.Args[1]
|
|
hash, err := auth.HashPassword(password)
|
|
if err != nil {
|
|
fmt.Printf("Error: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
fmt.Println(hash)
|
|
}
|