Docs: remove stale DEV_ID, clarify NODE_ENV for production
This commit is contained in:
parent
d34eac97c7
commit
33804bf0df
2 changed files with 6 additions and 5 deletions
|
|
@ -23,7 +23,7 @@ COOKIE_SECURE=auto
|
||||||
SESSION_MAX_AGE_HOURS=24
|
SESSION_MAX_AGE_HOURS=24
|
||||||
# SQLite DB path (sessions). Corrupt DB is rotated aside automatically.
|
# SQLite DB path (sessions). Corrupt DB is rotated aside automatically.
|
||||||
DB_PATH=./data/oscar-web.sqlite
|
DB_PATH=./data/oscar-web.sqlite
|
||||||
# Web API devId/key - see planning.md open question 2 / M0.
|
|
||||||
DEV_ID=your-web-api-key
|
|
||||||
# Long random string for cookie signing.
|
# Long random string for cookie signing.
|
||||||
SESSION_SECRET=change-me-to-a-long-random-string
|
SESSION_SECRET=change-me-to-a-long-random-string
|
||||||
|
# Set to production behind HTTPS reverse proxy.
|
||||||
|
NODE_ENV=development
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ Copy `.env.example` to `.env` and set values for your environment.
|
||||||
| `COOKIE_SECURE` | Session cookie secure mode: `auto`, `true`, `false` | `auto` |
|
| `COOKIE_SECURE` | Session cookie secure mode: `auto`, `true`, `false` | `auto` |
|
||||||
| `SESSION_MAX_AGE_HOURS` | Session lifetime in hours | `24` |
|
| `SESSION_MAX_AGE_HOURS` | Session lifetime in hours | `24` |
|
||||||
| `DB_PATH` | SQLite DB path for sessions | `./data/oscar-web.sqlite` |
|
| `DB_PATH` | SQLite DB path for sessions | `./data/oscar-web.sqlite` |
|
||||||
| `DEV_ID` | Optional Web API devId/key if your server requires it | unset |
|
|
||||||
| `SESSION_SECRET` | Long random secret for cookie signing | required |
|
| `SESSION_SECRET` | Long random secret for cookie signing | required |
|
||||||
|
| `NODE_ENV` | Runtime mode (`production` recommended behind HTTPS proxy) | `development` |
|
||||||
|
|
||||||
## Deployment (public / reverse proxy)
|
## Deployment (public / reverse proxy)
|
||||||
|
|
||||||
|
|
@ -82,6 +82,7 @@ PORT=3000
|
||||||
TRUST_PROXY=1
|
TRUST_PROXY=1
|
||||||
COOKIE_SECURE=true
|
COOKIE_SECURE=true
|
||||||
SESSION_SECRET=replace-with-a-long-random-secret
|
SESSION_SECRET=replace-with-a-long-random-secret
|
||||||
|
NODE_ENV=production
|
||||||
```
|
```
|
||||||
|
|
||||||
Protect `.env`:
|
Protect `.env`:
|
||||||
|
|
@ -116,12 +117,12 @@ location /api/events {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For all other routes, proxy normally to `http://127.0.0.1:3000`.
|
For all other routes, proxy normally to `http://127.0.0.1:3000`. See `deploy/nginx.conf.example` for a full example.
|
||||||
|
|
||||||
### 3. Firewall / process
|
### 3. Firewall / process
|
||||||
|
|
||||||
- Do **not** expose port `3000` publicly; bind to `127.0.0.1`.
|
- Do **not** expose port `3000` publicly; bind to `127.0.0.1`.
|
||||||
- Run with a process manager (e.g. systemd) and restart on failure.
|
- Run with a process manager (e.g. systemd) and restart on failure. See `deploy/oscar-web.service.example`.
|
||||||
- Sessions are stored in SQLite; corrupted DB files are rotated aside and recreated automatically. Run as a single process.
|
- Sessions are stored in SQLite; corrupted DB files are rotated aside and recreated automatically. Run as a single process.
|
||||||
|
|
||||||
## Security notes
|
## Security notes
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue