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

Don't mkdir books #60

Closed
typkrft opened this issue Jan 10, 2022 · 5 comments
Closed

Don't mkdir books #60

typkrft opened this issue Jan 10, 2022 · 5 comments

Comments

@typkrft
Copy link

typkrft commented Jan 10, 2022

Is it possible not to run mkdir books? I could be completely off base, but generally when I mount a volume to a path I'm expecting the data to be in that path. Making another books directory in /books seems redundant. This is not a huge deal though, just a thought.

My Compose:

version: "3.9"

volumes:
  books:
    driver_opts:
      type: "nfs"
      o: "addr=${NAS_IP},nolock,soft,rw"
      device: ":${NAS_MEDIA_PATH}/Literature/Books"

services:
  openbooks:
    container_name: openBooks
    image: evanbuss/openbooks:latest
    environment:
      - BASE_PATH=/openbooks/
    volumes:
      - 'books:/books'
    ports:
      - '17012:80'
    restart: unless-stopped
    command: --persist
@TaylorWorthing
Copy link

The BASE_PATH is a general cache that holds more than just cached book downloads. For example, if you enable IRC logs with --log, a ${BASE_PATH}/logs directory is created.

If you want to store just the download cache, you could mount the books subdirectory like: books:/openbooks/books.

@evan-buss
Copy link
Owner

So the BASE_PATH is just used if you want to host the server at a subpath. For example http://yourwebsite.com/base_path/. If you aren't doing that you can remove the BASE_PATH environment variable.

The app creates a directory structure like the following:

openbooks/
├─ books/
│  ├─ book1.epub
│  ├─ book2.epub
├─ logs
│  ├─ log1.txt

@BrowncoatShadow Is correct in that you can modify the mount point of your docker file if you don't care about exposing the logs folder/files. This config will show the book files at the top level.

services:
  openbooks:
    container_name: openBooks
    image: evanbuss/openbooks:latest
    environment:
      - BASE_PATH=/openbooks/
    volumes:
-      - 'books:/books'
+      - 'books:/books/books'
    ports:
      - '17012:80'
    restart: unless-stopped
    command: --persist

I agree that having two separate mount points (1 for books and 1 for logs) would be less confusing. I will keep it in mind.

@typkrft
Copy link
Author

typkrft commented Jan 10, 2022

So the BASE_PATH is just used if you want to host the server at a subpath. For example http://yourwebsite.com/base_path/. If you aren't doing that you can remove the BASE_PATH environment variable.

The app creates a directory structure like the following:

openbooks/
├─ books/
│  ├─ book1.epub
│  ├─ book2.epub
├─ logs
│  ├─ log1.txt

@BrowncoatShadow Is correct in that you can modify the mount point of your docker file if you don't care about exposing the logs folder/files. This config will show the book files at the top level.

services:
  openbooks:
    container_name: openBooks
    image: evanbuss/openbooks:latest
    environment:
      - BASE_PATH=/openbooks/
    volumes:
-      - 'books:/books'
+      - 'books:/books/books'
    ports:
      - '17012:80'
    restart: unless-stopped
    command: --persist

I agree that having two separate mount points (1 for books and 1 for logs) would be less confusing. I will keep it in mind.

I should have tried this first, sorry. I assumed incorrectly that it would throw an error or something weird because the path was already created. That'll work. Thanks!

@typkrft typkrft closed this as completed Jan 10, 2022
@TaylorWorthing
Copy link

Whoops. I always forget that the environment variable is separate from the the --dir flag. @evan-buss, are you considering that in the future the log and book cache directories might be separate flags instead of a common directory flag?

@brettinternet
Copy link

I would love to see a separate mountpoint for logs and books. Configuring the volume as books:/books/books is unintuitive and the help description of --dir is sort of confusing since eBooks are actually saved in a subdirectory within the --dir folder instead of the folder itself.

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

No branches or pull requests

4 participants