Often you want to expose your library publicly, which requires
authentication to prevent unknown users from seeing your
content.
In my case, I also expose the library on a local domain using a local DNS server which doesn't have these security issues.
This change adds a `local_only` option to the feed auth
config which will only supply the provided username/password
when the request comes from a private IP address.
Omitting `local_only` or setting to false will keep the current
logic of sending the credentials no matter the origin of the
request.
This change adds a child logger with request information to the
http request context. Also improved the log format for clarity.
- Unescaped the query string
- Use JSON log format when not in dev mode.
- Added request ip to the request child logger.
- The child logger is passed to the converter so we can associate
any errors with a specific request / file.
- Add book file name as a logger attribute
- Add user agent header as a logger attribute
- Log the "X-Forwarded-For" header, falling back to RemoteAddr
See the notes for a full explanation, but basically
Kobo is making simultaneous requests and the
files were conflicting because there were 2 being
downloaded / converted at the same time which
resulted in unreliable behavior.
The solution is to protect the conversion
section to allow a single conversion to complete
before allowing the next one to start.
If a feed requires credentials, OPDS Proxy can transparently
set them server side by reading the feed configuration.
This is useful in scenarios where the server operator sets up their
own authentication in front of OPDS Proxy and doesn't want to
have users remember separate credentials for each of the configured
feeds.
If keys aren't specified they will be generated. The downside
of this is that the keys will change every server restart
which will invalidate previously generated cookies.
If the keys are specified in the config.yml, they are
used between restarts and all previously generated
cookies remain valid.
Working *.epub to *.kepub.epub file conversions when
using a Kobo reader. Updated docker file to include
`kepubify` to convert to kepub. If not available the
file is just sent without conversion.
We now allow multiple OPDS feeds to be pre-defined and displayed
on the homepage. As a result we need to pass the feed navigation
URLs via query parameter rather than a subpath which would only
support proxying to a single OPDS feed.
The feed is passed via the q= query parameter and any relative
links from the OPDS XML are resolved to a complete URL with
domain / scheme.
We also check the "Content-Type" header in the response
received from the OPDS feed to determine whether to parse
an OPDS catalog or just proxy the raw response back (images / files).
Convert the raw OPDS format to a view model that
is easier to work with. Biggest change is that
we construct a single "Link" from an entry with
an array of Links with different "TypeLinks" and "Rel"
attributes.