From 5e81472fcbd0c7372e5e9dd6592a7a611a9c1b7f Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Tue, 18 Jun 2024 11:57:03 -0400 Subject: [PATCH 1/2] Add billing enabled Helm value and add to /settings --- backend/btrixcloud/main.py | 1 + backend/test/test_settings.py | 1 + chart/templates/configmap.yaml | 2 ++ chart/values.yaml | 2 ++ 4 files changed, 6 insertions(+) diff --git a/backend/btrixcloud/main.py b/backend/btrixcloud/main.py index 04bcec4db..c47c19019 100644 --- a/backend/btrixcloud/main.py +++ b/backend/btrixcloud/main.py @@ -68,6 +68,7 @@ def main(): ), "maxPagesPerCrawl": int(os.environ.get("MAX_PAGES_PER_CRAWL", 0)), "maxScale": int(os.environ.get("MAX_CRAWL_SCALE", 3)), + "billingEnabled": is_bool(os.environ.get("BILLING_ENABLED")), } invites = init_invites(mdb, email) diff --git a/backend/test/test_settings.py b/backend/test/test_settings.py index a15f012ee..0796ea540 100644 --- a/backend/test/test_settings.py +++ b/backend/test/test_settings.py @@ -16,4 +16,5 @@ def test_settings(): "maxPagesPerCrawl": 4, "maxScale": 3, "defaultPageLoadTimeSeconds": 120, + "billingEnabled": False, } diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml index dfd6bd930..db85c3a37 100644 --- a/chart/templates/configmap.yaml +++ b/chart/templates/configmap.yaml @@ -58,6 +58,8 @@ data: MAX_CRAWLER_MEMORY: "{{ .Values.max_crawler_memory }}" + BILLING_ENABLED: "{{ .Values.billing_enabled }}" + --- apiVersion: v1 kind: ConfigMap diff --git a/chart/values.yaml b/chart/values.yaml index a8f7c2425..d144422fe 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -110,6 +110,8 @@ job_memory: "70Mi" profile_browser_idle_seconds: 60 +billing_enabled: false + # if set, print last 'log_failed_crawl_lines' of each failed # crawl pod to backend operator stdout # mostly intended for debugging / testing From bc76957c5d9cfe4e9abac0c34a8adaaf225b3717 Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Tue, 18 Jun 2024 11:58:57 -0400 Subject: [PATCH 2/2] Add sales email to helm chart and /settings --- backend/btrixcloud/main.py | 1 + backend/test/test_settings.py | 1 + chart/templates/configmap.yaml | 2 ++ chart/values.yaml | 1 + 4 files changed, 5 insertions(+) diff --git a/backend/btrixcloud/main.py b/backend/btrixcloud/main.py index c47c19019..bdc3e7476 100644 --- a/backend/btrixcloud/main.py +++ b/backend/btrixcloud/main.py @@ -69,6 +69,7 @@ def main(): "maxPagesPerCrawl": int(os.environ.get("MAX_PAGES_PER_CRAWL", 0)), "maxScale": int(os.environ.get("MAX_CRAWL_SCALE", 3)), "billingEnabled": is_bool(os.environ.get("BILLING_ENABLED")), + "salesEmail": os.environ.get("SALES_EMAIL"), } invites = init_invites(mdb, email) diff --git a/backend/test/test_settings.py b/backend/test/test_settings.py index 0796ea540..2a0425ba8 100644 --- a/backend/test/test_settings.py +++ b/backend/test/test_settings.py @@ -17,4 +17,5 @@ def test_settings(): "maxScale": 3, "defaultPageLoadTimeSeconds": 120, "billingEnabled": False, + "salesEmail": "sales@webrecorder.org", } diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml index db85c3a37..754b09dd2 100644 --- a/chart/templates/configmap.yaml +++ b/chart/templates/configmap.yaml @@ -60,6 +60,8 @@ data: BILLING_ENABLED: "{{ .Values.billing_enabled }}" + SALES_EMAIL: "{{ .Values.sales_email }}" + --- apiVersion: v1 kind: ConfigMap diff --git a/chart/values.yaml b/chart/values.yaml index d144422fe..c739f8fcd 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -111,6 +111,7 @@ job_memory: "70Mi" profile_browser_idle_seconds: 60 billing_enabled: false +sales_email: "sales@webrecorder.org" # if set, print last 'log_failed_crawl_lines' of each failed # crawl pod to backend operator stdout