Skip to content

Commit 5ff6266

Browse files
modify connect-src of Content Security Policy to include dynamic wss URL based on configured base URL
1 parent e57fc1c commit 5ff6266

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/docker.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Run `docker build -t send:latest .` to create an image or `docker-compose up` to
1313
| `SENTRY_DSN` | Sentry DSN
1414
| `MAX_FILE_SIZE` | in bytes (defaults to 2147483648)
1515
| `NODE_ENV` | "production"
16+
| `BASE_URL` | The HTTPS URL where traffic will be served (e.g. `https://send.firefox.com`)
1617

1718
## Example:
1819

@@ -22,5 +23,6 @@ $ docker run --net=host -e 'NODE_ENV=production' \
2223
-e 'REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' \
2324
-e 'SENTRY_CLIENT=https://[email protected]/168' \
2425
-e 'SENTRY_DSN=https://51e23d7263e348a7a3b90a5357c61cb2:[email protected]/168' \
26+
-e 'BASE_URL=https://send.firefox.com' \
2527
mozilla/send:latest
2628
```

server/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function(app) {
3939
"'self'",
4040
'wss://*.dev.lcip.org',
4141
'wss://*.send.nonprod.cloudops.mozgcp.net',
42-
'wss://send.firefox.com',
42+
config.base_url.replace(/^https:\/\//, 'wss://'),
4343
'https://*.dev.lcip.org',
4444
'https://accounts.firefox.com',
4545
'https://*.accounts.firefox.com',

0 commit comments

Comments
 (0)