DodoApp: Support PHP 8.2
Change-Id: I7cfe082c66a0efe0b3b9c85433a96623466ced5c
diff --git a/core/installer/welcome/dodo_app.go b/core/installer/welcome/dodo_app.go
index afcd627..87b003a 100644
--- a/core/installer/welcome/dodo_app.go
+++ b/core/installer/welcome/dodo_app.go
@@ -44,8 +44,6 @@
userCtx = "user"
)
-var types = []string{"golang:1.22.0", "golang:1.20.0", "hugo:latest"}
-
type dodoAppTmplts struct {
index *template.Template
appStatus *template.Template
@@ -373,6 +371,10 @@
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
+ var types []string
+ for _, t := range s.appTmpls.Types() {
+ types = append(types, strings.Replace(t, "-", ":", 1))
+ }
data := statusData{apps, networks, types}
if err := s.tmplts.index.Execute(w, data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
@@ -869,7 +871,7 @@
}
func (s *DodoAppServer) initRepo(repo soft.RepoIO, appType string, network installer.Network, subdomain string) error {
- appType = strings.ReplaceAll(appType, ":", "-")
+ appType = strings.Replace(appType, ":", "-", 1)
appTmpl, err := s.appTmpls.Find(appType)
if err != nil {
return err
@@ -925,9 +927,8 @@
}
}
for _, t := range s.appTmpls.Types() {
- ret.Types = append(ret.Types, strings.ReplaceAll(t, "-", ":"))
+ ret.Types = append(ret.Types, strings.Replace(t, "-", ":", 1))
}
- w.Header().Set("Access-Control-Allow-Origin", "*")
if err := json.NewEncoder(w).Encode(ret); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return