installer-env: generate env task key
diff --git a/core/installer/welcome/env.go b/core/installer/welcome/env.go
index 7514adf..2595028 100644
--- a/core/installer/welcome/env.go
+++ b/core/installer/welcome/env.go
@@ -153,7 +153,7 @@
return
}
}
- http.Redirect(w, r, "/env/foo", http.StatusSeeOther)
+ http.Redirect(w, r, fmt.Sprintf("/env/%s", key), http.StatusSeeOther)
}
func (s *EnvServer) createEnvForm(w http.ResponseWriter, r *http.Request) {
@@ -318,8 +318,16 @@
s.nsCreator,
s.repo,
)
- s.tasks["foo"] = t
- s.dns["foo"] = dns
+ key := func() string {
+ for {
+ key, err := s.nameGenerator.Generate()
+ if err == nil {
+ return key
+ }
+ }
+ }()
+ s.tasks[key] = t
+ s.dns[key] = dns
go t.Start()
- http.Redirect(w, r, "/env/foo", http.StatusSeeOther)
+ http.Redirect(w, r, fmt.Sprintf("/env/key", key), http.StatusSeeOther)
}