Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved files can not be deleted #145

Open
moritzfl opened this issue Mar 3, 2022 · 5 comments
Open

Moved files can not be deleted #145

moritzfl opened this issue Mar 3, 2022 · 5 comments

Comments

@moritzfl
Copy link
Contributor

moritzfl commented Mar 3, 2022

This might be docker specific but when files are moved, users may only read the files but not delete it.

I am currently experimenting with Phockup on my Unraid-NAS and the plan is to have two folders where me and my wife can drop in photos and have them organized by date. However, neither me nor my wife can actually modify anything in the moved data (delete/rename does not work).

For Unraid, there is a fix that works but it has to be manually triggered from the User Interface. It would be nice if the Docker image would take care of properly handling permissions instead.

The fix is described here
Essentially an Unraid Plugin repairs permissions in folders that were set by docker containers.

Description from the web interface of the Unraid Plugin:

You should use this tool in case a misconfigured docker application
 (notably CouchPotato or Sonarr / SickBeard) has written media files 
to your array with the wrong permissions, and you find yourself unable
 to modify / delete those files.

This utility starts a background process that goes to each of your data
 disks and cache disk and changes file and directory ownership to 
nobody/users (i.e., uid/gid to 99/100), and sets permissions as follows:


For directories:
  drwxrwxrwx

For read/write files:
  -rw-rw-rw-

For readonly files:
  -r--r--r--

By the way and just in case this is interesting for you - if the configuration options could be accessed through Environment Variables instead of Post Arguments, it would be pretty easy to publish Phockup in the Unraid-Store (as shown in this YouTube video).

@ivandokov
Copy link
Owner

I don't use Phockup as docker image and I don't have any idea about this issue so any assistance is more than welcome.

Regarding publishing the software to Unraid app store - this sounds interesting and I think we can adapt the code to honor environment variables. Anyone willing to work on this is welcome to send a PR (or maybe two - one for env vars and one for store config). I hope we can push to the store automatically using our existing Github Actions pipeline.

@JoshuaCrewe
Copy link
Contributor

@moritzfl does using -u in the docker command work for you?

       -u, --user=""
          Sets the username or UID used and optionally the groupname or GID for the specified command.
          
docker run -u 1000:1000 -v ~/Downloads/photos:/mnt ivandokov/phockup:latest /mnt/Input /mnt/Output

@JoshuaCrewe
Copy link
Contributor

Using the user flag works for a one shot but when running the docker command using the cron it fails due to permission denied.

@fabiencharrasse
Copy link

Hello. Same problem here, #213 seem to fix the problem ?

@kinghat
Copy link

kinghat commented Mar 13, 2024

Using the user flag works for a one shot but when running the docker command using the cron it fails due to permission denied.

ya so either phockup should own the files as a specified user or utilize its own scheduler over cron.

Hello. Same problem here, #213 seem to fix the problem ?

im not sure if this is a fix for file ownership when being run from docker.

something one could do is toss the docker command in a compose and then schedule that from where docker is run if needed:

services:
    phockup:
        image: ivandokov/phockup:latest
        container_name: phockup
        user: ${UID:-1000}:${GID:-1000}
        volumes:
            - /path/to/input/dir:/mnt/input
            - /path/to/output/dir:/mnt/output
        command: /mnt/input /mnt/output --move --original-names --date YYYY/MM

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

No branches or pull requests

5 participants