feat: add secure auth, admin and postgres persistence
This commit is contained in:
@@ -21,10 +21,19 @@ A fillable, live-computing web version of the manual coffee roast plan worksheet
|
||||
## Run it
|
||||
|
||||
```bash
|
||||
cp .env.example .env # set strong secrets
|
||||
npm install
|
||||
npm start # http://localhost:8090 (set PORT to override)
|
||||
npm test
|
||||
# local PostgreSQL stack (database is not published to the host)
|
||||
docker compose --env-file .env up --build
|
||||
```
|
||||
|
||||
The public landing page is at `/`; plans require an account at `/app`. Production is configured for `https://roast.srmr.xyz`: retain `APP_ORIGIN=https://roast.srmr.xyz` and `COOKIE_SECURE=true` behind its HTTPS proxy. Database migrations in `db/migrations/` run at application startup exactly once.
|
||||
|
||||
### First administrator
|
||||
|
||||
Generate `BOOTSTRAP_SETUP_TOKEN` with `openssl rand -base64 48`, keep it only in the deployment environment, then call `POST /api/auth/bootstrap` with that token, `[email protected]`, and a 12+ character password. The endpoint can create that account only once. Remove the setup token after success; no administrator password is stored in source control.
|
||||
|
||||
## Mobile and PWA use
|
||||
|
||||
The planner is responsive and caches its app shell for offline use after the first visit. Browser installation and service-worker caching require HTTPS in production (localhost is exempt). Put the Docker container behind an HTTPS reverse proxy before using it as an installable PWA on a phone.
|
||||
|
||||
Reference in New Issue
Block a user