summaryrefslogtreecommitdiff
path: root/system/admin
diff options
context:
space:
mode:
Diffstat (limited to 'system/admin')
-rw-r--r--system/admin/config/config.go1
-rw-r--r--system/admin/handlers.go5
2 files changed, 6 insertions, 0 deletions
diff --git a/system/admin/config/config.go b/system/admin/config/config.go
index b898b49..2e957ed 100644
--- a/system/admin/config/config.go
+++ b/system/admin/config/config.go
@@ -12,6 +12,7 @@ type Config struct {
Name string `json:"name"`
Domain string `json:"domain"`
+ HTTPPort string `json:"http_port"`
AdminEmail string `json:"admin_email"`
ClientSecret string `json:"client_secret"`
Etag string `json:"etag"`
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index fed77f7..55a5f30 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -71,6 +71,7 @@ func initHandler(res http.ResponseWriter, req *http.Request) {
etag := db.NewEtag()
req.Form.Set("etag", etag)
+ // create and save admin user
email := strings.ToLower(req.FormValue("email"))
password := req.FormValue("password")
usr := user.NewUser(email, password)
@@ -82,6 +83,10 @@ func initHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ // set HTTP port which should be previously added to config cache
+ port := db.ConfigCache("http_port")
+ req.Form.Set("http_port", port)
+
// set initial user email as admin_email and make config
req.Form.Set("admin_email", email)
err = db.SetConfig(req.Form)