Skip to content

Commit bcee2ed

Browse files
more corrections to deployment configuration
1 parent cce1837 commit bcee2ed

5 files changed

Lines changed: 32 additions & 56 deletions

File tree

.env.example

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
# REQUIRED SETTINGS
99
#
1010

11-
# If equal to "development", applies configurations on the backend and frontend containers that
12-
# are not suitable for production, related to CORS, secure cookies and https.
13-
# Any other value works for a production environment, and will be used by sentry to mark the environment
14-
# an error occurred in.
15-
ENV=production
16-
1711
# Ports respectively used by the backend API and the frontends containers
1812
# Maps to the "PORT" environment variable in the backend and frontend containers
1913
# respectively.
@@ -29,9 +23,9 @@ HOST_APP_PORT=3000
2923
# Must include the scheme (e.g http://), and the port if non-standard.
3024
MARBLE_APP_URL="http://localhost:3000"
3125

32-
# Set the value to the URL the Marble API can be reached at. Must include the scheme (e.g http://)
33-
# "MARBLE_API_URL_SERVER" must be reachable from the frontend host. With docker-compose, use the api container name as host name.
34-
MARBLE_API_URL_SERVER="http://api:8080"
26+
# Set the value to the URL the Marble API can be reached at, from the frontend host. Must include the scheme (e.g http://)
27+
# With docker-compose, use the api container name as host name.
28+
MARBLE_API_URL="http://api:8080"
3529

3630
# RSA private key, in PEM format, used for for signing authentication tokens. MUST be changed for production.
3731
# We recommend using AUTHENTICATION_JWT_SIGNING_KEY_FILE to point to a private key on disk because multi-line
@@ -91,12 +85,19 @@ FIREBASE_API_KEY=
9185

9286
# Generate a random string, for instance using `openssl rand -base64 128 | tr -d "\n"`
9387
SESSION_SECRET=changeme
94-
SESSION_MAX_AGE=43200
9588

9689
#
9790
# OPTIONAL SETTINGS
9891
#
9992

93+
# Used for minor logging and telemetry settings. In particular, it will be used by sentry to mark the environment
94+
# an error occurred in. Do not touch it in the general case and it should work fine.
95+
# *DO NOT* set it to "development" for production purposes, as this specifically enables some unsafe settings.
96+
# ENV=production
97+
98+
# Configure the frontend cookie session max age, in seconds. Defaults to 43200
99+
# SESSION_MAX_AGE=43200
100+
100101
# Set your license key here if you have one in order to access premium features.
101102
LICENSE_KEY=
102103

docker-compose-dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ x-frontend-image-version: &frontend-image-version
66
image: europe-west1-docker.pkg.dev/marble-infra/marble/marble-frontend:v0.53.0
77

88
x-shared-environment: &shared-env
9-
ENV: development
109
MARBLE_APP_URL: http://localhost:${HOST_APP_PORT:-3000}
1110
DISABLE_SEGMENT: ${DISABLE_SEGMENT:-false}
1211
x-backend-environment: &backend-env

docker-compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ x-backend-environment: &backend-env
3939
CREATE_ORG_NAME: ${CREATE_ORG_NAME}
4040
CREATE_ORG_ADMIN_EMAIL: ${CREATE_ORG_ADMIN_EMAIL}
4141

42-
FIREBASE_API_KEY: ${FIREBASE_API_KEY}
43-
4442
METABASE_SITE_URL: ${METABASE_SITE_URL}
4543
METABASE_JWT_SIGNING_KEY: ${METABASE_JWT_SIGNING_KEY}
4644
METABASE_GLOBAL_DASHBOARD_ID: ${METABASE_GLOBAL_DASHBOARD_ID}

installation/baremetal.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,21 @@ Copy the [example configuration](https://github.com/checkmarble/marble-backend/b
7070

7171
- Set the `PG_*` variables to point to your PostgresSQL instance.
7272
- Set the `GOOGLE_CLOUD_PROJECT` to the ID of your Firebase project.
73-
- The `GOOGLE_APPLICATION_CREDENTIALS` should contain the path to the JSON private key file downloaded from Firebase.
73+
- The `GOOGLE_APPLICATION_CREDENTIALS` should contain the path to the JSON private key file downloaded from Firebase/GCP.
74+
- Set `FIREBASE_API_KEY` with the information retrieved from your Firebase account.
7475
- Set `AUTHENTICATION_JWT_SIGNING_KEY_FILE` to point to the generated RSA private key at `/etc/marble/jwtsigningkey.pem`.
7576
- `*_BUCKET_URL`should point to buckets in your blob storage platform (S3, Azure Blob or GCS).
76-
If you are using Minio, use a URL such as `s3://<bucket>?awssdk=v1&endpoint=minio.domain.com&region=us-east-1&s3ForcePathStyle=true`. In this case, you may also add `disableSSL=true` if your MinIO instance is in cleartext.
77-
You might have to add provider-specific configuration, for example for authentication (for S3 and MinIO, for example, set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
78-
- Set the `CREATE_*` variables to specify your initial organization and admin user.
77+
If you are using Minio, use a URL such as `s3://<bucket>?awssdk=v1&endpoint=minio.domain.com&region=us-east-1&s3ForcePathStyle=true`. In this case, you may also add `disableSSL=true` if your MinIO instance is in cleartext.
78+
You might have to add provider-specific configuration, for example for authentication (for S3 and MinIO, for example, set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`).
79+
- Set the `CREATE_*` variables to specify your initial organization and admin user - this needs to be run only once and can be omitted after the first run.
7980
- Set your `LICENCE_KEY`.
80-
- Set `MARBLE_APP_URL` to the URL used to access the frontend.
81+
- Set `MARBLE_APP_URL` to the external HTTP base your users’ browsers can use to reach the frontend.
8182

8283
### Service configuration
8384

8485
Marble’s backend is composed of five discrete services, three of which are scheduled tasks. Those can be configured with the following systemd units:
8586

86-
#### API *(persistent service)*
87+
#### API _(persistent service)_
8788

8889
```bash
8990
# /etc/systemd/system/marble-api.service
@@ -103,7 +104,7 @@ ExecStart=/opt/marble/api/marble-backend -server
103104
WantedBy=multi-user.target
104105
```
105106

106-
#### Worker *(persistent service)*
107+
#### Worker _(persistent service)_
107108

108109
```bash
109110
# /etc/systemd/system/marble-worker.service
@@ -123,7 +124,7 @@ ExecStart=/opt/marble/api/marble-backend -worker
123124
WantedBy=multi-user.target
124125
```
125126

126-
#### Database migrator *(manual run only)*
127+
#### Database migrator _(manual run only)_
127128

128129
```bash
129130
# /etc/systemd/system/marble-migrate.service
@@ -170,16 +171,12 @@ $ curl http://127.0.0.1:8080/liveness
170171
Copy the [example configuration](https://github.com/checkmarble/marble-frontend/blob/main/packages/app-builder/.env.example) file into `/etc/marble/front.conf`and edit the relevant settings. Among others:
171172

172173
- `NODE_ENV` must be set to `production`.
173-
- `ENV` should be set to `production`.
174-
Note that this will require setting up TLS certificates to access the frontend. If prototyping without TLS, set this to `development`.
175174
- Set a random, high-entropy `SESSION_SECRET`.
176-
- `MARBLE_API_URL_SERVER` should be the external HTTP base your users’ browsers can use to reach the API.
177-
- `MARBLE_APP_URL` should be set to the external HTTP base your users’ browsers can use to reach the frontend.
178-
- Set the different Firebase configuration settings with the information retrieved from your Firebase account.
175+
- `MARBLE_API_URL` should be the internal HTTP base your frontend service can use to reach the API.
179176

180177
### Service configuration
181178

182-
Drop this `systemd`unit file in ``/etc/systemd/system/marble-front.service``:
179+
Drop this `systemd`unit file in `/etc/systemd/system/marble-front.service`:
183180

184181
#### Frontend
185182

@@ -201,7 +198,6 @@ ExecStart=/opt/marble/front/node_modules/@remix-run/serve/dist/cli.js ./build/se
201198
WantedBy=multi-user.target
202199
```
203200

204-
205201
And start the frontend service by running:
206202

207203
```bash

installation/production_run.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -217,43 +217,25 @@ Reference the following files for detailed configuration:
217217

218218
### Common Issues
219219

220-
1. **CORS Errors**
220+
1. **API URL Configuration**
221221

222-
- Ensure `MARBLE_APP_URL` environment variable is set correctly
223-
- Must use `https://` protocol in production
224-
- Example: `MARBLE_APP_URL=https://app.yourdomain.com`
225-
- Common symptoms:
226-
- API requests failing in browser
227-
- Console errors about CORS policy
228-
- Authentication issues
222+
- Frontend needs one API URL configured:
229223

230-
2. **API URL Configuration**
231-
232-
<<<<<<< HEAD
233-
234-
- # Frontend needs one API URL configured:
235-
- Frontend needs one API URLs configured:
236-
237-
> > > > > > > 32b0710 (Edit production guide to match requirements for IAM.)
238-
239-
- `MARBLE_API_URL_SERVER`: URL for container-to-container requests
240-
- Example: `http://api:8080` (Docker internal network)
241-
- `MARBLE_API_URL_CLIENT`: URL for browser requests (public URL)
242-
- Example: `https://api.yourdomain.com`
224+
- `MARBLE_API_URL`: URL for container-to-container requests
225+
- Example: `http://api:8080` (Docker internal network)
243226

244227
- Incorrect configuration leads to:
245-
- Failed API calls
246-
- CORS errors
247-
- Authentication failures
228+
- Missing variable means the frontend container will not start
229+
- Wrong value, or unreachable network, means the container will start but fail immediately as soon as you try to access the page
248230

249-
3. **Network Connectivity**
231+
2. **Network Connectivity**
250232

251233
- Confirm services can reach each other
252234
- Check firewall rules
253235
- Verify DNS resolution works
254236
- Test internal container networking
255237

256-
4. **Invalid Google Cloud Service Account**
238+
3. **Invalid Google Cloud Service Account**
257239

258240
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:
259241

@@ -273,13 +255,13 @@ Those lines indicate:
273255

274256
You can verify that those value match your environment if you encounter any issue.
275257

276-
5. **Firebase Configuration**
258+
4. **Firebase Configuration**
277259

278260
- Service account:
279261

280262
- Check that the detected Google Cloud project and service account match your environment
281263

282-
- Required environment variables:
264+
- Required environment variables (on the backend container):
283265

284266
- `FIREBASE_API_KEY`: Web API key from Firebase Console
285267

0 commit comments

Comments
 (0)