Documentation
¶
Overview ¶
Package main is the entry point for the Maktaba API server.
Story 22.1 created the binary as a stub; Story 22.2 wired the `--version` flag and reproducibility envelope; Story 22.3 added the `serve` subcommand so compose has a long-lived process to attach a healthcheck to; Story 22.4 added the `migrate` subcommand; Story 21.1 wired the structured logger; Story 21.4 split serve into a public mux (port 8080, /api/system/health aggregator) and an admin mux (port 9100, /healthz + /readyz). Story 7.1 replaces the public mux's placeholder route with the chi-based real router; Story 21.2 adds /metrics on the admin port; Story 21.3 wires opt-in OTel tracing. Stories 10.1/10.6/10.9/10.15 add the auth bootstrap (`adduser`, `keys`, JWKS endpoint, security middleware stack).
Source Files
¶
- adduser.go
- auth_bootstrap.go
- cloudflare_cli.go
- cluster_bootstrap.go
- cluster_link.go
- components_cli.go
- components_cli_packs.go
- direct.go
- discovery_home.go
- e2e_github_off.go
- hashpassword.go
- keys_cli.go
- license.go
- license_cli.go
- link_proxy.go
- log_notices.go
- main.go
- migrate.go
- migrate_sqlite.go
- node_bootstrap.go
- node_clock.go
- node_link.go
- node_metrics.go
- offline.go
- plexlink.go
- plugins_cli.go
- reviewhome.go
- schema_ahead.go
- search_indexes.go
- search_relevance.go
- self_update.go
- stream_signer.go
- supervisor_metrics.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
levelcheck
command
Command levelcheck checks shared/api/openapi.yaml against the current API level's snapshot (Epic 58 story 58.01), and with -write writes that snapshot.
|
Command levelcheck checks shared/api/openapi.yaml against the current API level's snapshot (Epic 58 story 58.01), and with -write writes that snapshot. |
|
rehearsal-direct-home
command
Command rehearsal-direct-home is the cloud rehearsal's home for direct remote access (Epic 50 story 50.15, scenario direct-remote, T10): the home's real direct access (directaccess: the port mapping, the certificate by CSR over the relay agent, the TLS listener) in front of a small stand-in for the home's web port.
|
Command rehearsal-direct-home is the cloud rehearsal's home for direct remote access (Epic 50 story 50.15, scenario direct-remote, T10): the home's real direct access (directaccess: the port mapping, the certificate by CSR over the relay agent, the TLS listener) in front of a small stand-in for the home's web port. |
|
internal
|
|
|
auth/argon2id
Package argon2id implements password hashing for Story 10.1.
|
Package argon2id implements password hashing for Story 10.1. |
|
auth/authz
Package authz is Maktaba's permission decision point (Story 10.13).
|
Package authz is Maktaba's permission decision point (Story 10.13). |
|
auth/cloudlink
Package cloudlink is the home's side of linked accounts (Epic 42 story 42.7): a home user links a Maktaba Cloud account, and that account can then sign in to this home through the cloud.
|
Package cloudlink is the home's side of linked accounts (Epic 42 story 42.7): a home user links a Maktaba Cloud account, and that account can then sign in to this home through the cloud. |
|
auth/cloudlink/cloudlinktest
Package cloudlinktest signs home assertions the way the cloud does (cloud/internal/homeassert), for the home's tests.
|
Package cloudlinktest signs home assertions the way the cloud does (cloud/internal/homeassert), for the home's tests. |
|
auth/jwt
Package jwt is a small RS256-only JWT issuer/verifier on top of internal/auth/keys.
|
Package jwt is a small RS256-only JWT issuer/verifier on top of internal/auth/keys. |
|
auth/keys
Package keys owns the RS256 key material used to mint and verify Maktaba access tokens (Story 10.6).
|
Package keys owns the RS256 key material used to mint and verify Maktaba access tokens (Story 10.6). |
|
auth/middleware
Package middleware wires authentication into the HTTP request pipeline.
|
Package middleware wires authentication into the HTTP request pipeline. |
|
auth/pat
Package pat implements personal access tokens (web-pages-batch2, slot 0071): long-lived bearer credentials a user creates for scripts, CI, and the CLI.
|
Package pat implements personal access tokens (web-pages-batch2, slot 0071): long-lived bearer credentials a user creates for scripts, CI, and the CLI. |
|
auth/principal
Package principal carries the authenticated identity through a request lifecycle.
|
Package principal carries the authenticated identity through a request lifecycle. |
|
auth/refresh
Package refresh implements Stories 10.3 (issue) and 10.4 (rotate / detect reuse) for opaque refresh tokens.
|
Package refresh implements Stories 10.3 (issue) and 10.4 (rotate / detect reuse) for opaque refresh tokens. |
|
auth/securityaudit
Package securityaudit implements Story 10.16's vocabulary and write/read paths over the canonical `audit_log` table (slot 0036).
|
Package securityaudit implements Story 10.16's vocabulary and write/read paths over the canonical `audit_log` table (slot 0036). |
|
auth/serverkeys
Package serverkeys owns the long-lived Ed25519 keypair that identifies a Maktaba Server to its federation peers, the cloud relay, and any consumer that needs to verify signatures originating from "this exact box."
|
Package serverkeys owns the long-lived Ed25519 keypair that identifies a Maktaba Server to its federation peers, the cloud relay, and any consumer that needs to verify signatures originating from "this exact box." |
|
auth/sessions
Package sessions implements Story 10.2's `web_sessions` persistence layer (slot 0050).
|
Package sessions implements Story 10.2's `web_sessions` persistence layer (slot 0050). |
|
auth/signedurl
Package signedurl is the API's signed-URL minter for the streaming service (Story 10.8; verified by Epic 8 Story 8.1's middleware).
|
Package signedurl is the API's signed-URL minter for the streaming service (Story 10.8; verified by Epic 8 Story 8.1's middleware). |
|
auth/users
Package users implements Story 10.1's persistence layer for the `users` table (slot 0029).
|
Package users implements Story 10.1's persistence layer for the `users` table (slot 0029). |
|
broadcast
Package broadcast is the home's side of home broadcasting (Epic 50 story 50.22): the Broadcast page's API (Admin → Live TV → Broadcast), the six publish checks, the uplink rule, the encoder slots, the calls to Maktaba Cloud through the relay agent (which alone holds the home's server secret) and the hourly ingest-token refresh.
|
Package broadcast is the home's side of home broadcasting (Epic 50 story 50.22): the Broadcast page's API (Admin → Live TV → Broadcast), the six publish checks, the uplink rule, the encoder slots, the calls to Maktaba Cloud through the relay agent (which alone holds the home's server secret) and the hourly ingest-token refresh. |
|
broadcastaccess
Package broadcastaccess is the home's side of who may watch its broadcast channels (Epic 50 story 50.26): each channel's access (invite or open), the home's viewer limits, its invite links and codes and the devices on each invite.
|
Package broadcastaccess is the home's side of who may watch its broadcast channels (Epic 50 story 50.26): each channel's access (invite or open), the home's viewer limits, its invite links and codes and the devices on each invite. |
|
castgrant
Package castgrant is the cast grant (Epic 58 story 58.07): the credential a signed-in sender (the Android Player, the Apple Player, the web) mints for Maktaba's Cast receiver, so the TV reports progress, renews its stream URLs and walks a play queue by itself, without the person's own token.
|
Package castgrant is the cast grant (Epic 58 story 58.07): the credential a signed-in sender (the Android Player, the Apple Player, the web) mints for Maktaba's Cast receiver, so the TV reports progress, renews its stream URLs and walks a play queue by itself, without the person's own token. |
|
client
Package client says which app sent a request (Epic 44 story 44.2).
|
Package client says which app sent a request (Epic 44 story 44.2). |
|
cluster
Package cluster is the home side of multi-instance Maktaba (Epic 31, specs/epics/31-multi-instance/design.md): the join cryptography (§3.2), the instance identity and machine registry store (§4) and the database role provisioning for joined machines (§3.3).
|
Package cluster is the home side of multi-instance Maktaba (Epic 31, specs/epics/31-multi-instance/design.md): the join cryptography (§3.2), the instance identity and machine registry store (§4) and the database role provisioning for joined machines (§3.3). |
|
cluster/agent
Package agent is the home's side of the cluster channel (Epic 31 phase 2, specs/epics/31-multi-instance/design-agent.md): the authenticated, encrypted WebSocket every Maktaba process holds to the home (/api/cluster/agent), the hub that keeps the live state of every connected process, the browser WebSocket (/api/cluster/ws), the history endpoints that read the cluster files on the share, the per-process commands and the LLM router with its OpenAI-compatible door.
|
Package agent is the home's side of the cluster channel (Epic 31 phase 2, specs/epics/31-multi-instance/design-agent.md): the authenticated, encrypted WebSocket every Maktaba process holds to the home (/api/cluster/agent), the hub that keeps the live state of every connected process, the browser WebSocket (/api/cluster/ws), the history endpoints that read the cluster files on the share, the per-process commands and the LLM router with its OpenAI-compatible door. |
|
cluster/agent/relayfixture
command
Command relayfixture is the home side of the extension relay's two-process test (pipeline/tests/cluster/test_relay_two_process.py): the real cluster hub with the real service door, on a scratch Postgres database, reading the node registry (cluster_nodes), rules.relay and the Plex extension's row and token (home_secrets) from it.
|
Command relayfixture is the home side of the extension relay's two-process test (pipeline/tests/cluster/test_relay_two_process.py): the real cluster hub with the real service door, on a scratch Postgres database, reading the node registry (cluster_nodes), rules.relay and the Plex extension's row and token (home_secrets) from it. |
|
cluster/ca
Package ca is the home's cluster CA (Epic 35 story 35.16, design §18.2): a small ECDSA P-256 root, valid ten years, created by the home's API at its first start after the story.
|
Package ca is the home's cluster CA (Epic 35 story 35.16, design §18.2): a small ECDSA P-256 root, valid ten years, created by the home's API at its first start after the story. |
|
cluster/cache
Package cache is the home database's cache of the cluster channel (specs/epics/31-multi-instance/design-agent.md §7.9).
|
Package cache is the home database's cache of the cluster channel (specs/epics/31-multi-instance/design-agent.md §7.9). |
|
cluster/clustertest
Package clustertest gives the Epic 31 tests a scratch, fully migrated Postgres database.
|
Package clustertest gives the Epic 31 tests a scratch, fully migrated Postgres database. |
|
cluster/delegation
Package delegation is how a full node acts for a user without ever reading the sessions table (Epic 35 story 35.9, design §10): every node → home HTTP request is signed with the node's delegation key, a per-node HMAC key the home issues over the cluster channel (`keys` frame), keeps sealed in home_secrets, rotates daily and deletes when the machine is revoked.
|
Package delegation is how a full node acts for a user without ever reading the sessions table (Epic 35 story 35.9, design §10): every node → home HTTP request is signed with the node's delegation key, a per-node HMAC key the home issues over the cluster channel (`keys` frame), keeps sealed in home_secrets, rotates daily and deletes when the machine is revoked. |
|
cluster/homelink
Package homelink is a full node's way to the home (Epic 35 stories 35.9, 35.10): the session checks, the cluster sign-in's exchange, the home's JWKS, the home-class requests the node proxies, and the events the home pushes (a new delegation key, a revocation).
|
Package homelink is a full node's way to the home (Epic 35 stories 35.9, 35.10): the session checks, the cluster sign-in's exchange, the home's JWKS, the home-class requests the node proxies, and the events the home pushes (a new delegation key, a revocation). |
|
cluster/homeproxy
Package homeproxy is a full node's reverse proxy to its home (Epic 35 story 35.10, design §11.2): every `home` route a node gets goes to the home's API with the user's session as X-Maktaba-Delegated-Session, the node's signature (story 35.9) and X-Maktaba-Via: node.
|
Package homeproxy is a full node's reverse proxy to its home (Epic 35 story 35.10, design §11.2): every `home` route a node gets goes to the home's API with the user's session as X-Maktaba-Delegated-Session, the node's signature (story 35.9) and X-Maktaba-Via: node. |
|
cluster/link
Package link is the cluster link (Epic 35 story 35.16, design §18): machine-to-home traffic over WebSockets on mutual TLS, on the home API's existing port.
|
Package link is the cluster link (Epic 35 story 35.16, design §18): machine-to-home traffic over WebSockets on mutual TLS, on the home API's existing port. |
|
cluster/linkctx
Package linkctx carries the cluster link's word on a request (Epic 35 story 35.16): which machine sent it over its mutual-TLS link, and the home's link mode.
|
Package linkctx carries the cluster link's word on a request (Epic 35 story 35.16): which machine sent it over its mutual-TLS link, and the home's link mode. |
|
cluster/nodeauth
Package nodeauth resolves who is asking on a full node (Epic 35 story 35.9, design §10.3).
|
Package nodeauth resolves who is asking on a full node (Epic 35 story 35.9, design §10.3). |
|
cluster/nodedb
Package nodedb is a full node's database (specs/epics/37-node-replica): one *sql.DB over two Postgres servers, this machine's own read-only copy of the home's database and the home's database itself.
|
Package nodedb is a full node's database (specs/epics/37-node-replica): one *sql.DB over two Postgres servers, this machine's own read-only copy of the home's database and the home's database itself. |
|
cluster/nodemetrics
Package nodemetrics is a full node's Prometheus metrics (Epic 35 story 35.15 AC1), on the API's /metrics: the sessions it asks the home about (delegation, story 35.9), the requests it serves by placement class (story 35.10) and whether the schema guard paused it (story 35.8 AC4).
|
Package nodemetrics is a full node's Prometheus metrics (Epic 35 story 35.15 AC1), on the API's /metrics: the sessions it asks the home about (delegation, story 35.9), the requests it serves by placement class (story 35.10) and whether the schema guard paused it (story 35.8 AC4). |
|
cluster/placement
Package placement says where each API route is served when the API runs on a full node (Epic 35 story 35.10, design §11.1):
|
Package placement says where each API route is served when the API runs on a full node (Epic 35 story 35.10, design §11.1): |
|
cluster/relay
Package relay is the home's service door (story 31.R, design specs/epics/31-multi-instance/story-31-relay-service-door.md): a cluster node sends an extension's HTTP request over its sealed agent channel, and the home checks it against that extension's allow-list, adds the secret the node never sees (the Plex token, kept in home_secrets), forwards it to the configured server and streams the answer back with the secret scrubbed out of it.
|
Package relay is the home's service door (story 31.R, design specs/epics/31-multi-instance/story-31-relay-service-door.md): a cluster node sends an extension's HTTP request over its sealed agent channel, and the home checks it against that extension's allow-list, adds the secret the node never sees (the Plex token, kept in home_secrets), forwards it to the configured server and streams the answer back with the secret scrubbed out of it. |
|
cluster/schemaguard
Package schemaguard is a full node's API schema guard (Epic 35 story 35.8, design §9.3): the same rule, table and reason texts as the pipeline's cluster/schema.py and the streaming node's streaming/internal/cluster/schema.go (Epic 31 design §5.1).
|
Package schemaguard is a full node's API schema guard (Epic 35 story 35.8, design §9.3): the same rule, table and reason texts as the pipeline's cluster/schema.py and the streaming node's streaming/internal/cluster/schema.go (Epic 31 design §5.1). |
|
cluster/switchover
Package switchover runs a switch of the home from the home's API (specs/epics/ 37-node-replica, "Switching the home"): another machine of the cluster, whose copy follows this home, becomes the home, and this one one of its machines.
|
Package switchover runs a switch of the home from the home's API (specs/epics/ 37-node-replica, "Switching the home"): another machine of the cluster, whose copy follows this home, becomes the home, and this one one of its machines. |
|
cluster/vodfallback
Package vodfallback serves video on demand on a full node (Epic 35 story 35.8 AC9, story 35.10 AC4a, design §11.5).
|
Package vodfallback serves video on demand on a full node (Epic 35 story 35.8 AC9, story 35.10 AC4a, design §11.5). |
|
compat
Package compat is the compatibility contract between a home and its apps (Epic 58 story 58.01).
|
Package compat is the compatibility contract between a home and its apps (Epic 58 story 58.01). |
|
compat/levelcheck
Package levelcheck keeps the API level honest (Epic 58 story 58.01): it reads the response surface of an OpenAPI document (every operation's success responses, their schemas inlined) and finds what an older app would get wrong in a newer one, a route or a response gone, a field gone, a field whose type changed, a field that may now be missing.
|
Package levelcheck keeps the API level honest (Epic 58 story 58.01): it reads the response surface of an OpenAPI document (every operation's success responses, their schemas inlined) and finds what an older app would get wrong in a newer one, a route or a response gone, a field gone, a field whose type changed, a field that may now be missing. |
|
components
Package components is the API's handle on the component tables (Epic 51): the shared store (shared/components/store) stamped with this build's version.
|
Package components is the API's handle on the component tables (Epic 51): the shared store (shared/components/store) stamped with this build's version. |
|
directaccess
Package directaccess is the home's side of direct remote access (Epic 50, story 50.15): it asks the router to open a port (UPnP-IGD, NAT-PMP, then PCP), notices a shared address (CGNAT), keeps the home's key and certificate for *.<home id>.<its domain>, serves the same web and API as the LAN port over TLS on the direct listener, and tells the cloud through the relay agent (POST /admin/cloud-link/direct).
|
Package directaccess is the home's side of direct remote access (Epic 50, story 50.15): it asks the router to open a port (UPnP-IGD, NAT-PMP, then PCP), notices a shared address (CGNAT), keeps the home's key and certificate for *.<home id>.<its domain>, serves the same web and API as the LAN port over TLS on the direct listener, and tells the cloud through the relay agent (POST /admin/cloud-link/direct). |
|
discovery
Package discovery implements LAN service discovery (Epic 15 plans 15.1/15.5/15.6).
|
Package discovery implements LAN service discovery (Epic 15 plans 15.1/15.5/15.6). |
|
extcheck
Package extcheck is "Test connection" for the Plex and web search extensions (the Cloudflare Stream one lives in tvremote).
|
Package extcheck is "Test connection" for the Plex and web search extensions (the Cloudflare Stream one lives in tvremote). |
|
flags
Package flags resolves the feature-flag bundle a signed-in user sees (Epic 16 Story 16.8) and signs it with the server's long-term Ed25519 identity key (Story 10.18) so a client that keeps it can tell a tampered copy from the server's.
|
Package flags resolves the feature-flag bundle a signed-in user sees (Epic 16 Story 16.8) and signs it with the server's long-term Ed25519 identity key (Story 10.18) so a client that keeps it can tell a tampered copy from the server's. |
|
graphql
Package graphql is the GraphQL surface of the API (Story 7.17).
|
Package graphql is the GraphQL surface of the API (Story 7.17). |
|
grpcclients/jsoncodec
Package jsoncodec is a gRPC codec that marshals messages with encoding/json instead of protobuf.
|
Package jsoncodec is a gRPC codec that marshals messages with encoding/json instead of protobuf. |
|
grpcclients/pipeline
Package pipeline is the API's typed wrapper around the Pipeline gRPC service (Story 7.18 AC-1).
|
Package pipeline is the API's typed wrapper around the Pipeline gRPC service (Story 7.18 AC-1). |
|
grpcclients/streaming
Package streaming is the API's typed wrapper around the Streaming gRPC service (Story 7.18 AC-2).
|
Package streaming is the API's typed wrapper around the Streaming gRPC service (Story 7.18 AC-2). |
|
handlers/analytics
Package analytics implements the admin analytics reads (Epic 29, widened by Epic 44 story 44.6), per-video statistics (29.5) and the CSV/JSON export (29.6).
|
Package analytics implements the admin analytics reads (Epic 29, widened by Epic 44 story 44.6), per-video statistics (29.5) and the CSV/JSON export (29.6). |
|
handlers/apitokens
Package apitokens implements the self-service personal-access-token surface (web-pages-batch2 Profile → API Tokens):
|
Package apitokens implements the self-service personal-access-token surface (web-pages-batch2 Profile → API Tokens): |
|
handlers/auth
Package auth implements Phase 9 (Epic 10) HTTP handlers for the login surface:
|
Package auth implements Phase 9 (Epic 10) HTTP handlers for the login surface: |
|
handlers/browse
Package browse implements the browsing API of Epic 45 (story 45.4): the library cards, each user's pinned libraries, the home rows and a library's hub.
|
Package browse implements the browsing API of Epic 45 (story 45.4): the library cards, each user's pinned libraries, the home rows and a library's hub. |
|
handlers/channels
Package channels implements Story 27.1 — virtual channel CRUD:
|
Package channels implements Story 27.1 — virtual channel CRUD: |
|
handlers/cluster
Package cluster serves the home side of multi-instance Maktaba (Epic 31, specs/epics/31-multi-instance/design.md §8):
|
Package cluster serves the home side of multi-instance Maktaba (Epic 31, specs/epics/31-multi-instance/design.md §8): |
|
handlers/clusterauth
Package clusterauth serves sign-ins across the machines of a cluster (Epic 35 story 35.9, design §10): on the home, the delegation endpoint a full node resolves a session, a bearer or a personal access token through, and the sign-outs a node made while the home did not answer; on every machine, its /api/cluster/self (node.go).
|
Package clusterauth serves sign-ins across the machines of a cluster (Epic 35 story 35.9, design §10): on the home, the delegation endpoint a full node resolves a session, a bearer or a personal access token through, and the sign-outs a node made while the home did not answer; on every machine, its /api/cluster/self (node.go). |
|
handlers/collections
Package collections implements Story 7.14 collection routes:
|
Package collections implements Story 7.14 collection routes: |
|
handlers/common
Package common holds the small handler primitives that every Epic 7 / Phase 6 handler package consumes: JSON read/write, URL-id extraction, query parsing, and the JSON envelope shape.
|
Package common holds the small handler primitives that every Epic 7 / Phase 6 handler package consumes: JSON read/write, URL-id extraction, query parsing, and the JSON envelope shape. |
|
handlers/components
Package components serves the admin routes of the components (Epic 51, story 51.08):
|
Package components serves the admin routes of the components (Epic 51, story 51.08): |
|
handlers/contextcard
Package contextcard implements the Story 26.9 web context card:
|
Package contextcard implements the Story 26.9 web context card: |
|
handlers/devices
Package devices implements Story 7.22 device-registration routes:
|
Package devices implements Story 7.22 device-registration routes: |
|
handlers/discovery
A TV signed in from anywhere with a code through Maktaba Cloud (Epic 58 story 58.03).
|
A TV signed in from anywhere with a code through Maktaba Cloud (Epic 58 story 58.03). |
|
handlers/enrichment
Package enrichment implements the Story 26.6 enrichment review surface:
|
Package enrichment implements the Story 26.6 enrichment review surface: |
|
handlers/filler
Package filler implements the Story 27.10 filler & bumper routes:
|
Package filler implements the Story 27.10 filler & bumper routes: |
|
handlers/flags
Package flags is the HTTP surface of feature-flag resolution (Epic 16 Story 16.8; the client side is Story 16.6):
|
Package flags is the HTTP surface of feature-flag resolution (Epic 16 Story 16.8; the client side is Story 16.6): |
|
handlers/guide
Package guide implements Story 27.4 — the EPG read surface over channel_programs:
|
Package guide implements Story 27.4 — the EPG read surface over channel_programs: |
|
handlers/jobs
Package jobs implements Stories 7.12 + 7.13:
|
Package jobs implements Stories 7.12 + 7.13: |
|
handlers/libraries
Story 9.17 — surfaced library audit log + helpers shared by the destructive endpoints (Story 9.15 deletion, Story 9.1 settings PATCH, Story 9.11 speaker merge — owned in their respective handlers).
|
Story 9.17 — surfaced library audit log + helpers shared by the destructive endpoints (Story 9.15 deletion, Story 9.1 settings PATCH, Story 9.11 speaker merge — owned in their respective handlers). |
|
handlers/libraryacl
Package libraryacl implements the admin Library-ACL matrix surface (web-pages-batch2):
|
Package libraryacl implements the admin Library-ACL matrix surface (web-pages-batch2): |
|
handlers/logs
Package logs implements the troubleshooting log-collection surface:
|
Package logs implements the troubleshooting log-collection surface: |
|
handlers/models
Package models implements the Model Management surface used by the web Settings page:
|
Package models implements the Model Management surface used by the web Settings page: |
|
handlers/parental
Package parental serves restricted accounts and their guardians (Epic 57 story 57.02): who is restricted, at what limit, who looks after them, and their allow and block rules.
|
Package parental serves restricted accounts and their guardians (Epic 57 story 57.02): who is restricted, at what limit, who looks after them, and their allow and block rules. |
|
handlers/perf
Package perf wires the admin endpoints documented in plan-18-08 (cache flush) and plan-18-01 (budget surface):
|
Package perf wires the admin endpoints documented in plan-18-08 (cache flush) and plan-18-01 (budget surface): |
|
handlers/playqueue
Package playqueue is Epic 56 story 56.01: one play queue on the server.
|
Package playqueue is Epic 56 story 56.01: one play queue on the server. |
|
handlers/plugins
Package plugins holds the HTTP routes of Epic 54 on the API's TCP listener.
|
Package plugins holds the HTTP routes of Epic 54 on the API's TCP listener. |
|
handlers/processes
Package processes serves the process supervisor's state to the web app and records crashes for the control centre (Story 22.9).
|
Package processes serves the process supervisor's state to the web app and records crashes for the control centre (Story 22.9). |
|
handlers/queues
Package queues implements the queue control-centre API of plan-06-11 §8 (workstream B):
|
Package queues implements the queue control-centre API of plan-06-11 §8 (workstream B): |
|
handlers/queues/queuestest
Package queuestest is a tiny scripted database/sql driver for unit tests of the queue handlers.
|
Package queuestest is a tiny scripted database/sql driver for unit tests of the queue handlers. |
|
handlers/recommendations
Package recommendations implements Story 7.21 + Epic 14 (Stories 14.6 / 14.7):
|
Package recommendations implements Story 7.21 + Epic 14 (Stories 14.6 / 14.7): |
|
handlers/reports
Package reports serves the HTML reports the pipeline writes into its reports folder (default ~/.maktaba/cache/reviews, beside the thumbnail cache) and drives the channel plan preview:
|
Package reports serves the HTML reports the pipeline writes into its reports folder (default ~/.maktaba/cache/reviews, beside the thumbnail cache) and drives the channel plan preview: |
|
handlers/review
Package review serves word review (Epic 52): the suspect words word_check saved, the audio around each, the fixes a reviewer makes (transcript edits, undo), what the fixes teach (the vocabulary), each library's word review settings and the language packs' report.
|
Package review serves word review (Epic 52): the suspect words word_check saved, the audio around each, the fixes a reviewer makes (transcript edits, undo), what the fixes teach (the vocabulary), each library's word review settings and the language packs' report. |
|
handlers/rules
Package rules exposes the admin-editable pipeline "rules" (planner, grouping and detection knobs) over HTTP:
|
Package rules exposes the admin-editable pipeline "rules" (planner, grouping and detection knobs) over HTTP: |
|
handlers/search
Package search implements Stories 7.8 and 7.9 and the per-video results:
|
Package search implements Stories 7.8 and 7.9 and the per-video results: |
|
handlers/security
Package security wires the public security endpoints:
|
Package security wires the public security endpoints: |
|
handlers/series
Package series implements the Story 26.10 cross-library series browser read paths:
|
Package series implements the Story 26.10 cross-library series browser read paths: |
|
handlers/serversettings
Package serversettings is the admin's view of server.toml (Epic 45, story 45.3):
|
Package serversettings is the admin's view of server.toml (Epic 45, story 45.3): |
|
handlers/settings
Package settings implements Story 7.15:
|
Package settings implements Story 7.15: |
|
handlers/speakers
Package speakers implements the Story 7.14 speaker routes:
|
Package speakers implements the Story 7.14 speaker routes: |
|
handlers/streaming
Package streaming implements Stories 7.10, 7.11:
|
Package streaming implements Stories 7.10, 7.11: |
|
handlers/subscriptions
Package subscriptions wires the entitlement HTTP surface (Epic 16):
|
Package subscriptions wires the entitlement HTTP surface (Epic 16): |
|
handlers/systemstatus
Package systemstatus answers "is everything OK, and if not, what is wrong and what do I do" for the System health page (/admin/health):
|
Package systemstatus answers "is everything OK, and if not, what is wrong and what do I do" for the System health page (/admin/health): |
|
handlers/tags
Package tags implements the Story 7.14 tag routes:
|
Package tags implements the Story 7.14 tag routes: |
|
handlers/telemetry
Package telemetry is the home's part of anonymous usage data (Epic 16 stories 16.5 and 16.7): what goes to Maktaba Cloud to improve Maktaba, never to the home's admin (who already has Epic 44's named analytics).
|
Package telemetry is the home's part of anonymous usage data (Epic 16 stories 16.5 and 16.7): what goes to Maktaba Cloud to improve Maktaba, never to the home's admin (who already has Epic 44's named analytics). |
|
handlers/transcription
Package transcription serves the live report of the whole-library transcription programme:
|
Package transcription serves the live report of the whole-library transcription programme: |
|
handlers/tv
Package tv is the admin + client surface that makes Maktaba TV reachable from outside the web app:
|
Package tv is the admin + client surface that makes Maktaba TV reachable from outside the web app: |
|
handlers/tvchange
Package tvchange serves the TV change API (Epic 33, story 33.10 AC8; README "APIs"):
|
Package tvchange serves the TV change API (Epic 33, story 33.10 AC8; README "APIs"): |
|
handlers/tvcluster
Package tvcluster is the admin surface of Maktaba TV across the cluster (Epic 32, stories 32.4 and 32.5):
|
Package tvcluster is the admin surface of Maktaba TV across the cluster (Epic 32, stories 32.4 and 32.5): |
|
handlers/tvremote
Package tvremote is the admin HTTP surface of Epic 32's remote viewing (story 32.6: the Cloudflare Stream integration).
|
Package tvremote is the admin HTTP surface of Epic 32's remote viewing (story 32.6: the Cloudflare Stream integration). |
|
handlers/videos
Package videos implements Story 7.4 (list/detail/patch/delete), Story 7.5 (process/reprocess), Story 7.6 (transcript window), and the read-only enumerations from Story 7.7 (subtitles/chapters lists scoped to a video).
|
Package videos implements Story 7.4 (list/detail/patch/delete), Story 7.5 (process/reprocess), Story 7.6 (transcript window), and the read-only enumerations from Story 7.7 (subtitles/chapters lists scoped to a video). |
|
handlers/watch
Package watch implements Epic 29's watch-session collection and the per-user history / activity reads built on top of it.
|
Package watch implements Epic 29's watch-session collection and the per-user history / activity reads built on top of it. |
|
handlers/ws
Package ws implements Story 7.16 fan-out endpoints:
|
Package ws implements Story 7.16 fan-out endpoints: |
|
handlers/ws/eventbus
Package eventbus is the cross-replica WebSocket event bus (Epic 19 Story 19.2, HLB-353).
|
Package eventbus is the cross-replica WebSocket event bus (Epic 19 Story 19.2, HLB-353). |
|
hostload
Package hostload says when the machine this server runs on is overloaded: more work wants the CPU than it has cores, for minutes, so every job and the database are slow.
|
Package hostload says when the machine this server runs on is overloaded: more work wants the CPU than it has cores, for minutes, so every job and the database are slow. |
|
httperror
Package httperror implements the API's RFC 9457 problem+json error envelope (Story 7.1 AC-1).
|
Package httperror implements the API's RFC 9457 problem+json error envelope (Story 7.1 AC-1). |
|
httpsec
Package httpsec ships the transport-security middleware for the Maktaba API (Story 10.15).
|
Package httpsec ships the transport-security middleware for the Maktaba API (Story 10.15). |
|
idempotency
Package idempotency stores the per-key request/response pair the API replays when a client retries a mutation with the same Idempotency-Key header.
|
Package idempotency stores the per-key request/response pair the API replays when a client retries a mutation with the same Idempotency-Key header. |
|
libaccess
Package libaccess answers whether Maktaba may write a library (Epic 59, story 59.03): the result of the library's last access check (libraries.access), which the API's writing actions consult before they touch a file.
|
Package libaccess answers whether Maktaba may write a library (Epic 59, story 59.03): the result of the library's last access check (libraries.access), which the API's writing actions consult before they touch a file. |
|
libpaths
Package libpaths resolves a library folder between the database's form and this machine's (epic 45).
|
Package libpaths resolves a library folder between the database's form and this machine's (epic 45). |
|
middleware
Package middleware bundles the canonical chi.Mux middleware stack for the Maktaba API.
|
Package middleware bundles the canonical chi.Mux middleware stack for the Maktaba API. |
|
nodemode
Package nodemode is what a full node's API (Epic 35 story 35.8, design §9.1) knows about itself: that it runs in node mode (MAKTABA_NODE_MODE=1, set by the node's supervisor from node.json), the home it belongs to, and the rule that it never changes the schema: it refuses to migrate, and refuses to start when its database role could run DDL (a copied superuser URL must never let a node migrate by mistake).
|
Package nodemode is what a full node's API (Epic 35 story 35.8, design §9.1) knows about itself: that it runs in node mode (MAKTABA_NODE_MODE=1, set by the node's supervisor from node.json), the home it belongs to, and the rule that it never changes the schema: it refuses to migrate, and refuses to start when its database role could run DDL (a copied superuser URL must never let a node migrate by mistake). |
|
notify
Package notify is the in-app notification store and fan-out (Epic 33, story 33.13; README decision 8: a general notifications table, TV changes its first user).
|
Package notify is the in-app notification store and fan-out (Epic 33, story 33.13; README decision 8: a general notifications table, TV changes its first user). |
|
paginate
Package paginate implements the API's single cursor-pagination contract (Story 7.2).
|
Package paginate implements the API's single cursor-pagination contract (Story 7.2). |
|
parental
Package parental holds restricted accounts (Epic 57): a viewer's policy, the guardians an admin named for them, and their allow and block rules (story 57.02, slot 0221).
|
Package parental holds restricted accounts (Epic 57): a viewer's policy, the guardians an admin named for them, and their allow and block rules (story 57.02, slot 0221). |
|
perf
Package perf implements the API-side performance budget gate (Epic 18).
|
Package perf implements the API-side performance budget gate (Epic 18). |
|
pgdsn
Package pgdsn adapts a libpq connection string to lib/pq, which has no sslmode=prefer or sslmode=allow: it fails with `pq: unsupported sslmode "prefer"`.
|
Package pgdsn adapts a libpq connection string to lib/pq, which has no sslmode=prefer or sslmode=allow: it fails with `pq: unsupported sslmode "prefer"`. |
|
plugins
Package plugins is the plugin API's rules (Epic 54, story 54.04): invocation tokens minted from the grants the API stores, and the checks every plugin call passes (token, capability, subject and library scope, quota, rate).
|
Package plugins is the plugin API's rules (Epic 54, story 54.04): invocation tokens minted from the grants the API stores, and the checks every plugin call passes (token, capability, subject and library scope, quota, rate). |
|
plugins/catalog
Package catalog is the home's side of the plugin store (Epic 54, story 54.17): the loop `api:plugins_catalog` that fetches the signed lists from the store's CDN, verifies them by the chain of trust (story 54.14, shared/plugins/pluginsig), keeps them and the newest versions seen (in <data>/state and in Postgres, the newer of the two winning), applies the revocation list to the installed plugins (the kill switch), offers updates, and installs from the store.
|
Package catalog is the home's side of the plugin store (Epic 54, story 54.17): the loop `api:plugins_catalog` that fetches the signed lists from the store's CDN, verifies them by the chain of trust (story 54.14, shared/plugins/pluginsig), keeps them and the newest versions seen (in <data>/state and in Postgres, the newer of the two winning), applies the revocation list to the installed plugins (the kill switch), offers updates, and installs from the store. |
|
plugins/statements
Package statements is the plugin API's registry of named SQL statements (Epic 54, story 54.24 §2): the only way Maktaba's own first-party plugins reach the database.
|
Package statements is the plugin API's registry of named SQL statements (Epic 54, story 54.24 §2): the only way Maktaba's own first-party plugins reach the database. |
|
plugins/storelink
Package storelink is the home's half of linking it to a plugin store account (Epic 54, story 54.15 §5).
|
Package storelink is the home's half of linking it to a plugin store account (Epic 54, story 54.15 §5). |
|
reqid
Package reqid carries the per-request UUID v7 across the middleware chain via context.
|
Package reqid carries the per-request UUID v7 across the middleware chain via context. |
|
reviewhome
Package reviewhome seeds and maintains the store reviewers' home (Epic 58 story 58.04): review.maktaba.tv, a Maktaba home the project runs with public-domain and openly licensed content only.
|
Package reviewhome seeds and maintains the store reviewers' home (Epic 58 story 58.04): review.maktaba.tv, a Maktaba home the project runs with public-domain and openly licensed content only. |
|
router
Phase 10 handler wiring — the four packages that previously had working Mount() methods but no caller.
|
Phase 10 handler wiring — the four packages that previously had working Mount() methods but no caller. |
|
runtimecfg
Package runtimecfg reads the runtime settings an admin PATCHes through /api/settings (app_settings rows such as search.fts_weight or session.url_ttl_sec) for the handlers that use them.
|
Package runtimecfg reads the runtime settings an admin PATCHes through /api/settings (app_settings rows such as search.fts_weight or session.url_ttl_sec) for the handlers that use them. |
|
runtimecfg/runtimecfgtest
Package runtimecfgtest gives tests an app_settings table to store runtime settings in (SQLite, in memory).
|
Package runtimecfgtest gives tests an app_settings table to store runtime settings in (SQLite, in memory). |
|
safego
Package safego starts background goroutines that cannot take the API down.
|
Package safego starts background goroutines that cannot take the API down. |
|
scale
Package scale carries the horizontal-scaling stubs documented in Epic 19 plans 19.2–19.4 and 19.7.
|
Package scale carries the horizontal-scaling stubs documented in Epic 19 plans 19.2–19.4 and 19.7. |
|
searchindex
Package searchindex makes keyword search's BM25 indexes (Epic 49, stories 49.5 and 49.6) where the database can hold them.
|
Package searchindex makes keyword search's BM25 indexes (Epic 49, stories 49.5 and 49.6) where the database can hold them. |
|
searchterms
Package searchterms is keyword search's terms dictionary in Go (Epic 49 story 49.8): a word's key, as search_terms holds it (slot 0235), and the words of a text.
|
Package searchterms is keyword search's terms dictionary in Go (Epic 49 story 49.8): a word's key, as search_terms holds it (slot 0235), and the words of a text. |
|
secret
Package secret centralises Maktaba's handling of sensitive configuration values (Story 10.14).
|
Package secret centralises Maktaba's handling of sensitive configuration values (Story 10.14). |
|
secrets
Package secrets is the home's sealed secret store (Epic 32 story 32.6, slot 0120 home_secrets).
|
Package secrets is the home's sealed secret store (Epic 32 story 32.6, slot 0120 home_secrets). |
|
security
Package security holds the cross-cutting security primitives wired across Epic 23 stories:
|
Package security holds the cross-cutting security primitives wired across Epic 23 stories: |
|
sharepath
Package sharepath resolves the canonical media paths of story 31.3 (smb://<server>/<share>/<path>, nfs://..., file:///...) on the home.
|
Package sharepath resolves the canonical media paths of story 31.3 (smb://<server>/<share>/<path>, nfs://..., file:///...) on the home. |
|
subscriptions
embedded_pubkey.go bundles the license-server Ed25519 public key into the binary at build time (Story 16.4: "Server bundles license-server public key at build time").
|
embedded_pubkey.go bundles the license-server Ed25519 public key into the binary at build time (Story 16.4: "Server bundles license-server public key at build time"). |
|
swr
Package swr is a stale-while-revalidate cache of one value with a single build in flight.
|
Package swr is a stale-while-revalidate cache of one value with a single build in flight. |
|
system
Security advisories for the running version (Story 23.8 AC4, TC2).
|
Security advisories for the running version (Story 23.8 AC4, TC2). |
|
textnorm
Package textnorm is the Arabic normalisation of keyword search (Epic 49 story 49.4) in Go: the same folding as Postgres's maktaba_normalize() (migration 0231), for what normalises in the application (SQLite installs, whose FTS5 indexes and matches the normalised text).
|
Package textnorm is the Arabic normalisation of keyword search (Epic 49 story 49.4) in Go: the same folding as Postgres's maktaba_normalize() (migration 0231), for what normalises in the application (SQLite installs, whose FTS5 indexes and matches the normalised text). |
|
transcript
Package transcript writes a reviewer's word fixes (Epic 52, story 52.9).
|
Package transcript writes a reviewer's word fixes (Epic 52, story 52.9). |
|
transcript/transcripttest
Package transcripttest seeds a scratch Postgres with a video, its active transcript and word flags, for the word review tests (Epic 52).
|
Package transcripttest seeds a scratch Postgres with a video, its active transcript and word flags, for the word review tests (Epic 52). |
|
transcript/worddata
Package worddata reads and writes a transcript sentence's packed words (Epic 52, story 52.1): transcript_segments.word_data.
|
Package worddata reads and writes a transcript sentence's packed words (Epic 52, story 52.1): transcript_segments.word_data. |
|
tvchange
Package tvchange is the TV change controller (Epic 33, stories 33.10 and 33.12): the change store, the state machine of design §11.2, approval and the auto-promote rules, the open drafts the channel editor and the TV settings write into, and the controller loop that verifies staged changes, promotes approved ones and enqueues the pipeline's tv_stage / tv_swap / tv_gc jobs.
|
Package tvchange is the TV change controller (Epic 33, stories 33.10 and 33.12): the change store, the state machine of design §11.2, approval and the auto-promote rules, the open drafts the channel editor and the TV settings write into, and the controller loop that verifies staged changes, promotes approved ones and enqueues the pipeline's tv_stage / tv_swap / tv_gc jobs. |
|
tvchange/tvchangetest
Package tvchangetest gives the Epic 33 tests a database with the TV change tables on both backends: SQLite (always: the slot 0127 / 0128 / 0130 SQLite twins plus the tables they read) and Postgres (a scratch, fully migrated database when MAKTABA_TEST_PG_URL is set).
|
Package tvchangetest gives the Epic 33 tests a database with the TV change tables on both backends: SQLite (always: the slot 0127 / 0128 / 0130 SQLite twins plus the tables they read) and Postgres (a scratch, fully migrated database when MAKTABA_TEST_PG_URL is set). |
|
tvremote
Package tvremote is Maktaba's remote viewing through Cloudflare Stream (Epic 32).
|
Package tvremote is Maktaba's remote viewing through Cloudflare Stream (Epic 32). |
|
tvremote/cf
Package cf is Maktaba's client for the Cloudflare API v4, the Stream calls of Epic 32 (design §7.1): live inputs, videos and lifecycle, signing keys and token minting, storage use and the GraphQL analytics probe.
|
Package cf is Maktaba's client for the Cloudflare API v4, the Stream calls of Epic 32 (design §7.1): live inputs, videos and lifecycle, signing keys and token minting, storage use and the GraphQL analytics probe. |
|
tvremote/cftest
Package cftest is a fake Cloudflare API for the Epic 32 tests (32.6 to 32.10): token verify, live inputs, videos, storage use, signing keys, the GraphQL analytics probe, the customer-domain lifecycle endpoint and live outputs (simulcast, 32.13), with switches to make each one fail.
|
Package cftest is a fake Cloudflare API for the Epic 32 tests (32.6 to 32.10): token verify, live inputs, videos, storage use, signing keys, the GraphQL analytics probe, the customer-domain lifecycle endpoint and live outputs (simulcast, 32.13), with switches to make each one fail. |
|
tvremote/rtmptest
Package rtmptest is a fake RTMP(S) ingest for the Epic 32 end-to-end tests: enough of RTMP (handshake, chunk stream, AMF0 connect/createStream/publish) for ffmpeg's rtmp/rtmps muxer to publish to it.
|
Package rtmptest is a fake RTMP(S) ingest for the Epic 32 end-to-end tests: enough of RTMP (handshake, chunk stream, AMF0 connect/createStream/publish) for ffmpeg's rtmp/rtmps muxer to publish to it. |
|
tvremote/spike
Package spike is the Cloudflare Stream spike of Epic 32 story 32.6 (AC7): with a real account it creates a live input, pushes a test pattern with ffmpeg over RTMPS (or SRT), and measures and checks what the design assumes but Cloudflare does not document:
|
Package spike is the Cloudflare Stream spike of Epic 32 story 32.6 (AC7): with a real account it creates a live input, pushes a test pattern with ffmpeg over RTMPS (or SRT), and measures and checks what the design assumes but Cloudflare does not document: |
|
updates
Package updates is the home's update policy, release discovery and scheduling (Epic 35, story 35.3; design §4).
|
Package updates is the home's update policy, release discovery and scheduling (Epic 35, story 35.3; design §4). |
|
updates/dltoken
Package dltoken is the home's download token for a machine that has no delegation key yet: a worker-only machine converting to a full node on its update (Epic 35 story 35.8 AC8).
|
Package dltoken is the home's download token for a machine that has no delegation key yet: a worker-only machine converting to a full node on its update (Epic 35 story 35.8 AC8). |
|
usage
Package usage counts the API's use per app and day (Epic 44 story 44.5).
|
Package usage counts the API's use per app and day (Epic 44 story 44.5). |
|
version
Package version exposes build-time metadata injected via -ldflags.
|
Package version exposes build-time metadata injected via -ldflags. |
|
videotitle
Package videotitle holds the one rule for the title a video shows when it has no metadata title: its file name without the final extension.
|
Package videotitle holds the one rule for the title a video shows when it has no metadata title: its file name without the final extension. |
|
tools
|
|
|
fp-packages
command
Command fp-packages checks a release directory's first-party plugin packages (Epic 54, story 54.27 §2, T01) the way the server trusts one (story 54.22 §2, firstparty.CheckPackage): every plugin of the bundle this binary embeds has its <id>-<version>.mkplugin and <id>-<version>.files.json, both listed in the directory's checksums.txt; each unpacks with the home's reader to that files.json; its manifest, strings and statements are the embedded ones, stamped with the version.
|
Command fp-packages checks a release directory's first-party plugin packages (Epic 54, story 54.27 §2, T01) the way the server trusts one (story 54.22 §2, firstparty.CheckPackage): every plugin of the bundle this binary embeds has its <id>-<version>.mkplugin and <id>-<version>.files.json, both listed in the directory's checksums.txt; each unpacks with the home's reader to that files.json; its manifest, strings and statements are the embedded ones, stamped with the version. |
|
plugin-api-dev
command
Command plugin-api-dev serves the plugin API's trusted routes and the token mint on a test database, for the parity proof (Epic 54, story 54.26) and the first-party plugins' contract tests: the same statements executor, roles and tokens the API runs, with a first-party bundle read from a file (a developer's build of the plugins).
|
Command plugin-api-dev serves the plugin API's trusted routes and the token mint on a test database, for the parity proof (Epic 54, story 54.26) and the first-party plugins' contract tests: the same statements executor, roles and tokens the API runs, with a first-party bundle read from a file (a developer's build of the plugins). |