s365b.cli

The s365b command: one entry point for every container role.

Examples:

s365b migrate              # apply database migrations
s365b api                  # run the web API
s365b worker               # run background jobs (and the scheduler tick)
s365b generate-master-key  # print a new master key

Attributes

app

Functions

version() → None

Print the version.

generate_master_key([output]) → None

Create a new master key for encrypting secrets in the database.

migrate() → None

Apply database migrations (app schema and job queue schema).

api([host, port]) → None

Run the web API.

worker([queues, concurrency]) → None

Run background jobs and the scheduler tick.

setup_token() → None

Issue a new one-time setup token for creating the first admin in the web UI.

create_local_admin(username) → None

Create a break-glass admin from the command line (prompts for password and code).

reset_local_admin(username[, new_password]) → None

Reset a break-glass admin's authenticator and recovery codes (and unlock it).

run_job(job_id) → None

Queue a backup job to run now.

repository_check([repair]) → None

Read every blob of every repository and report unreadable ones.

Module Contents

s365b.cli.app[source]
s365b.cli.version() → None[source]

Print the version.

s365b.cli.generate_master_key(output: Annotated[pathlib.Path | None, typer.Option(help='Write to this file (mode 0600)')] = None) → None[source]

Create a new master key for encrypting secrets in the database.

s365b.cli.migrate() → None[source]

Apply database migrations (app schema and job queue schema).

s365b.cli.api(host: Annotated[str, typer.Option(help='Bind address')] = '0.0.0.0', port: Annotated[int, typer.Option(help='Port')] = 8000) → None[source]

Run the web API.

s365b.cli.worker(queues: Annotated[str, typer.Option(help='Comma-separated queues; empty for all')] = '', concurrency: Annotated[int, typer.Option(help='Jobs run at the same time')] = 2) → None[source]

Run background jobs and the scheduler tick.

s365b.cli.setup_token() → None[source]

Issue a new one-time setup token for creating the first admin in the web UI.

s365b.cli.create_local_admin(username: str) → None[source]

Create a break-glass admin from the command line (prompts for password and code).

Use inside the api container: docker compose exec api s365b create-local-admin NAME.

s365b.cli.reset_local_admin(username: str, new_password: Annotated[bool, typer.Option(help='Also set a new password')] = False) → None[source]

Reset a break-glass admin’s authenticator and recovery codes (and unlock it).

For when the authenticator is lost and no other admin can sign in. Requires shell access to the server, which is the trust boundary.

s365b.cli.run_job(job_id: int) → None[source]

Queue a backup job to run now.

s365b.cli.repository_check(repair: Annotated[bool, typer.Option(help='Repair around unreadable blobs')] = False) → None[source]

Read every blob of every repository and report unreadable ones.

With –repair: remove the versions that use them, reset the affected objects so the next backup stores those items again, and delete the unreadable blobs. Waits for no one: fails if a backup is running.