Initial commit
This commit is contained in:
42
app/__init__.py
Normal file
42
app/__init__.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""OPDS server backed by FreshRSS.
|
||||
|
||||
An OPDS 1.2 catalog whose shelves mirror FreshRSS categories and feeds, serving
|
||||
one EPUB per article, generated in memory at download time. Nothing is written to
|
||||
disk: the catalog is rebuilt from the FreshRSS API as it is browsed, and a
|
||||
completed EPUB download marks the corresponding article read upstream.
|
||||
|
||||
Layout, in dependency order:
|
||||
|
||||
``config``
|
||||
The JSON document, its interpolation (``${ENV}``, ``${file:...}``) and its
|
||||
validation. Everything else is configured from here.
|
||||
``urls``
|
||||
Identifier and filename helpers: base64url for path identifiers, stable
|
||||
``urn:uuid`` values for Atom ids, and safe download filenames.
|
||||
``cache``
|
||||
A bounded in-memory TTL cache with per-key single-flight, so a reader
|
||||
browsing quickly does not turn into a burst of upstream requests.
|
||||
``xhtml``
|
||||
Feed HTML into well-formed XHTML. Everything the reader's XML parser sees
|
||||
has been rebuilt by this module.
|
||||
``images``
|
||||
Media-type sniffing and dimension parsing, so a book's manifest is honest
|
||||
about its bytes and a cover can be chosen without an imaging library.
|
||||
``fetch``
|
||||
The one place that fetches a host the operator did not choose. Article
|
||||
images are fetched through an SSRF guard that dials a validated address.
|
||||
``epub``
|
||||
The EPUB 3 writer, assembled entirely in memory.
|
||||
``freshrss``
|
||||
The FreshRSS client, over its Google Reader compatible API.
|
||||
``auth``
|
||||
HTTP Basic authentication, with a throttle on failed attempts.
|
||||
``opds``
|
||||
OPDS 1.2 Atom document builders.
|
||||
``server``
|
||||
Routing, the catalog logic, and EPUB delivery.
|
||||
|
||||
Run it with ``python -m app --config config.json``.
|
||||
"""
|
||||
|
||||
__version__ = "1.0.0"
|
||||
Reference in New Issue
Block a user