first commit

This commit is contained in:
Blake Ridgway
2026-04-11 14:01:09 -05:00
commit 6915cab5f3
22 changed files with 1842 additions and 0 deletions

34
tools/genhash/main.go Normal file
View File

@@ -0,0 +1,34 @@
// genhash generates a bcrypt password hash suitable for use as ADMIN_PASSWORD_HASH.
//
// Usage:
//
// go run ./tools/genhash <password>
// make genhash
package main
import (
"fmt"
"os"
"golang.org/x/crypto/bcrypt"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "usage: genhash <password>")
fmt.Fprintln(os.Stderr, " or: make genhash")
os.Exit(1)
}
password := os.Args[1]
if len(password) == 0 {
fmt.Fprintln(os.Stderr, "error: password cannot be empty")
os.Exit(1)
}
hash, err := bcrypt.GenerateFromPassword([]byte(password), 12)
if err != nil {
fmt.Fprintln(os.Stderr, "error:", err)
os.Exit(1)
}
fmt.Println(string(hash))
fmt.Fprintln(os.Stderr, "\nSet this as ADMIN_PASSWORD_HASH in your .env file.")
}