From de01f0c9fa5a9eadaddc2d8318faf73fcebe1b75 Mon Sep 17 00:00:00 2001 From: Roman Serikov Date: Thu, 26 Nov 2020 21:15:37 +0300 Subject: [PATCH 1/2] Added: sentry DSN for config endpoint --- cmd/api/handlers/config.go | 4 ++++ cmd/api/handlers/responses.go | 1 + 2 files changed, 5 insertions(+) diff --git a/cmd/api/handlers/config.go b/cmd/api/handlers/config.go index 1295b606d..d768c7e45 100644 --- a/cmd/api/handlers/config.go +++ b/cmd/api/handlers/config.go @@ -26,5 +26,9 @@ func (ctx *Context) GetConfig(c *gin.Context) { TzKTEndpoints: tzktEndpoints, } + if ctx.Config.API.SentryEnabled { + cfg.SentryDSN = ctx.Config.Sentry.URI + } + c.JSON(http.StatusOK, cfg) } diff --git a/cmd/api/handlers/responses.go b/cmd/api/handlers/responses.go index b9c18d346..c02edbd27 100644 --- a/cmd/api/handlers/responses.go +++ b/cmd/api/handlers/responses.go @@ -575,6 +575,7 @@ type ConfigResponse struct { OauthEnabled bool `json:"oauth_enabled"` RPCEndpoints map[string]string `json:"rpc_endpoints"` TzKTEndpoints map[string]string `json:"tzkt_endpoints"` + SentryDSN string `json:"sentry_dsn"` } // DApp - From 94fb865c772b3ff9cd89ad4862014b8de2b910f6 Mon Sep 17 00:00:00 2001 From: Roman Serikov Date: Wed, 2 Dec 2020 17:17:00 +0300 Subject: [PATCH 2/2] Added separate sentry dsn for frontend-part --- cmd/api/handlers/config.go | 2 +- configs/development.yml | 3 ++- configs/production.yml | 1 + configs/you.yml | 1 + internal/config/config.go | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/api/handlers/config.go b/cmd/api/handlers/config.go index d768c7e45..2940cd3cd 100644 --- a/cmd/api/handlers/config.go +++ b/cmd/api/handlers/config.go @@ -27,7 +27,7 @@ func (ctx *Context) GetConfig(c *gin.Context) { } if ctx.Config.API.SentryEnabled { - cfg.SentryDSN = ctx.Config.Sentry.URI + cfg.SentryDSN = ctx.Config.Sentry.FrontURI } c.JSON(http.StatusOK, cfg) diff --git a/configs/development.yml b/configs/development.yml index f77b8f31f..706001210 100644 --- a/configs/development.yml +++ b/configs/development.yml @@ -59,6 +59,7 @@ oauth: sentry: environment: development uri: ${SENTRY_DSN} + front_uri: ${SENTRY_DSN_FRONT} debug: true share_path: ${HOME}/.bcd @@ -116,7 +117,7 @@ indexer: # mainnet: # boost: tzkt carthagenet: - boost: tzkt + boost: tzkt # delphinet: # boost: tzkt # dalphanet: diff --git a/configs/production.yml b/configs/production.yml index 650818a88..f4b70bfdf 100644 --- a/configs/production.yml +++ b/configs/production.yml @@ -60,6 +60,7 @@ oauth: sentry: environment: production uri: ${SENTRY_DSN} + front_uri: ${SENTRY_DSN_FRONT} debug: false share_path: /etc/bcd diff --git a/configs/you.yml b/configs/you.yml index de47faa12..ba9d87a8c 100644 --- a/configs/you.yml +++ b/configs/you.yml @@ -59,6 +59,7 @@ oauth: sentry: environment: staging uri: ${SENTRY_DSN} + front_uri: ${SENTRY_DSN_FRONT} debug: false share_path: /etc/bcd diff --git a/internal/config/config.go b/internal/config/config.go index 308a7b866..484d2946d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -164,6 +164,7 @@ type SeedConfig struct { type SentryConfig struct { Environment string `yaml:"environment"` URI string `yaml:"uri"` + FrontURI string `yaml:"front_uri"` Debug bool `yaml:"debug"` }