Skip to content

Commit

Permalink
Merge pull request #2 from fogbender/feature--smtp-alerts
Browse files Browse the repository at this point in the history
Alerts
  • Loading branch information
mkurkov authored Sep 16, 2024
2 parents 44ba8ba + 8f8fb6b commit 864a25b
Show file tree
Hide file tree
Showing 30 changed files with 2,223 additions and 461 deletions.
18 changes: 16 additions & 2 deletions infra/modules/grafana-template.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ param location string = resourceGroup().location
param env string
param supafanaDomain string
param supabaseProjectRef string
param supabaseProjectName string
param supabaseServiceRoleKey string
param smtpHost string
param smtpUser string
param smtpPassword string
param smtpFromAddress string
@secure()
param grafanaPassword string

Expand All @@ -13,7 +18,7 @@ param grafanaSubnetName string = 'supafana-${env}-grafana-subnet'
param commonResourceGroupName string = 'supafana-common-rg'
param imageGalleryName string = 'supafanasig'
param imageName string = 'grafana'
param imageVersion string = '0.0.5'
param imageVersion string = '0.0.13'

param projectId string = supabaseProjectRef

Expand All @@ -27,6 +32,8 @@ var networkInterfaceName = '${vmName}-nic'

param privateDnsZoneName string = 'supafana-${env}.local'

var smtpFromName = 'Grafana alerts for ${supabaseProjectName}'

var customDataRaw = format('''
#cloud-config
write_files:
Expand All @@ -36,8 +43,15 @@ write_files:
GF_SERVER_ROOT_URL=https://{3}/dashboard/{2}
GF_SERVER_SERVE_FROM_SUB_PATH=true
GRAFANA_PASSWORD={4}
GF_SMTP_ENABLED=true
GF_SMTP_HOST={5}
GF_SMTP_USER={6}
GF_SMTP_PASSWORD={7}
GF_SMTP_FROM_ADDRESS={8}
GF_SMTP_FROM_NAME={9}
SUPABASE_PROJECT_NAME={10}
path: /var/lib/supafana/supafana.env
''', supabaseProjectRef, supabaseServiceRoleKey, projectId, supafanaDomain, grafanaPassword)
''', supabaseProjectRef, supabaseServiceRoleKey, projectId, supafanaDomain, grafanaPassword, smtpHost, smtpUser, smtpPassword, smtpFromAddress, smtpFromName, supabaseProjectName)

resource vnet 'Microsoft.Network/virtualNetworks@2021-05-01' existing = {
name: virtualNetworkName
Expand Down
8 changes: 6 additions & 2 deletions infra/secrets/supafana-absdev1.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ STRIPE_SECRET_KEY=ENC[AES256_GCM,data:F9PGDFuDGa0RXLTseKbjtof/8fytgn1ranSeNw4TZO
STRIPE_PRICE_ID=ENC[AES256_GCM,data:4tMJqku3zF/FI8yTdV3InKQy+MDSusCtloGnM400lko=,iv:+5xJgKWqMOBC5C0daV6qZaGoONKAnSyKIGEIHnCKYQQ=,tag:6e/Pz52iDTE2TypD/L+K0w==,type:str]
SUPAFANA_AZURE_TENANT_ID=ENC[AES256_GCM,data:AU7MFFvgB4gdb+yHADeL9qWxZMazRAplNqzCpcGPZpit7tjddcY=,iv:VecaWNabawmd+4LRmUCwEw4Ql9FoG4lumA3pHKkcRm8=,tag:bz5NJwVrgZMxtq9V/GhE2w==,type:str]
SUPAFANA_AZURE_SUBSCRIPTION_ID=ENC[AES256_GCM,data:xi7PMVajtfU1FXfRmfaIUReDpt206iyWWxt4EAG36UwfinmBe6I=,iv:ZZ0L/Fx94RC6CbfaeaIkCavBRlH+XBWzAProfkbFg2k=,tag:tq463QBsEemui1HG9T7WWg==,type:str]
SMTP_HOST=ENC[AES256_GCM,data:zqqDBY8l+jf7Q7VV9ZqrPvpan/O3+sV5QTjwmANSYLot/1ZhghRC6A0=,iv:W4/cTo4Ys5atsBCO6/KNJlz7FdIYafp7CsOXzJgQkI8=,tag:H9KpIQOmRl+lKq9hx5dGpg==,type:str]
SMTP_USER=ENC[AES256_GCM,data:SYAaPh9CX+C5MywlEnD5C3zrC5nTyg==,iv:jdB/U9OD0L1XVKpBUG190Zfw6tDz8xRedbj7RGZxnE0=,tag:UxZG8Os83gqSQZeAm+r7EA==,type:str]
SMTP_PASSWORD=ENC[AES256_GCM,data:UisslpYl/y5vOnBr7uqE1gyT08XHR8wHnIt3K5wocNxRRwD02M1geRE5uxeXmg==,iv:R726lsmsYzhqIymp7YJ7lZM8/Kbw+JZX3vOnQTsQ5W0=,tag:OStkDbYhdwVxKmVv6U4ztA==,type:str]
SMTP_FROM_ADDRESS=ENC[AES256_GCM,data:Ey1USM7/xl1w4NIEQLSnSNUcWoRLQBCjKhC5,iv:GxRdYI548M8Lut5ByVGU2uw+WgRiizvC23j1JlJusb8=,tag:smxJnTuncCnFm+ESnQyUhw==,type:str]
sops_azure_kv__list_0__map_created_at=2024-08-18T11:00:17Z
sops_azure_kv__list_0__map_enc=AfDvX65YS0aBsDY_ES7t8Iv5S2F3z48Gjvbu6iTK09B20db8tnhcEh-WcWFFuPzUJzYp1eliRD_J6TPHqloIFw26kNjizNz-OqUttQmyTwdROsD9WnpIM4XBIDxWv88sYl3h_GCkZrRsx8zaBDWBQALt5kL8_wRvNIHm0Pt1QL9iCbyiHsISgfe_Psg45zyiPI-IyeHeb9_4MlZjVKPdcn6O3JsmLJrNaPe2f0tBrIgRu7y0kQdqtsHcjUsV0DandG2tylSgTVOkYjzgvKTena09DJQ7iIqN5kLZuayE76vuGE7Wk_7aU3-yIx_Z9Ip6NNEj3T8qZqWjTbvkqsaF-A
sops_azure_kv__list_0__map_name=sops-key
sops_azure_kv__list_0__map_vault_url=https://supafana-absdev1-vault.vault.azure.net
sops_azure_kv__list_0__map_version=bacf2c0de40e4c5e9423f8b27e92381d
sops_lastmodified=2024-08-18T11:00:20Z
sops_mac=ENC[AES256_GCM,data:NN/S8iYCtUO/AwDPtj+LIzy3mX5f4M/nCYQ0oOGwsh7heNxq0PJ79ED1X3sweEX3Uk+IB2ZhEZx1ND6547TVckY68Qc7mT2GvRKtKYOmTZQ1GYyc0M8PD2PL8zYHh1XBUJC5pyNWj3KzLnZpA9q9w46ziCGu63ak2RzRZrYfaqQ=,iv:do3Uernjw0H7lfJpXkku8Id/Rm22tfVTOsqKsrMOnMg=,tag:OY6pvRUgvUXb6qvhiqtxXQ==,type:str]
sops_lastmodified=2024-09-12T23:46:25Z
sops_mac=ENC[AES256_GCM,data:xjb8ETZ642Ms+PUWQYbl7heFjXG/rpBh7K+PQetwkBLKHwqRv+Nrck9WILm+ui8508cJiKuJDIFwusRI+x8YaYcxlncxGLWZOpfnFrblVsSDKFAklGIfkvt0TLO6W16FKVWixvdHeevqAz/+QcLaeK4Q+VOqwHbAzq5wtr/NaKw=,iv:29+lKPmmAZS9ZcyTVj9RhNoZsUEMw1q70NR026V9Dms=,tag:3PWpksbisR1knhwBgw7aOQ==,type:str]
sops_unencrypted_suffix=_unencrypted
sops_version=3.8.1
8 changes: 6 additions & 2 deletions infra/secrets/supafana-kndev.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ SUPAFANA_AZURE_CLIENT_ID=ENC[AES256_GCM,data:e0AkWtPySfe/saS0dtKrgbB3rundL2dcKXr
SUPAFANA_AZURE_CLIENT_SECRET=ENC[AES256_GCM,data:01qApafs0tw664rHEKZqb0FEu8jYi8m8HGnvdfd56ugjaJKWQo/CpBgG,iv:zgeXF75XGumZIPRLYhhafRiIe7ysSgE4/ko0ep2i+nM=,tag:0GMT3HxV6A1fOQkh5kW2+A==,type:str]
SUPAFANA_AZURE_TENANT_ID=ENC[AES256_GCM,data:/wQhk5MSjXpRhOaBPVRIXHZ+fgs37PpP2Cgj2rsBkQMtrpzIpHY=,iv:9FA5ls0fnKzr5VRE+MBZ/oSKvNrCRxMNsdjFp5OMq44=,tag:l+NAQpY6lEB6Fubldaat7Q==,type:str]
SUPAFANA_AZURE_SUBSCRIPTION_ID=ENC[AES256_GCM,data:tgPYTQsPxAMxU9rfaUL1O2LT5TznbC4XNNljHegSqae4CulI0S0=,iv:Tne78fps2giXqzDVAJh+TYTbRbxjqMC/QyGcMvgtBAs=,tag:OZ1c0l0o9vHrxaSF+YRB1w==,type:str]
SMTP_HOST=ENC[AES256_GCM,data:WSnxJaazew99wrE/aXzP6HTXtfqyoAcufS77LVsyx+6B2k2bRIR/Ggs=,iv:6C4A7Z/a/Yk/ZX2hazK/RJEe4MmCs0wtDfElxnWlWzY=,tag:IgRcb+HFG3z+xDP3V+U/ug==,type:str]
SMTP_USER=ENC[AES256_GCM,data:8Ud5ALDFErKvGAjb6LIF2mFuVPG18w==,iv:olvXs4X4ddVwUrKxlUODIgfZtsDXAacvhyek7y495CY=,tag:ZupXrs16MrkJMbSUAn+ssw==,type:str]
SMTP_PASSWORD=ENC[AES256_GCM,data:0qt6ej+tyxtRe4iXnFWSD8FA/q6b1cfCO866JOvrmMOd0stFpWVTJ79l5WJ/3g==,iv:vC00imZGRP9PKY8XxEEYNX8PKJLNRPBj7oTwyzt3v5w=,tag:nxqjxWUR4hFNSsfA7SqyzQ==,type:str]
SMTP_FROM_ADDRESS=ENC[AES256_GCM,data:8lP9qDDFEDuRUOBV3CBnSXzJFgz6hVyRtGbO,iv:w6gRR4h42kuxLD8igGUieyi08aO0xNG/YDRGb6bEU4s=,tag:Qz4egfP5tCvGZJInGBN4+A==,type:str]
sops_azure_kv__list_0__map_created_at=2024-08-14T17:30:18Z
sops_azure_kv__list_0__map_enc=R6TjugB40dZYEPKwJMi9sdOUj1c_vC5YMbpdoZnAogwL5PD98P8irzBDVvjB9KGEVzF3UyHg6wOPnphkAteBpgaAUu51buViNCykIpHT-PFDFSPu441SYAOcA8rRpxX1hs-hdLXRyUMMFLrSNxJxYXSd4VHDRLUWbXYE-de8NjV1ac-9PVOmt5Kq4aim7O-_S3qRKyYiMQ7G83zeUnrZBjOuY-jsbpdkFzHjd_4IFhW_cTW-BtwSXsSAwwyrMqaiO9VOTHliFbb-JLLKG7sWI6IQiNWB5uB8p_pjmUi1Xq95BeAas7Cl91d7qvMidE6Of5caaWJOavbkjRsAP8iqBg
sops_azure_kv__list_0__map_name=sops-key
sops_azure_kv__list_0__map_vault_url=https://supafana-kndev-vault.vault.azure.net
sops_azure_kv__list_0__map_version=f3d8dc8cd993493a86e924eba85255c4
sops_lastmodified=2024-08-14T17:30:22Z
sops_mac=ENC[AES256_GCM,data:XUFlEVgrcnHMGJ6+lvw+TEh1l5XSKkZVXhQs65PJZR9N0Bq71vW9DgwGx4pygZgy0Cx/YRXC1eA0QyjxIbtWdFdB3+AbI13wYHu6YloovwfKlyXwiRPhOW6ClpttSo7HLRs0VhXIoYiB/pJckAhKXQvDfl2Z1OmYQjgAm7LZrt8=,iv:T0AJYhxlJo00Q4oQ++Le/UuR8S6GD9RTYS6eYG6XWuE=,tag:tmwmZGioYLIGEIdPEaoaDA==,type:str]
sops_lastmodified=2024-09-16T05:46:40Z
sops_mac=ENC[AES256_GCM,data:ywxNfOvHfIq5IrKwZtIuTKE2HIyrVvLprmcQtaruNPo3xAs7YJZ21i+5S5aL++SJK6cIZfSGl3+uwiDOmWN4kBG/qgLCljxALRXxsTCOn3eVB4/iddSdXYccnESU/XqvOLAZ/ULCUV0wjHcXhy6+SAWlYb+cWLN2+nji6QPPgbc=,iv:0Jtc6uYvHpiI6cQrgLCdAkrcXfsWpMCoW60yHu5OL9I=,tag:8oS0zvk1nHkK5J2Ze2U3Ew==,type:str]
sops_unencrypted_suffix=_unencrypted
sops_version=3.8.1
8 changes: 6 additions & 2 deletions infra/secrets/supafana-mkdev.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ STRIPE_SECRET_KEY=ENC[AES256_GCM,data:owJKZJmlu0JIhky8AsWgLUMPHpulZg1KW0iKYxeFSd
STRIPE_PRICE_ID=ENC[AES256_GCM,data:SjGMWbiz8ttkFUsQuPQk3P+qw28x4iEwFhRdEmjFyPI=,iv:8nIT+xocI5YeGJkiobQlQQi6m8dcgEs4vShxaQs4luI=,tag:DFRnBN0iXU/8SZAQqRAZjw==,type:str]
SUPAFANA_AZURE_TENANT_ID=ENC[AES256_GCM,data:wxllgOWAZIQZREq7/OtijLylcLVSGe4LsV194mBfA7lr6WgXaQI=,iv:1PCDdHSaZZ2GRgWmEKc8Hp9sXcu9jqKtslm5cS/wV9k=,tag:udVqyy0hmhwsGTGy3SX8Gw==,type:str]
SUPAFANA_AZURE_SUBSCRIPTION_ID=ENC[AES256_GCM,data:0c9/C37pDm/zIA1Qz24le0Aa+NprK6oK7PZ6NIJ2Mk3vRkGlPJ8=,iv:KSmLq2smDhAlEWBFfu8Il6jzSJChGZ2s47XlAylaLEU=,tag:TyuvMNei9czb+qxeGMiRuA==,type:str]
SMTP_HOST=ENC[AES256_GCM,data:7BT+Pfn/crshXame58bwoOx9fFmZO5gchKhtY/Q+sb73/P+NnqMsx7U=,iv:5h5rE6TZaLa92x27jhXSgPv5sUG0buFjGS+DjXw4Gpk=,tag:W89kWDuHjB3V3rXpRxiu3Q==,type:str]
SMTP_USER=ENC[AES256_GCM,data:wwJsgAND2WxKJPgDVdfJ0VXLygxSsA==,iv:reyXnWq+F3RHc/ngdffR/jwbXwMeWltoIJKYbv5pXeA=,tag:89AF/Cxp5duz7c/eZMiwRw==,type:str]
SMTP_PASSWORD=ENC[AES256_GCM,data:dJpeMxHvtx/hnGH8OueLS7rCA4PbFr4hEFD97lcF0jA177VQKhTnNv7iO50mtQ==,iv:WkUpRWkD9ppvyfj0aDzRW4VX3irLQqzS2dAY3+96jyY=,tag:cwXU1+yrTlBkg+UuVpK4hw==,type:str]
SMTP_FROM_ADDRESS=ENC[AES256_GCM,data:sm1jesf9UH5e+7NHdIsTP80aB1aFc99WevED,iv:zHj5C88VkOnPBdE0oVM6C7zEqqjTJAXQ+2PHivQEK7E=,tag:Z83gp/3GgyH8pibRCS4zdA==,type:str]
sops_azure_kv__list_0__map_created_at=2024-08-02T15:52:18Z
sops_azure_kv__list_0__map_enc=CUwnn1KGEukhxQy9cnhnkoEYREFLK8kbvxevtsZLzt2A3P55mJLmufy7FxQ3nXgDn-ZCAwQZujsYYpPYRWBQAZuUHprTUjyOn9dAet5h7ywManarMVtIVz7m97o58U2Arsh9u_EDfdelNstvk6yCm5XYZI1wvLtZn748BwxLoyEaJ3IypDwC5XN5F13a_dGzjLpXH4q_xiSKKlbwMvVkBi4mbV4bE2Mmh_4Vo4GHx-FvfwU2ndEa4ICLQBjb_qG4rk4wqZHxGCT5cu3GexCHr0aOvgbHzJcZAbanxhcYy0FhKWKqbMn_b36SCAr8LcvJqY8HZA0H2cjpJ4rs2rEB4w
sops_azure_kv__list_0__map_name=sops-key
sops_azure_kv__list_0__map_vault_url=https://supafana-mkdev-vault.vault.azure.net
sops_azure_kv__list_0__map_version=ca3be5c0b9c14439a2b149037133b193
sops_lastmodified=2024-08-15T16:15:09Z
sops_mac=ENC[AES256_GCM,data:KawqxrtFqojoSLAja1VpfEShIYT8CW3pYvmwiX2lhxIUmg66tcBZMALH0XZGI6H6Q8I7S7MMcWJ3rADja6vUI4AHD+QJZHh3kOr6p5QM0G+IXTzET+TVw2nXS2MtLanm+HSX6A1HfwFoM0YUKRGnrlreUtz3HrOo1u8pU2CKCRI=,iv:1FuDoKRJDhjTPUV159Hfuv9pcnU05nHgBUVJVB4Ej9M=,tag:6s7Z5N/+iIpaaGMNvF68gg==,type:str]
sops_lastmodified=2024-09-16T05:47:00Z
sops_mac=ENC[AES256_GCM,data:zEb4TY397WAfOJxW9RoYbfj7wGhhGcP1Cg7XxSiTfcGlA8qkSH8Sglx/qx4P3+pnZT0E+XJzduPDRvbz3f6T6TQkeS6TsQf7bLlgbqMfcnjKjiN8v+1Nl3B0uO5tx35teBTK3HYf17Pvg3IAtVlq74D2owx3y0bxPeLFuIVqlzQ=,iv:xtv+4n7UFMdmRl2IVrC8DNKB3Ym7ynbl+GDYztmOrnA=,tag:BFWrBmijUMPtAKryFtccvA==,type:str]
sops_unencrypted_suffix=_unencrypted
sops_version=3.8.1
8 changes: 6 additions & 2 deletions infra/secrets/supafana-prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ STRIPE_SECRET_KEY=ENC[AES256_GCM,data:zAODgk4php8c/Bi4Q2RnluH5EBYWZhtq6+qCmGIDY3
STRIPE_PRICE_ID=ENC[AES256_GCM,data:J9N7djRGfmzm2dXQEaM/4AlWSnDrq//AmCJHJ2bIQLM=,iv:hfq2se/zE87waBMT4srVNEaN1MkgIGPlzhCpLk98z54=,tag:QvE6uxQAbQ2F8blxxT7bUg==,type:str]
SUPAFANA_AZURE_TENANT_ID=ENC[AES256_GCM,data:N8gHBbAUtdXpYkIvivcoSnwJ28aRspVuKlsbqnvsBjnPYCFAOM0=,iv:nTmT80vjMLBoH7/tQpcC4jkN1Ye1jK4f/uTGGls/54Q=,tag:HF03BMlaISZ+1vF12A8MzQ==,type:str]
SUPAFANA_AZURE_SUBSCRIPTION_ID=ENC[AES256_GCM,data:hqzHusHv+g8BAgJWPMo8AyvL9tIv25kMC0FO8wJwL06YrGNG9us=,iv:ft1y1fmzs9o2QvLUNW7MBzv/xX0cgIjvEI98B2AYtcA=,tag:W2+MyaAjGJhJgKozs1Rdbg==,type:str]
SMTP_HOST=ENC[AES256_GCM,data:W6nCzjGOpd7Gp3VAIBbOROeAhqRIM0VXUwoYnNwVrwmeLJ/Oa4Gtq6k=,iv:YgZqQ2LYUr9FflMcry3ppeKVJIiKQzTLc8a+EaNLRwE=,tag:cfX2ku7Bkjau5auGmPUaog==,type:str]
SMTP_USER=ENC[AES256_GCM,data:ExV+it7Xzpw5AJm72a3aojDO8sWksA==,iv:SxVi/Gw023ZCm8LujhQDhr2Vo1Ev/W1/bfIH+RBHhJ8=,tag:ngte5pPlWtmiXbsQwHXl/g==,type:str]
SMTP_PASSWORD=ENC[AES256_GCM,data:93g7oYYyM1HBpXUpzHd+0jB5bZnN8zGqPLyF/fD/kvzeN2De5hHGajkfkekLoA==,iv:/rck0HRZpjRJqUck8HvulWXqTwsetJ5QsFEQ49V/XFc=,tag:FF+c+Cewwx8Tf8U/nOFKog==,type:str]
SMTP_FROM_ADDRESS=ENC[AES256_GCM,data:cpLiAFot0FH7iwTSxkFjKuYr/5Dofqne1uVW,iv:Wuf1vHIqLjF1iE0P/HA47gCbyX4Zi3xMtFaaa5NSrn4=,tag:7PUcteq03/Az3sKVVNCOTw==,type:str]
sops_azure_kv__list_0__map_created_at=2024-08-18T14:52:41Z
sops_azure_kv__list_0__map_enc=nhzmifiW9JMx6ladg8OrJQMMyU116XjpD9OK1rIhPv5TN4wNA91H3_KIGIvueDJB7W8SajqmM2urGFITkmQ_4Lan4YSobHZpLHyfO1KnMebxHPeYL9YBNxAd_zNxlB9xhSH-mBV7SLYea51pyNAymt_S6eb7M9BEIq3N-9TMYKhtCYhqtv7z2ywWIptpnn-cbkuriiduw8ZiCXjKWlteI3eFUDN55KqT3-dnFltuaKIHj1pelHR3m7xsPRkG8w20EaYCYtu6pWTaTf4vkJXCQ_5BIeiPfFy16ikrzN70rtu-hqv3TCJVgsl5FUh-MJzdvsvB5rxpzTZGynxu_CWpOA
sops_azure_kv__list_0__map_name=sops-key
sops_azure_kv__list_0__map_vault_url=https://supafana-prod-vault.vault.azure.net
sops_azure_kv__list_0__map_version=a2b94928dca54f3e9444e0b39a9ac79e
sops_lastmodified=2024-08-18T19:23:14Z
sops_mac=ENC[AES256_GCM,data:NoqE8YD+5BMvwQggpt7OrWswT+KE6HdhNogn+nCdymsiieVEcVZDnQEZw/cP/xpoCISE1gLDK+m16wQ1b0Gb/8Ej8kJDmB9lq73nMA9jsCHyKhzli3iM+4/F7C6JCVcO74e20mV/CVTWQe8b4XTZcm/WNB1COW9Lf4yhls+pk9E=,iv:SMQSTvz+C1p6DoVsm6wbnDU7l4Y1xccWwa1joJdVJXc=,tag:MCWl7n6h8QVtYcMIMOs0Zw==,type:str]
sops_lastmodified=2024-09-16T05:46:23Z
sops_mac=ENC[AES256_GCM,data:/beZ1DLZj089yYJvK1D6BX4pVVPO6CHZxbNUPzbAMAcpPvKr+yhXjNRPqC9+ZyTfsY5aibNk9jl46p4V+8GHyhsBALfxcRcZRfGDSTu+CgI4JowNgannLKHZsZ4P9SiCbyGqVSG971p94CCFFft0FcLGHS1Tayd2bZTfxJwq/gM=,iv:uhR0E1I58QfZkzXMJ3wQvVJTn6WLvz4S3JBneiqgtbc=,tag:TOhRE0W5dZB4rdhE0bCnRg==,type:str]
sops_unencrypted_suffix=_unencrypted
sops_version=3.8.1
8 changes: 6 additions & 2 deletions infra/secrets/supafana-test.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ STRIPE_SECRET_KEY=ENC[AES256_GCM,data:AuyIBz4NfZXgwRCSz5rag7DwNkdwbKU09MZGuMR5Hl
STRIPE_PRICE_ID=ENC[AES256_GCM,data:3c1xkIqthRet53Va0R4ZUVPG8vtqsb5491E4mB94uRc=,iv:8dGyOO2QckJPg7ZvQnV5/i2Wr7yap+F6mc3CLZnT+CE=,tag:smVFwcBx7B93EvyFmFAezw==,type:str]
SUPAFANA_AZURE_TENANT_ID=ENC[AES256_GCM,data:Sk7DMqCGZBkNf+pAGH/4wFZevLlPilNVPZdMGwCih2onq1gu4zA=,iv:+ljwUAxE5ajLdhXFOx2hs0GkAEte0jxIk2N1kAFdlaE=,tag:oMGGApHbtM7zqJUmSGaAdA==,type:str]
SUPAFANA_AZURE_SUBSCRIPTION_ID=ENC[AES256_GCM,data:roSDxKMiHXUe4HsvQ+eElxTwyQ8INnDynVAvyYoH9ymc47dxZh4=,iv:uCfOOLX8mCG9VgYWKWeH1Ha4eNBELX2bwJQGXXUt0yc=,tag:iXMCTa2d5yKbNbnFPz0Q6w==,type:str]
SMTP_HOST=ENC[AES256_GCM,data:XGE4fiZZS3mubR/P7kVeltJ18zGAJ33x+mljZpFwDAbWBr/0xO4/iR0=,iv:esIBDHmUi3eiWNDkSxnxMZqtS5O7OXxMQyadmQkdF6o=,tag:Er541Mo3Z+TnJLmc0mUylQ==,type:str]
SMTP_USER=ENC[AES256_GCM,data:1JBPTzYwa4RBE+xACbDcBwhFBQ41wA==,iv:9d+MQzQALWOBCsDytRnaUj2lKruyJ2BWzuZDTmk+28o=,tag:xM6RingmxeUhvo+HtOZdCQ==,type:str]
SMTP_PASSWORD=ENC[AES256_GCM,data:PotZXsDYJLzoOu4DFcl72CmWCOM1z/OKQj56KrbD07sEBp6h+FclzcIIdLXwaA==,iv:8wJmne5cjnKnIAg3Eqfad/MkOuMsyblR07MIdADbdcQ=,tag:Z0I0CX4iOHRfB4AUISgeZw==,type:str]
SMTP_FROM_ADDRESS=ENC[AES256_GCM,data:hdchTTfohEJZKk7tVzasOG69LM5X4Z0BEzXO,iv:l13PRRwopyWVBM79kISUjc13cohX1lVn8QHdH7If8hs=,tag:8hXk02e8NrrLRURQXy8Ymw==,type:str]
sops_azure_kv__list_0__map_created_at=2024-08-18T10:52:40Z
sops_azure_kv__list_0__map_enc=ephcBU8yikLxrCULJUhWYahbzQBGlB-xqQ3JYDcf_-mTZk5MCLIurwUcS0xpQbZbjArOJQoiVFnTeifrXQMmv02Zq8B7Dlk0CldSqdCi2TG37t1oWTW9xuWh8y8qKRy1WW8SDx-AW6xkole3WVfEwGjQGq59R5AEcoKOwTEs2rCYsuB4KuUh2ta_HiFvHta_FpbrH9Kakj1E7EBNQqg7Rt94T9627lU-sm-BCDDeZBmJexdFiw5dHGDvI30h0PnId8OWinnaPCOU4zloAEWh9tyuhrHRkvmJcN8_1xa5FAAI2i7hAPXjeZAZKPohIIeaffIyqJwZAAkEWD8B5NFtlg
sops_azure_kv__list_0__map_name=sops-key
sops_azure_kv__list_0__map_vault_url=https://supafana-test-vault.vault.azure.net
sops_azure_kv__list_0__map_version=6e31977c366f4306947102b155257e04
sops_lastmodified=2024-08-18T14:52:06Z
sops_mac=ENC[AES256_GCM,data:02gYnGw9BXYymjib30yp0Va1HMeVqrPqkaFa5ofRnUm3h+Al9IzNbsCgt3Y33Enu8peltLexfSFtW4y+KL+AoNEDo946Zq6f2/2cBZBGI9BoLBwDkbfBWhZAm28gYvbQ3gZSfVk4EByEl6d6W7j8beYPUbYGwZjEUAhk69D4rmw=,iv:Dh7QKwOmwUa/iFm+cpf/NfHysckCO6TuFnR9M5CVsEQ=,tag:bdX41cggLU4PzKiHuWF4Hg==,type:str]
sops_lastmodified=2024-09-16T05:47:14Z
sops_mac=ENC[AES256_GCM,data:ulOTk2KpHJ4FwYmq2Q0FssGjBAjUuo0vEukk38n+f+5nl2sYtL2hqKp2XAaNZMGyHisX2E+mviYDd01FgkLOTBU3z0ftCb/WqzsI1fGDZEQ/nx6bWJGZv5i40KoH5DziTDTQsH05mwUM+FoJqAObyxD4KwlKecZu02iBXg20v1w=,iv:cspKwEBiCcTlhbCzfIUbiec5EKNBrVrUNqPCO4Yufos=,tag:AfdQHZZ1ziQElDbttlvk/A==,type:str]
sops_unencrypted_suffix=_unencrypted
sops_version=3.8.1
24 changes: 20 additions & 4 deletions infra/templates/grafana-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26",
"templateHash": "17905435322716412113"
"version": "0.28.1.47646",
"templateHash": "12594621635294195744"
}
},
"parameters": {
Expand All @@ -22,9 +22,24 @@
"supabaseProjectRef": {
"type": "string"
},
"supabaseProjectName": {
"type": "string"
},
"supabaseServiceRoleKey": {
"type": "string"
},
"smtpHost": {
"type": "string"
},
"smtpUser": {
"type": "string"
},
"smtpPassword": {
"type": "string"
},
"smtpFromAddress": {
"type": "string"
},
"grafanaPassword": {
"type": "securestring"
},
Expand All @@ -50,7 +65,7 @@
},
"imageVersion": {
"type": "string",
"defaultValue": "0.0.5"
"defaultValue": "0.0.13"
},
"projectId": {
"type": "string",
Expand Down Expand Up @@ -80,7 +95,8 @@
"variables": {
"osDiskName": "[format('{0}-os-disk', parameters('vmName'))]",
"networkInterfaceName": "[format('{0}-nic', parameters('vmName'))]",
"customDataRaw": "[format('#cloud-config\nwrite_files:\n- content: |\n SUPABASE_PROJECT_REF={0}\n SUPABASE_SERVICE_ROLE_KEY={1}\n GF_SERVER_ROOT_URL=https://{3}/dashboard/{2}\n GF_SERVER_SERVE_FROM_SUB_PATH=true\n GRAFANA_PASSWORD={4}\n path: /var/lib/supafana/supafana.env\n', parameters('supabaseProjectRef'), parameters('supabaseServiceRoleKey'), parameters('projectId'), parameters('supafanaDomain'), parameters('grafanaPassword'))]",
"smtpFromName": "[format('Grafana alerts for {0}', parameters('supabaseProjectName'))]",
"customDataRaw": "[format('#cloud-config\nwrite_files:\n- content: |\n SUPABASE_PROJECT_REF={0}\n SUPABASE_SERVICE_ROLE_KEY={1}\n GF_SERVER_ROOT_URL=https://{3}/dashboard/{2}\n GF_SERVER_SERVE_FROM_SUB_PATH=true\n GRAFANA_PASSWORD={4}\n GF_SMTP_ENABLED=true\n GF_SMTP_HOST={5}\n GF_SMTP_USER={6}\n GF_SMTP_PASSWORD={7}\n GF_SMTP_FROM_ADDRESS={8}\n GF_SMTP_FROM_NAME={9}\n SUPABASE_PROJECT_NAME={10}\n path: /var/lib/supafana/supafana.env\n', parameters('supabaseProjectRef'), parameters('supabaseServiceRoleKey'), parameters('projectId'), parameters('supafanaDomain'), parameters('grafanaPassword'), parameters('smtpHost'), parameters('smtpUser'), parameters('smtpPassword'), parameters('smtpFromAddress'), variables('smtpFromName'), parameters('supabaseProjectName'))]",
"grafanaSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('grafanaSubnetName'))]",
"tags": {
"vm": "[parameters('vmName')]"
Expand Down
2 changes: 1 addition & 1 deletion infra/templates/grafana-template.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.8.2
2024.9.1
2 changes: 1 addition & 1 deletion nix/hosts/grafana/grafana-container.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in
networking.firewall.allowedTCPPorts = [ 8080 9090];

virtualisation.oci-containers.containers.grafana = {
image = "supafanacr.azurecr.io/supabase-grafana:2024.07.18";
image = "supafanacr.azurecr.io/supabase-grafana:2024.09.06";
login.registry = "https://supafanacr.azurecr.io";
# readonly principal
login.username = "df1f34b8-bc26-4606-b4cc-c1e08511e709";
Expand Down
2 changes: 1 addition & 1 deletion scripts/azure-upload-image-gallery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ then
--output tsv
)"

azcopy copy "${img_file}" "${sasurl}" \
AZCOPY_CONCURRENCY_VALUE=10 AZCOPY_REQUEST_TRY_TIMEOUT=100 azcopy copy "${img_file}" "${sasurl}" \
--blob-type PageBlob

# https://docs.microsoft.com/en-us/cli/azure/disk?view=azure-cli-latest#az-disk-revoke-access
Expand Down
6 changes: 6 additions & 0 deletions server/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ config :supafana,
azure_resource_group: System.get_env("SUPAFANA_AZURE_RESOURCE_GROUP"),
azure_subscription_id: System.get_env("SUPAFANA_AZURE_SUBSCRIPTION_ID")

config :supafana,
smtp_host: System.get_env("SMTP_HOST"),
smtp_user: System.get_env("SMTP_USER"),
smtp_password: System.get_env("SMTP_PASSWORD"),
smtp_from_address: System.get_env("SMTP_FROM_ADDRESS")

config :logger, :console,
level: (System.get_env("SUPAFANA_LOG_LEVEL") || "debug") |> String.to_atom(),
format: "\n$time [$level] $message $metadata\n",
Expand Down
Loading

0 comments on commit 864a25b

Please sign in to comment.