forked from janeczku/calibre-web
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Restrict NGINX (public?) access to "large" files only (e.g. .mp3, .mp4, .webm) in /library/calibre-web — for PR #51 OOM workaround #57
Open
deldesir
wants to merge
12
commits into
iiab:master
Choose a base branch
from
deldesir:deldesir-access-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6f53a2e
Tighten access
deldesir 092182b
Add comment
deldesir 018e5ee
Add correct PR #
deldesir f6bb5b5
Update scripts/calibre-web-nginx.conf
deldesir 4ed871e
Update scripts/calibre-web-nginx.conf
deldesir c362d63
Lint calibre-web-nginx.conf: Properly remove gratuitous whitespace
holta c10f12b
Simplify the conf
deldesir 6e1be57
Merge branch 'iiab:master' into deldesir-access-fix
deldesir f157f56
Update scripts/calibre-web-nginx.conf
deldesir 14968fd
calibre-web-nginx.conf: Contextualize "books-direct" code path
holta bd032b7
calibre-web-nginx.conf: Slight clarification of .webm and .mp4
holta 289235e
Merge branch 'iiab:master' into deldesir-access-fix
deldesir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
# RELATED: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy | ||
|
||
# http://box/library/calibre-web/<author>/<title>/<webm_or_mp4_video_file> | ||
location /library/calibre-web/ { | ||
alias /library/www/html/calibre-web/; | ||
fancyindex on; # autoindex on; | ||
# 2023-12-04: This is part of an (interim?) workaround so that playback of | ||
# larger videos actually works. Far better would be a proper MM (memory | ||
# management) solution that respects Calibre-Web's existing username/password | ||
# security model. Can anybody suggest concrete ideas to make that happen? | ||
# | ||
# The failure of large videos to play is summarized here: | ||
# https://github.com/iiab/calibre-web/issues/37 | ||
# | ||
# This (perhaps imperfect) proposed solution is emerging here: | ||
# https://github.com/iiab/calibre-web/pull/50 | ||
# https://github.com/iiab/calibre-web/pull/51 | ||
# https://github.com/iiab/calibre-web/issues/53 | ||
# https://github.com/iiab/iiab/pull/3676 | ||
# https://github.com/iiab/calibre-web/pull/55 | ||
# https://github.com/iiab/calibre-web/pull/56 | ||
# https://github.com/iiab/calibre-web/pull/57 | ||
|
||
# http://box/books-direct/<author>/<title>/<webm_or_mp4_video_file> | ||
|
||
# Align NGINX path (e.g. "books-direct") with Line ~1580 of: | ||
# https://github.com/iiab/calibre-web/blob/master/cps/web.py | ||
location /books-direct/ { | ||
alias /library/calibre-web/; | ||
#autoindex off; # Directory listings (should be off by default?) | ||
|
||
# Deny access to all other content: https://serverfault.com/a/222928 | ||
location /books-direct/ { deny all; } | ||
|
||
# Allow serving of .webm and .mp4 files | ||
location ~* \.(webm|mp4)$ { } | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep in mind this is a temporary fix. We'll need to align with Calibre-Web architecture eventually.