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

Create calibre-web-nginx.conf #50

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Create calibre-web-nginx.conf #50

merged 4 commits into from
Nov 29, 2023

Conversation

deldesir
Copy link
Collaborator

Allows access to /library/calibre-web//<title>/<webm_or_mp4_video_file>

Allows access to /library/calibre-web/<author>/<title>/<webm_or_mp4_video_file>
@deldesir deldesir self-assigned this Nov 23, 2023
@deldesir
Copy link
Collaborator Author

I symlink /library/calibre-web with /library/www/html/calibre-web

@holta holta added enhancement New feature or request question Further information is requested labels Nov 23, 2023
@holta
Copy link
Member

holta commented Nov 23, 2023

Should this PR temporarily eliminate its 3 Ansible vars, hard-coding them to {/books, /libros, /libros} during testing of... ?

@deldesir
Copy link
Collaborator Author

Yes. We don't need them for now though support to handle these hardcore variables in all Calibre-Web routes has been added in PR #33

@holta
Copy link
Member

holta commented Nov 28, 2023

Yes. We don't need them for now though support to handle these hardcore variables in all Calibre-Web routes has been added in PR #33

Are you going ahead hard-coding them to {/books, /libros, /libros} in this PR, so people can test this?

@holta holta merged commit 73af1b2 into iiab:master Nov 29, 2023
@holta
Copy link
Member

holta commented Dec 4, 2023

@deldesir if possible can you please explain more how this PR works, as a MM (memory management) workaround for Calibre-Web playback of larger videos?

@holta
Copy link
Member

holta commented Dec 4, 2023

@deldesir
Copy link
Collaborator Author

deldesir commented Dec 4, 2023

This PR is where it all starts, with the creation of the calibre-web-nginx.conf file. Didn't know beforehand I would have to adjust it further until I was reported wide access was allowed to /library/calibre-web/ by @holta's comment (moved to issue #53)

  • PR Fix OOM issue - affecting large videos' playback #51 is still relevant. We move away from loading file to memory to reading files directly using watchvideo.html (called in

    calibre-web/cps/web.py

    Lines 1568 to 1576 in fa70213

    for fileExt in constants.EXTENSIONS_VIDEO:
    if book_format.lower() == fileExt:
    entries = calibre_db.get_filtered_book(book_id)
    log.debug("Start video watching for %d", book_id)
    video_path = os.path.join(config.config_calibre_dir, book.path)
    video_file = glob.glob(os.path.join(video_path, "*." + book_format.lower()))
    video_file = video_file[0]
    video_type = "video/" + book_format.lower()
    return render_title_template('watchvideo.html', videofile=video_file , videotype=video_type,
    )

  • PR Deny wide access to entire calibre-web library directory #57 ensures only needed video file is readable for playback.

@deldesir deldesir deleted the deldesir-nginx branch July 1, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants