Repository navigation
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
321 lines (296 loc) · 19 KB
/
Copy pathconfig.example.yaml
File metadata and controls
321 lines (296 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# AudioSilo server configuration.
#
# The server writes <data-dir>/config.yaml on first run and on every console
# save, holding only what differs from the defaults (at first, its server_id):
# a key left out is its default, a later release's default once that changes.
# Every key is listed below with its default. Edit it and restart, change most of it in the admin console (Server >
# Settings, which saves here), or override selected values with environment
# variables (shown in brackets). A value an environment variable sets wins at
# every start, shows as locked in the console, and is never written into this
# file. Command-line flags are: --data (data dir), --ffprobe / --ffmpeg (tool
# paths; "" disables each), and --setup (first-run web setup wizard):
# `audiosilo --data ./data`. Lost the first-run admin password? `audiosilo --data
# ./data reset-admin` prints a new one.
# The server's display name: shown in the apps when someone connects, on invites
# and in the admin console. Empty = "AudioSilo".
name: ""
# Ask GitHub Releases once a day whether a newer AudioSilo exists (shown in the
# admin console's Server > About). Sends nothing but the request itself (this
# server's address and a User-Agent naming its version). false = never ask.
# [AUDIOSILO_UPDATE_CHECK]
update_check: true
# Listening history: raw listening sessions (which device and app, the time of
# day, the playback mode) are kept this many days, 30 to 3650, then summed into
# per-day totals per listener and book (Settings > General; the daily retention
# job applies a change).
activity:
session_days: 400 # [AUDIOSILO_SESSION_DAYS]
# Database backups. schedule is "" (off), "daily:HH:MM" or "weekly:DAY:HH:MM"
# (day as sun..sat) in the server's time zone; keep is how many scheduled
# backups are kept, 1 to 365 (manual ones stay until deleted); dir is the
# backups folder, empty = <data-dir>/backups, set only here or by its variable,
# never in the console (Settings > Backups changes the other two).
backups:
schedule: "daily:03:00" # [AUDIOSILO_BACKUP_SCHEDULE]
keep: 7 # [AUDIOSILO_BACKUP_KEEP]
dir: "" # [AUDIOSILO_BACKUP_DIR]
# Address to listen on. [AUDIOSILO_BIND]
bind: "0.0.0.0:8080"
# Externally reachable base URL. Used to build QR pairing payloads. If empty it
# is derived from the incoming request. [AUDIOSILO_PUBLIC_URL]
public_url: ""
# The server's address on your home network, e.g. "http://192.168.1.20:8080".
# The apps learn it when they pair (and from GET /api/v1/addresses afterwards) and
# switch to it by themselves when they can reach it, using public_url when away.
# If empty, the address a request arrived on is used when it is a home-network
# one (a private or link-local IP, a .local/.lan/.home.arpa/.internal or single-label
# name; never localhost), as http:// when tls.home_http serves plain HTTP there.
# [AUDIOSILO_LAN_URL]
lan_url: ""
tls:
# off - plain HTTP (use behind a reverse proxy that terminates TLS)
# selfsigned - generate & persist a self-signed cert (default; good for LAN)
# autocert - automatic Let's Encrypt certificates (requires public hostname)
mode: "selfsigned" # [AUDIOSILO_TLS_MODE]
# selfsigned only (and only with the generated certificate: off when cert_file
# is set): the port also answers plain HTTP, but only to clients on a
# home-network address that use the server's home address (its LAN IP, a
# .local name); any other plain HTTP client is redirected to https. The phone
# apps can't trust a self-signed certificate, so this is how they connect at
# home (they learn the http:// home address when they pair). Away from home
# needs autocert or a reverse proxy.
home_http: true # [AUDIOSILO_TLS_HOME_HTTP]
hosts: [] # autocert: hostnames to obtain certs for [AUDIOSILO_TLS_HOSTS]
cache_dir: "" # autocert cert cache (default <data>/certs)
cert_file: "" # selfsigned: optional explicit cert path
key_file: "" # selfsigned: optional explicit key path
# Reverse proxy CIDRs. The server trusts their X-Forwarded-For for client IPs
# and their X-Forwarded-Proto (or Forwarded proto=) https for pairing and invite
# links when public_url is unset. Those links use the request's Host, so a proxy
# that rewrites Host should pass the original (nginx: proxy_set_header Host $host).
trusted_proxies: [] # [AUDIOSILO_TRUSTED_PROXIES]
# e.g. ["127.0.0.1/32", "10.0.0.0/8"]
# Allowed browser origins for CORS. Empty = no cross-origin CORS headers granted
# (native apps and same-origin web clients still work). "*" disables the check.
# Once set, covers and audio answer with a cross-origin resource policy, so a web
# player on another site can show and play them.
cors_origins: [] # [AUDIOSILO_CORS_ORIGINS]
# Request rate limits (read at start), each a bucket refilled at `rate` requests a
# second that holds at most `burst`; a request past it is answered 429.
# address - per client address: requests with no valid token (a wrong or
# missing token pays here), the public routes, and sign-in, pairing
# and account requests (/api/v1/auth/*) even with a valid token.
# This includes the public Bridge pairing exchange and missing or
# refused Bridge tokens. A paired Bridge has its own per-token
# budget of 2,000 requests/s with a burst of 20,000.
# token - per signed-in device or API key: every other API request. A
# household behind one address, or everyone behind a reverse proxy,
# each have their own; a token past its budget also costs its address.
# A demo session (anyone can start one) spends from address instead.
# media - per signed-in device or API key: covers and audio.
# The lockouts on wrong passwords and invite codes (10 per address per 15
# minutes) are separate and always on. Set only what you want to change: a value
# left out (or 0) is the release's default, shown below, and is never written
# into config.yaml, so a later release's defaults still apply.
# rate_limit:
# address:
# rate: 50 # [AUDIOSILO_RATE_LIMIT_ADDRESS_RATE]
# burst: 200 # [AUDIOSILO_RATE_LIMIT_ADDRESS_BURST]
# token:
# rate: 50000 # [AUDIOSILO_RATE_LIMIT_TOKEN_RATE]
# burst: 100000 # [AUDIOSILO_RATE_LIMIT_TOKEN_BURST]
# media:
# rate: 200 # [AUDIOSILO_RATE_LIMIT_MEDIA_RATE]
# burst: 2000 # [AUDIOSILO_RATE_LIMIT_MEDIA_BURST]
# Maximum request/upload body size in bytes (uploads land in Phase B).
max_upload_bytes: 2147483648 # [AUDIOSILO_MAX_UPLOAD_BYTES] (2 GiB)
# Directory holding the prebuilt web player, served at /web. Empty disables it
# (the web_player capability then reports false). The Docker image bakes a pinned
# build in at /app/web; for local dev point this at an Expo export (see
# scripts/build-web.sh). [AUDIOSILO_WEB_DIR]
web_dir: ""
# Native deep-link association. When set, the server serves
# /.well-known/apple-app-site-association and /.well-known/assetlinks.json so a
# phone can open the installed app straight from a pairing/invite link (iOS
# Universal Links / Android App Links). Leave empty to fall back to the web
# player. The app build must also claim this domain. (YAML only; no env override.)
app_links:
apple_app_ids: [] # ["<TEAMID>.com.anonymous.audiosilo"]
android_package: "" # "com.anonymous.audiosilo"
android_sha256: [] # ["AA:BB:CC:..."] signing-cert SHA-256 fingerprints
# Libraries to expose. Declaring them here syncs them into the database and
# scans them on startup; you can also create libraries at runtime via the admin
# API. Folder shape (single-file books, folder-per-book, multi-file parts) is
# auto-detected per folder by the scanner - there is no layout to configure; a
# folder the detector gets wrong is fixed via the admin folder-override endpoint
# (mode: book | collection).
libraries: []
# - name: "Main"
# root: "/srv/audiobooks"
# The admin console's "Set up your server" flow, which opens on a new server's
# first console visit. skip: true marks it finished at start, for an install set
# up by script or by this file (a public demo too): steps already done keep
# their mark, the rest read as skipped, and the Overview's reminder card is
# dismissed. A flow already finished is left as it is. Read at start only.
# setup:
# skip: false # [AUDIOSILO_SETUP_SKIP]
# Library scans. A scan reads several audio files at once (their tags, then
# ffprobe) and writes the index in one place, so its result is the same however
# many it reads. Read at start only: no console setting.
scan:
# Files read at once, 0 to 64. 0 = one per CPU, up to 8. Set below 8, it also
# caps the folder listings and file lookups made at once while finding the books
# (8 otherwise). Lower it for a slow disk or a busy share; raise it for a fast
# disk on a machine with cores to spare.
concurrency: 0 # [AUDIOSILO_SCAN_CONCURRENCY]
# The database (read at start only: no console setting).
# database:
# Whether the database's readers map the file into memory (SQLite mmap_size,
# 256 MiB, readers only), in any case:
# auto - only when the data folder is on Linux on an Unraid /mnt/user share
# (shfs), where reads are several times faster with it (the
# default); never on another FUSE filesystem (mergerfs, sshfs, rclone, s3fs,
# ntfs-3g) or a network share, where an I/O error under a mapping stops
# the server and a plain read fails one request
# on - always (at that risk)
# off - never
# mmap: auto # [AUDIOSILO_DB_MMAP]
# Public demo mode. When enabled, an unauthenticated visitor can mint a throwaway
# account via POST /api/v1/demo/session that is granted the named library; idle
# demo accounts (and their data) are reaped automatically. Intended for a public
# demo instance (e.g. demo.audiosilo.app). Seed the library with public-domain
# audiobooks via scripts/seed-librivox.sh.
demo:
enabled: false # [AUDIOSILO_DEMO_ENABLED]
library: "" # name of a library above to grant demo users [AUDIOSILO_DEMO_LIBRARY]
# max_users: 200 # cap on live demo users; omit for the safe default of 200, explicit 0 = unlimited (opt-in risk) [AUDIOSILO_DEMO_MAX_USERS]
idle_ttl: "" # reap demo users idle longer than this, e.g. "48h"; empty = 24h [AUDIOSILO_DEMO_IDLE_TTL]
# Household members. Anyone with an account (not a demo account) can add the
# people they live with from the player (Me > Household): a kid, signed in on
# their device at once, or a grown-up, who scans a code. A member is a real
# account that listens to everything its owner can, or only the collections the
# owner shares with it. The admin console turns this off for everyone (Settings >
# Household) or for one person (their page's Household row). Both settings apply
# at once.
household:
members_enabled: true # people can add household members [AUDIOSILO_HOUSEHOLD_MEMBERS_ENABLED]
max_members: 6 # members per person, 1 to 50 [AUDIOSILO_HOUSEHOLD_MAX_MEMBERS]
# Managed modules: optional features that ship off. The admin console turns each
# on or off (Settings > Modules) without a restart. A module that needs a Bridge
# feature stays hidden from listeners until a paired Bridge offers it.
modules:
podcasts:
enabled: false # Following feeds and scheduled checks need a paired Bridge.
contributions:
enabled: false # send corrections and generated sidecars to the community database through the Bridge (needs a Bridge signed in to GitHub) [AUDIOSILO_MODULES_CONTRIBUTIONS_ENABLED]
audible:
enabled: false # back up the Audible books you own through the Bridge, which holds the sign-in; the server queues its library checks (needs a Bridge with Audible) [AUDIOSILO_MODULES_AUDIBLE_ENABLED]
# Podcast directory search and OPML transfer (while the podcasts module is on).
# Search asks Apple's podcast directory by default (it receives the search text
# and this server's address); the server fetches result artwork itself. Read at
# start only: no console setting. Podcast Index search additionally needs its
# key pair, from the environment only (never written here):
# AUDIOSILO_PODCAST_INDEX_KEY and AUDIOSILO_PODCAST_INDEX_SECRET.
podcasts:
discovery:
enabled: true # [AUDIOSILO_PODCAST_DISCOVERY_ENABLED]
# Community metadata lookup (Phase 1.5). When enabled, the server resolves a
# book's ASIN/ISBN against the community metadata API and exposes a composed
# enrichment envelope at GET /libraries/{id}/meta (author/narrator, description,
# series rail); answers are cached in memory and in the server's database (so a
# restarted server answers warm, and a known book keeps its details while the
# service is down). Disabling it stops all outbound calls (lookups and the mirror
# download alike) with one key, and the `metadata` capability then reports false
# so clients hide the UI. base_url must be an absolute http(s) URL when enabled.
metadata:
enabled: true # [AUDIOSILO_METADATA_ENABLED]
base_url: "https://meta.audiosilo.app" # metaserve base URL [AUDIOSILO_METADATA_BASE_URL]
# The Audible marketplace whose ASIN a community match takes when a recording
# sells in several: us, uk, ca, au, de, fr, es, it, jp, in or br. Empty takes
# the US store's. [AUDIOSILO_METADATA_REGION]
region: ""
# Where the lookups are answered (applies after a restart):
# remote - ask the service at base_url for each book (the default).
# mirror - keep a local copy of the service's database in <data>/meta-mirror/
# and answer from it, so no book is looked up over the internet. The
# copy comes from the audiosilo-meta releases on GitHub, checked weekly
# by default: about 450 MB downloaded per update and about 1.8 GB on disk
# (up to twice that while an update is swapped in). Until the first
# copy is ready, and for any question the copy can't answer, the
# server asks base_url as in remote mode. Switching back to remote
# deletes the copy at the next start.
# [AUDIOSILO_METADATA_MODE]
mode: remote
mirror:
# Time between successful release checks, read at startup: 0 for one week,
# else at least 1h (such as 48h).
interval: 0
# Help complete the community database (Settings > Metadata; off by default,
# applies at once): once a day, send the metadata service the Audible ASINs of
# your books the community database doesn't know, and nothing else (no titles,
# paths, server name or listeners). Each ASIN is looked up first (in mirror
# mode only in the local copy, never online); only the unknown ones are sent,
# and only over https (or plain http to this machine). A service that takes
# no reports (an older one, or intake off) is left alone for a week. Never on
# a demo server. [AUDIOSILO_METADATA_REPORT_UNKNOWN]
report_unknown: false
# Match new books after a scan (Settings > Community metadata). The default
# is on only when the server starts with no config.yaml (a new install); a
# config.yaml without the key, an upgraded server's or a copy of this file,
# reads off. [AUDIOSILO_METADATA_AUTO_MATCH]
# auto_match: true
# Upcoming releases: once a day the server reads the community metadata for the
# series it holds and works out, for each listener, the preorders, recent
# releases and missing volumes in the series they have (the player's Upcoming
# list), and tells the admin about a new release in one (the book_released
# notification). It makes no call while metadata is off; in mirror mode the
# local copy answers. The first run records what is there without announcing it.
# Switched off with metadata on, it still looks up which community work each
# book is (once a day and after a scan), so the player can keep a work's
# recordings together; nothing else.
upcoming:
enabled: true # Settings > Metadata [AUDIOSILO_UPCOMING_ENABLED]
# How many days back a release still counts as new (1-365; applies after a
# restart). [AUDIOSILO_UPCOMING_WINDOW_DAYS]
window_days: 90
# Sign in with OpenID Connect (single sign-on: Authentik, Authelia, Keycloak,
# Pocket ID and the like). Off by default. The admin console and the web player
# show a "Sign in with <name>" button; the apps keep pairing by QR code. Register
# the server at your provider with the redirect URI
# <public_url>/api/v1/auth/oidc/callback
# (public_url must be set). The provider settings apply after a restart and show
# read only in Settings > Sign-in; a problem with them never stops the server
# (single sign-on stays off and the console says why).
auth:
oidc:
enabled: false # [AUDIOSILO_OIDC_ENABLED]
name: "" # the button's name (default "single sign-on") [AUDIOSILO_OIDC_NAME]
# Exactly as the provider's discovery document states it (a trailing slash
# counts): <issuer>/.well-known/openid-configuration. [AUDIOSILO_OIDC_ISSUER]
issuer: ""
client_id: "" # [AUDIOSILO_OIDC_CLIENT_ID]
# The client secret: here, in AUDIOSILO_OIDC_CLIENT_SECRET, or in the file
# client_secret_file names (one of them). None is a public client (PKCE
# alone). Never shown in the console or logged.
# [AUDIOSILO_OIDC_CLIENT_SECRET] [AUDIOSILO_OIDC_CLIENT_SECRET_FILE]
# client_secret: ""
# client_secret_file: ""
# Unset: openid, profile, email, and groups only while admin_group is set,
# or allowed_group with auto_create on. Listed: asked exactly as listed. [AUDIOSILO_OIDC_SCOPES]
# scopes: [openid, profile, email, groups]
# username_claim: preferred_username # a new account's username [AUDIOSILO_OIDC_USERNAME_CLAIM]
# groups_claim: groups # or a namespaced one, https://example.org/groups [AUDIOSILO_OIDC_GROUPS_CLAIM]
ca_file: "" # PEM certificates trusted for the provider [AUDIOSILO_OIDC_CA_FILE]
# Who may sign in and as what (Settings > Sign-in, applies at once). A
# sign-in links to an existing account only by a verified email that matches
# exactly one ordinary account (never an admin's, a household member's or a
# demo account's); any other sign-in waits for an admin to link it, make an
# account for it or dismiss it, unless auto_create makes an ordinary account
# (for members of allowed_group, when set).
auto_create: false # [AUDIOSILO_OIDC_AUTO_CREATE]
allowed_group: "" # [AUDIOSILO_OIDC_ALLOWED_GROUP]
# In this group: an admin; out of it: an ordinary user, at each single
# sign-on (never the last enabled admin). A sign-in with no groups claim
# (or one that can't be read) leaves the role as it is: only a list that
# is there changes it. Empty: roles are the console's.
admin_group: "" # [AUDIOSILO_OIDC_ADMIN_GROUP]