mirror of
https://github.com/fergalmoran/onearmy-community-platform.git
synced 2025-12-22 09:37:54 +00:00
feat: track firebase extension configuration in code
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
"taskkill",
|
||||
"teardown",
|
||||
"Brevo",
|
||||
"Sendinblue"
|
||||
"Sendinblue",
|
||||
"envsubst"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
"project-kamp-production": "project-kamp-community",
|
||||
"fixing-fashion-development": "fixing-fashion-dev",
|
||||
"fixing-fashion-production": "fixing-fashion-prod"
|
||||
}
|
||||
},
|
||||
"targets": {}
|
||||
}
|
||||
|
||||
1
extensions/.gitignore
vendored
Normal file
1
extensions/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.env
|
||||
30
extensions/README.md
Normal file
30
extensions/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Firebase Extensions Directory
|
||||
|
||||
Firebase Extensions are pre-packaged solutions that help you perform common tasks and integrate additional services into your Firebase project. Each extension in this directory is designed to address a specific use case or functionality, providing a seamless development experience.
|
||||
|
||||
## Handling configuration
|
||||
|
||||
We should not store sensitive information in the `*.config` files, instead
|
||||
we can reference environmental variables, which will then be set in the `.env` file.
|
||||
|
||||
At the time of writing the firebase CLI does not support this, so we need to use [envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) to populate the `.env` file.
|
||||
|
||||
The environmental variables required are:
|
||||
|
||||
- CP_SMTP_CONNECTION_URI: A connection URI for the SMTP server
|
||||
|
||||
The suggested convention is for each environment variable to be prefixed with `CP_`.
|
||||
|
||||
## Deploy extension
|
||||
|
||||
Populate a `.env` based on the `.config` for each extension. This can be done with the following command:
|
||||
|
||||
```bash
|
||||
envsubst < extensions/firestore-send-email.config > extensions/firestore-send-email.env
|
||||
```
|
||||
|
||||
Run the following command from the project root directory:
|
||||
|
||||
```bash
|
||||
firebase deploy --only extensions [--project project_id]
|
||||
```
|
||||
5
extensions/firestore-send-email.config
Normal file
5
extensions/firestore-send-email.config
Normal file
@@ -0,0 +1,5 @@
|
||||
DEFAULT_FROM=community@preciousplastic.com
|
||||
MAIL_COLLECTION=emails
|
||||
SMTP_CONNECTION_URI=${CP_SMTP_CONNECTION_URI}
|
||||
TTL_EXPIRE_TYPE=never
|
||||
TTL_EXPIRE_VALUE=1
|
||||
@@ -118,5 +118,8 @@
|
||||
},
|
||||
"storage": {
|
||||
"rules": "firebase.storage.rules"
|
||||
},
|
||||
"extensions": {
|
||||
"firestore-send-email": "firebase/firestore-send-email@0.1.27"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user