Skip to content

Commit

Permalink
feat: FCM v1 (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed May 15, 2024
1 parent 4701eb7 commit 2c2f09a
Show file tree
Hide file tree
Showing 47 changed files with 1,845 additions and 945 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TELEMETRY_PROMETHEUS_PORT=3001

# FCM
FCM_API_KEY=
FCM_V1_CREDENTIALS=

# APNS
APNS_CERTIFICATE= # base64 encoded .p12 APNS Certificate
Expand Down
3 changes: 2 additions & 1 deletion .env.single-tenant-example
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ TELEMETRY_PROMETHEUS_PORT=3001

# FCM
FCM_API_KEY= # Firebase Cloud Messaging Server Key
FCM_V1_CREDENTIALS= # Firebase Cloud Messaging Service Account Credentials

# APNS
APNS_CERTIFICATE= # base64 encoded .p12 APNS Certificate
APNS_CERTIFICATE_PASSWORD= # Password for provided certificate
APNS_TOPIC= # bundle ID/app ID
APNS_TOPIC= # bundle ID/app ID
17 changes: 17 additions & 0 deletions .github/SECRETS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## `PROD_JWT_SECRET` & `STAGING_JWT_SECRET`

From 1Password: `cloud/push-server-jwt/prod` and `cloud/push-server-jwt/staging`

Generated randomly and used by Cloud app to sign JWTs.

## `ECHO_TEST_FCM_V1_CREDENTIALS`

From 1Password: `Firebase Push Server Tests Service Account`

FCM v1 service account credentials for test cases.

Setup:
- Go to the Push Server Tests Firebase project: https://console.firebase.google.com/project/push-server-tests-cc0f7/settings/cloudmessaging
- On Cloud Messaging tab, under the "Firebase Cloud Messaging API (V1)" header, click the "Manage Service Accounts" link
- Select the service account and click "Manage keys"
- Click "Add key" and select "Create new key" and pick JSON
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
id: tf-apply
uses: WalletConnect/actions/terraform/apply/@1.0.3
env:
GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }}
TF_VAR_jwt_secret: ${{ secrets.STAGING_JWT_SECRET }}
TF_VAR_image_version: ${{ inputs.image_tag }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
id: tf-apply
uses: WalletConnect/actions/terraform/apply/@1.0.3
env:
GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }}
TF_VAR_jwt_secret: ${{ secrets.PROD_JWT_SECRET }}
TF_VAR_image_version: ${{ inputs.image_tag }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
rustc: stable
- name: "Clippy all features"
cmd: clippy
args: --all-features --tests -- -D warnings
args: --all-features --all-targets -- -D warnings
cache: {}
rustc: stable
- name: "Formatting"
Expand All @@ -85,7 +85,7 @@ jobs:
rustc: nightly
- name: "Unit Tests"
cmd: test
args: --features multitenant,analytics,geoblock,functional_tests
args: --features multitenant,analytics,geoblock,functional_tests,apns_tests,fcm_tests,fcmv1_tests
cache: { sharedKey: "tests" }
rustc: stable
- name: "Single-tenant functional tests"
Expand Down Expand Up @@ -170,6 +170,7 @@ jobs:
args: ${{ matrix.cargo.args }}
env:
ECHO_TEST_FCM_KEY: ${{ secrets.ECHO_TEST_FCM_KEY }}
ECHO_TEST_FCM_V1_CREDENTIALS: ${{ secrets.ECHO_TEST_FCM_V1_CREDENTIALS }}
ECHO_TEST_APNS_P8_KEY_ID: ${{ secrets.ECHO_TEST_APNS_P8_KEY_ID }}
ECHO_TEST_APNS_P8_TEAM_ID: ${{ secrets.ECHO_TEST_APNS_P8_TEAM_ID }}
ECHO_TEST_APNS_P8_PEM: ${{ secrets.ECHO_TEST_APNS_P8_PEM }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
id: tf-plan-staging
uses: WalletConnect/actions/terraform/plan/@1.0.3
env:
GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }}
TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }}
TF_VAR_jwt_secret: ${{ secrets.JWT_SECRET }}
TF_VAR_relay_public_key: ${{ secrets.RELAY_PUBLIC_KEY }}
Expand Down
Loading

0 comments on commit 2c2f09a

Please sign in to comment.