How denzuko/podcast-mgr works
1. This repository contains two intentionally separate subsystems built around the same data file: a FastCGI/CGI subscription manager and a cron-driven downloader. The shared boundary between them is feeds.xml, which acts as the persistent state for the whole project.
2. The primary runtime component is main.c, a single-user FastCGI SPA. It serves the podcast management UI and handles all subscription CRUD-style interactions against the XML database. The README says it uses htmx for partial updates, so the browser talks to the CGI worker incrementally rather than as a full-page traditional app.
3. The server-side web stack is the BCHS ecosystem: kcgi for FastCGI and request handling, khtml for HTML generation, and kcgixml for XML-related support. In architectural terms, main.c is both the HTTP endpoint and the application controller for the subscription list.
4. Persistence is file-based, not database-based. feeds.xml is the canonical store, and feeds.xsd defines the schema used to validate that file’s structure. That makes the XML document the key state boundary: the CGI writes/manages it, while the downloader reads it.
5. podcast.sh is a separate tcsh cron job that consumes feeds.xml and downloads episodes according to the schedule stored there. It does not depend on the web UI at runtime, which means the architecture cleanly splits “manage subscriptions” from “execute downloads.”
6. The repository is designed for a single-user deployment model rather than a multi-tenant service. That is reinforced by the configuration path under $XDG_CONFIG_HOME/podcasts/feeds.xml with a home-directory fallback, and by the focus on a local cron-based workflow.
7. sandbox.h provides a portability layer for privilege reduction and syscall confinement. The README mentions seccomp, Capsicum, and pledge, so the CGI worker is intended to run with reduced privileges depending on platform support. That is a security boundary around the request-processing process.
8. nob.c is the build entry point, using tsoding’s nob as a minimal build system. The post-clone git hook automates building the project, so the repo’s build story is intentionally lightweight and source-driven rather than using a heavy external build framework.
9. index.cgi.8 is the operator-facing documentation for the CGI service, while the .7 manpages and changelog support packaging and release management. These files indicate the project is meant to be deployed and maintained like a small Unix service, not as an application with a separate admin console.
10. sbom.json and podcast_mgr.sarif are supply-chain and static-analysis artifacts. They do not affect the runtime architecture, but they show that the project tracks dependency composition and security findings alongside the codebase.
11. The main data flow is: user edits subscriptions in the CGI UI -> main.c updates feeds.xml -> cron later reads the same file -> podcast.sh downloads episodes. Any architecture diagram should draw feeds.xml in the center, with the web worker on one side and the scheduled downloader on the other.
12. The key architectural boundary is therefore not between “frontend” and “backend,” but between “interactive management” and “automated execution.” The web app owns the configuration lifecycle; the cron script owns content retrieval, and both are coupled only through the XML file and its schema.
Main entry points: main.c main.c · podcast.sh podcast.sh · nob.c nob.c · sbom.json sbom/sarif
Components 16
Interactive management
FastCGI/CGI subscription manager and its request-processing stack
- main.c · FastCGI/CGI subscription manager and UI controller
main.c - HTMX UI · Incremental browser interaction pattern used by the CGI app
- kcgi stack · FastCGI request handling and HTTP plumbing used by the web worker
- khtml · HTML generation support for the management UI
- kcgixml · XML-related support used by the CGI application
Scheduled downloads
Cron-driven retrieval pipeline that consumes the shared feed state
- podcast.sh · Scheduled downloader that reads the shared XML state
podcast.sh - cron job · External scheduler that triggers the downloader on a timetable
- downloads · Episode fetching and file retrieval performed by the cron worker
Shared state
Canonical XML configuration and schema boundary used by both runtimes
- feeds.xml · Canonical persistent store for subscriptions and download schedule
- feeds.xsd · XML schema defining the structure of the shared state
feeds.xsd
Build and ops
Build entrypoint, portability layer, packaging docs, and repository automation
- sandbox.h · Portability layer for privilege reduction and syscall confinement
sandbox.h - nob.c · Minimal build system entrypoint used to compile the project
nob.c - githooks · Repository hook automation that builds after checkout
.githooks/post-checkout - index.cgi.8 · Operator documentation for the CGI service
index.cgi.8 - policy docs · Process and release documentation for packaging and maintenance
podcast-mgr.ieee829.7 - sbom/sarif · Supply-chain and static-analysis outputs tracked in the repository
sbom.json
Connections 18
- main.c → kcgi stack: uses · Handles FastCGI requests through the BCHS request layer
- main.c → khtml: renders · Generates the management UI markup
- main.c → kcgixml: parses · Uses XML helpers for feed state handling
- main.c → HTMX UI: drives · Serves partial updates to the browser UI
- main.c → feeds.xml: reads/writes · Manages subscriptions in the shared XML store
- main.c → feeds.xsd: validates · Relies on the schema as the structure contract
- main.c → sandbox.h: constrains · Runs under reduced privileges and confinement where supported
- podcast.sh → cron job: triggered by · Runs as a scheduled cron job
- podcast.sh → feeds.xml: reads · Consumes the shared schedule and subscription state
- podcast.sh → downloads: executes · Performs episode retrieval and download actions
- feeds.xml → feeds.xsd: constrained by · The persistent XML file follows the declared schema
- nob.c → main.c: builds · Compiles the CGI application
- nob.c → podcast.sh: packages · Supports project build/release assembly
- githooks → nob.c: automates · Post-checkout hook builds the project
- index.cgi.8 → main.c: documents · Operator guidance for the CGI service
- policy docs → nob.c: supports · Describes maintenance and release process
- sbom/sarif → main.c: tracks · Captures security and dependency metadata for the codebase
- sbom/sarif → podcast.sh: tracks · Captures analysis and artifact metadata for the downloader side