From c3f48ca1b48fb2f4702f470407b0c385c3c94058 Mon Sep 17 00:00:00 2001 From: potsables Date: Fri, 8 Mar 2019 03:06:40 -0800 Subject: [PATCH 1/2] config: add cors api configuration --- config.go | 4 ++++ config.json | 27 ++++++++++++++++++++++++++- types.go | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index c68655b..fb760f8 100644 --- a/config.go +++ b/config.go @@ -44,4 +44,8 @@ func (t *TemporalConfig) setDefaults() { if t.LogDir == "" { t.LogDir = "/var/log/temporal/" } + if len(t.API.Connection.CORS.AllowedOrigin) == 0 { + origins := []string{"temporal.cloud", "backup.temporal.cloud"} + t.API.Connection.CORS.AllowedOrigin = origins + } } diff --git a/config.json b/config.json index 67c1f94..20d3e10 100755 --- a/config.json +++ b/config.json @@ -10,6 +10,12 @@ "ip": "", "port": "" }, + "cords": { + "allowed_origins": [ + "temporal.cloud", + "backup.temporal.cloud" + ] + }, "limit": "" }, "jwt": { @@ -40,7 +46,16 @@ "cert_path": "", "key_file": "" }, - "auth_key": "" + "auth_key": "", + "options": { + "engine": { + "store_path": "", + "queue": { + "rate": 0, + "batch": 0 + } + } + } }, "nexus": { "host": "", @@ -73,6 +88,16 @@ "auth_key": "", "log_file": "", "keystore_password": "" + }, + "krab_fallback": { + "url": "", + "TLS": { + "cert_path": "", + "key_file": "" + }, + "auth_key": "", + "log_file": "", + "keystore_password": "" } }, "ethereum": { diff --git a/types.go b/types.go index 005df15..26a870a 100644 --- a/types.go +++ b/types.go @@ -31,6 +31,9 @@ type API struct { IP string `json:"ip"` Port string `json:"port"` } `json:"prometheus"` + CORS struct { + AllowedOrigin []string `json:"allowed_origins"` + } `json:"cords"` // define the maximum number of people allowed to connect to the API Limit string `json:"limit"` } `json:"connection"` From 1b249a50e945d4737463028057d8972bfd635a79 Mon Sep 17 00:00:00 2001 From: potsables Date: Fri, 8 Mar 2019 22:56:03 -0800 Subject: [PATCH 2/2] config: cleanup double assignment --- config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.go b/config.go index fb760f8..60059c3 100644 --- a/config.go +++ b/config.go @@ -45,7 +45,6 @@ func (t *TemporalConfig) setDefaults() { t.LogDir = "/var/log/temporal/" } if len(t.API.Connection.CORS.AllowedOrigin) == 0 { - origins := []string{"temporal.cloud", "backup.temporal.cloud"} - t.API.Connection.CORS.AllowedOrigin = origins + t.API.Connection.CORS.AllowedOrigin = []string{"temporal.cloud", "backup.temporal.cloud"} } }