Skip to content

Commit f684a95

Browse files
committed
Edit production guide to match requirements for IAM.
1 parent 902c827 commit f684a95

File tree

1 file changed

+56
-21
lines changed

1 file changed

+56
-21
lines changed

installation/production_run.md

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,32 @@ Supported Providers:
6363
Configuration details are available in `.env.example`.
6464
The .env file expects two different buckets for the two purposes, but you may use the same bucket for both.
6565

66-
### 3. Firebase Authentication
66+
### 3. Google Cloud service account
67+
68+
Marble requires valid service account credentials in order to provide the following features:
69+
70+
- Authentication via Firebase (mandatory)
71+
- Blob storage on Google Cloud Storage (if applicable)
72+
73+
This service account **must** have the following roles or permissions:
74+
75+
- Role: `Storage Object User` on the configured buckets to store and retrieve blobs
76+
- Permission: `iam.serviceAccounts.signBlob` to generate pre-signed download URLs
77+
This permission is provided by the `Service Account Token Creator` role, but we recommend creating a custom role containing the required permission only.
78+
79+
_Note:_ depending on whether you are hosted on GCP, the service account might need extra permissions to accomodate your setup.
80+
81+
#### Provide the credentials to Marble
82+
83+
Marble supports two ways to retrieve the service account's credentials:
84+
85+
- **Recommended:** Marble is able to retrieve the service account (and associated configuration) from the [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). If you have properly configured the system on which Marble runs, it should be able to automatically use the configured service account. \
86+
If Marble is running on Google Cloud Platform, the service account is pulled from the environment, depending on how you configured your infrastructure.
87+
- Alternatively, you can download a file-based service account key and provide the path to it in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
88+
89+
By default, it will be assumed that the service account's Google Cloud project is the project where your Firebase tenant lives. If that is the case, no further configuration is required. If, on the other hand, your Firebase project and Google Cloud project are separate, you will need to specify the name of your Firebase project in the `FIREBASE_PROJECT_ID` environment variable.
90+
91+
### 4. Firebase Authentication
6792

6893
#### Setup Steps
6994

@@ -75,9 +100,6 @@ The .env file expects two different buckets for the two purposes, but you may us
75100
2. **Configure Authentication**
76101

77102
- Enable Firebase Authentication
78-
- Go to Project overview → project settings → Service Accounts → Generate new private key
79-
- Create service account
80-
- Download service account key
81103

82104
3. **Configure Domain**
83105

@@ -102,7 +124,7 @@ The .env file expects two different buckets for the two purposes, but you may us
102124

103125
> 💡 **Cost**: Firebase Auth free tier should be sufficient, but credit card required for project setup.
104126
105-
### 4. Convoy (Webhook Gateway)
127+
### 5. Convoy (Webhook Gateway)
106128

107129
Options:
108130

@@ -120,7 +142,7 @@ Setup Steps:
120142
CONVOY_PROJECT_ID=your-project-id
121143
```
122144

123-
### 5. Yente + Elasticsearch
145+
### 6. Yente + Elasticsearch
124146

125147
Purpose: Sanctions screening and search functionality
126148

@@ -201,9 +223,7 @@ Reference the following files for detailed configuration:
201223

202224
2. **API URL Configuration**
203225

204-
- Frontend needs two API URLs configured:
205-
- `MARBLE_API_URL_CLIENT`: URL for browser requests (public URL)
206-
- Example: `https://api.yourdomain.com`
226+
- Frontend needs one API URLs configured:
207227
- `MARBLE_API_URL_SERVER`: URL for container-to-container requests
208228
- Example: `http://api:8080` (Docker internal network)
209229
- Incorrect configuration leads to:
@@ -218,21 +238,36 @@ Reference the following files for detailed configuration:
218238
- Verify DNS resolution works
219239
- Test internal container networking
220240

221-
4. **Firebase Configuration**
241+
4. **Invalid Google Cloud Service Account**
242+
243+
Check Marble's startup logs for messages related to Google Cloud Platform's authentication, they may be able to point your to a potential misconfiguration:
244+
245+
For example, a good configuration would look like this:
246+
247+
```
248+
2025-05-27T14:12:41+02:00 INFO successfully authenticated in GCP [email protected] project=my-project
249+
2025-05-27T14:12:41+02:00 INFO FIREBASE_PROJECT_ID was not provided, falling back to Google Cloud project project=my-project
250+
2025-05-27T14:12:41+02:00 INFO firebase project configured project=my-project
251+
```
252+
253+
Those lines indicate:
254+
255+
- The authenticated service account is `marble-dev@[email protected] project=my-project`
256+
- The detected Google Cloud Project is `my-project`
257+
- The assumed Firebase project is also `my-project`
258+
259+
You can verify that those value match your environment if you encounter any issue.
260+
261+
5. **Firebase Configuration**
222262

223-
- Service Account Key:
263+
- Service account:
264+
- Check that the detected Google Cloud project and service account match your environment
224265

225-
- ⚠️ Backend service will fail to start without accessible Firebase service account key
226-
- Exception: On GCP, automatic service account discovery may work
227-
- Generate key in Firebase Console → Project Settings → Service Accounts
228-
- Mount key file to container and set `GOOGLE_APPLICATION_CREDENTIALS`
229-
- Example: `GOOGLE_APPLICATION_CREDENTIALS=/secrets/firebase-key.json`
266+
- Required environment variables:
267+
- `FIREBASE_API_KEY`: Web API key from Firebase Console
230268

231-
- Required Environment Variables:
232-
- `GOOGLE_CLOUD_PROJECT`: Firebase project ID
233-
- `FIREBASE_API_KEY`: Web API key from Firebase Console
234-
- `FIREBASE_AUTH_DOMAIN`: Auth domain from Firebase settings
235-
- `FIREBASE_APP_ID`: Application ID from Firebase Console
269+
- If you plan on using Single-Sign On (SSO) with Firebase (to delegate authentication to another Identity Provider), you will need to configure the following directives:
270+
- `FIREBASE_AUTH_DOMAIN`: Auth domain from Firebase settings
236271

237272
## Next Steps
238273

0 commit comments

Comments
 (0)