hub: use Hungarian word passphrases for retrieval passwords

Replace 64-char hex retrieval passwords with 5-word Hungarian
passphrases (e.g. áldás-plazmid-palánta-süvítve-pócgém) for
better UX in disaster recovery scenarios. Embed 29K+ word list
via go:embed. API keys remain hex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 14:31:39 +01:00
parent 165c59e84b
commit 1f05f9f866
5 changed files with 29744 additions and 3 deletions
+3 -3
View File
@@ -367,7 +367,7 @@ func (s *Server) handleConfigCreate(w http.ResponseWriter, r *http.Request) {
}
// Generate credentials
retrievalPassword, err := configgen.RandomHex(32)
retrievalPassword, err := configgen.RandomPassphrase(5)
if err != nil {
http.Error(w, "Internal error", http.StatusInternalServerError)
return
@@ -493,7 +493,7 @@ func (s *Server) handleConfigPreview(w http.ResponseWriter, r *http.Request, cus
// handleConfigRegenPassword regenerates the retrieval password.
func (s *Server) handleConfigRegenPassword(w http.ResponseWriter, r *http.Request, customerID string) {
newPassword, err := configgen.RandomHex(32)
newPassword, err := configgen.RandomPassphrase(5)
if err != nil {
http.Error(w, "Internal error", http.StatusInternalServerError)
return
@@ -633,7 +633,7 @@ func (s *Server) handleCreateConfigFromReport(w http.ResponseWriter, r *http.Req
}
// Generate credentials
retrievalPassword, _ := configgen.RandomHex(32)
retrievalPassword, _ := configgen.RandomPassphrase(5)
apiKey, _ := configgen.RandomHex(32)
cfg := &store.CustomerConfig{