util, db: generate key material as hex via tailscale rands

This commit is contained in:
Kristoffer Dalby
2026-06-15 10:03:35 +00:00
parent 368b9e7edd
commit ea5165e325
16 changed files with 50 additions and 239 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"strings"
"time"
"github.com/juanfont/headscale/hscontrol/util"
"github.com/ory/dockertest/v3"
"tailscale.com/util/rands"
)
const (
@@ -46,7 +46,7 @@ func GenerateRunID() string {
timestamp := now.Format(TimestampFormatRunID)
// Add a short random hash to ensure uniqueness
randomHash := util.MustGenerateRandomStringDNSSafe(6)
randomHash := rands.HexString(6)
return fmt.Sprintf("%s-%s", timestamp, randomHash)
}