From 9118ccfe581b7db5bfff28831fbded9d5380776d Mon Sep 17 00:00:00 2001 From: Alex Burnett <145339794+elburnetto-intapp@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:23:32 +0000 Subject: [PATCH] Allow custom values for Self Hosted Clusters (Slugs, Titles, Region) (#4121) # What this PR does Allows for environment variables to be set on Grafana OnCall Engine for Self Hosted users, giving them the ability to set values for Stack Slug, Org Slug/Title, Region & Cluster Slugs. This will mean then using the Grafana OnCall App, when adding multiple OSS Stacks, you can set the correct value of 'stack_slug' so you can differentiate between the stacks in the App. ## Which issue(s) this PR closes Closes [#4119](https://github.com/grafana/oncall/issues/4119) ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes. Co-authored-by: Joey Orlando --- engine/settings/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/settings/base.py b/engine/settings/base.py index 55b842e1..729d3ef7 100644 --- a/engine/settings/base.py +++ b/engine/settings/base.py @@ -736,13 +736,13 @@ GRAFANA_CLOUD_AUTH_API_SYSTEM_TOKEN = os.environ.get("GRAFANA_CLOUD_AUTH_API_SYS SELF_HOSTED_SETTINGS = { "STACK_ID": 5, - "STACK_SLUG": "self_hosted_stack", + "STACK_SLUG": os.environ.get("SELF_HOSTED_STACK_SLUG", "self_hosted_stack"), "ORG_ID": 100, - "ORG_SLUG": "self_hosted_org", - "ORG_TITLE": "Self-Hosted Organization", - "REGION_SLUG": "self_hosted_region", + "ORG_SLUG": os.environ.get("SELF_HOSTED_ORG_SLUG", "self_hosted_org"), + "ORG_TITLE": os.environ.get("SELF_HOSTED_ORG_TITLE", "Self-Hosted Organization"), + "REGION_SLUG": os.environ.get("SELF_HOSTED_REGION_SLUG", "self_hosted_region"), "GRAFANA_API_URL": os.environ.get("GRAFANA_API_URL", default=None), - "CLUSTER_SLUG": "self_hosted_cluster", + "CLUSTER_SLUG": os.environ.get("SELF_HOSTED_CLUSTER_SLUG", "self_hosted_cluster"), } GRAFANA_INCIDENT_STATIC_API_KEY = os.environ.get("GRAFANA_INCIDENT_STATIC_API_KEY", None)