codex 1.4.1__py3-none-any.whl → 1.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/applications/websocket.py +1 -1
- codex/librarian/importer/aggregate_metadata.py +38 -25
- codex/librarian/importer/clean_metadata.py +26 -13
- codex/librarian/importer/create_fks.py +1 -1
- codex/librarian/librariand.py +7 -4
- codex/librarian/watchdog/db_snapshot.py +1 -1
- codex/librarian/watchdog/event_batcherd.py +14 -11
- codex/librarian/watchdog/events.py +1 -1
- codex/logger/loggerd.py +14 -11
- codex/migrations/0001_init.py +3 -2
- codex/migrations/0002_auto_20200826_0622.py +4 -2
- codex/migrations/0003_auto_20200831_2033.py +4 -2
- codex/migrations/0004_failedimport.py +4 -2
- codex/migrations/0005_auto_20200918_0146.py +4 -2
- codex/migrations/0006_update_default_names_and_remove_duplicate_comics.py +12 -7
- codex/migrations/0007_auto_20211210_1710.py +3 -2
- codex/migrations/0008_alter_comic_created_at_alter_comic_format_and_more.py +4 -2
- codex/migrations/0009_alter_comic_parent_folder.py +4 -2
- codex/migrations/0010_haystack.py +4 -2
- codex/migrations/0011_library_groups_and_metadata_changes.py +3 -2
- codex/migrations/0012_rename_description_comic_comments.py +4 -2
- codex/migrations/0013_int_issue_count_longer_charfields.py +3 -3
- codex/migrations/0014_pdf_issue_suffix_remove_cover_image_sort_name.py +3 -2
- codex/migrations/0015_link_comics_to_top_level_folders.py +5 -2
- codex/migrations/0016_remove_comic_cover_path_librarianstatus.py +3 -3
- codex/migrations/0017_alter_timestamp_options_alter_adminflag_name_and_more.py +3 -3
- codex/migrations/0018_rename_userbookmark_bookmark.py +3 -2
- codex/migrations/0019_delete_queuejob.py +3 -2
- codex/migrations/0020_remove_search_tables.py +3 -2
- codex/migrations/0021_bookmark_fit_to_choices_read_in_reverse.py +3 -2
- codex/migrations/0022_bookmark_vertical_useractive_null_statuses.py +3 -2
- codex/migrations/0023_rename_credit_creator_and_more.py +3 -2
- codex/migrations/0024_comic_gtin_comic_story_arc_number.py +4 -2
- codex/migrations/0025_add_story_arc_number.py +4 -2
- codex/models.py +3 -4
- codex/search/backend.py +34 -31
- codex/serializers/auth.py +2 -1
- codex/serializers/choices.py +1 -0
- codex/static_root/assets/admin-b2b56cd6.f68d07d2bf93.js +41 -0
- codex/static_root/assets/admin-b2b56cd6.f68d07d2bf93.js.br +0 -0
- codex/static_root/assets/admin-b2b56cd6.f68d07d2bf93.js.gz +0 -0
- codex/static_root/assets/admin-b2b56cd6.js +41 -0
- codex/static_root/assets/admin-b2b56cd6.js.br +0 -0
- codex/static_root/assets/admin-b2b56cd6.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-522f1e6c.089d70878270.js → admin-drawer-panel-efc525ec.ddab36a24e08.js} +1 -1
- codex/static_root/assets/admin-drawer-panel-efc525ec.ddab36a24e08.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-efc525ec.ddab36a24e08.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-522f1e6c.js → admin-drawer-panel-efc525ec.js} +1 -1
- codex/static_root/assets/admin-drawer-panel-efc525ec.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-efc525ec.js.gz +0 -0
- codex/static_root/assets/admin-f2bb1dc8.css +1 -0
- codex/static_root/assets/admin-f2bb1dc8.css.br +0 -0
- codex/static_root/assets/admin-f2bb1dc8.css.gz +0 -0
- codex/static_root/assets/admin-f2bb1dc8.ecec18791c01.css +1 -0
- codex/static_root/assets/admin-f2bb1dc8.ecec18791c01.css.br +0 -0
- codex/static_root/assets/admin-f2bb1dc8.ecec18791c01.css.gz +0 -0
- codex/static_root/assets/{browser-7f7d7134.0fe3749b0f2f.css → browser-198df919.css} +1 -1
- codex/static_root/assets/browser-198df919.css.br +0 -0
- codex/static_root/assets/browser-198df919.css.gz +0 -0
- codex/static_root/assets/{browser-7f7d7134.css → browser-198df919.f06301531790.css} +1 -1
- codex/static_root/assets/browser-198df919.f06301531790.css.br +0 -0
- codex/static_root/assets/browser-198df919.f06301531790.css.gz +0 -0
- codex/static_root/assets/browser-ca158ba5.980d652eb174.js +1 -0
- codex/static_root/assets/browser-ca158ba5.980d652eb174.js.br +0 -0
- codex/static_root/assets/browser-ca158ba5.980d652eb174.js.gz +0 -0
- codex/static_root/assets/browser-ca158ba5.js +1 -0
- codex/static_root/assets/browser-ca158ba5.js.br +0 -0
- codex/static_root/assets/browser-ca158ba5.js.gz +0 -0
- codex/static_root/assets/{http-error-5e17b794.77ceeb2d4641.js → http-error-d31fd3bd.6ab9acf65973.js} +1 -1
- codex/static_root/assets/http-error-d31fd3bd.6ab9acf65973.js.br +0 -0
- codex/static_root/assets/http-error-d31fd3bd.6ab9acf65973.js.gz +0 -0
- codex/static_root/assets/{http-error-5e17b794.js → http-error-d31fd3bd.js} +1 -1
- codex/static_root/assets/http-error-d31fd3bd.js.br +0 -0
- codex/static_root/assets/http-error-d31fd3bd.js.gz +0 -0
- codex/static_root/assets/{main-0898f4bb.181e0145c642.css → main-c11eb0f1.776522baac3b.css} +1 -1
- codex/static_root/assets/main-c11eb0f1.776522baac3b.css.br +0 -0
- codex/static_root/assets/{main-0898f4bb.181e0145c642.css.gz → main-c11eb0f1.776522baac3b.css.gz} +0 -0
- codex/static_root/assets/{main-0898f4bb.css → main-c11eb0f1.css} +1 -1
- codex/static_root/assets/main-c11eb0f1.css.br +0 -0
- codex/static_root/assets/{main-0898f4bb.css.gz → main-c11eb0f1.css.gz} +0 -0
- codex/static_root/assets/main-c5736dea.a4790dbdb569.js +1 -0
- codex/static_root/assets/main-c5736dea.a4790dbdb569.js.br +0 -0
- codex/static_root/assets/main-c5736dea.a4790dbdb569.js.gz +0 -0
- codex/static_root/assets/main-c5736dea.js +1 -0
- codex/static_root/assets/main-c5736dea.js.br +0 -0
- codex/static_root/assets/main-c5736dea.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-83c74d48.b5cccc13c737.css +1 -0
- codex/static_root/assets/metadata-dialog-83c74d48.b5cccc13c737.css.br +0 -0
- codex/static_root/assets/metadata-dialog-83c74d48.b5cccc13c737.css.gz +0 -0
- codex/static_root/assets/metadata-dialog-83c74d48.css +1 -0
- codex/static_root/assets/metadata-dialog-83c74d48.css.br +0 -0
- codex/static_root/assets/metadata-dialog-83c74d48.css.gz +0 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.b281b7635db5.js +1 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.b281b7635db5.js.br +0 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.b281b7635db5.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.js +1 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.js.br +0 -0
- codex/static_root/assets/metadata-dialog-8c0a11ff.js.gz +0 -0
- codex/static_root/assets/{page-pdf-157ba97e.613d7c2beb77.js → page-pdf-ed976750.730244f14d16.js} +1 -1
- codex/static_root/assets/page-pdf-ed976750.730244f14d16.js.br +0 -0
- codex/static_root/assets/page-pdf-ed976750.730244f14d16.js.gz +0 -0
- codex/static_root/assets/{page-pdf-157ba97e.js → page-pdf-ed976750.js} +1 -1
- codex/static_root/assets/page-pdf-ed976750.js.br +0 -0
- codex/static_root/assets/page-pdf-ed976750.js.gz +0 -0
- codex/static_root/assets/reader-5540ffcb.8ea3c63a3154.css +1 -0
- codex/static_root/assets/reader-5540ffcb.8ea3c63a3154.css.br +0 -0
- codex/static_root/assets/reader-5540ffcb.8ea3c63a3154.css.gz +0 -0
- codex/static_root/assets/reader-5540ffcb.css +1 -0
- codex/static_root/assets/reader-5540ffcb.css.br +0 -0
- codex/static_root/assets/reader-5540ffcb.css.gz +0 -0
- codex/static_root/assets/reader-c562377d.7f78718f4c63.js +1 -0
- codex/static_root/assets/reader-c562377d.7f78718f4c63.js.br +0 -0
- codex/static_root/assets/reader-c562377d.7f78718f4c63.js.gz +0 -0
- codex/static_root/assets/reader-c562377d.js +1 -0
- codex/static_root/assets/reader-c562377d.js.br +0 -0
- codex/static_root/assets/reader-c562377d.js.gz +0 -0
- codex/static_root/{manifest.d2f93a519ada.json → manifest.55457ccaa01c.json} +32 -32
- codex/static_root/manifest.55457ccaa01c.json.br +0 -0
- codex/static_root/manifest.55457ccaa01c.json.gz +0 -0
- codex/static_root/manifest.json +32 -32
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/pwa/{offline.37a4206d79f0.html → offline.7bfaf9f94bf9.html} +1 -1
- codex/static_root/pwa/offline.7bfaf9f94bf9.html.br +0 -0
- codex/static_root/pwa/offline.7bfaf9f94bf9.html.gz +0 -0
- codex/static_root/pwa/offline.html +1 -1
- codex/static_root/pwa/offline.html.br +0 -0
- codex/static_root/pwa/offline.html.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/threads.py +1 -1
- codex/views/admin/api_key.py +3 -1
- codex/views/admin/flag.py +3 -1
- codex/views/admin/group.py +3 -1
- codex/views/admin/library.py +5 -4
- codex/views/admin/stats.py +10 -6
- codex/views/admin/tasks.py +35 -30
- codex/views/admin/user.py +4 -2
- codex/views/bookmark.py +6 -4
- codex/views/browser/base.py +30 -28
- codex/views/browser/browser.py +78 -80
- codex/views/browser/browser_annotations.py +15 -10
- codex/views/browser/browser_order_by.py +21 -16
- codex/views/browser/choices.py +37 -22
- codex/views/browser/filters/search.py +19 -16
- codex/views/browser/metadata.py +50 -41
- codex/views/cover.py +3 -1
- codex/views/download.py +4 -2
- codex/views/frontend.py +3 -2
- codex/views/mixins.py +13 -9
- codex/views/opds/authentication_v1.py +45 -41
- codex/views/opds/const.py +20 -13
- codex/views/opds/v1/entry/data.py +2 -1
- codex/views/opds/v1/facets.py +2 -1
- codex/views/opds/v1/feed.py +11 -4
- codex/views/opds/v1/links.py +8 -6
- codex/views/opds/v1/opensearch_v1.py +1 -1
- codex/views/opds/v2/feed.py +2 -1
- codex/views/opds/v2/publications.py +15 -12
- codex/views/reader/page.py +1 -1
- codex/views/session.py +50 -43
- codex/views/template.py +2 -2
- codex/websockets/listener.py +10 -7
- {codex-1.4.1.dist-info → codex-1.4.3.dist-info}/METADATA +24 -28
- {codex-1.4.1.dist-info → codex-1.4.3.dist-info}/RECORD +167 -167
- {codex-1.4.1.dist-info → codex-1.4.3.dist-info}/WHEEL +1 -1
- codex/static_root/assets/admin-12749881.ef0f50bac290.js +0 -41
- codex/static_root/assets/admin-12749881.ef0f50bac290.js.br +0 -0
- codex/static_root/assets/admin-12749881.ef0f50bac290.js.gz +0 -0
- codex/static_root/assets/admin-12749881.js +0 -41
- codex/static_root/assets/admin-12749881.js.br +0 -0
- codex/static_root/assets/admin-12749881.js.gz +0 -0
- codex/static_root/assets/admin-beda768d.a614eee46307.css +0 -1
- codex/static_root/assets/admin-beda768d.a614eee46307.css.br +0 -0
- codex/static_root/assets/admin-beda768d.a614eee46307.css.gz +0 -0
- codex/static_root/assets/admin-beda768d.css +0 -1
- codex/static_root/assets/admin-beda768d.css.br +0 -0
- codex/static_root/assets/admin-beda768d.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-522f1e6c.089d70878270.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-522f1e6c.089d70878270.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-522f1e6c.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-522f1e6c.js.gz +0 -0
- codex/static_root/assets/browser-7f7d7134.0fe3749b0f2f.css.br +0 -0
- codex/static_root/assets/browser-7f7d7134.0fe3749b0f2f.css.gz +0 -0
- codex/static_root/assets/browser-7f7d7134.css.br +0 -0
- codex/static_root/assets/browser-7f7d7134.css.gz +0 -0
- codex/static_root/assets/browser-af622672.d51aca96d64d.js +0 -1
- codex/static_root/assets/browser-af622672.d51aca96d64d.js.br +0 -0
- codex/static_root/assets/browser-af622672.d51aca96d64d.js.gz +0 -0
- codex/static_root/assets/browser-af622672.js +0 -1
- codex/static_root/assets/browser-af622672.js.br +0 -0
- codex/static_root/assets/browser-af622672.js.gz +0 -0
- codex/static_root/assets/http-error-5e17b794.77ceeb2d4641.js.br +0 -0
- codex/static_root/assets/http-error-5e17b794.77ceeb2d4641.js.gz +0 -0
- codex/static_root/assets/http-error-5e17b794.js.br +0 -0
- codex/static_root/assets/http-error-5e17b794.js.gz +0 -0
- codex/static_root/assets/main-0898f4bb.181e0145c642.css.br +0 -0
- codex/static_root/assets/main-0898f4bb.css.br +0 -0
- codex/static_root/assets/main-9e76a4c3.6844a407d14c.js +0 -1
- codex/static_root/assets/main-9e76a4c3.6844a407d14c.js.br +0 -0
- codex/static_root/assets/main-9e76a4c3.6844a407d14c.js.gz +0 -0
- codex/static_root/assets/main-9e76a4c3.js +0 -1
- codex/static_root/assets/main-9e76a4c3.js.br +0 -0
- codex/static_root/assets/main-9e76a4c3.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-62c29ce0.8418785c0453.js +0 -1
- codex/static_root/assets/metadata-dialog-62c29ce0.8418785c0453.js.br +0 -0
- codex/static_root/assets/metadata-dialog-62c29ce0.8418785c0453.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-62c29ce0.js +0 -1
- codex/static_root/assets/metadata-dialog-62c29ce0.js.br +0 -0
- codex/static_root/assets/metadata-dialog-62c29ce0.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-cb306ffd.cc304996d7bb.css +0 -1
- codex/static_root/assets/metadata-dialog-cb306ffd.cc304996d7bb.css.br +0 -0
- codex/static_root/assets/metadata-dialog-cb306ffd.cc304996d7bb.css.gz +0 -0
- codex/static_root/assets/metadata-dialog-cb306ffd.css +0 -1
- codex/static_root/assets/metadata-dialog-cb306ffd.css.br +0 -0
- codex/static_root/assets/metadata-dialog-cb306ffd.css.gz +0 -0
- codex/static_root/assets/page-pdf-157ba97e.613d7c2beb77.js.br +0 -0
- codex/static_root/assets/page-pdf-157ba97e.613d7c2beb77.js.gz +0 -0
- codex/static_root/assets/page-pdf-157ba97e.js.br +0 -0
- codex/static_root/assets/page-pdf-157ba97e.js.gz +0 -0
- codex/static_root/assets/reader-36266549.0b2cf1291f27.js +0 -1
- codex/static_root/assets/reader-36266549.0b2cf1291f27.js.br +0 -0
- codex/static_root/assets/reader-36266549.0b2cf1291f27.js.gz +0 -0
- codex/static_root/assets/reader-36266549.js +0 -1
- codex/static_root/assets/reader-36266549.js.br +0 -0
- codex/static_root/assets/reader-36266549.js.gz +0 -0
- codex/static_root/assets/reader-7f004141.506eecc6954b.css +0 -1
- codex/static_root/assets/reader-7f004141.506eecc6954b.css.br +0 -0
- codex/static_root/assets/reader-7f004141.506eecc6954b.css.gz +0 -0
- codex/static_root/assets/reader-7f004141.css +0 -1
- codex/static_root/assets/reader-7f004141.css.br +0 -0
- codex/static_root/assets/reader-7f004141.css.gz +0 -0
- codex/static_root/manifest.d2f93a519ada.json.br +0 -0
- codex/static_root/manifest.d2f93a519ada.json.gz +0 -0
- codex/static_root/pwa/offline.37a4206d79f0.html.br +0 -0
- codex/static_root/pwa/offline.37a4206d79f0.html.gz +0 -0
- {codex-1.4.1.dist-info → codex-1.4.3.dist-info}/LICENSE +0 -0
- {codex-1.4.1.dist-info → codex-1.4.3.dist-info}/entry_points.txt +0 -0
codex/views/session.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Manage user sessions with appropriate defaults."""
|
|
2
2
|
from abc import ABC, abstractmethod
|
|
3
3
|
from copy import deepcopy
|
|
4
|
+
from types import MappingProxyType
|
|
4
5
|
|
|
5
6
|
from drf_spectacular.utils import extend_schema
|
|
6
7
|
from rest_framework.generics import GenericAPIView
|
|
@@ -24,7 +25,7 @@ class SessionViewBaseBase(GenericAPIView, ABC):
|
|
|
24
25
|
"""Implement the session key string."""
|
|
25
26
|
raise NotImplementedError
|
|
26
27
|
|
|
27
|
-
SESSION_DEFAULTS = {}
|
|
28
|
+
SESSION_DEFAULTS = MappingProxyType({})
|
|
28
29
|
|
|
29
30
|
@classmethod
|
|
30
31
|
def _get_source_values_or_set_defaults(cls, defaults_dict, source_dict, data):
|
|
@@ -64,60 +65,66 @@ class BrowserSessionViewBase(SessionViewBaseBase):
|
|
|
64
65
|
SESSION_KEY = "browser" # type: ignore
|
|
65
66
|
CREATOR_PERSON_UI_FIELD = "creators"
|
|
66
67
|
STORY_ARC_UI_FIELD = "story_arcs"
|
|
67
|
-
_DYNAMIC_FILTER_DEFAULTS =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
_DYNAMIC_FILTER_DEFAULTS = MappingProxyType(
|
|
69
|
+
{
|
|
70
|
+
"age_rating": [],
|
|
71
|
+
"characters": [],
|
|
72
|
+
"country": [],
|
|
73
|
+
CREATOR_PERSON_UI_FIELD: [],
|
|
74
|
+
"community_rating": [],
|
|
75
|
+
"critical_rating": [],
|
|
76
|
+
"decade": [],
|
|
77
|
+
"file_type": [],
|
|
78
|
+
"genres": [],
|
|
79
|
+
"language": [],
|
|
80
|
+
"locations": [],
|
|
81
|
+
"original_format": [],
|
|
82
|
+
"q": "",
|
|
83
|
+
"read_ltr": [],
|
|
84
|
+
"series_groups": [],
|
|
85
|
+
STORY_ARC_UI_FIELD: [],
|
|
86
|
+
"tags": [],
|
|
87
|
+
"teams": [],
|
|
88
|
+
"year": [],
|
|
89
|
+
}
|
|
90
|
+
)
|
|
88
91
|
FILTER_ATTRIBUTES = frozenset(_DYNAMIC_FILTER_DEFAULTS.keys())
|
|
89
|
-
SESSION_DEFAULTS =
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
SESSION_DEFAULTS = MappingProxyType(
|
|
93
|
+
{
|
|
94
|
+
"filters": {
|
|
95
|
+
"bookmark": DEFAULTS["bookmarkFilter"],
|
|
96
|
+
**_DYNAMIC_FILTER_DEFAULTS,
|
|
97
|
+
},
|
|
98
|
+
"order_by": DEFAULTS["orderBy"],
|
|
99
|
+
"order_reverse": False,
|
|
100
|
+
"q": DEFAULTS["q"],
|
|
101
|
+
"route": DEFAULTS["route"],
|
|
102
|
+
"show": DEFAULTS["show"],
|
|
103
|
+
"twenty_four_hour_time": False,
|
|
104
|
+
"top_group": DEFAULTS["topGroup"],
|
|
105
|
+
}
|
|
106
|
+
)
|
|
102
107
|
|
|
103
108
|
|
|
104
109
|
class ReaderSessionViewBase(SessionViewBaseBase):
|
|
105
110
|
"""Reader session base."""
|
|
106
111
|
|
|
107
112
|
SESSION_KEY = "reader" # type: ignore
|
|
108
|
-
SESSION_DEFAULTS =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
SESSION_DEFAULTS = MappingProxyType(
|
|
114
|
+
{
|
|
115
|
+
"fit_to": DEFAULTS["fitTo"],
|
|
116
|
+
"two_pages": False,
|
|
117
|
+
"read_in_reverse": False,
|
|
118
|
+
"read_rtl_in_reverse": False,
|
|
119
|
+
"vertical": False,
|
|
120
|
+
}
|
|
121
|
+
)
|
|
115
122
|
|
|
116
123
|
|
|
117
124
|
class SessionViewBase(SessionViewBaseBase, ABC):
|
|
118
125
|
"""Session view for retrieving stored settings."""
|
|
119
126
|
|
|
120
|
-
permission_classes =
|
|
127
|
+
permission_classes = (IsAuthenticatedOrEnabledNonUsers,)
|
|
121
128
|
|
|
122
129
|
@property
|
|
123
130
|
@classmethod
|
codex/views/template.py
CHANGED
|
@@ -28,12 +28,12 @@ class SimpleAPIView(APIView):
|
|
|
28
28
|
class CodexTemplateView(SimpleAPIView):
|
|
29
29
|
"""HTML Template View."""
|
|
30
30
|
|
|
31
|
-
renderer_classes =
|
|
31
|
+
renderer_classes = (TemplateHTMLRenderer,)
|
|
32
32
|
content_type = "text/html"
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class CodexXMLTemplateView(SimpleAPIView):
|
|
36
36
|
"""XML Template View."""
|
|
37
37
|
|
|
38
|
-
renderer_classes =
|
|
38
|
+
renderer_classes = (TemplateXMLRenderer,)
|
|
39
39
|
content_type = "application/xml"
|
codex/websockets/listener.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Listens to the Broadcast Queue and sends its messages to channels."""
|
|
2
2
|
from queue import Empty
|
|
3
|
+
from types import MappingProxyType
|
|
3
4
|
|
|
4
5
|
from channels.exceptions import InvalidChannelLayerError
|
|
5
6
|
from channels.layers import get_channel_layer
|
|
@@ -12,13 +13,15 @@ from codex.websockets.consumers import ChannelGroups
|
|
|
12
13
|
class BroadcastListener(LoggerBaseMixin):
|
|
13
14
|
"""Listens to the Broadcast Queue and sends its messages to channels."""
|
|
14
15
|
|
|
15
|
-
_WS_DISCONNECT_EVENT =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
_WS_DISCONNECT_EVENT = MappingProxyType(
|
|
17
|
+
{
|
|
18
|
+
"group": ChannelGroups.ALL.name,
|
|
19
|
+
"message": {
|
|
20
|
+
"type": "websocket_disconnect",
|
|
21
|
+
"code": CloseReason.NORMAL_CLOSURE.value,
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
22
25
|
|
|
23
26
|
def __init__(self, queue, log_queue):
|
|
24
27
|
"""Initialize."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: codex
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: A comic archive web server.
|
|
5
5
|
Home-page: https://github.com/ajslater/codex
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -23,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
24
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
25
|
Classifier: Topic :: Multimedia :: Graphics :: Viewers
|
|
26
|
-
Requires-Dist: Pillow (>=
|
|
26
|
+
Requires-Dist: Pillow (>=10.0.0,<11.0.0)
|
|
27
27
|
Requires-Dist: aioprocessing (>=2.0.1,<3.0.0)
|
|
28
28
|
Requires-Dist: ansicolors (>=1.1,<2.0)
|
|
29
29
|
Requires-Dist: case-converter (>=1.1.0,<2.0.0)
|
|
@@ -33,7 +33,7 @@ Requires-Dist: django (>=4.2,<5.0)
|
|
|
33
33
|
Requires-Dist: django-cors-headers (>=4.0,<5.0)
|
|
34
34
|
Requires-Dist: django-haystack (>=3.2.1,<4.0.0)
|
|
35
35
|
Requires-Dist: django-rest-registration (>=0.8.0,<0.9.0)
|
|
36
|
-
Requires-Dist: django-vite (
|
|
36
|
+
Requires-Dist: django-vite (>=2.1.3,<3.0.0)
|
|
37
37
|
Requires-Dist: djangorestframework (>=3.11,<4.0)
|
|
38
38
|
Requires-Dist: djangorestframework-camel-case (>=1.3.0,<2.0.0)
|
|
39
39
|
Requires-Dist: drf-spectacular (>=0.26.0,<0.27.0)
|
|
@@ -234,7 +234,7 @@ CODEX_RESET_ADMIN=1 codex
|
|
|
234
234
|
or, if using Docker:
|
|
235
235
|
|
|
236
236
|
```sh
|
|
237
|
-
docker run -e CODEX_RESET_ADMIN=1 -v
|
|
237
|
+
docker run -e CODEX_RESET_ADMIN=1 -v host-parent-dir/config:/config ajslater/codex
|
|
238
238
|
```
|
|
239
239
|
|
|
240
240
|
### Private Libraries
|
|
@@ -307,29 +307,25 @@ index, a Django cache and comic book cover thumbnails.
|
|
|
307
307
|
Here's an example nginx config with a subpath named '/codex'.
|
|
308
308
|
|
|
309
309
|
```nginx
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
# If the nginx credentials are different than codex credentials use this line to
|
|
330
|
-
# not forward the authorization.
|
|
331
|
-
proxy_set_header Authorization "";
|
|
332
|
-
}
|
|
310
|
+
# HTTP
|
|
311
|
+
proxy_set_header Host $http_host;
|
|
312
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
313
|
+
proxy_set_header X-Forwarded-Host $server_name;
|
|
314
|
+
proxy_set_header X-Forwarded-Port $server_port;
|
|
315
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
316
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
317
|
+
proxy_set_header X-Scheme $scheme;
|
|
318
|
+
# Websockets
|
|
319
|
+
proxy_http_version 1.1;
|
|
320
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
321
|
+
|
|
322
|
+
proxy_set_header Connection "Upgrade" location /codex {
|
|
323
|
+
proxy_pass http://codex:9810;
|
|
324
|
+
# Codex reads http basic authentication.
|
|
325
|
+
# If the nginx credentials are different than codex credentials use this line to
|
|
326
|
+
# not forward the authorization.
|
|
327
|
+
proxy_set_header Authorization "";
|
|
328
|
+
}
|
|
333
329
|
```
|
|
334
330
|
|
|
335
331
|
Specify a reverse proxy sub path (if you have one) in `config/hypercorn.toml`
|
|
@@ -445,7 +441,7 @@ database. Place a file named `rebuild_db` in your Codex config directory like
|
|
|
445
441
|
so:
|
|
446
442
|
|
|
447
443
|
```sh
|
|
448
|
-
|
|
444
|
+
touch config/rebuild_db
|
|
449
445
|
```
|
|
450
446
|
|
|
451
447
|
Shut down and restart Codex.
|