From 335de960d9b3f10dfd12b2972b04d18a86d27201 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Thu, 9 Mar 2023 13:07:25 +0100 Subject: [PATCH 1/4] Skip sign confirmation, and adding chalice liveness probe (#1026) * chore(helm): chalice updating liveness probe * chore(build): Skip confirmation for signing --------- Signed-off-by: rjshrjndrn --- scripts/helmcharts/build_deploy.sh | 1 + scripts/helmcharts/openreplay/charts/chalice/values.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/helmcharts/build_deploy.sh b/scripts/helmcharts/build_deploy.sh index c922878d4..f37f26c94 100644 --- a/scripts/helmcharts/build_deploy.sh +++ b/scripts/helmcharts/build_deploy.sh @@ -10,6 +10,7 @@ docker rmi alpine || true # Signing image # cosign sign --key awskms:///alias/openreplay-container-sign image_url:tag +export COSIGN_YES=true # Skip confirmation export SIGN_IMAGE=1 export PUSH_IMAGE=1 export AWS_DEFAULT_REGION="eu-central-1" diff --git a/scripts/helmcharts/openreplay/charts/chalice/values.yaml b/scripts/helmcharts/openreplay/charts/chalice/values.yaml index 3269aa503..c639d9cbd 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/values.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/values.yaml @@ -121,11 +121,11 @@ affinity: {} healthCheck: livenessProbe: httpGet: - path: / + path: /signup port: 8000 - initialDelaySeconds: 100 - periodSeconds: 15 - timeoutSeconds: 10 + initialDelaySeconds: 120 + periodSeconds: 30 + timeoutSeconds: 15 pvc: From c4ae41b54df4dddd0919fd56cccf94d8f1d2ed46 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 10 Mar 2023 11:45:33 +0100 Subject: [PATCH 2/4] feat(chalice): enhanced helper functions --- api/chalicelib/utils/helper.py | 2 ++ ee/api/chalicelib/core/unlock.py | 3 ++- ee/api/routers/crons/core_dynamic_crons.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/utils/helper.py b/api/chalicelib/utils/helper.py index 369aff40a..62fe6c248 100644 --- a/api/chalicelib/utils/helper.py +++ b/api/chalicelib/utils/helper.py @@ -318,4 +318,6 @@ def get_domain(): def obfuscate(text, keep_last: int = 4): if text is None or not isinstance(text, str): return text + if len(text) <= keep_last: + return "*" * len(text) return "*" * (len(text) - keep_last) + text[-keep_last:] diff --git a/ee/api/chalicelib/core/unlock.py b/ee/api/chalicelib/core/unlock.py index d656edf8a..646cea681 100644 --- a/ee/api/chalicelib/core/unlock.py +++ b/ee/api/chalicelib/core/unlock.py @@ -4,6 +4,7 @@ from os import environ import requests from decouple import config +from chalicelib.utils import helper from chalicelib.utils.TimeUTC import TimeUTC @@ -22,7 +23,7 @@ def check(): environ["expiration"] = "-1" environ["numberOfSeats"] = "0" return - print(f"validating: {license}") + print(f"validating: {helper.obfuscate(license)}") r = requests.post('https://api.openreplay.com/os/license', json={"mid": __get_mid(), "license": get_license()}) if r.status_code != 200 or "errors" in r.json() or not r.json()["data"].get("valid"): print("license validation failed") diff --git a/ee/api/routers/crons/core_dynamic_crons.py b/ee/api/routers/crons/core_dynamic_crons.py index 0ea096546..5d13c90d1 100644 --- a/ee/api/routers/crons/core_dynamic_crons.py +++ b/ee/api/routers/crons/core_dynamic_crons.py @@ -26,7 +26,7 @@ def unlock_cron() -> None: cron_jobs = [ - {"func": unlock_cron, "trigger": "cron", "hour": "*"}, + {"func": unlock_cron, "trigger": CronTrigger(day="*")}, ] SINGLE_CRONS = [{"func": telemetry_cron, "trigger": CronTrigger(day_of_week="*"), From f93627901af026219582519163175d31c11d1223 Mon Sep 17 00:00:00 2001 From: Jacob Martin Date: Mon, 13 Mar 2023 09:48:53 -0700 Subject: [PATCH 3/4] Fix invalid yaml errors in openreplay chart (#1031) * fix duplicate restartPolicy yaml error in openreplay chart * hard-code efs-cleaner to alpine --- .../openreplay/charts/utilities/templates/efs-cron.yaml | 2 -- scripts/helmcharts/openreplay/charts/utilities/values.yaml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml b/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml index 31b6caea8..a2a6967ca 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml +++ b/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml @@ -26,7 +26,6 @@ spec: containers: - name: efs-cleaner image: alpine - image: "{{ tpl .Values.efsCleaner.image.repository . }}:{{ .Values.efsCleaner.image.tag | default .Chart.AppVersion }}" command: - /bin/sh - -c @@ -44,7 +43,6 @@ spec: volumeMounts: - mountPath: /mnt/efs name: datadir - restartPolicy: Never {{- if eq (tpl .Values.efsCleaner.pvc.name . ) "hostPath" }} volumes: - name: datadir diff --git a/scripts/helmcharts/openreplay/charts/utilities/values.yaml b/scripts/helmcharts/openreplay/charts/utilities/values.yaml index 97ee29798..6be201fba 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/values.yaml +++ b/scripts/helmcharts/openreplay/charts/utilities/values.yaml @@ -5,10 +5,6 @@ replicaCount: 1 efsCleaner: - image: - repository: "{{ .Values.global.openReplayContainerRegistry }}/alpine" - pullPolicy: Always - tag: 3.16.1 retention: 2 pvc: # This can be either persistentVolumeClaim or hostPath. From 421192486b7cebfc8235119f96f44e21d3ceb38a Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 13 Mar 2023 18:30:02 +0100 Subject: [PATCH 4/4] fix(ui) - check for login on redirect --- frontend/app/Router.js | 2 -- frontend/app/components/Login/Login.js | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 662a7a7a7..81fcaefc3 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -120,8 +120,6 @@ class Router extends React.Component { super(props); if (props.isLoggedIn) { this.fetchInitialData(); - } else { - props.fetchTenants(); } } diff --git a/frontend/app/components/Login/Login.js b/frontend/app/components/Login/Login.js index b51970036..05702a2fe 100644 --- a/frontend/app/components/Login/Login.js +++ b/frontend/app/components/Login/Login.js @@ -11,6 +11,7 @@ import cn from 'classnames'; import { setJwt } from 'Duck/user'; import LoginBg from '../../svg/login-illustration.svg'; import { ENTERPRISE_REQUEIRED } from 'App/constants'; +import { fetchTenants } from 'Duck/user'; const FORGOT_PASSWORD = forgotPassword(); const SIGNUP_ROUTE = signup(); @@ -24,7 +25,7 @@ export default authDetails: state.getIn(['user', 'authDetails']), params: new URLSearchParams(props.location.search), }), - { login, setJwt } + { login, setJwt, fetchTenants } ) @withPageTitle('Login - OpenReplay') @withRouter @@ -37,6 +38,7 @@ class Login extends React.Component { componentDidMount() { const { params } = this.props; + this.props.fetchTenants(); const jwt = params.get('jwt'); if (jwt) { this.props.setJwt(jwt);