v0.84.0: catalog-driven initial_credentials — read an app's auto-generated first-login from a file and show it on the app page
This commit is contained in:
@@ -477,6 +477,17 @@ func (s *Server) appDetailHandler(w http.ResponseWriter, r *http.Request, slug s
|
||||
data["HasAppInfo"] = found.Meta.HasAppInfo()
|
||||
data["EffectiveSubdomain"] = effectiveSubdomain
|
||||
|
||||
// Initial auto-generated login (e.g. Crafty writes a random admin password to a file at first
|
||||
// boot). Read it live from the container so the customer doesn't have to dig through logs. Only
|
||||
// for deployed apps that declare an initial_credentials spec; hidden when unreadable.
|
||||
if found.Deployed && found.Meta.InitialCreds != nil {
|
||||
if creds, err := s.stackMgr.ReadInitialCredentials(found.Name); err != nil {
|
||||
s.logger.Printf("[WARN] [web] initial-creds for %s: %v", found.Name, err)
|
||||
} else if creds != nil && creds.Available {
|
||||
data["InitialCreds"] = creds
|
||||
}
|
||||
}
|
||||
|
||||
// Per-app migration (B1): offer to move this app's data to another connected drive (≠ current).
|
||||
if found.Deployed {
|
||||
current := ""
|
||||
|
||||
Reference in New Issue
Block a user