tilie_server.settings#
Typed settings for one server run.
- tilie_server.settings.PUBLIC_BODY_LIMIT = 16777216#
The largest request body, in bytes, a server in public mode accepts.
- tilie_server.settings.PUBLIC_TABLE_ROWS = 1000000#
The most rows of a posted table a server in public mode reads.
- tilie_server.settings.PUBLIC_TABLE_BYTES = 134217728#
The largest posted table, in bytes uncompressed, a server in public mode reads.
- tilie_server.settings.PUBLIC_COMPUTATIONS = 2#
The most posted-body computations a server in public mode runs at once.
- tilie_server.settings.PUBLIC_CONNECTIONS = 32#
The most connections a server in public mode serves at once.
- tilie_server.settings.size_named(size)[source]#
A number of bytes as a refusal names it.
A whole number of MiB is named in MiB, any other number in bytes, with a comma between thousands.
- class tilie_server.settings.ServerSettings(host, port, token, static_dir=None, root=<factory>, public_hosts=(), files=True, body_limit=None, table_rows=None, table_bytes=None, computations=None, connections=None)[source]#
Bases:
objectThe network, authorization, static-app and file settings for one run.
A local run (the default) answers to its own loopback origin, checks the run’s bearer token on every
/api/path and serves the file routes belowroot. A public run names the hosts it answers as inpublic_hosts, checks no token, serves no files and bounds every request body, every posted table and the work done at once.- Variables:
host (str) – The address the server binds.
port (int) – The port the server listens on.
token (str | None) – The bearer token every
/api/path requires;Nonefor no token check.static_dir (pathlib.Path | None) – The built editor to serve; the bundled one when
None.root (pathlib.Path) – The folder whose files the file routes serve: the user’s home folder unless another is given.
public_hosts (tuple[str, ...]) – The
Hostheader values a public run answers to, exactly as given; empty for a local run.files (bool) – Whether the file routes are served; only with a token.
body_limit (int | None) – The largest request body in bytes;
Nonefor no limit.table_rows (int | None) – The most rows of a posted table;
Nonefor no bound.table_bytes (int | None) – The largest posted table in bytes uncompressed;
Nonefor no bound.computations (int | None) – The most posted-body computations run at once, the others waiting their turn;
Nonefor no limit.connections (int | None) – The most connections served at once, uvicorn answering 503 beyond them;
Nonefor no limit.
- Parameters: