Skip to content

fix: read directory paths from settings.json instead of hardcoding#319

Open
lexfrei wants to merge 1 commit intolinuxserver:masterfrom
lexfrei:fix/read-paths-from-settings
Open

fix: read directory paths from settings.json instead of hardcoding#319
lexfrei wants to merge 1 commit intolinuxserver:masterfrom
lexfrei:fix/read-paths-from-settings

Conversation

@lexfrei
Copy link
Copy Markdown

@lexfrei lexfrei commented Apr 4, 2026


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

The init script reads download-dir, incomplete-dir, and watch-dir from settings.json using jq (already a dependency in the same script) instead of hardcoding /downloads/complete and /downloads/incomplete.

Ownership checks for incomplete-dir and watch-dir are now conditional on their respective *-enabled flags in settings.json.

Falls back to default paths (/downloads, /downloads/incomplete, /watch) when settings.json does not exist yet (first start).

Benefits of this PR and context:

The current init script hardcodes /downloads/complete and /downloads/incomplete paths for ownership checks. When users configure different paths in settings.json (or disable these features entirely), the script produces stat: cannot statx errors on every container start.

This change respects user configuration while preserving the original ownership-fixing behavior for users who keep the default paths.

Closes #34, closes #164

How Has This Been Tested?

  • Container start with default settings.json (default paths) — ownership set correctly
  • Container start with incomplete-dir-enabled: false and no complete/incomplete directories — no errors
  • Container start with custom download-dir path — ownership set on the correct directory
  • Container start without settings.json (first run) — falls back to default paths

Source / References:

The init script previously hardcoded /downloads/complete and
/downloads/incomplete for ownership checks, causing errors when
users configure different paths in settings.json.

Now reads download-dir, incomplete-dir, and watch-dir from
settings.json, and only checks ownership when the corresponding
feature is enabled (incomplete-dir-enabled, watch-dir-enabled).

jq is already a dependency used earlier in the same script.

Closes linuxserver#34, closes linuxserver#164

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Copy Markdown
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/transmission/4.1.1-r1-pkg-643509e3-dev-520598766753175e0ad0e7cd8d7a2b4f42701776-pr-319/index.html
https://ci-tests.linuxserver.io/lspipepr/transmission/4.1.1-r1-pkg-643509e3-dev-520598766753175e0ad0e7cd8d7a2b4f42701776-pr-319/shellcheck-result.xml

Tag Passed
amd64-4.1.1-r1-pkg-643509e3-dev-520598766753175e0ad0e7cd8d7a2b4f42701776-pr-319
arm64v8-4.1.1-r1-pkg-643509e3-dev-520598766753175e0ad0e7cd8d7a2b4f42701776-pr-319

@aptalca
Copy link
Copy Markdown
Member

aptalca commented Apr 4, 2026

This is a design decision we made. We don't have plans to change it.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

can't get watch-dir to work Use single /download directory

3 participants