Changes:
- cleaned env-vars - changed chalice.yaml env-vars
This commit is contained in:
parent
29bb1735f5
commit
d4487f531c
9 changed files with 160 additions and 32 deletions
|
|
@ -15,8 +15,6 @@
|
|||
"isEE": "false",
|
||||
"stage": "default-fos",
|
||||
"jwt_issuer": "openreplay-default-fos",
|
||||
"allowCron": "true",
|
||||
"sentry": "false",
|
||||
"sentryURL": "",
|
||||
"pg_host": "postgresql.db.svc.cluster.local",
|
||||
"pg_port": "5432",
|
||||
|
|
@ -28,16 +26,10 @@
|
|||
"email_funnel": "http://127.0.0.1:8000/async/funnel/%s",
|
||||
"email_basic": "http://127.0.0.1:8000/async/basic/%s",
|
||||
"assign_link": "http://127.0.0.1:8000/async/email_assignment",
|
||||
"verification_link": "http://127.0.0.1:8000/email/validate/",
|
||||
"verification_success_redirect": "",
|
||||
"verification_fail_redirect": "",
|
||||
"captcha_server": "",
|
||||
"captcha_key": "",
|
||||
"jira_api": "http://127.0.0.1:3000/dev",
|
||||
"github_api": "http://127.0.0.1:4000/dev",
|
||||
"sessions_bucket": "",
|
||||
"sessions_region": "",
|
||||
"stack_reader": "",
|
||||
"put_S3_TTL": "20",
|
||||
"sourcemaps_bucket": "",
|
||||
"sourcemaps_bucket_key": "",
|
||||
|
|
|
|||
|
|
@ -870,7 +870,13 @@ def get_weekly_report_config(context):
|
|||
|
||||
@app.route('/{projectId}/issue_types', methods=['GET'])
|
||||
def issue_types(projectId, context):
|
||||
return {"data": issues.get_types(project_id=projectId)}
|
||||
# return {"data": issues.get_types_by_project(project_id=projectId)}
|
||||
return {"data": issues.get_all_types()}
|
||||
|
||||
|
||||
@app.route('/issue_types', methods=['GET'])
|
||||
def all_issue_types(context):
|
||||
return {"data": issues.get_all_types()}
|
||||
|
||||
|
||||
@app.route('/flows', methods=['GET', 'PUT', 'POST', 'DELETE'])
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ def get_by_session_id(session_id, issue_type=None):
|
|||
return helper.list_to_camel_case(cur.fetchall())
|
||||
|
||||
|
||||
def get_types(project_id):
|
||||
def get_types_by_project(project_id):
|
||||
with pg_client.PostgresClient() as cur:
|
||||
cur.execute(
|
||||
cur.mogrify(f"""SELECT type,
|
||||
|
|
@ -70,3 +70,56 @@ def get_types(project_id):
|
|||
WHERE project_id = %(project_id)s) AS types
|
||||
ORDER BY "order";""", {"project_id": project_id}))
|
||||
return helper.list_to_camel_case(cur.fetchall())
|
||||
|
||||
|
||||
def get_all_types():
|
||||
return [
|
||||
{
|
||||
"type": "js_exception",
|
||||
"visible": True,
|
||||
"order": 0,
|
||||
"name": "Errors"
|
||||
},
|
||||
{
|
||||
"type": "bad_request",
|
||||
"visible": True,
|
||||
"order": 1,
|
||||
"name": "Bad Requests"
|
||||
},
|
||||
{
|
||||
"type": "missing_resource",
|
||||
"visible": True,
|
||||
"order": 2,
|
||||
"name": "Missing Images"
|
||||
},
|
||||
{
|
||||
"type": "click_rage",
|
||||
"visible": True,
|
||||
"order": 3,
|
||||
"name": "Click Rage"
|
||||
},
|
||||
{
|
||||
"type": "dead_click",
|
||||
"visible": True,
|
||||
"order": 4,
|
||||
"name": "Dead Clicks"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"visible": True,
|
||||
"order": 5,
|
||||
"name": "High Memory"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"visible": True,
|
||||
"order": 6,
|
||||
"name": "High CPU"
|
||||
},
|
||||
{
|
||||
"type": "crash",
|
||||
"visible": True,
|
||||
"order": 7,
|
||||
"name": "Crashes"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -134,17 +134,13 @@ def __sbool_to_bool(value):
|
|||
return value.lower() in ["true", "yes", "1"]
|
||||
|
||||
|
||||
def allow_cron():
|
||||
return "allowCron" not in environ or __sbool_to_bool(environ["allowCron"])
|
||||
|
||||
|
||||
def allow_captcha():
|
||||
return environ.get("captcha_server") is not None and environ.get("captcha_key") is not None \
|
||||
and len(environ["captcha_server"]) > 0 and len(environ["captcha_key"]) > 0
|
||||
|
||||
|
||||
def allow_sentry():
|
||||
return "sentry" not in environ or __sbool_to_bool(environ["sentry"])
|
||||
return environ.get("sentryURL") is not None and len(environ["sentryURL"]) > 0
|
||||
|
||||
|
||||
def async_post(endpoint, data):
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
"isEE": "true",
|
||||
"stage": "default-ee",
|
||||
"jwt_issuer": "openreplay-default-ee",
|
||||
"allowCron": "true",
|
||||
"sentry": "false",
|
||||
"sentryURL": "",
|
||||
"pg_host": "127.0.0.1",
|
||||
"pg_port": "9202",
|
||||
|
|
@ -31,24 +29,16 @@
|
|||
"email_plans": "http://127.0.0.1:8000/async/plans/%s",
|
||||
"email_basic": "http://127.0.0.1:8000/async/basic/%s",
|
||||
"assign_link": "http://127.0.0.1:8000/async/email_assignment",
|
||||
"verification_link": "http://127.0.0.1:8000/email/validate/",
|
||||
"verification_success_redirect": "",
|
||||
"verification_fail_redirect": "",
|
||||
"captcha_server": "",
|
||||
"captcha_key": "",
|
||||
"jira_api": "http://127.0.0.1:3000/dev",
|
||||
"github_api": "http://127.0.0.1:4000/dev",
|
||||
"sessions_bucket": "asayer-mobs-staging",
|
||||
"sessions_region": "eu-central-1",
|
||||
"stack_reader": "",
|
||||
"put_S3_TTL": "20",
|
||||
"sourcemaps_bucket": "",
|
||||
"sourcemaps_bucket_key": "",
|
||||
"sourcemaps_bucket_secret": "",
|
||||
"sourcemaps_bucket_region": "",
|
||||
"js_cache_bucket": "",
|
||||
"SIGN_ID": "",
|
||||
"SIGN_KEY": "",
|
||||
"async_Token": "",
|
||||
"EMAIL_HOST": "",
|
||||
"EMAIL_PORT": "587",
|
||||
|
|
|
|||
|
|
@ -870,7 +870,13 @@ def get_weekly_report_config(context):
|
|||
|
||||
@app.route('/{projectId}/issue_types', methods=['GET'])
|
||||
def issue_types(projectId, context):
|
||||
return {"data": issues.get_types(project_id=projectId)}
|
||||
# return {"data": issues.get_types_by_project(project_id=projectId)}
|
||||
return {"data": issues.get_all_types()}
|
||||
|
||||
|
||||
@app.route('/issue_types', methods=['GET'])
|
||||
def all_issue_types(context):
|
||||
return {"data": issues.get_all_types()}
|
||||
|
||||
|
||||
@app.route('/flows', methods=['GET', 'PUT', 'POST', 'DELETE'])
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ def get_by_session_id(session_id, issue_type=None):
|
|||
return helper.list_to_camel_case(cur.fetchall())
|
||||
|
||||
|
||||
def get_types(project_id):
|
||||
def get_types_by_project(project_id):
|
||||
with pg_client.PostgresClient() as cur:
|
||||
cur.execute(
|
||||
cur.mogrify(f"""SELECT type,
|
||||
|
|
@ -70,3 +70,56 @@ def get_types(project_id):
|
|||
WHERE project_id = %(project_id)s) AS types
|
||||
ORDER BY "order";""", {"project_id": project_id}))
|
||||
return helper.list_to_camel_case(cur.fetchall())
|
||||
|
||||
|
||||
def get_all_types():
|
||||
return [
|
||||
{
|
||||
"type": "js_exception",
|
||||
"visible": True,
|
||||
"order": 0,
|
||||
"name": "Errors"
|
||||
},
|
||||
{
|
||||
"type": "bad_request",
|
||||
"visible": True,
|
||||
"order": 1,
|
||||
"name": "Bad Requests"
|
||||
},
|
||||
{
|
||||
"type": "missing_resource",
|
||||
"visible": True,
|
||||
"order": 2,
|
||||
"name": "Missing Images"
|
||||
},
|
||||
{
|
||||
"type": "click_rage",
|
||||
"visible": True,
|
||||
"order": 3,
|
||||
"name": "Click Rage"
|
||||
},
|
||||
{
|
||||
"type": "dead_click",
|
||||
"visible": True,
|
||||
"order": 4,
|
||||
"name": "Dead Clicks"
|
||||
},
|
||||
{
|
||||
"type": "memory",
|
||||
"visible": True,
|
||||
"order": 5,
|
||||
"name": "High Memory"
|
||||
},
|
||||
{
|
||||
"type": "cpu",
|
||||
"visible": True,
|
||||
"order": 6,
|
||||
"name": "High CPU"
|
||||
},
|
||||
{
|
||||
"type": "crash",
|
||||
"visible": True,
|
||||
"order": 7,
|
||||
"name": "Crashes"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -134,17 +134,13 @@ def __sbool_to_bool(value):
|
|||
return value.lower() in ["true", "yes", "1"]
|
||||
|
||||
|
||||
def allow_cron():
|
||||
return "allowCron" not in environ or __sbool_to_bool(environ["allowCron"])
|
||||
|
||||
|
||||
def allow_captcha():
|
||||
return environ.get("captcha_server") is not None and environ.get("captcha_key") is not None \
|
||||
and len(environ["captcha_server"]) > 0 and len(environ["captcha_key"]) > 0
|
||||
|
||||
|
||||
def allow_sentry():
|
||||
return "sentry" not in environ or __sbool_to_bool(environ["sentry"])
|
||||
return environ.get("sentryURL") is not None and len(environ["sentryURL"]) > 0
|
||||
|
||||
|
||||
def async_post(endpoint, data):
|
||||
|
|
|
|||
|
|
@ -26,3 +26,39 @@ env:
|
|||
pg_dbname: postgres
|
||||
pg_user: postgres
|
||||
pg_password: asayerPostgres
|
||||
ch_host: ''
|
||||
ch_port: ''
|
||||
alert_ntf: http://127.0.0.1:8000/async/alerts/notifications/%s
|
||||
email_signup: http://127.0.0.1:8000/async/email_signup/%s
|
||||
email_funnel: http://127.0.0.1:8000/async/funnel/%s
|
||||
email_plans: http://127.0.0.1:8000/async/plans/%s
|
||||
email_basic: http://127.0.0.1:8000/async/basic/%s
|
||||
assign_link: http://127.0.0.1:8000/async/email_assignment
|
||||
captcha_server: ''
|
||||
captcha_key: ''
|
||||
sessions_bucket: asayer-mobs-staging
|
||||
sessions_region: eu-central-1
|
||||
put_S3_TTL: '20'
|
||||
sourcemaps_bucket: ''
|
||||
sourcemaps_bucket_key: ''
|
||||
sourcemaps_bucket_secret: ''
|
||||
sourcemaps_bucket_region: ''
|
||||
js_cache_bucket: ''
|
||||
async_Token: ''
|
||||
EMAIL_HOST: ''
|
||||
EMAIL_PORT: '587'
|
||||
EMAIL_USER: ''
|
||||
EMAIL_PASSWORD: ''
|
||||
EMAIL_USE_TLS: 'true'
|
||||
EMAIL_USE_SSL: 'false'
|
||||
EMAIL_SSL_KEY: ''
|
||||
EMAIL_SSL_CERT: ''
|
||||
EMAIL_FROM: OpenReplay<do-not-reply@openreplay.com>
|
||||
SITE_URL: ''
|
||||
announcement_url: ''
|
||||
jwt_secret: ''
|
||||
jwt_algorithm: ''
|
||||
jwt_exp_delta_seconds: ''
|
||||
S3_HOST: ''
|
||||
S3_KEY: ''
|
||||
S3_SECRET: ''
|
||||
Loading…
Add table
Reference in a new issue