Docs Platform
Deployment
Run the API yourself: requirements, configuration and what to check before launch.
The API is a single Spring Boot application (Java 25) with a PostgreSQL database. Database migrations run automatically at startup with Liquibase.
Requirements#
- Java 25
- PostgreSQL
- A persistent directory for uploaded files
Configuration#
Set these as environment variables.
| Variable | Purpose | Default |
|---|---|---|
DB_URL |
JDBC URL of the database | jdbc:postgresql://localhost:5432/nobslms |
DB_USER, DB_PASSWORD |
Credentials the API runs as. Must be an ordinary role, see Database roles | nobslms_app (development) |
MIGRATION_DB_USER, MIGRATION_DB_PASSWORD |
Credentials used only to run migrations (the schema owner) | nobslms (development) |
REQUIRE_RLS |
true refuses to start if the API’s role bypasses row-level security |
false |
REQUIRE_REAL_SECRETS |
true refuses to start on the built-in development JWT_SECRET or ENCRYPTION_KEY |
false |
RATE_LIMIT_ATTEMPTS |
Attempts per client address per 15 minutes on login, invitation accept and tenant creation | 30 |
JWT_SECRET |
Signs login tokens. At least 32 bytes. | development value |
ENCRYPTION_KEY |
Encrypts webhook secrets at rest | development value |
PLATFORM_TOKEN |
Enables POST /platform/tenants. Leave empty to disable it. |
empty (disabled) |
CORS_ORIGINS |
Comma-separated browser origins allowed to call the API | empty (none) |
STORAGE_DIR |
Where uploaded files are stored | ./data/files |
MAIL_OUTBOX |
Development only: writes emails to this folder | empty |
Caution
JWT_SECRET and ENCRYPTION_KEY have placeholder defaults that are public. Anyone who knows them can forge tokens. Always override them outside local development.
Database roles#
The API uses two database roles, so that Postgres can enforce tenant isolation (see Security):
- Owner. Creates and migrates the schema. Used only by Liquibase at startup (
MIGRATION_DB_*). - Runtime. What the API connects as (
DB_USER). It has data access to the tables and nothing else: not a superuser, noBYPASSRLS, and it does not own the tables.
Create the runtime role once, before the first start. Migrations grant it access to everything they create, on every start.
create role nobslms_app login password '<a long random password>' nosuperuser nobypassrls;
grant connect on database nobslms to nobslms_app;
Warning
A superuser, or any role with BYPASSRLS, ignores every row-level security policy. The API logs a warning at startup if it is connected as one. Set REQUIRE_RLS=true in production to make that a startup failure instead.
Build and run#
./mvnw -DskipTests package
java -jar target/*.jar
For local development, docker-compose.yml starts a PostgreSQL container and creates the runtime role for you (nobslms_app). If you already have a local database volume from before this change, either create the role by hand (the SQL above) or start fresh with docker compose down -v.
Before launch checklist#
- Real
JWT_SECRETandENCRYPTION_KEY. - A separate runtime database role, with
REQUIRE_RLS=true. - HTTPS in front of the API, and
CORS_ORIGINSset to your own origins. STORAGE_DIRon a persistent, backed-up volume.- A real email provider behind the
Mailerinterface (messages are only logged today). - Database backups.
PLATFORM_TOKENset only while you create tenants.
Background jobs#
A job runs every few minutes (nobslms.jobs.interval, default 5 minutes). It expires enrollments past expiresAt and grades timed-out attempts. Access is also checked on read, so correctness doesn’t depend on the job.
Health and documentation#
The server publishes its OpenAPI contract, and this site’s reference is generated from it.