Skip to content

Commit

Permalink
Added: sentry DSN for config endpoint (#394)
Browse files Browse the repository at this point in the history
* Added: sentry DSN for config endpoint

* Added separate sentry dsn for frontend-part

Co-authored-by: Michael Zaikin <mz@baking-bad.org>
  • Loading branch information
RomanSerikov and m-kus authored Dec 3, 2020
1 parent 8eb524c commit c84a0ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmd/api/handlers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ func (ctx *Context) GetConfig(c *gin.Context) {
TzKTEndpoints: tzktEndpoints,
}

if ctx.Config.API.SentryEnabled {
cfg.SentryDSN = ctx.Config.Sentry.FrontURI
}

c.JSON(http.StatusOK, cfg)
}
1 change: 1 addition & 0 deletions cmd/api/handlers/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
3 changes: 1 addition & 2 deletions configs/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ oauth:
sentry:
environment: development
uri: ${SENTRY_DSN}
front_uri: ${SENTRY_DSN_FRONT}
debug: true

share_path: ${HOME}/.bcd
Expand Down Expand Up @@ -115,8 +116,6 @@ indexer:
networks:
mainnet:
boost: tzkt
# carthagenet:
# boost: tzkt
# delphinet:
# boost: tzkt
# dalphanet:
Expand Down
1 change: 1 addition & 0 deletions configs/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ oauth:
sentry:
environment: production
uri: ${SENTRY_DSN}
front_uri: ${SENTRY_DSN_FRONT}
debug: false

share_path: /etc/bcd
Expand Down
1 change: 1 addition & 0 deletions configs/you.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ oauth:
sentry:
environment: staging
uri: ${SENTRY_DSN}
front_uri: ${SENTRY_DSN_FRONT}
debug: false

share_path: /etc/bcd
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down

0 comments on commit c84a0ff

Please sign in to comment.