subflux

command module
v0.5.50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: AGPL-3.0 Imports: 60 Imported by: 0

README

subflux

Image Size Platforms Mutation SBOM

A fast, small subtitle search, download, and sync engine for Sonarr and Radarr. A Go-based Bazarr alternative that ships as a ~14 MB container.

⚠️ Alpha software

Subflux is pre-1.0 and under active development. It is functional and runs a 52,000-episode library in production today, but rough edges remain. Any update can introduce a breaking change. The config format, the on-disk state, the API, and behavior can all change between releases. Pin a specific image tag instead of latest, and check the release notes before upgrading.

What it does

Subflux finds, scores, downloads, and time-syncs subtitles for your Sonarr/Radarr library. It watches the *arr import history (default 30 s poll) so new downloads get subtitles within moments of importing, and runs scheduled full-library scans (default 24 h) to fill gaps and upgrade what's already there. Every result passes an identity check and a release-quality score; the best one is downloaded, synced against the video's own timing, cleaned up, and saved next to the media file. A web UI shows per-show coverage at a glance and lets you search, pick, and visually sync subtitles by hand when you want control.

Why subflux

Subflux was born from debugging Bazarr consuming 15-20 GB of RAM on a 52,000-episode library (a CPython allocator fragmentation problem, architectural rather than fixable). The answer was a rewrite with resource discipline as a design goal rather than an optimization pass:

  • ~14 MB compressed image, ffmpeg included. Distroless base, one static Go binary, no Python, no runtime dependencies.
  • The library that broke Bazarr runs in a 1 GB container limit. Arr responses are batch-fetched then iterated (the largest payload, 4,360 movies, decodes to 24 MB); goroutine pools are bounded; media probing streams instead of buffering.
  • A purpose-built ffmpeg (~5 MB, plus ~2 MB ffprobe): decoders for every mainstream video and audio codec plus the common subtitle formats (SRT/ASS, MOV text, WebVTT, PGS, DVD, DVB), a single x264 encoder for the 360p preview, statically linked, no network support compiled in. It does track detection, subtitle/audio extraction, and the sync editor's live preview.
  • One file of state. Pure-Go bbolt (no SQLite, no CGO): crash-durable on commit, hot-backed-up on schedule, and reconciled against the filesystem so it heals itself after manual file changes.
  • amd64 + arm64 images, cosign-signed, with SBOM attestations.

Features

Search and scoring
  • Eight online providers (OpenSubtitles, Gestdown, SubSource, SubDL, BetaSeries, AnimeTosho, YIFY Subtitles, HDBits) behind one interface, plus always-on embedded-track detection (local ffprobe inspection, not a provider).
  • Two-phase scoring: a hard identity gate (IMDB/TVDB/TMDB id, season/episode, title validation) before a 0-100 release-quality score used for ranking and upgrades. Upgrades replace an existing subtitle only when a strictly better release shows up.
  • Language rules keyed on the audio track: map detected audio languages to subtitle targets (Japanese audio can want different subs than English audio), with standard/forced/hi variants and per-target provider or min-score overrides.
  • Anime-aware numbering: searches run with aired, scene (TheXEM), and absolute (TVDB) numbering and merge the results, so long-running shows with weird episode orders still match.
  • Embedded-subtitle awareness: coverage counts text and bitmap tracks already in the container (SRT/ASS, PGS, VobSub, DVB), with per-codec ignore settings (top-level embedded_subtitles config section) so an unwanted PGS track doesn't stop the search for a text alternative.
  • Adaptive backoff: per-provider exponential backoff for no-result media, season-level early termination, and per-provider timeouts, so failing or empty providers don't get hammered.
  • Manual override with locks: manual downloads are saved as numbered siblings (movie.fr.1.srt) and lock the item from automation; locks clear automatically when the files are deleted or the video is replaced.
The sync engine

Downloaded subtitles rarely match your exact file, so subflux syncs every download before it reaches the disk. The engine is a from-scratch Go port of alass plus subflux's own additions: split-aware and framerate-aware alignment, audio sync via a re-tuned voice-activity detector cross-correlated with the subtitle's dialogue signal, and cross-language anchor matching (a French subtitle can sync against the English track embedded in the file). The strategies run concurrently and vote; the winner is applied only above a confidence threshold, so a sync that is not confident does not happen.

Hash-matched and same-release downloads skip sync (their timing is already right), and forced subtitles skip it (too few cues to align reliably). Every saved file is post-processed: encoding normalization to UTF-8, hearing-impaired annotation removal, tag stripping, and whitespace cleanup. Auto-downloads sync against an embedded subtitle reference when the file has one (audio-based sync as an automatic fallback is opt-in); audio sync and manual offset adjustment are always available from the sync dialog.

The web UI

A single-page app served by the same binary: framework-free TypeScript compiled to ~380 KB of first-party JS, loaded as native ES modules, updating live over SSE.

  • Coverage table: every series and movie against your language rules, with per-target have/total badges, embedded-track counts, a missing-only filter, and text search.
  • Visual sync editor: subflux transcodes the actual video to a 360p stream on the fly (fMP4 over MSE, using the bundled ffmpeg) and renders the subtitle as a live caption track. Scrub the offset with a timecode control and the captions reload in place, so you verify timing with your own eyes; or run any sync strategy (embedded reference, external file, audio VAD) and preview its computed result before a byte is written.
  • Manual search: query all providers for any item, see each result's score breakdown and tier, and grab a specific pick. Downloading anything other than the top pick locks the item from automation until you release it.
  • Schema-driven settings: the entire config renders from a server-generated schema with tooltips; saves are validated, hot-reload the engine without a restart, and never echo secrets back to the browser.
  • History: every download and search attempt, filterable by type, language, and provider.

First run lands in unconfigured mode: the settings dialog auto-opens and the instance serves nothing else until a valid config is saved.

Auth, API, and operations
  • Multi-user auth (optional): local passwords (Argon2id), passkeys/WebAuthn, OIDC with PKCE, per-user API keys, and login rate limiting.
  • API and CLI: the UI drives a JSON API you can use too; the CLI's read and trigger subcommands run against a live instance (subflux search, scan, status, locks, backoff, score, ...) authenticated via SUBFLUX_URL / SUBFLUX_API_KEY. The account bootstrap commands (reset-password, generate-api-key) use a private Unix socket, so run them inside the container.
  • Operations: Prometheus metrics at /metrics, structured slog logging (UTC), a distroless file-marker healthcheck, graceful shutdown, scheduled bbolt hot backups with a staleness metric, database reconciliation before each scan, and scan resume after a restart.

Quick start

Images are published to both ghcr.io/cplieger/subflux and docker.io/cplieger/subflux; use whichever registry you prefer.

# compose.yaml
services:
  subflux:
    image: ghcr.io/cplieger/subflux:latest
    container_name: subflux
    restart: unless-stopped
    # Override with PUID/PGID in .env; defaults to 1000:1000.
    user: "${PUID:-1000}:${PGID:-1000}"  # match your host user
    ports:
      - "8374:8374"
    volumes:
      - "/opt/appdata/subflux:/config"  # config.yaml + bbolt state
      - "/path/to/media:/media"         # must NOT be read-only; subflux writes subtitle files
First run

Open http://localhost:8374. Every first boot runs ONE guided flow: create the admin account, then walk the setup wizard (Sonarr/Radarr, media roots, providers, languages, and tunable defaults), then an optional passkey enrollment. The wizard adapts to what it finds:

  • From scratch: subflux wrote a placeholder config on first boot, so the wizard walks every step with sensible defaults prefilled.
  • Pre-authored config.yaml: every step the file already answers is prefilled and collapsed (saved secrets show as present without exposing values); a fully valid config fast-forwards straight to a review screen with a "Finish" button. Collapsed steps stay reviewable and editable before finishing.

The Sonarr and Radarr step carries a Test connection button that checks the URL and API key from the server side and reports the answer at the field. It is optional — leave it alone and Next moves on — but using it catches a wrong URL or a rejected key on the first step rather than at the final save. The same button is on both sections of the settings dialog afterwards; where a key is already saved, testing uses the stored one, so there is nothing to retype. The check runs from subflux rather than from your browser on purpose: url is subflux's own address for the service (the default is a Docker service name, which is why public_url exists separately for browser links), so subflux is the only party that can answer whether the scanner will reach it.

Reloading the page mid-setup returns you to the step you were on rather than dropping you into the app.

Finishing saves the config and activates everything in place (providers, arr clients, background scans, and auth capabilities) with no restart. The same holds for later edits in the settings dialog: saving a valid config hot-activates it, including WebAuthn/OIDC and logging changes.

Configuration reference

All settings are editable in the web UI (schema-driven form) and persist to config.yaml. To pre-author the file instead, copy the annotated config.example.yaml. The CLI's subcommands, including manual search, run against a running instance via the SUBFLUX_URL env var; set SUBFLUX_API_KEY (created in the web UI, or with subflux generate-api-key inside the container) to authenticate them when auth is enabled.

Environment variables in config.yaml

String values in config.yaml can reference environment variables with the braced ${VAR} form, so secrets stay in the container environment while the file holds the structure:

some_api_key: ${SUBFLUX_SOME_KEY}

Expansion is allowlisted: SUBFLUX_* names plus the common deployment vars CONFIG_ROOT, MEDIA_FOLDER, PUID, PGID, TZ, LAN_IP, and HOSTNAME. Any other name, and the unbraced $VAR form, stays literal. Referencing an allowlisted var that is unset logs a startup warning naming the variable and keeps the literal ${VAR} text (a set-but-empty var substitutes the empty string). Expansion runs after YAML parsing, on string values only, so an environment value can never alter the document structure.

Running behind a reverse proxy

When subflux runs behind a reverse proxy (nginx, Caddy, Traefik, HAProxy, ...), the network peer subflux sees is the proxy, not the browser. Set trusted_proxies to the proxy's IP or CIDR so the real client IP, resolved from a trusted X-Forwarded-For header, is used for the audit log, the login rate limiter, the session IPAddress, and the request access log, instead of the proxy's address:

trusted_proxies:
  - 10.0.0.0/8
  - 192.168.0.0/16

Entries are CIDR ranges; write a single proxy as a /32 (IPv4) or /128 (IPv6). Only when the direct peer is one of these ranges is X-Forwarded-For consulted (walked right-to-left, spoof-safe); invalid CIDRs are rejected at config load. Leave trusted_proxies empty (the default) when subflux is directly exposed: the socket peer is used and X-Forwarded-For is ignored.

Blocking DNS rebinding

allowed_hosts lists the exact hostnames or IPs subflux answers for. A request whose Host header is not on the list is rejected with 403 before it reaches any route:

allowed_hosts:
  - subflux.example.com
  - 192.0.2.5

This closes a gap the cross-origin (CSRF) check alone leaves open: a DNS-rebinding attack makes a malicious page's hostname resolve to subflux's address, so the browser's same-origin request carries the attacker's name in both Origin and Host; they agree, so the CSRF check admits it. Only an exact-match Host check breaks that chain. Requests from localhost (the container healthcheck) always pass regardless of the list. Leave allowed_hosts empty (the default) to accept any Host, matching prior behavior.

Alerting

subflux exposes Prometheus metrics on /metrics. Scrape it and evaluate the rules in alerts/promql.yaml with Prometheus or the Mimir ruler; firing alerts deliver through your Alertmanager. They cover:

Alert Fires when Severity
SubfluxTargetDown no successful scrape for 15m, so every other rule here is blind warning
SubfluxTargetAbsent there is no up series at all, so subflux is not a configured target any more warning
SubfluxScanStalled no scheduled scan has completed in 26h while the process has been up that long warning
SubfluxHTTP5xx more than 5 server errors in 10m warning
SubfluxBackupStale no successful backup recorded in over 48h warning

The two target rules pin job="subflux" because they read the synthetic up series, where a bare up == 0 would fire on every unrelated target in your Prometheus; set that matcher to whatever your scrape config calls subflux. The rules reading subflux's own metrics carry no job matcher, so add one if you run more than one instance. Thresholds and the severity labels are starting points, and SubfluxScanStalled's window tracks scan_interval (24h by default), so move both together if you change it. Route by whatever labels your Alertmanager uses.

Healthcheck

The container probe runs subflux health, which reports healthy while the marker file /tmp/.healthy exists. Subflux creates it once the HTTP server is listening, in unconfigured mode as well as configured mode, and removes it on shutdown. So unhealthy means the process is gone or never finished starting, not that a scan failed or a provider is down: a bad provider key leaves the container healthy and serving the web UI so you can correct it. Docker checks every 30s after a 15s grace period and restarts the container after 3 consecutive failures. GET /api/health is a separate, narrower signal for a load balancer, answering whether the server is ready to serve requests.

Security

Distroless gcr.io/distroless/static-debian13:nonroot (UID 65532, no shell). Provider URLs are validated against SSRF before every fetch; secrets are redacted from config API responses; archive extraction is zip-bomb-guarded; all external input is size-capped and validated. Images are published with cosign signatures and SBOM attestations.

Known limitations

  • The media volume must be writable. Subflux saves subtitle files next to the media, so mounting /media read-only silently prevents downloads from being saved.
  • Cloudflare-protected providers (subf2m, AvistaZ, CinemaZ) are not implemented.
  • Long-running anime with colliding aired/absolute numbering has a rare false-positive window: results matched by a stable ID skip title validation, so an aired SxxEyy that collides with another episode's absolute number can slip through.

Dependencies

Every pin below is tracked automatically and bumped by pull request; the base image is pinned by digest, and the two media libraries are built from source in the image because no distribution ships them in the shape subflux needs.

Dependency Source
Runtime base image gcr.io/distroless/static-debian13:nonroot, pinned by digest
FFmpeg and ffprobe built from source at a pinned release tag, statically linked, network support not compiled in
x264 built from source at a pinned commit, since upstream publishes no release tags
Go modules go.mod and go.sum
Frontend packages the @cplieger/* set, exact-pinned in internal/server/static-src/package.json

Credits

  • alass by @kaegi: the subtitle alignment algorithm (constant-offset rating and split-aware DP) that subflux ports to Go.
  • The WebRTC project: the GMM voice-activity detector that subflux ports and re-tunes for film audio.
  • Bazarr: the project that defined this category; subflux is an original engine, not a fork, but Bazarr set the bar for what it has to do.

Contributing

Issues and pull requests are welcome; please open an issue first for larger changes so the approach can be discussed. Architecture notes and local build/test instructions are in CONTRIBUTING.md; operational runbooks live in docs/OPERABILITY.md.

Disclaimer

This project is built with care and follows security best practices, but it is intended for personal / self-hosted use. No guarantees of fitness for production environments. Use at your own risk.

This project was built with AI-assisted tooling using Claude, GPT, and Kiro. The human maintainer defines architecture, supervises implementation, and makes all final decisions.

License

AGPL-3.0-or-later. See LICENSE.

Documentation

Overview

providers.go is the single registration point for all subtitle providers. Each provider's factory function and settings schema are registered here; adding a new provider requires one Register + one RegisterSchema call. No init(), no blank imports, no global state.

Directories

Path Synopsis
cmd
bundle command
Command bundle builds subflux's browser client: it bundles the SSE worker and the two page entrypoints (app.ts, login.ts) with esbuild (a Go library — no Node, no npm, per the fleet's no-Node-in-the-builder doctrine), assembles the CSS bundles from the manifest files, copies @cplieger/ui-primitives' base stylesheet.
Command bundle builds subflux's browser client: it bundles the SSE worker and the two page entrypoints (app.ts, login.ts) with esbuild (a Go library — no Node, no npm, per the fleet's no-Node-in-the-builder doctrine), assembles the CSS bundles from the manifest files, copies @cplieger/ui-primitives' base stylesheet.
wire-codegen command
Command wire-codegen generates the TypeScript wire surface and the Go path constants from the single wire contract in internal/wirespec, using the wiregen library (AST-based; github.com/cplieger/wiregen/v3).
Command wire-codegen generates the TypeScript wire surface and the Go path constants from the single wire contract in internal/wirespec, using the wiregen library (AST-based; github.com/cplieger/wiregen/v3).
internal
arrsvc
Package arrsvc composes the github.com/cplieger/arrapi Sonarr and Radarr clients with subflux's subtitle-specific operations: "wanted" iteration (which library items need a subtitle search), exclude-tag name resolution, and a fire-and-forget rescan.
Package arrsvc composes the github.com/cplieger/arrapi Sonarr and Radarr clients with subflux's subtitle-specific operations: "wanted" iteration (which library items need a subtitle search), exclude-tag name resolution, and a fire-and-forget rescan.
authstore
Package authstore is subflux's bbolt-backed implementation of the auth library's persistence SPI.
Package authstore is subflux's bbolt-backed implementation of the auth library's persistence SPI.
authstore/authstoretest
Package authstoretest provides a shared, engine-agnostic behavioral contract suite for subflux's auth store against the auth library's persistence SPI.
Package authstoretest provides a shared, engine-agnostic behavioral contract suite for subflux's auth store against the auth library's persistence SPI.
boltstore
Package boltstore is the bbolt-backed core store for subflux's search, subtitle, scan, sync-offset, and poll domains.
Package boltstore is the bbolt-backed core store for subflux's search, subtitle, scan, sync-offset, and poll domains.
cache
Package cache provides a generic TTL cache with singleflight coalescing.
Package cache provides a generic TTL cache with singleflight coalescing.
cliparse
Package cliparse implements subflux's flat CLI grammar: a single ParseAndValidate pass that splits "--key value" / "--key=value" tokens, rejects unknown flags (with typo suggestions) and stray positionals, parses bool flags from the spec table, validates typed values, enforces required flags, and applies spec defaults.
Package cliparse implements subflux's flat CLI grammar: a single ParseAndValidate pass that splits "--key value" / "--key=value" tokens, rejects unknown flags (with typo suggestions) and stray positionals, parses bool flags from the spec table, validates typed values, enforces required flags, and applies spec defaults.
config
Package config loads, validates, and hot-reloads the subflux YAML configuration.
Package config loads, validates, and hot-reloads the subflux YAML configuration.
config/defaults
Package defaults provides the shared configuration default values and validation thresholds used by both config/ and config/schema/.
Package defaults provides the shared configuration default values and validation thresholds used by both config/ and config/schema/.
config/schema
Package schema generates the UI configuration schema for the web frontend.
Package schema generates the UI configuration schema for the web frontend.
embedded
Package embedded detects embedded subtitle tracks in video files.
Package embedded detects embedded subtitle tracks in video files.
epmarker
Package epmarker is the single authority for reading episode markers out of release names and archive member filenames.
Package epmarker is the single authority for reading episode markers out of release names and archive member filenames.
httpapi
Package httpapi is the handler plumbing of subflux's own HTTP API: the prelude every handler opens with and the envelope every handler answers in.
Package httpapi is the handler plumbing of subflux's own HTTP API: the prelude every handler opens with and the envelope every handler answers in.
httpwire
Package httpwire holds subflux's own HTTP wire policy: the byte bounds it will read from a peer, and the vocabulary it classifies a peer's response with.
Package httpwire holds subflux's own HTTP wire policy: the byte bounds it will read from a peer, and the vocabulary it classifies a peer's response with.
langcode
Package langcode maps any language identifier subflux meets — a provider payload, an ffprobe stream tag, an arr API response, a config file — onto the one internal code space, and is the only place that mapping happens.
Package langcode maps any language identifier subflux meets — a provider payload, an ffprobe stream tag, an arr API response, a config file — onto the one internal code space, and is the only place that mapping happens.
logsafe
Package logsafe binds runesafe's single-line preset to Subflux's log surface, so every untrusted string reaches slog through one policy.
Package logsafe binds runesafe's single-line preset to Subflux's log surface, so every untrusted string reaches slog through one policy.
mediaid
Package mediaid builds the stable identifier subflux addresses one media item by: "tmdb-27205" for a movie, "tvdb-121361-s01e09" for an episode, plus the prefixes that select a whole season or series in one scan.
Package mediaid builds the stable identifier subflux addresses one media item by: "tmdb-27205" for a movie, "tvdb-121361-s01e09" for an episode, plus the prefixes that select a whole season or series in one scan.
obs
Package obs owns Subflux's observability surface: the Prometheus registry (exposition prefix "subflux_") and every counter, gauge and histogram it serves — searches, downloads, imports, scans, the HTTP transport, and the bbolt store.
Package obs owns Subflux's observability surface: the Prometheus registry (exposition prefix "subflux_") and every counter, gauge and histogram it serves — searches, downloads, imports, scans, the HTTP transport, and the bbolt store.
provider
Package provider contains the provider registry and retry wrappers.
Package provider contains the provider registry and retry wrappers.
provider/anidb
Package anidb provides TVDB → AniDB mapping using the community-maintained anime-list.xml from https://github.com/Anime-Lists/anime-lists.
Package anidb provides TVDB → AniDB mapping using the community-maintained anime-list.xml from https://github.com/Anime-Lists/anime-lists.
provider/animetosho
Package animetosho implements the AnimeTosho subtitle provider.
Package animetosho implements the AnimeTosho subtitle provider.
provider/archive
Package archive extracts a subtitle from a ZIP or RAR container.
Package archive extracts a subtitle from a ZIP or RAR container.
provider/betaseries
Package betaseries implements the BetaSeries subtitle provider.
Package betaseries implements the BetaSeries subtitle provider.
provider/classify
Package classify provides subtitle classification (forced/HI) and language resolution utilities consumed by provider sub-packages.
Package classify provides subtitle classification (forced/HI) and language resolution utilities consumed by provider sub-packages.
provider/gestdown
Package gestdown implements the Gestdown subtitle provider.
Package gestdown implements the Gestdown subtitle provider.
provider/hdbits
Package hdbits implements the HDBits.org subtitle provider.
Package hdbits implements the HDBits.org subtitle provider.
provider/opensubtitles
Package opensubtitles implements the OpenSubtitles.com REST API provider.
Package opensubtitles implements the OpenSubtitles.com REST API provider.
provider/subdl
Package subdl implements the SubDL subtitle provider.
Package subdl implements the SubDL subtitle provider.
provider/subsource
Package subsource implements the SubSource subtitle provider.
Package subsource implements the SubSource subtitle provider.
provider/synthetic
Package synthetic provides a subtitle provider that answers from generated data instead of an upstream service.
Package synthetic provides a subtitle provider that answers from generated data instead of an upstream service.
provider/yifysubtitles
Package yifysubtitles implements the YIFY Subtitles provider.
Package yifysubtitles implements the YIFY Subtitles provider.
scorer
Package scorer holds the CONFIGURED scoring engine: it carries the user's weight table and answers the two questions callers outside the search domain ask, what does this subtitle score and which tier is that score.
Package scorer holds the CONFIGURED scoring engine: it carries the user's weight table and answers the two questions callers outside the search domain ask, what does this subtitle score and which tier is that score.
search
Package search implements the subtitle search engine.
Package search implements the subtitle search engine.
search/providerhealth
Package providerhealth tracks how a provider is behaving and takes a failing one out of rotation: it counts failures in a sliding window and, past a threshold, times the provider out for a cooldown.
Package providerhealth tracks how a provider is behaving and takes a failing one out of rotation: it counts failures in a sliding window and, past a threshold, times the provider out for a cooldown.
search/release
Package release provides release name parsing via PCRE-compatible regex patterns sourced from TRaSH Guides and Sonarr/Radarr QualityParser.
Package release provides release name parsing via PCRE-compatible regex patterns sourced from TRaSH Guides and Sonarr/Radarr QualityParser.
search/scoring
Package scoring holds the pure matching and weighting rules the scan engine applies to a candidate: which subtitles identify as the requested item, which weight categories a release hits, and the title and episode comparisons under both.
Package scoring holds the pure matching and weighting rules the scan engine applies to a candidate: which subtitles identify as the requested item, which weight categories a release hits, and the title and episode comparisons under both.
search/syncing
Package syncing provides subtitle timing synchronization for the search engine.
Package syncing provides subtitle timing synchronization for the search engine.
server
Package server — Content-Security-Policy construction.
Package server — Content-Security-Policy construction.
server/activity
Package activity provides concurrent-safe activity and alert tracking for the subflux UI status indicator.
Package activity provides concurrent-safe activity and alert tracking for the subflux UI status indicator.
server/activityhandlers
Package activityhandlers serves the activity log, the alert list, and the SSE event stream with its digest and presence-acknowledgement routes: the HTTP surface over the in-memory registries that record what the server is doing and what went wrong.
Package activityhandlers serves the activity log, the alert list, and the SSE event stream with its digest and presence-acknowledgement routes: the HTTP surface over the in-memory registries that record what the server is doing and what went wrong.
server/adminsocket
Package adminsocket serves the out-of-band admin plane: the one route the CLI posts to for password reset and API-key generation.
Package adminsocket serves the out-of-band admin plane: the one route the CLI posts to for password reset and API-key generation.
server/authhandlers
Package authhandlers provides shared types and utilities for the server's authentication handler cluster: login, WebAuthn, OIDC, admin user management, and security management (password change, API keys, passkeys).
Package authhandlers provides shared types and utilities for the server's authentication handler cluster: login, WebAuthn, OIDC, admin user management, and security management (password change, API keys, passkeys).
server/confighandlers
Package confighandlers provides HTTP handlers for configuration CRUD operations: get, save, reset, schema, and path validation.
Package confighandlers provides HTTP handlers for configuration CRUD operations: get, save, reset, schema, and path validation.
server/coverage
Package coverage provides pure computation functions for subtitle coverage analysis.
Package coverage provides pure computation functions for subtitle coverage analysis.
server/coveragehandlers
Package coveragehandlers provides HTTP handlers for the /api/coverage/* endpoints.
Package coveragehandlers provides HTTP handlers for the /api/coverage/* endpoints.
server/events
Package events is subflux's typed server-sent-events layer: the sealed Event/EventData types the app publishes, marshaled onto the shared cplieger/sse broadcast hub.
Package events is subflux's typed server-sent-events layer: the sealed Event/EventData types the app publishes, marshaled onto the shared cplieger/sse broadcast hub.
server/filehandlers
Package filehandlers provides HTTP handlers for the /api/files/* endpoints.
Package filehandlers provides HTTP handlers for the /api/files/* endpoints.
server/manualops
Package manualops implements the business logic for manual subtitle search and download operations.
Package manualops implements the business logic for manual subtitle search and download operations.
server/mediahandlers
Package mediahandlers provides HTTP handlers for the /api/media/* endpoints.
Package mediahandlers provides HTTP handlers for the /api/media/* endpoints.
server/polling
Package polling provides the history-polling subsystem for Sonarr/Radarr import events and the write-through poll timestamp cache.
Package polling provides the history-polling subsystem for Sonarr/Radarr import events and the write-through poll timestamp cache.
server/previewhandlers
Package previewhandlers provides HTTP handlers for the video/subtitle preview and poster proxy endpoints.
Package previewhandlers provides HTTP handlers for the video/subtitle preview and poster proxy endpoints.
server/queryhandlers
Package queryhandlers provides read-only HTTP query handlers: subtitle state, backoff, manual locks, providers, parsed config, score simulation, and dashboard stats.
Package queryhandlers provides read-only HTTP query handlers: subtitle state, backoff, manual locks, providers, parsed config, score simulation, and dashboard stats.
server/resolve
Package resolve is the one home for typed-reference resolution (S7): it maps the wire references — FileRef (one stored subtitle file) and MediaRef (the arr-known video of a media item) — to absolute filesystem paths using server-derived facts only.
Package resolve is the one home for typed-reference resolution (S7): it maps the wire references — FileRef (one stored subtitle file) and MediaRef (the arr-known video of a media item) — to absolute filesystem paths using server-derived facts only.
server/scanning
Package scanning implements the full-scan orchestration engine.
Package scanning implements the full-scan orchestration engine.
server/scheduler
Package scheduler provides the periodic full-scan pipeline, DB maintenance, and auth cleanup scheduling for the subflux server.
Package scheduler provides the periodic full-scan pipeline, DB maintenance, and auth cleanup scheduling for the subflux server.
server/showskip
Package showskip provides a TTL-based cache for show-level subtitle pre-check results.
Package showskip provides a TTL-based cache for show-level subtitle pre-check results.
server/storeops
Package storeops runs the periodic operations that treat the bbolt file as an operational artifact rather than a set of rows: timestamped snapshots with retention pruning, and the file-size and freelist gauges.
Package storeops runs the periodic operations that treat the bbolt file as an operational artifact rather than a set of rows: timestamped snapshots with retention pruning, and the file-size and freelist gauges.
server/synchandlers
Package synchandlers provides HTTP handlers for subtitle sync operations (audio-based sync and manual offset adjustment).
Package synchandlers provides HTTP handlers for subtitle sync operations (audio-based sync and manual offset adjustment).
server/syncjobs
Package syncjobs owns the server-side async sync job machinery (D1, D2): a bounded FIFO dispatcher with an admission lease, the job record registry GET /api/sync/jobs serves, and the sync:done publication seam.
Package syncjobs owns the server-side async sync job machinery (D1, D2): a bounded FIFO dispatcher with an admission lease, the job record registry GET /api/sync/jobs serves, and the sync:done publication seam.
store/buckets
Package buckets is the single owner of the AUTH-domain bbolt bucket names shared by the two packages that operate on one database file: the core store (internal/boltstore) bootstraps every bucket in its schema, and the auth store (internal/authstore) builds keys inside these.
Package buckets is the single owner of the AUTH-domain bbolt bucket names shared by the two packages that operate on one database file: the core store (internal/boltstore) bootstraps every bucket in its schema, and the auth store (internal/authstore) builds keys inside these.
store/kv
Package kv holds the shared bbolt store primitives used by both the core subflux store (internal/store) and the auth store (internal/authstore).
Package kv holds the shared bbolt store primitives used by both the core subflux store (internal/store) and the auth store (internal/authstore).
store/storetest
Package storetest provides a shared, engine-agnostic behavioral contract suite for the core subtitle store.
Package storetest provides a shared, engine-agnostic behavioral contract suite for the core subtitle store.
subflux
Package subflux is the application's wire and domain type vocabulary.
Package subflux is the application's wire and domain type vocabulary.
subsync
Package subsync provides subtitle timing synchronization.
Package subsync provides subtitle timing synchronization.
subsync/crosslang
Package crosslang implements cross-language subtitle alignment using anchor-based matching and dynamic programming.
Package crosslang implements cross-language subtitle alignment using anchor-based matching and dynamic programming.
subsync/ffmpeg
Package ffmpeg provides low-level ffmpeg/ffprobe subprocess wrappers for stream probing, subtitle extraction, and PCM audio extraction.
Package ffmpeg provides low-level ffmpeg/ffprobe subprocess wrappers for stream probing, subtitle extraction, and PCM audio extraction.
subsync/fft
Package fft provides a radix-2 Cooley-Tukey FFT implementation for cross-correlation in the subsync package.
Package fft provides a radix-2 Cooley-Tukey FFT implementation for cross-correlation in the subsync package.
subsync/framerate
Package framerate provides framerate drift detection for subtitle alignment.
Package framerate provides framerate drift detection for subtitle alignment.
subtitleenc
Package subtitleenc is the single authority for what encoding a subtitle's bytes are in and how to read them as UTF-8.
Package subtitleenc is the single authority for what encoding a subtitle's bytes are in and how to read them as UTF-8.
subtitleext
Package subtitleext is the single authority for which file extensions count as subtitle files, exposed as capability-scoped views rather than one flat union.
Package subtitleext is the single authority for which file extensions count as subtitle files, exposed as capability-scoped views rather than one flat union.
subtitlefile
Package subtitlefile owns the subtitle file on disk: what subflux names it, and what it will accept as its contents.
Package subtitlefile owns the subtitle file on disk: what subflux names it, and what it will accept as its contents.
syncworker
Package syncworker isolates subtitle-sync computation in a supervised one-shot child process (P13).
Package syncworker isolates subtitle-sync computation in a supervised one-shot child process (P13).
testsupport
Package testsupport provides shared test helpers used across multiple packages.
Package testsupport provides shared test helpers used across multiple packages.
wirespec
Package wirespec is the single source of truth for subflux's HTTP wire contract: the registered wire types, enums, and the endpoint table that cmd/wire-codegen feeds into wiregen to emit the TS types, decoders, typed client, and the Go path constants (internal/apipaths).
Package wirespec is the single source of truth for subflux's HTTP wire contract: the registered wire types, enums, and the endpoint table that cmd/wire-codegen feeds into wiregen to emit the TS types, decoders, typed client, and the Go path constants (internal/apipaths).
wiring
Package wiring holds composition-root types that connect concrete implementations across the config, provider, scorer, search and embedded packages.
Package wiring holds composition-root types that connect concrete implementations across the config, provider, scorer, search and embedded packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL