fix: read directory paths from settings.json instead of hardcoding#319
Open
lexfrei wants to merge 1 commit intolinuxserver:masterfrom
Open
fix: read directory paths from settings.json instead of hardcoding#319lexfrei wants to merge 1 commit intolinuxserver:masterfrom
lexfrei wants to merge 1 commit intolinuxserver:masterfrom
Conversation
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>
There was a problem hiding this comment.
Thanks for opening this pull request! Be sure to follow the pull request template!
Collaborator
|
I am a bot, here are the test results for this PR:
|
Member
|
This is a design decision we made. We don't have plans to change it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The init script reads
download-dir,incomplete-dir, andwatch-dirfromsettings.jsonusingjq(already a dependency in the same script) instead of hardcoding/downloads/completeand/downloads/incomplete.Ownership checks for
incomplete-dirandwatch-dirare now conditional on their respective*-enabledflags insettings.json.Falls back to default paths (
/downloads,/downloads/incomplete,/watch) whensettings.jsondoes not exist yet (first start).Benefits of this PR and context:
The current init script hardcodes
/downloads/completeand/downloads/incompletepaths for ownership checks. When users configure different paths insettings.json(or disable these features entirely), the script producesstat: cannot statxerrors 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?
settings.json(default paths) — ownership set correctlyincomplete-dir-enabled: falseand nocomplete/incompletedirectories — no errorsdownload-dirpath — ownership set on the correct directorysettings.json(first run) — falls back to default pathsSource / References:
/downloaddirectory