ReferenceEdit on GitHub

Configuration#

Every environment variable eezo reads, and every override the entry traits offer, with their defaults. The types are in the API; this page is the values.

Environment#

variableread bydefaultnotes
EEZO_SECRETHttpApp.secreta throwaway, with a WARNINGat least 32 bytes; openssl rand -base64 32
EEZO_DB_URLDbInit.databaseUrlsee DATABASE_URLa JDBC URL, passed to the driver as written
EEZO_DB_USERDbInit.databaseUsersee DATABASE_URL
EEZO_DB_PASSDbInit.databasePasswordsee DATABASE_URL
DATABASE_URLthe three above, when they're unsetjdbc:postgresql://localhost:5442/eezo, postgres, postgresthe postgres://user:pass@host/db form a platform injects
EEZO_DB_POOL_SIZEDbInit.databasePoolSize10below 1, or not a number, falls back to the default
EEZO_DB_ACQUIRE_TIMEOUTDbInit.databaseAcquireTimeout5000milliseconds; below 250 falls back to the default

The EEZO_DB_* variables always win. When all three are unset and DATABASE_URL is set, it's parsed into them. The rules of that parse:

  • The scheme is postgres or postgresql, and a host and a database name are required. Anything else is ignored and the defaults apply.
  • User and password come out of the URL percent-decoded. No user info means postgres with an empty password.
  • sslmode=require is appended when the query names no sslmode. A query that names one, with any value, travels byte for byte.

Under eezo dev the sbt plugin sets EEZO_SECRET to one value per sbt session, unless sbt's own environment already has one.

HttpApp#

memberdefaultread
routes: RouteTableabstractwhen serve runs
port: Int8080at boot
maxBodySize: Long1 MiBat boot; also the WebSocket text message cap
secret: SecretSecret.fromEnv()once, when serve boots
problems: PartialFunction[Throwable, Problem]emptyper failure
boot(): Unitserve(routes)the program
frameworkRoutes: Seq[Route]emptyat boot; LiveApp adds its two

serve(table, dev) is protected final and is the only way to start the server. An overridden boot that still wants to serve calls it.

DbApp, through DbInit#

memberdefaultread
schema: Schemaabstractper command
boot(): Unitabstract on DbApp; EezoApp supplies the http layer'sthe program
databaseSchema: String"public"by the commands that introspect
databaseUrl: Stringfrom the environment, abovewhen a Database is built
databaseUser: Stringfrom the environmentsame
databasePassword: Stringfrom the environmentsame
databasePoolSize: Intfrom the environment, 10same
databaseAcquireTimeout: Durationfrom the environment, 5 ssame
databaseInit: Connection -> Unitnothingon every physical connection the pool opens

A Database is built per command and per program run, installed around it, and closed after. databaseInit is where search_path, application_name and statement timeouts go. An application that keeps its tables in a schema other than public sets both databaseSchema and a databaseInit that sets search_path, because the first is what the drift commands read and the second is what every query runs under.

LiveApp#

memberdefaultread
allowedOrigins: Set[String]emptyat boot; an entry that isn't an origin fails the boot

Each entry is scheme://host or scheme://host:port, matched exactly. The server's own origin is always admitted and the list only widens it.

EezoApp#

All of the above. program is the http layer's boot under withDatabase, and devServer runs the drift check first.

Build settings#

settingdefaultnotes
run / forktrue in the scaffoldthe application needs the JDK floor
run / connectInputtrue, set by the pluginso freeze can prompt
Compile / run / mainClasssbt's choiceset it to Main once a second main exists, such as a CreateUser
eezoJavaVersion"25"the JRE image eezoStage writes into the Dockerfile

Fixed limits#

limitvalue
request body and WebSocket text messagemaxBodySize, 1 MiB
session cookie, encoded3800 bytes; past it, encoding throws
CSRF token32 bytes, base64url
sign-in lifetime14 days from the sign in, Guard(lifetime = ...) to change
WebSocket idle timeout5 minutes
outgoing WebSocket frames queued64
drain on stop3 seconds
live page registry10000 pages
live page grace after a dropped socket60 seconds
live page never connectedreaped after 30 seconds

The CLI is what reads these from a terminal. Deployment files is where the secrets go on Fly.