Skip to content
Snippets Groups Projects
Commit 26cf07f2 authored by Malte Finsterwalder's avatar Malte Finsterwalder
Browse files

NOISSUE fix: upgrade to the new FCM v1 API

parent 344b5818
No related branches found
No related tags found
No related merge requests found
# ========= SYGNAL PUSH GATEWAY CONFIGURATION ========= # ========= SYGNAL PUSH GATEWAY CONFIGURATION =========
export SYGNAL_CONF=/data/sygnal.yaml export SYGNAL_CONF=/data/sygnal.yaml
# API key for Firebase Cloud Messaging
export HOLI_CHAT_PUSH_GATEWAY_FCM_API_KEY=
export APNS_KEYFILE=/data/apns_keyfile_staging.p8 export APNS_KEYFILE=/data/apns_keyfile_staging.p8
export APNS_KEY_ID= export APNS_KEY_ID=
export APNS_TEAM_ID= export APNS_TEAM_ID=
export APNS_TOPIC= export APNS_TOPIC=
\ No newline at end of file
export FCM_KEYFILE=
\ No newline at end of file
...@@ -8,3 +8,4 @@ apns-test/node_modules/ ...@@ -8,3 +8,4 @@ apns-test/node_modules/
data-push-gateway/apns_keyfile_staging.p8 data-push-gateway/apns_keyfile_staging.p8
apns-test/apns_keyfile_staging.p8 apns-test/apns_keyfile_staging.p8
.idea/ .idea/
data-push-gateway/fcm_keyfile.json
...@@ -207,7 +207,9 @@ apps: ...@@ -207,7 +207,9 @@ apps:
# #
social.holi: social.holi:
type: gcm type: gcm
api_key: ${HOLI_CHAT_PUSH_GATEWAY_FCM_API_KEY} api_version: v1
project_id: holi-shared
service_account_file: ${FCM_KEYFILE}
# #
# # This is the maximum number of connections to GCM servers at any one time # # This is the maximum number of connections to GCM servers at any one time
# # the default is 20. # # the default is 20.
......
...@@ -28,6 +28,16 @@ resource "google_cloud_run_service" "chat_push_gateway" { ...@@ -28,6 +28,16 @@ resource "google_cloud_run_service" "chat_push_gateway" {
} }
} }
} }
volumes {
name = "fcm_keyfile"
secret {
secret_name = local.environment_name == "production" ? "FCM_KEYFILE_PRODUCTION" : "FCM_KEYFILE_STAGING"
items {
key = "latest"
path = "fcm-keyfile.json" # relative to mount_path in volume_mounts
}
}
}
containers { containers {
image = "${data.terraform_remote_state.holi_infra_state.outputs.artifact_registry_location}/holi-chat-push-gateway:${var.image_tag}" image = "${data.terraform_remote_state.holi_infra_state.outputs.artifact_registry_location}/holi-chat-push-gateway:${var.image_tag}"
ports { ports {
...@@ -37,6 +47,10 @@ resource "google_cloud_run_service" "chat_push_gateway" { ...@@ -37,6 +47,10 @@ resource "google_cloud_run_service" "chat_push_gateway" {
mount_path = "/apns" mount_path = "/apns"
name = "apns_keyfile" name = "apns_keyfile"
} }
volume_mounts {
mount_path = "/fcm"
name = "fcm_keyfile"
}
# TODO consider adding resource limits # TODO consider adding resource limits
env { env {
name = "HOLI_CHAT_PUSH_GATEWAY_FCM_API_KEY" name = "HOLI_CHAT_PUSH_GATEWAY_FCM_API_KEY"
...@@ -47,6 +61,10 @@ resource "google_cloud_run_service" "chat_push_gateway" { ...@@ -47,6 +61,10 @@ resource "google_cloud_run_service" "chat_push_gateway" {
} }
} }
} }
env {
name = "FCM_KEYFILE"
value = "/fcm/fcm-keyfile.json" # see volume_mounts and volumes
}
env { env {
name = "APNS_KEYFILE" name = "APNS_KEYFILE"
value = "/apns/apns-keyfile.p8" # see volume_mounts and volumes value = "/apns/apns-keyfile.p8" # see volume_mounts and volumes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment