From 9ea0ec0e6fa0bd65c8d263a1cd418f83a3848a8b Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sun, 23 Jul 2017 10:15:12 -0600 Subject: adding bind option in CLI run cmd, including in system config --- system/admin/config/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system') diff --git a/system/admin/config/config.go b/system/admin/config/config.go index 19da39b..83ca2f7 100644 --- a/system/admin/config/config.go +++ b/system/admin/config/config.go @@ -14,6 +14,7 @@ type Config struct { Name string `json:"name"` Domain string `json:"domain"` + BindAddress string `json:"bind_addr"` HTTPPort string `json:"http_port"` HTTPSPort string `json:"https_port"` AdminEmail string `json:"admin_email"` @@ -53,6 +54,11 @@ func (c *Config) MarshalEditor() ([]byte, error) { "placeholder": "e.g. www.example.com or example.com", }), }, + editor.Field{ + View: editor.Input("BindAddress", c, map[string]string{ + "type": "hidden", + }), + }, editor.Field{ View: editor.Input("HTTPPort", c, map[string]string{ "type": "hidden", -- cgit v1.2.3 From 3734011fc98992aa7d3a3a4334f998c3ae535f83 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sun, 23 Jul 2017 10:32:48 -0600 Subject: update addon api to support non-domain bind address --- system/addon/api.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system') diff --git a/system/addon/api.go b/system/addon/api.go index cd792aa..ae4909b 100644 --- a/system/addon/api.go +++ b/system/addon/api.go @@ -18,10 +18,10 @@ type QueryOptions db.QueryOptions // ContentAll retrives all items from the HTTP API within the provided namespace func ContentAll(namespace string) []byte { - host := db.ConfigCache("domain").(string) + addr := db.ConfigCache("bind_addr").(string) port := db.ConfigCache("http_port").(string) endpoint := "http://%s:%s/api/contents?type=%s&count=-1" - URL := fmt.Sprintf(endpoint, host, port, namespace) + URL := fmt.Sprintf(endpoint, addr, port, namespace) j, err := Get(URL) if err != nil { @@ -35,10 +35,10 @@ func ContentAll(namespace string) []byte { // Query retrieves a set of content from the HTTP API based on options // and returns the total number of content in the namespace and the content func Query(namespace string, opts QueryOptions) []byte { - host := db.ConfigCache("domain").(string) + addr := db.ConfigCache("bind_addr").(string) port := db.ConfigCache("http_port").(string) endpoint := "http://%s:%s/api/contents?type=%s&count=%d&offset=%d&order=%s" - URL := fmt.Sprintf(endpoint, host, port, namespace, opts.Count, opts.Offset, opts.Order) + URL := fmt.Sprintf(endpoint, addr, port, namespace, opts.Count, opts.Offset, opts.Order) j, err := Get(URL) if err != nil { -- cgit v1.2.3