This repository was archived by the owner on May 6, 2024. It is now read-only.
File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 124
124
</ div >
125
125
</ div >
126
126
</ div >
127
+ < script src ="https://cdn.ravenjs.com/3.17.0/raven.min.js "
128
+ crossorigin ="anonymous "> </ script >
129
+ < script > window . SENTRY_DSN = '{{ SENTRY_DSN_FRONTEND }}' ; </ script >
130
+ < script >
131
+ window . SENTRY_DSN && Raven . config ( window . SENTRY_DSN , {
132
+ // TODO(dcramer): make this configurable/autobind?
133
+ whitelistUrls : [ / z e u s \. c i / ] ,
134
+ environment : '{{ SENTRY_ENVIRONMENT }}' ,
135
+ release : '{{ SENTRY_RELEASE }}' ,
136
+ } ) . install ( ) ;
137
+ </ script >
127
138
< script type ="text/javascript " src ="{{ url_for('static', filename='bundle.js') }} "> </ script >
128
139
</ body >
129
140
</ html >
Original file line number Diff line number Diff line change @@ -70,13 +70,15 @@ def create_app(_read_config=True, **config):
70
70
app .config ['REDIS_URL' ] = REDIS_URL
71
71
72
72
app .config ['SENTRY_DSN' ] = os .environ .get ('SENTRY_DSN' ) or None
73
+ app .config ['SENTRY_DSN_FRONTEND' ] = os .environ .get ('SENTRY_DSN_FRONTEND' ) or None
73
74
app .config ['SENTRY_INCLUDE_PATHS' ] = [
74
75
'zeus' ,
75
76
]
76
77
try :
77
78
app .config ['SENTRY_RELEASE' ] = raven .fetch_git_sha (ROOT )
78
79
except Exception :
79
80
app .logger .warn ('unable to bind sentry.release context' , exc_info = True )
81
+ app .config ['SENTRY_ENVIRONMENT' ] = os .environ .get ('NODE_ENV' , 'development' )
80
82
81
83
app .config ['GITHUB_CLIENT_ID' ] = os .environ .get ('GITHUB_CLIENT_ID' ) or None
82
84
app .config ['GITHUB_CLIENT_SECRET' ] = os .environ .get ('GITHUB_CLIENT_SECRET' ) or None
Original file line number Diff line number Diff line change 1
- from flask import render_template
1
+ from flask import current_app , render_template
2
2
3
3
4
4
def index (path = None ):
5
- return render_template ('index.html' )
5
+ return render_template (
6
+ 'index.html' , ** {
7
+ 'SENTRY_DSN_FRONTEND' : current_app .config .get ('SENTRY_DSN_FRONTEND' ) or '' ,
8
+ 'SENTRY_ENVIRONMENT' : current_app .config .get ('SENTRY_ENVIRONMENT' ) or '' ,
9
+ 'SENTRY_RELEASE' : current_app .config .get ('SENTRY_RELEASE' ) or '' ,
10
+ }
11
+ )
You can’t perform that action at this time.
0 commit comments