Skip to content

Commit fa86022

Browse files
committed
docs: tighten deployment and hardening guidance
1 parent 2cbd8a1 commit fa86022

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

MIGRATION.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ The resolver is safe, but it’s still an extra lookup. Treat it like part of yo
316316
**Cloudflare (high-level)**
317317

318318
- Add a Rate Limiting rule or WAF rule for `/jsonapi/resolve*` and `/jsonapi/*` (block or managed challenge after a threshold).
319+
- Example expressions:
320+
- Resolver: `http.request.uri.path eq "/jsonapi/resolve"`
321+
- JSON:API: `starts_with(http.request.uri.path, "/jsonapi/")`
319322

320323
**nginx (example)**
321324

@@ -334,6 +337,16 @@ location ^~ /jsonapi/ {
334337
}
335338
```
336339

340+
### 1b) Forward auth headers (when using a proxy)
341+
342+
If you use authenticated JSON:API requests (Basic/OAuth/JWT), ensure your proxy forwards the `Authorization` header to Drupal.
343+
344+
**nginx**
345+
346+
```nginx
347+
proxy_set_header Authorization $http_authorization;
348+
```
349+
337350
### 2) Prevent image-host abuse (Next.js)
338351

339352
In production, always restrict remote images to your Drupal host:
@@ -346,6 +359,16 @@ In production, always restrict remote images to your Drupal host:
346359
- Set `trusted_host_patterns` in Drupal `settings.php` (prevents Host-header injection issues).
347360
- Set “Drupal URL” in the module settings so generated `drupal_url` values are deterministic.
348361

362+
Example `settings.php`:
363+
364+
```php
365+
$settings['trusted_host_patterns'] = [
366+
'^example\\.com$',
367+
'^www\\.example\\.com$',
368+
'^cms\\.example\\.com$',
369+
];
370+
```
371+
349372
### 4) Keep secrets out of config exports
350373

351374
This module avoids storing secrets in config exports (config sync). Secrets are stored in Drupal state by default, and you can optionally override them in `settings.php` for deterministic deploys:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ Typical settings:
9898

9999
For deployment and migration examples, see `MIGRATION.md`.
100100

101+
## Production checklist
102+
103+
- Set “Drupal URL” so `drupal_url` is deterministic (don’t rely on Host headers).
104+
- Set `trusted_host_patterns` in `settings.php`.
105+
- If using `nextjs_first`, set `X-Proxy-Secret` and keep it in env/`settings.php` (not config exports).
106+
- Rate limit `/jsonapi/resolve*` and `/jsonapi/*` at the edge (Cloudflare/nginx) to prevent path brute-force load.
107+
- If using authenticated JSON:API, keep credentials server-side and never cache authenticated responses.
108+
- For Next.js images, restrict remote domains (`DRUPAL_IMAGE_DOMAIN` in the starter).
109+
101110
## Supported content
102111

103112
- **Entities:** any canonical content entity route exposed by JSON:API (nodes, terms, media, users, and custom entities)

composer.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,5 @@
2424
],
2525
"require": {
2626
"drupal/core": "^10 || ^11"
27-
},
28-
"extra": {
29-
"drupal": {
30-
"version": "1.0.7",
31-
"datestamp": ""
32-
}
3327
}
3428
}

0 commit comments

Comments
 (0)