feat: add authenticated search frontend

This commit is contained in:
agent committed 2026-10-10 18:34:07 +03:00
1 parent 93e5fc5837
commit 0a30adb85f
20 files changed
+885 -113

No files matched your search

+1
View File
@@ -6,3 +6,4 @@ OPENSEARCH_MEM_LIMIT=4g
OPENSEARCH_JAVA_OPTS=-Xms2g -Xmx2g
# Generate with: openssl rand -hex 32
REVIEW_SECRET=replace-with-a-random-secret
COOKIE_SECURE=true
+29 -4
View File
@@ -5,8 +5,9 @@ binds the API only to `127.0.0.1`; publish it through an authenticated reverse
proxy or VPN. OpenSearch is not published outside the compose network.
The current compose intentionally disables the OpenSearch security plugin to
match the existing API client. Keep both services on a private host/network
until authenticated OpenSearch support is implemented.
match the existing API client. Keep both services on a private host/network.
The application provides cookie-based accounts for its search API and review
workspace; it does not replace host-level network controls or TLS.
## First deployment
@@ -32,6 +33,30 @@ until authenticated OpenSearch support is implemented.
validation succeed. Back up `DATA_ROOT` and the `opensearch-data` volume
before the first import.
## Initial administrator and accounts
After starting the backend for the first time, create the initial `admin`
account with an interactive password prompt:
```bash
docker compose --env-file .env -f compose.yaml exec backend python -m search.api --create-admin
```
The account database is stored at `DATA_ROOT/search-users.sqlite3`. Back it up
alongside the review database. Sign in at `/review`; `admin` can create accounts
with temporary passwords. Each new account must replace its temporary password
at first sign-in. Only the `admin` login can create, reset, or delete accounts.
If the `admin` password is lost, reset it in an interactive terminal with:
```bash
docker compose --env-file .env -f compose.yaml exec backend python -m search.api --reset-admin-password
```
The next sign-in requires another password change. Serve the backend behind
HTTPS, rate-limit login requests at the reverse proxy, and keep
`COOKIE_SECURE=true` in production.
This is a deployment baseline, not a public internet exposure recipe. TLS,
authentication, backups, monitoring, and a production OpenSearch security
configuration must be provided by the host reverse proxy/operations setup.
backups, monitoring, and a production OpenSearch security configuration must
be provided by the host reverse proxy/operations setup.
+3
View File
@@ -34,6 +34,7 @@ services:
restart: unless-stopped
environment:
REVIEW_SECRET: ${REVIEW_SECRET:?set REVIEW_SECRET in .env}
COOKIE_SECURE: ${COOKIE_SECURE:-true}
command:
- python
- -m
@@ -50,6 +51,8 @@ services:
- /app/data/minjust-normalized
- --reviews-db
- /app/data/search-reviews.sqlite3
- --users-db
- /app/data/search-users.sqlite3
- --review-secret
- ${REVIEW_SECRET}
ports: