* fix: changed sessions bucket * fix: text changes in login and signup forms * change: version number * change: config changes * fix: alerts image name * fix: alerts image name * Update README.md * chore(actions): pushing internalized to script. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * feat(nginx): No redirection to HTTPS by default. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * chore(deploy): optional nginx https redirect Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix: review fixes and other changes * fix: events modal openreplay logo * fix: stack event icon * Changes: - debugging - smtp status - session's issues - session's issue_types as array - changed Slack error message * Changes: - set chalice pull policy to always * fix(openreplay-cli): path issues. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix(openreplay-cli): fix path Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * change: onboarding explore text changes * change: timeline issue pointers and static issue types * change: removed issues_types api call * connectors * Update README.md * Update README.md * Update README.md * Updating services * Update README.md * Updated alert-notification-string to chalice * Delete issues.md * Changes: - fixed connexion pool exhausted using Semaphores - fixed session-replay-url signing * Changes: - fixed connexion pool exhausted using Semaphores - fixed session-replay-url signing * Change pullPolicy to IfNotPresent * Fixed typo * Fixed typo * Fixed typos * Fixed typo * Fixed typo * Fixed typos * Fixed typos * Fixed typo * Fixed typo * Removed /ws * Update README.md * feat(nginx): increase minio upload size to 50M Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix(deploy): nginx custom changes are overriden in install Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix(nginx): deployment indentation issue Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix: revid filter crash * fix: onboarding links * fix: update password store new token * fix: report issue icon jira/github * fix: onboarding redirect on signup * Changes: - hardcoded S3_HOST * Changes: - changed "sourcemaps" env var to "sourcemaps_reader" - set "sourcemaps_reader" env var value * chore(script): remove logo Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * Making domain_name mandatory Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * Changes: - un-ignore *.js * feat(install): auto create jwt_secret for chalice. * docs(script): Adding Banner Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * chore(script): Remove verbose logging Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * Change: - use boto3-resource instead of boto3-client to check if file exists - changed .gitignore to allow *.js files - changed sourcemaps_reader env-var & env-var-value * fix (baxkend-ender): skip inputs with no label (technical) * Change: - changed DB structure * change: removed /flows api call * fix: skipping errorOnFetch check * Change: - changed sourcemaps_reader-nodejs script * Change: - changed sourcemaps_reader-nodejs script * fix (backend-postgres): correct autocomplete type-value * fix: slack webhooks PUT call * change: added external icon for integration doc links * fix: updated the sourcemap upload doc link * fix: link color of no sessions message * fix (frontend-player): show original domContentLoaded text values, while adjusted on timeline * fix (frontend-player): syntax * Changes: - changed requirements - changed slack add integration - added slack edit integration - removed sourcemaps_reader extra payload * Changes: - fixed sentry-issue-reporter - fixed telemetry reporter - fixed DB schema * fix(cli): fix logs flag Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * ci(deploy): Injecting domain_name Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * feat(nginx): Get real client ip Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * chore(nginx): restart on helm installation. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * fix(deployment): respect image tags. * Changes: - changed sentry tags - changed asayer_session_id to openReplaySessionToken - EE full merge * fix: close the issue modal after creating * fix: show description in issue details modal * fix: integrate slack button redirect, and doc link * fix: code snippet conflict set back * fix: slack share channel selection * Changes: - fixed DB structure * Changes: - return full integration body on add slack * fix (integrations): ignore token expired + some logs * feat (sourcemaps-uploader): v.3.0.2 filename fix + logging arg * fix (tracker): 3.0.3 version: start before auth * fix: funnel calendar position * fix: fetch issue types * fix: missing icon blocking the session to play * change: sessions per browser widget bar height reduced * fix: github colored circles * Changes: - changed session-assignment-jira response * chore(nginx): pass x-forward-for Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * feat(chalice): included sourcemaps_reader It's not advised to run multiple processes in a single docker container. In Kubernetes we can run this as sidecar, but other platforms such as Heroku, and vanilla docker doesn't support such feature. So till we figure out better solution, this is the workaround. * chore(install): Remove sqs * feat(deployment): restart pods on installations. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * Changes: - changed DB-oauth-unique constraint Co-authored-by: Shekar Siri <sshekarsiri@gmail.com> Co-authored-by: Mehdi Osman <estradino@users.noreply.github.com> Co-authored-by: KRAIEM Taha Yassine <tahayk2@gmail.com> Co-authored-by: ourvakan <hi-psi@yandex.com> Co-authored-by: ShiKhu <alex.kaminsky.11@gmail.com>
117 lines
4.2 KiB
Python
117 lines
4.2 KiB
Python
import sentry_sdk
|
|
from chalice import Chalice, Response
|
|
from sentry_sdk import configure_scope
|
|
|
|
from chalicelib import _overrides
|
|
from chalicelib.blueprints import bp_authorizers
|
|
from chalicelib.blueprints import bp_core, bp_core_crons
|
|
from chalicelib.blueprints import bp_core_dynamic, bp_core_dynamic_crons
|
|
from chalicelib.blueprints.subs import bp_dashboard
|
|
from chalicelib.utils import helper
|
|
from chalicelib.utils import pg_client
|
|
from chalicelib.utils.helper import environ
|
|
|
|
from chalicelib.blueprints import bp_ee, bp_ee_crons
|
|
|
|
app = Chalice(app_name='parrot')
|
|
app.debug = not helper.is_production() or helper.is_local()
|
|
|
|
sentry_sdk.init(environ["sentryURL"])
|
|
|
|
# Monkey-patch print for DataDog hack
|
|
import sys
|
|
import traceback
|
|
|
|
old_tb = traceback.print_exception
|
|
old_f = sys.stdout
|
|
old_e = sys.stderr
|
|
OR_SESSION_TOKEN = None
|
|
|
|
|
|
class F:
|
|
def write(self, x):
|
|
if OR_SESSION_TOKEN is not None and x != '\n' and not helper.is_local():
|
|
old_f.write(f"[or_session_token={OR_SESSION_TOKEN}] {x}")
|
|
else:
|
|
old_f.write(x)
|
|
|
|
def flush(self):
|
|
pass
|
|
|
|
|
|
def tb_print_exception(etype, value, tb, limit=None, file=None, chain=True):
|
|
if OR_SESSION_TOKEN is not None and not helper.is_local():
|
|
value = type(value)(f"[or_session_token={OR_SESSION_TOKEN}] " + str(value))
|
|
|
|
old_tb(etype, value, tb, limit, file, chain)
|
|
|
|
|
|
if helper.is_production():
|
|
traceback.print_exception = tb_print_exception
|
|
|
|
sys.stdout = F()
|
|
sys.stderr = F()
|
|
# ---End Monkey-patch
|
|
|
|
|
|
_overrides.chalice_app(app)
|
|
|
|
|
|
@app.middleware('http')
|
|
def or_middleware(event, get_response):
|
|
from chalicelib.ee import unlock
|
|
if not unlock.is_valid():
|
|
return Response(body={"errors": ["expired license"]}, status_code=403)
|
|
if "{projectid}" in event.path.lower():
|
|
from chalicelib.ee import projects
|
|
if not projects.is_authorized(project_id=event.uri_params["projectId"],
|
|
tenant_id=event.context["authorizer"]["tenantId"]):
|
|
print("unauthorized project")
|
|
pg_client.close()
|
|
return Response(body={"errors": ["unauthorized project"]}, status_code=401)
|
|
global OR_SESSION_TOKEN
|
|
OR_SESSION_TOKEN = app.current_request.headers.get('vnd.openreplay.com.sid',
|
|
app.current_request.headers.get('vnd.asayer.io.sid'))
|
|
if "authorizer" in event.context and event.context["authorizer"] is None:
|
|
print("Deleted user!!")
|
|
pg_client.close()
|
|
return Response(body={"errors": ["Deleted user"]}, status_code=403)
|
|
|
|
try:
|
|
if helper.TRACK_TIME:
|
|
import time
|
|
now = int(time.time() * 1000)
|
|
response = get_response(event)
|
|
if response.status_code == 500 and helper.allow_sentry() and OR_SESSION_TOKEN is not None and not helper.is_local():
|
|
with configure_scope() as scope:
|
|
scope.set_tag('stage', environ["stage"])
|
|
scope.set_tag('openReplaySessionToken', OR_SESSION_TOKEN)
|
|
scope.set_extra("context", event.context)
|
|
sentry_sdk.capture_exception(Exception(response.body))
|
|
if helper.TRACK_TIME:
|
|
print(f"Execution time: {int(time.time() * 1000) - now} ms")
|
|
except Exception as e:
|
|
if helper.allow_sentry() and OR_SESSION_TOKEN is not None and not helper.is_local():
|
|
with configure_scope() as scope:
|
|
scope.set_tag('stage', environ["stage"])
|
|
scope.set_tag('openReplaySessionToken', OR_SESSION_TOKEN)
|
|
scope.set_extra("context", event.context)
|
|
sentry_sdk.capture_exception(e)
|
|
response = Response(body={"Code": "InternalServerError",
|
|
"Message": "An internal server error occurred [level=Fatal]."},
|
|
status_code=500)
|
|
pg_client.close()
|
|
return response
|
|
|
|
|
|
# Open source
|
|
app.register_blueprint(bp_authorizers.app)
|
|
app.register_blueprint(bp_core.app)
|
|
app.register_blueprint(bp_core_crons.app)
|
|
app.register_blueprint(bp_core_dynamic.app)
|
|
app.register_blueprint(bp_core_dynamic_crons.app)
|
|
app.register_blueprint(bp_dashboard.app)
|
|
|
|
# Enterprise
|
|
app.register_blueprint(bp_ee.app)
|
|
app.register_blueprint(bp_ee_crons.app)
|