January 13, 20251 yr Hi all. I have a media library (all music is public domain) in my /mnt/user/music share. I want some docker containers to be able to access all folders - say qBittorrent for the purposes of sharing said music, and plex, I only want to have access to some folders. For example, I usually have FLAC versions, and I want to make the Plex folder unable to access the MP3 and V0 versions. How would I go about doing this? I tried using `chown` and `chmod`, but when i try to run a container as anyone other than `root` or `nobody` user, it says `unable to find user steven: no matching entries in passwd file`, even though I see it in `cat /etc/passwd`....
January 13, 20251 yr Community Expert Solution plex realy should be its on folders... I would run a script and symlink the .flac files to a folder and pass that to plex. Let Qbit access the /mnt/user/music ... so my suggestion would be to add a share lets call it plex. then using termianl maeka music folder within... this will be the plex docker path for music... #!/bin/bash # Variables SOURCE_DIR="/mnt/user/music" TARGET_DIR="/mnt/user/plex/music" # Ensure target directory exists mkdir -p "$TARGET_DIR" # Traverse the source directory to find all .flac files find "$SOURCE_DIR" -type f -name "*.flac" | while read -r file; do # Get the relative path of the file relative_path="${file#$SOURCE_DIR/}" # Get the directory of the file relative to the source file_dir=$(dirname "$relative_path") # Create the corresponding directory structure in the target directory mkdir -p "$TARGET_DIR/$file_dir" # Create a symlink to the .flac file in the corresponding target directory ln -s "$file" "$TARGET_DIR/$relative_path" done echo "Symlinks for .flac files have been created in $TARGET_DIR" This will create a symlinked structure under the target directory.... Example output: /mnt/user/music/ ├── Artist1/ │ ├── Album1/ │ │ ├── track1.flac │ │ ├── track1.mp3 │ │ └── track2.flac │ └── Album2/ │ └── track3.flac └── Artist2/ └── Album1/ ├── track1.mp3 └── track2.flac the symlink example output: /mnt/user/plexFLAC/ ├── Artist1/ │ ├── Album1/ │ │ ├── track1.flac │ │ └── track2.flac │ └── Album2/ │ └── track3.flac └── Artist2/ └── Album1/ └── track2.flac This way, only .flac files are visible to Plex while maintaining the original folder structure. mby install the user script plugin and cron that script to run every 3 hours or so.... if your source changes from time to time. this way plex doesnt' touch the real files but can use the files form that directory... usualy what is known as teh *arrs have a folder structure hierachy... so snar, qbit torrent, plex all have there directies shared with in 1 location... what your fighting atm is file structure and who has access to what. you may need to add extra option like puig,pgid and umask when sharing the same folder across mutiple dockers...
January 28, 20251 yr Author @bmartino1 Thanks for such a thorough solution; I think it makes complete sense. I've hit the donate button! :-)
January 30, 20251 yr Author @bmartino1 FYI, this worked very well, but there was a piece missing. Since I'm creating symbolic links, the Plex docker container also has to have access to the source data, and that source data must be accessible via the same path as the links. What I mean is this: `/mnt/user/plex/music/some_directory/some_file.flac` points to `/mnt/user/data/music/some_directory/some_file.flac`. This means that Plex must have access to the source files via that directory: ``` --volumes /mnt/user/data/music:/mnt/user/data/music:ro ``` So we mount the source directory with the same path inside the container as outside the container, because the symlinks are "references" for our purposes to the source.
January 31, 20251 yr Community Expert 20 hours ago, stevenxl said: @bmartino1 FYI, this worked very well, but there was a piece missing. Since I'm creating symbolic links, the Plex docker container also has to have access to the source data, and that source data must be accessible via the same path as the links. What I mean is this: `/mnt/user/plex/music/some_directory/some_file.flac` points to `/mnt/user/data/music/some_directory/some_file.flac`. This means that Plex must have access to the source files via that directory: ``` --volumes /mnt/user/data/music:/mnt/user/data/music:ro ``` So we mount the source directory with the same path inside the container as outside the container, because the symlinks are "references" for our purposes to the source. correct. if you only wanted plex to see teh sym linkd files as read only you would need to edit the mount points to be read only. This was asumed. its how you want a docker to interact with the files at that point.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.