evan-buss / openbooks

Search and Download eBooks
https://evan-buss.github.io/openbooks/
MIT License
1.78k stars 58 forks source link

Persist books with user (not root) permissions #92

Open vik-s opened 1 year ago

vik-s commented 1 year ago

Hey, I'm running the latest docker install of Openbooks. I absolutely love it, thanks for your work. One issue I run into is, when I download books, they are stored in the persist directory with root permissions. This stops Calibre from running Auto-import till I change the permission of the downloaded books, into my user permissions. I do not run the docker container as root, but instead as my specified docker user.

Is there any way I can define the owner / permissions of the books being persisted?

Thanks!

sbelongie commented 1 year ago

would like to know a way to fix this issue as well.

robflate commented 1 year ago

anyone found a solution to this?

CyBuzz commented 1 year ago

I just wrote a cron job to change the permissions of files in the download folder and it runs every 5 minutes. The books get picked up by Calibre once the permissions change.

knipster commented 1 year ago

Also having this issue....

4very commented 11 months ago

You can specify the UID and GID of a container via compose. Cheers!

  openbooks:
    restart: unless-stopped
    container_name: openbooks
    command: --name my_irc_name --persist --port 80 --no-browser-downloads -d /books
    image: evanbuss/openbooks:latest
    user: "1002:1002"
mikaeltarquin commented 6 months ago

You can specify the UID and GID of a container via compose. Cheers!

  openbooks:
    restart: unless-stopped
    container_name: openbooks
    command: --name my_irc_name --persist --port 80 --no-browser-downloads -d /books
    image: evanbuss/openbooks:latest
    user: "1002:1002"

I found this post while trying to figure out this exact issue (openbooks to calibre auto-add from folder). I added the user line exactly, but files are still coming in with read only permissions for "group" and "other" (-rw-r--r--), as far as my unraid server can tell. Here is my full docker compose file, not sure what the issue is:

version: '3.3'
services:
    openbooks:
        container_name: OpenBooks
        image: evanbuss/openbooks:latest
        ports:
            - "8585:80"
        volumes:
            - '/mnt/user/data/media/eBooks/to_import:/books'
        command: --name my_irc_name --persist --no-browser-downloads
        restart: unless-stopped
        environment:
          - BASE_PATH=/openbooks/
        user: "1002:1002"
volumes:
    booksVolume:

Edit: Never mind! Was able to fix it by changing the user line to "99:100":

version: '3.3'
services:
    openbooks:
        container_name: OpenBooks
        image: evanbuss/openbooks:latest
        ports:
            - "8585:80"
        volumes:
            - '/mnt/user/data/media/eBooks/to_import:/books'
        command: --name my_irc_name --persist --no-browser-downloads
        restart: unless-stopped
        environment:
          - BASE_PATH=/openbooks/
        user: "99:100"
volumes:
    booksVolume: