docs: improved usage & config instructions

This commit is contained in:
ae 2025-05-09 15:19:36 +03:00
parent 4625720588
commit 4fb6cf9622
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E
2 changed files with 26 additions and 5 deletions

View File

@ -20,18 +20,39 @@ Available:
Waiting to be implemented:
- (Bulk) import/export (Markdown, PDF)
- Webhooks
- Import/export of notes ([#7](https://git.umbrella.haus/ae/qnote/issues/7))
- Bulk import/export with Markdown
- Single note export with PDF
- Webhook compatibility ([#4](https://git.umbrella.haus/ae/qnote/issues/4))
## Usage
The Dockerized app can be run in fullstack (`docker-compose-full.yml`) and backend (`docker-compose-back.yml`) modes. In backend mode only the Golang server (and the Postgres database) are containerized and the frontend can be run separately for quicker development (`npm run dev`). The default fullstack setup defaults to exposing port 3000.
The app can be run in two modes:
The `./scripts/run_dev.sh -h` output can be used as reference of running each of the available modes (or purging data from previous test runs with `-p` or `-q`):
- Combined/fullstack (`docker-compose-full.yml`)
- Frontend published to `0.0.0.0:3000` (`DOMAIN` must be set to the "server's" IP address when accessing e.g. from local network, otherwise the authentication cookies won't be sent correctly by client's browser)
- Dockerized backend & Vite dev server (`docker-compose-back.yml`)
- Frontend published to `localhost:5173`
- Golang server and Postgres database are containerized and the frontend can be run in development mode with `npm run dev`
```
The `./scripts/run_dev.sh -h` output can be used as a reference of running each of the available modes (combined, separate frontend and backend, or purging data from previous test runs with `-p` or `-q`):
```shell
[?] usage: ./scripts/run_dev.sh [-h|-f|-p]
-f run both frontend and backend (default: false)
-p purge any existing database artifacts (default: false)
-q only purge old data without building/spawning any new containers (default: false)
```
## Configuration
| Variable | Description | Default |
| -------------------------- | ---------------------------------------------------------------------- | -------------------------- |
| `PG_*` | Postgres credentials | `qnote` (user and DB name) |
| `*_SECRET` | Backend secrets | - |
| `ADMIN_*` | Initial admin account credentials | - |
| `ACCOUNT_CREATION_ENABLED` | Boolean to toggle registration | `0` |
| `LOG_LEVEL` | Server log level | `info` |
| `APP_ENV` | Boolean to toggle production security features (HTTPS for CSRF & CORS) | `production` |
| `DOMAIN` | Domain of authentication cookies | `localhost` |
| `FRONTEND_URL` | CORS frontend URL | `http://localhost:3000` |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 333 KiB