Skip to main content

Server Configuration

The server is configured via a TOML file. A minimal configuration looks like:

[server]
host = "0.0.0.0"
port = 7700
api_key = "your-secret-key"

[library]
content_paths = ["/music"]

[storage]
db_path = "/data/muorg.db"
backup_dir = "/data/backups"
backup_retention_count = 5

[cors]
allowed_origins = ["tauri://localhost", "http://tauri.localhost", "http://localhost:7800"]

[transcoding]
bitrate = 320
format = "mp3"
sample_rate = 48000

A fully-commented example ships at server/muorg-server.example.toml.

Configuration Reference​

[server]​

KeyDefaultDescription
host"127.0.0.1"Bind address. Use "0.0.0.0" in Docker. When loopback, a second all-interfaces listener serves only the token-protected /stream/{token}/{id} route for Chromecast devices on the LAN; /api/* stays loopback-only.
port7700HTTP port
api_key"change-me"API key for Bearer auth — change before exposing to the internet
shutdown_timeout_secs30Graceful shutdown: seconds to wait for in-flight requests before force-exiting
rate_limit_requests100Requests one IP may make within the window before the server answers 429
rate_limit_window_secs60Length of the rate-limit window in seconds

[library]​

KeyDefaultDescription
content_paths[]Directories to scan for music (recursive)
scan_on_startuptrueAuto-scan on server start
browse_roots[]Directories GET /api/admin/browse may start from or descend into. Empty (default) falls back to each content_paths entry's parent directory plus the entry itself — never the server user's home directory unless listed here explicitly.
remote_scan_concurrency8How many objects to read tags from in parallel during a remote (S3) scan
remotes[]S3-compatible buckets indexed alongside content_paths. See below.

[[library.remotes]] — cloud storage (S3-compatible)​

Index music straight out of an S3-compatible bucket (Hetzner Object Storage, Cloudflare R2, Backblaze B2, Wasabi, MinIO, AWS S3, …). Tracks are stored as remote://<name>/<object-key>.

KeyDefaultDescription
name—Letters, digits, -, _ only; used internally as remote://<name>/<key>
bucket—Bucket name
endpointAWS S3Provider endpoint, e.g. https://nbg1.your-objectstorage.com
region"auto"Region code
access_key_id—Or set MUORG_REMOTE_<NAME>_ACCESS_KEY_ID env var
secret_access_key—Or set MUORG_REMOTE_<NAME>_SECRET_ACCESS_KEY env var
prefix—Optional sub-folder inside the bucket
virtual_hosted_stylefalsetrue for providers requiring <bucket>.<host> addressing (Hetzner)
unsigned_payloadfalseSend UNSIGNED-PAYLOAD instead of signing request bodies (some Ceph gateways)

[storage]​

KeyDefaultDescription
db_path—SQLite database path
backup_dir—Directory for database backups
backup_retention_count5How many backups to keep
cover_cache_dircovers/ next to the DBWhere extracted cover art for remote (cloud) tracks is cached
cover_cache_max_bytes536870912 (512 MiB)Max size of the cover cache

[cors]​

KeyDefaultDescription
allowed_origins["tauri://localhost", "http://tauri.localhost"]Origins allowed to call the API. The default only permits the desktop app.

List every origin that needs access: the desktop app (tauri://localhost, http://tauri.localhost), the web UI dev server (http://localhost:7800) and your web app's production URL.

warning

Never set allowed_origins = ["*"] on a public deployment. * lets any website you visit call your server, read your library and change your playlists using your API key.

[transcoding]​

KeyDefaultDescription
bitrate128Output bitrate in kbps (128/160/192/256/320)
format"mp3"Output format (currently only mp3)
sample_rate44100Output sample rate in Hz
downgrade_flac_to_mp3falseServe FLAC tracks through the MP3 transcode instead of the original file 1:1 from GET /stream/flac/{token}/{id}. Default serves FLAC as-is, with an automatic MP3 fallback for user agents that cannot decode FLAC (e.g. Safari).
downgrade_wav_to_mp3falseServe WAV tracks through the MP3 transcode instead of the original file 1:1 from GET /stream/wav/{token}/{id}. Default serves WAV as-is; every browser decodes WAV natively.

[images]​

Limits on POST /api/fetch-image, the one route that fetches a caller-supplied URL (used by clients for album art).

KeyDefaultDescription
allowed_hostssee urlguard::DEFAULT_ALLOWED_HOSTSHosts the route may fetch from. An entry also matches its subdomains. Replacing this list replaces the default — it is not merged.
max_bytes10485760 (10 MiB)Hard cap on the response body, enforced while streaming
timeout_secs15Whole-request budget so a stalling host cannot hold a worker indefinitely