From 2696dc4b3c951b84aa398dd12a76016f085b2bfe Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 19 Dec 2016 09:03:29 -0800 Subject: contin. debugging host port issue in config --- system/admin/config/config.go | 7 ++++++- system/admin/handlers.go | 1 + system/db/config.go | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system/admin/config/config.go b/system/admin/config/config.go index 6c315f5..ab17425 100644 --- a/system/admin/config/config.go +++ b/system/admin/config/config.go @@ -5,7 +5,7 @@ import ( "github.com/bosssauce/ponzu/system/item" ) -//Config represents the confirgurable options of the system +// Config represents the confirgurable options of the system type Config struct { item.Item editor editor.Editor @@ -40,6 +40,11 @@ func (c *Config) MarshalEditor() ([]byte, error) { "placeholder": "e.g. www.example.com or example.com", }), }, + editor.Field{ + View: editor.Input("HTTPPort", c, map[string]string{ + "type": "hidden", + }), + }, editor.Field{ View: editor.Input("AdminEmail", c, map[string]string{ "label": "Adminstrator Email (will be notified of internal system information)", diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 85c1f8b..b9408cf 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -85,6 +85,7 @@ func initHandler(res http.ResponseWriter, req *http.Request) { // set HTTP port which should be previously added to config cache port := db.ConfigCache("http_port") + fmt.Println("port from config (init handler)", port) req.Form.Set("http_port", port) // set initial user email as admin_email and make config diff --git a/system/db/config.go b/system/db/config.go index 7873a55..8168257 100644 --- a/system/db/config.go +++ b/system/db/config.go @@ -121,7 +121,7 @@ func ConfigAll() ([]byte, error) { // PutConfig updates a single k/v in the config func PutConfig(key string, value interface{}) error { - fmt.Println(key, value) + fmt.Println("PutConfig:", key, value) kv := make(map[string]interface{}) c, err := ConfigAll() -- cgit v1.2.3