Use of AI: AudioSilo is developed by me (a human), with assistance from AI, primarily Claude Code, to help me write, clean up, document, and review the code. That doesn't mean the app is generated on autopilot or "vibe coded". Nothing goes out until I've read it, tested it, and decided it belongs. AI is what lets one person keep up this pace, and I think it's important to disclose that.
Website · Server · Docs · Discord · Sponsor
A self-hosted audiobook server written in Go. It exposes a JSON API, a small
baked-in admin/connect web UI, and (optionally) the web player at /web,
and is designed to be safe to leave exposed to the internet: no default
passwords, app-layer hardening (rate limiting + brute-force lockout), and
configurable TLS.
The audiobook player frontend lives in a separate project
(audiosilo-frontend, an Expo app that ships as native iOS/Android and a web
build). The server does not vendor it: the Docker image bakes a pinned web
build in at /app/web, served from web_dir. Book details, series and the
community recaps come from the community metadata service (meta.audiosilo.app),
asked per book or, with metadata.mode: mirror, answered from a local copy of
its database that the server downloads once a day (see config.example.yaml).
- Connect flow with copy-invite + app-or-web QR - admins mint an auth code or
click Copy invite for a shareable link (
/connect#code=…, the code rides in the URL fragment so it never hits server logs). The connect screen shows a QR encoding an HTTPS link plus Open in app / Open web player: scanning opens the native app (when it claims the domain) or the web player, which exchanges a single-use pairing token for a device-scoped session. Username/password login is also supported. - Web player at
/web- the audiosilo-frontend web build, served fromweb_dir(not vendored; baked into the Docker image). Reports aweb_playercapability flag viaGET /api/v1/server. - Path is the identity - content is addressed by
(library, path), not a fragile database id. The filesystem is the source of truth (audiobook metadata is often junk); playback, progress, bookmarks and sharing all key on the path, so they survive DB rebuilds and re-tagging. A cheap fingerprint provides move-tracking: rename a file and its progress follows it. - Filesystem-based sharing - a share is a named set of filesystem paths (a whole author, one series, a single book, or a whole library). Grant shares to users for partial access; they browse a filtered tree scoped to what they're allowed, and the computed view + search are scoped to match.
- Admin - create users, create libraries, build/grant shares, mint auth codes, reorder libraries, trigger rescans.
- Auto-detected folder shape - no per-library layout to configure: the
scanner classifies each folder on its own (a directory of audio is one book;
loose files at the root are single-file books), and a folder the heuristic gets
wrong is fixed with a per-folder override (
book|collection). The default Hybrid view is the filesystem browsed as-is, enriched with indexed metadata. - Fast search - SQLite FTS5, fast at thousands of books; keyset pagination.
- Streaming - HTTP Range (seek/scrub) by path, direct download, cover art.
- Normalized chapters - single-file m4b chapters and multi-file mp3 parts
share one shape; each chapter carries the
file_pathto play. - Per-user listening state - progress, bookmarks, notes, history, playback speed, with last-write-wins reconciliation (the basis for realtime sync).
- Baked-in web UI - a public connect page at
/(and/connect) and the admin console at/admin(admin-ui/: React + Vite, embedded at build time): libraries (add with a server folder picker, edit, reorder, rescan with live progress, folder-detection overrides, export, delete, a "folder unavailable" safety state), people (invites with a QR code, access, passwords, roles), shares with a library path picker, and the community-metadata setting. The console is being extended in stages (ADMIN-CONSOLE-PLAN.mdin the workspace).
Planned next: upload + placement suggestions and AAX→M4B conversion (Phase B); on-the-fly transcoding and WebSocket realtime sync (Phase C); server federation (Phase D, designed).
- Go 1.26+ and Node 24 (to build from source; Node builds the admin console), or Docker (to run the published image).
- ffmpeg/ffprobe (optional but recommended) - used for durations, chapters, and (later) transcoding/AAX. Without it the server still runs; durations and chapters are simply unavailable. (The Docker image includes ffmpeg.)
# Build (the admin console first: it is embedded, never committed)
scripts/build-admin.sh
go build -o bin/audiosilo ./cmd/audiosilo
# First run: prints the admin password + auth code exactly once. Save them.
# Until the admin first signs in, later starts print a reminder; lost it?
# `./bin/audiosilo --data ./data reset-admin` prints a new one.
# Default TLS is a self-signed cert (HTTPS); for plain HTTP locally use TLS off:
AUDIOSILO_TLS_MODE=off ./bin/audiosilo --data ./data
# In another terminal - discover the server (public):
curl http://localhost:8080/api/v1/server
# Log in (or redeem the auth code) to get a session token:
curl -X POST http://localhost:8080/api/v1/auth/login \
-d '{"username":"admin","password":"<printed password>"}'
# Add a library (admin), then browse it immediately via the filesystem view:
TOKEN=... # from the login response
curl -X POST http://localhost:8080/api/v1/admin/libraries -H "Authorization: Bearer $TOKEN" \
-d '{"name":"Main","root":"/path/to/audiobooks"}'
curl "http://localhost:8080/api/v1/libraries/1/fs" -H "Authorization: Bearer $TOKEN"Flags: --data <dir> (config, database, certs), --ffprobe <path> ("" to
disable). Configuration and overrides are documented in
config.example.yaml.
POST /api/v1/auth/redeemwith{"code":"<auth code>"}→ returns a single-usepairing_token, aweb_url(https://<base>/web/connect?token=…, encoded in the QR), auri(audiosilo://connect?server=…&token=…, the "Open in app" deep link), and a QR PNG data URI.- The client (native app or the web player's
/connectroute) callsPOST /api/v1/auth/exchangewith the pairing token to obtain a durable, device-named session token. The pairing token is single-use. - All other endpoints take
Authorization: Bearer <session token>.
The admin Copy invite button wraps step 0: it mints an auth code and gives you
https://<base>/connect#code=<auth code>, which drops the recipient onto the
connect screen with the code pre-filled. For native auto-launch from the QR,
configure app_links so the server publishes the matching
/.well-known/apple-app-site-association and /.well-known/assetlinks.json.
When web_dir points at a built web player (the Expo web export from
audiosilo-frontend, built with baseUrl=/web), the server serves it at /web
with an SPA fallback and a scoped CSP. It is not stored in this repo or the
binary - the Docker image bakes a pinned build in at /app/web. Empty web_dir →
/web is unmounted and web_player is false in GET /api/v1/server.
For local development without Docker, build the export into a directory and point the server at it:
scripts/build-web.sh # exports into <frontend>/dist, prints the env to set
AUDIOSILO_WEB_DIR=~/dev/audiosilo/audiosilo-frontend/dist ./bin/audiosilo --data ./dataTLS is configurable (see tls.mode in the config):
selfsigned(default) - generates and persists a self-signed cert. Good for a LAN; clients must accept it.autocert- automatic Let's Encrypt certificates (settls.hosts). Needs a public hostname reachable on :443.off- plain HTTP for use behind a reverse proxy (Caddy/nginx/Traefik). Settrusted_proxiesso client IPs (used for rate limiting) are accurate.
App-layer protections are always on: request rate limiting (per address, and per device or API key once a token is proved), brute-force lockout on login and auth-code redemption, argon2id password hashing, hashed (revocable) tokens, strict path-traversal containment, and body-size limits.
The published image bundles the server and a pinned web player. Web assets are
app code (they live in the image); only /data (db, config, certs) is persisted.
docker compose up -d # see docker-compose.yml
docker compose logs # first run prints the admin password + auth code ONCE
docker compose exec -u 1000:1000 audiosilo audiosilo --data /data reset-admin
# lost it: a new admin password (1000:1000 = the compose file's PUID:PGID;
# until the admin signs in, each start's log prints the exact command)Edit docker-compose.yml to mount your audiobooks read-only, persist ./data, and
set AUDIOSILO_PUBLIC_URL (used to build QR/invite links) and, optionally,
AUDIOSILO_LAN_URL (the server's home-network address, e.g. http://192.168.1.20:8080,
which the apps switch to when they can reach it). Set PUID/PGID to
the user that should own /data (Unraid: 99/100; generic Linux: your id -u/
id -g; Synology: often 1026/100) - the entrypoint chowns the data dir (a file
mounted inside it such as config.yaml too, but not a folder, socket or device mounted
inside it, which keeps its owner) and AUDIOSILO_BACKUP_DIR when set,
and runs the server as that user, so it works regardless of how the mounted volume is
owned. Where a chown is refused (a NAS share with ACLs) the container log names each
folder the server's user can't write (data, backups) or read (the audiobooks), the
user, the folder's owner and the fix (user: instead of PUID/PGID when the container
runs with --user; "mounted read-only" for a :ro data or backups mount). Update -
server or the bundled player - is always a new image:
docker compose pull && docker compose up -d.
Health check. The image has a HEALTHCHECK: docker-entrypoint.sh healthcheck runs
audiosilo --data <folder> healthcheck on the data folder the container was started
with (its --data, /data by default), which asks the server's own /healthz on the
port and TLS mode from config.yaml and the AUDIOSILO_* environment, and exits 0
when the database answers (docker ps shows healthy). The server listens before it
opens the database, and while it restores a backup, copies the database for an upgrade
or runs the migrations it answers every request with 503 and "status": "starting",
which the check counts as healthy, so autoheal never restarts the container part way
through an upgrade's migrations on a large library. The answer also says how long the
start has run ("starting_for_seconds"), and a start that has run thirty minutes is
counted as stuck and reads unhealthy. /healthz is not
rate limited, so a busy reverse proxy on the same host never makes the check read
429. Docker only marks the container unhealthy; to restart a stuck server (an NFS
hard mount that stopped answering) pair it with an orchestrator liveness probe or an
autoheal sidecar such as willfarrell/autoheal (see the comment in
docker-compose.yml). The check also allows a ten-minute start period. A bind or TLS
change saved in the console counts from the next start, and the check asks the saved
address, so restart after one. With tls.mode: autocert the check asks /healthz
naming your host only while a valid certificate for it is cached and not yet due for
renewal: otherwise a request naming your host would start a certificate order, and
failed orders count against Let's Encrypt's limits. It then sends a TLS hello naming
no host, which autocert refuses without ordering, so it shows that the server is
listening and answering, not that the database is. For the start it reads
starting.json in the data folder instead, which the server keeps there while it
starts (replacing one a crashed start left behind, and removing it once it answers),
so a start that has run thirty minutes reads unhealthy under autocert too. A browser
that opens the console or the player while the server starts gets a short "AudioSilo
is starting" page that reloads itself every five seconds.
Run the same checks CI runs, locally:
go build ./... # compiles everything
go vet ./... # static checks
go test -race ./... # unit + integration tests (in-memory SQLite + testdata fixtures)
golangci-lint run # linting (v2; config in .golangci.yml)
scripts/test-floor.sh # every internal/ and pkg/ package has a test (or a `// no-tests:` reason)Tests use in-memory SQLite and the fixtures under testdata/ (tiny
generated M4B files), covering auth/token resolution, the catalog/search/pagination,
the scanner, path-traversal defense (SafeJoin), share-scope enforcement, rate
limiting, media range/streaming, config validation, and the HTTP auth flow.
A few scanner tests need ffprobe (real durations / embedded chapters); without
it they t.Skip and the suite still passes. Install ffmpeg to run them
(brew install ffmpeg / apt-get install ffmpeg). Install the linter once with
golangci-lint v2 (brew install golangci-lint, or the
official installer).
.github/workflows/ci.yml runs tests + coverage,
race tests + lint on the native SQLite engine, lint with the test floor, a
non-gating dead-code report, the admin console's checks and a booted snapshot of
the native release build on every pull request and push to main, and gates
merges (a pinned static ffmpeg is put on PATH in CI so the gated tests run). The image build
(image.yml) stays separate: it publishes a
release on v* tags and an unreleased :edge image on pushes to main.
See CLAUDE.md for the package layout, data model, and roadmap, and RELEASING.md for building/publishing the container images and the end-to-end smoke test.
