Skip to content

Use /config for appdata and /data for media in Docker installs#46

Open
JesseHawkins wants to merge 1 commit into
KirovAir:masterfrom
JesseHawkins:container-config-data-paths
Open

Use /config for appdata and /data for media in Docker installs#46
JesseHawkins wants to merge 1 commit into
KirovAir:masterfrom
JesseHawkins:container-config-data-paths

Conversation

@JesseHawkins

Copy link
Copy Markdown

Summary

This changes the Docker/container path contract so Muxarr stores its persistent app data under /config and expects mounted media libraries under /data.

That matches the common *arr/TRaSH-style convention where:

  • /config is application state, database, settings, and keys
  • /data is the shared media/downloads path used by the media stack

What changed

  • Move the default SQLite connection string from /data/muxarr.db to /config/muxarr.db
  • Set the container user's home and declared volume to /config
  • Ensure the entrypoint prepares both /config and /data
  • Update README, setup, profile, and post-processing examples to describe /config and /data consistently
  • Add startup handling for existing installs that still have /data/muxarr.db

Existing install migration

On startup, if /config/muxarr.db does not exist but /data/muxarr.db does:

  1. Muxarr copies the legacy DB to /config/muxarr.db using SQLite's backup API
  2. Muxarr validates the copied DB with PRAGMA quick_check
  3. Muxarr moves the old DB to /config/muxarr-previous.db for rollback

If /config/muxarr.db already exists, it is left untouched.

Testing

Tested with:

  • dotnet test Muxarr.Tests/Muxarr.Tests.csproj
  • Result: 507 passed, 1 skipped, 0 failed
  • dotnet publish Muxarr.Web/Muxarr.Web.csproj -c Release -o Muxarr.Web/publish
  • Docker image build using Muxarr.Web/Dockerfile
  • Fresh container boot with empty /config
  • Migration boot using a real existing Muxarr SQLite DB copied from an active homelab install
  • Manual conversion testing against media mounted under /data

The skipped test is the existing manual ISO language data generator.

Maintainer Note

Note: this was an AI-assisted change, but the scope was intentionally kept narrow: container path behavior, legacy DB migration, docs, and one focused regression test.

The generated code was reviewed manually, adjusted to avoid destructive DB deletion, tested with the project's test suite, and smoke-tested in Docker with both fresh and existing database scenarios.

@denkristoffer

Copy link
Copy Markdown

This would be nice just to avoid extra path mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants