Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3748942
D2920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D2920.diff
View Options
diff --git a/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py b/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
--- a/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
+++ b/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
@@ -53,13 +53,21 @@
return "{0:s}/{1:d}".format(base, netmask_bits)
-def read_secret(key):
+def read_secret(mount_point, prefix, key):
secret = vault_client.secrets.kv.read_secret_version(
- mount_point="ops", path="secrets/" + key
+ mount_point=mount_point, path=prefix + "/" + key
)
return secret["data"]["data"]
+def read_ops_secret(key):
+ return read_secret("ops", "secrets", key)
+
+
+def read_app_secret(key):
+ return read_secret("apps", "sentry", key)
+
+
# -------------------------------------------------------------
# Authenticate to Vault
#
@@ -84,7 +92,7 @@
INTERNAL_SYSTEM_IPS = (get_internal_network(),)
-secret = read_secret("{{ args.credentials.postgresql }}")
+secret = read_ops_secret("{{ args.credentials.postgresql }}")
DATABASES = {
"default": {
"ENGINE": "sentry.db.postgres",
@@ -103,6 +111,7 @@
# General
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+REALM = "{{ realm }}"
SENTRY_SINGLE_ORGANIZATION = False
@@ -110,7 +119,7 @@
env("SENTRY_EVENT_RETENTION_DAYS", "90")
)
-secret_key = read_secret("{{ args.credentials.secret_key }}")
+secret_key = read_ops_secret("{{ args.credentials.secret_key }}")
SENTRY_OPTIONS["system.secret-key"] = secret_key["password"]
GEOIP_PATH_MMDB = "/usr/local/share/geoip/GeoLite2-City.mmdb"
@@ -254,6 +263,19 @@
SENTRY_OPTIONS["mail.from"] = "{{ args.email_from }}"
+# -------------------------------------------------------------
+# Integration - GitHub
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+if REALM == "nasqueron":
+ secret = read_app_secret("github")
+ for k, v in secret.items():
+ if k == "id":
+ v = int(v)
+ SENTRY_OPTIONS["github-app." + k] = v
+
+
# -------------------------------------------------------------
# Features
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/vault/policies/files/sentry.hcl b/roles/vault/policies/files/sentry.hcl
--- a/roles/vault/policies/files/sentry.hcl
+++ b/roles/vault/policies/files/sentry.hcl
@@ -13,6 +13,10 @@
# and will be lost if the state is redeployed.
# </auto-generated>
+path "apps/data/sentry/github" {
+ capabilities = [ "read" ]
+}
+
path "ops/data/secrets/nasqueron.sentry.app_key" {
capabilities = [ "read" ]
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 11:35 (22 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249303
Default Alt Text
D2920.diff (2 KB)
Attached To
Mode
D2920: Integrate Sentry and GitHub
Attached
Detach File
Event Timeline
Log In to Comment