SealSkin

api

FastAPI application factory and lifespan.

The application object is created here and every router is registered. State initialisation, cache refreshes, the configuration file watcher, and the background jobs (image updates, share expiry, and session reconciliation) live in lifespan.

attributelogger
= logging.getLogger(__name__)
attributeRECONCILE_INTERVAL
= 30
attributeapi_app
= create_app()
funcbackground_reconcile_job() -> None

Periodically reconcile sessions with the backend.

Returns

None
funcbackground_update_job() -> None

Periodically refresh store caches, pull images, and prune dangling ones.

Returns

None
funcbackground_share_cleanup_job() -> None

Periodically delete expired public shares.

Returns

None
func_reload_installed_apps(_path) -> None

Watcher callback: reload installed apps after an external edit.

param_pathstr

Returns

None
func_reload_app_stores(_path) -> None

Watcher callback: reload app stores after an external edit.

param_pathstr

Returns

None
func_reload_templates(_path) -> None

Watcher callback: reload templates after an external edit.

param_pathstr

Returns

None
func_reload_proot_catalogs(_path) -> None

Watcher callback: reload the PRoot Apps catalogs and bring this node's copies along.

param_pathstr

Returns

None
func_reload_vpn(_path) -> None

Watcher callback: reload the VPN profiles after another node or an administrator changed them.

param_pathstr

Returns

None
func_reload_cluster(_path) -> None

Watcher callback: reload the cluster's records after another node or an administrator changed them.

param_pathstr

Returns

None
func_sync_records() -> None

Bring this node and the shared records together: the root key, its own record, and the registry.

Returns

None
func_catch_up() -> None

Finish what a start without the store left undone, and read again everything it served from its copy.

Returns

None
funcbackground_peer_job() -> None

Ask the other nodes for their sessions and load, over and over.

Returns

None
funcbackground_usage_job() -> None

Write this node's usage and sync the shared files of its running sessions, over and over.

Returns

None
func_reload_users(_path) -> None

Watcher callback: reload users and groups after an external edit.

param_pathstr

Returns

None
func_reload_branding(_path) -> None

Watcher callback: take up the brand after an edit.

param_pathstr

Returns

None
func_watch_targets() -> dict[str, persistence.ReloadCallback]

Return the configuration paths to watch and their reload callbacks.

Returns

dict[str, app.persistence.app.persistence.ReloadCallback]
func_warn_if_cert_expiring(days=14) -> None

Log a warning when the proxy TLS certificate is expired or about to expire.

paramdaysint
= 14

Returns

None
funclifespan(app) -> AsyncIterator[None]

Initialise state on startup and stop background tasks on shutdown.

paramappFastAPI

Returns

collections.abc.AsyncIterator[None]
func_conflict(_request, _exc) -> JSONResponse

Answer a write another node got in ahead of, after looking at what it wrote.

param_requestRequest
param_excException

Returns

fastapi.responses.JSONResponse
func_unavailable(_request, exc) -> JSONResponse

Answer a write the store could not take.

param_requestRequest
paramexcException

Returns

fastapi.responses.JSONResponse
funccreate_app() -> FastAPI

Build the FastAPI application with every router registered.

Returns

fastapi.FastAPI

The configured FastAPI instance.