5 Commits

Author SHA1 Message Date
0adfba1275 fixes
Some checks failed
Build and push image / deploy (push) Has been cancelled
2025-04-02 13:29:32 +01:00
708df71220 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	.pre-commit-config.yaml
#	Dockerfile
#	frontend/package-lock.json
#	frontend/package.json
#	poetry.lock
#	pyproject.toml
2025-04-02 11:35:56 +01:00
871f930727 update libs 2025-04-02 11:32:47 +01:00
3ae5b6b23b updating deps
Some checks failed
Build and push image / deploy (push) Has been cancelled
2024-04-15 16:23:56 +01:00
50d46ab835 updating deps
All checks were successful
Build and push image / deploy (push) Has been cancelled
2023-10-13 10:17:44 +01:00
19 changed files with 11952 additions and 4230 deletions

View File

@@ -14,5 +14,6 @@
!package-lock.json
!package.json
!frontend
!uv.lock
/frontend/node_modules
/frontend/dist

View File

@@ -8,12 +8,6 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/python-poetry/poetry
rev: '1.6.1' # add version here
hooks:
- id: poetry-check
- id: poetry-export
args: ["--without-hashes", "-o", "requirements.txt"]
- repo: https://github.com/pycqa/flake8
rev: "5.0.4"
hooks:

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.13

View File

@@ -1,4 +1,5 @@
FROM python:3.10-slim-bullseye
FROM python:3.13-slim-bullseye
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
@@ -13,19 +14,24 @@ RUN mkdir /static
WORKDIR /src
COPY . /src/
COPY pyproject.toml /src
COPY uv.lock /src
RUN echo "deb http://ftp.uk.debian.org/debian bullseye non-free non-free-firmware" > /etc/apt/sources.list.d/non-free.list
RUN apt update \
&& apt install -y software-properties-common \
&& apt-add-repository non-free \
&& apt update \
&& apt install -y npm cron unrar libmariadb-dev libpq-dev pkg-config \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& uv sync --frozen \
&& cd frontend \
&& npm install \
&& npm run build \
&& apt remove -y npm software-properties-common pkg-config \
&& apt remove -y npm software-properties-common pkg-config swig \
&& rm -r node_modules \
&& apt -y auto-remove \
&& apt clean \

View File

@@ -1,4 +1,3 @@
poetry export --without-hashes -f requirements.txt --output requirements.txt
$version=poetry version -s
docker build . --no-cache -t ajurna/cbwebreader -t ajurna/cbwebreader:$version
$version=uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version
docker build . -t ajurna/cbwebreader -t ajurna/cbwebreader:$version
docker push ajurna/cbwebreader --all-tags

View File

@@ -191,10 +191,13 @@ BOOTSTRAP4 = {
},
}
CSP_DEFAULT_SRC = ("'none'",)
CSP_STYLE_SRC = ("'self'", "'sha256-MBVp6JYxbC/wICelYC6eULCRpgi9kGezXXSaq/TS2+I='")
CSP_STYLE_SRC = (
"'self'",
"'unsafe-inline'"
)
CSP_IMG_SRC = ("'self'", "data:")
CSP_FONT_SRC = ("'self'",)
CSP_SCRIPT_SRC = ("'self'",)
CSP_SCRIPT_SRC = ("'self'", "'sha256-IYBrMxCTJ62EwagLTIRncEIpWwTmoXcXkqv3KZm/Wik='")
CSP_CONNECT_SRC = ("'self'",)
CSP_INCLUDE_NONCE_IN = ['script-src']
CSP_SCRIPT_SRC_ATTR = ("'self'",) # "'unsafe-inline'")

View File

@@ -22,7 +22,8 @@ from django.views.generic import TemplateView
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from rest_framework_extensions.routers import ExtendedDefaultRouter
from rest_framework.routers import DefaultRouter
# from rest_framework_extensions.routers import ExtendedDefaultRouter
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from comic import rest, feeds
@@ -39,12 +40,12 @@ schema_view = get_schema_view(
permission_classes=[permissions.AllowAny]
)
router = ExtendedDefaultRouter()
router = DefaultRouter()
router.register(r'users', rest.UserViewSet)
router.register(r'browse', rest.BrowseViewSet, basename='browse')
router.register(r'generate_thumbnail', rest.GenerateThumbnailViewSet, basename='generate_thumbnail')
router.register(r'read', rest.ReadViewSet, basename='read')\
.register(r'image', rest.ImageViewSet, basename='image', parents_query_lookups=['selector'])
router.register(r'read', rest.ReadViewSet, basename='read')
router.register(r'read/(?P<selector>[^/.]+)/image', rest.ImageViewSet, basename='image')
router.register(r'recent', rest.RecentComicsView, basename="recent")
router.register(r'history', rest.HistoryViewSet, basename='history')
router.register(r'action', rest.ActionViewSet, basename='action')

View File

@@ -7,8 +7,7 @@ import uuid
import django.db.models.deletion
from django.db import migrations, models
from django.utils.timezone import utc
utc = datetime.timezone.utc
class Migration(migrations.Migration):

View File

@@ -116,7 +116,7 @@ class BrowseViewSet(viewsets.GenericViewSet):
permission_classes = [permissions.IsAuthenticated]
lookup_field = 'selector'
def get_queryset(self):
def get_queryset(self) -> None:
return
def list(self, request: Request) -> Response:
@@ -302,8 +302,8 @@ class ImageViewSet(viewsets.ViewSet):
renderer_classes = [PassthroughRenderer]
@swagger_auto_schema(responses={status.HTTP_200_OK: "A Binary Image response"})
def retrieve(self, _request: Request, parent_lookup_selector: UUID, page: int) -> FileResponse:
book = models.ComicBook.objects.get(selector=parent_lookup_selector)
def retrieve(self, _request: Request, selector: UUID, page: int) -> FileResponse:
book = models.ComicBook.objects.get(selector=selector)
img, content = book.get_image(int(page) - 1)
self.renderer_classes[0].media_type = content
return FileResponse(img, content_type=content)

View File

@@ -13,7 +13,7 @@ services:
expose:
- 8000
volumes:
- ${COMIC_BOOK_VOLUME}:${COMIC_BOOK_VOLUME}
- ${COMIC_BOOK_VOLUME}:/comics
# - c:/comics:/comics
- static_files:/static
- media_files:/media
@@ -35,7 +35,7 @@ services:
# command: /bin/bash entrypoint-cron.sh
database:
image: postgres:14-alpine
image: postgres:16-alpine
expose:
- 5432
volumes:

View File

@@ -1,5 +1,6 @@
python manage.py migrate --settings=cbreader.settings.base
#!/usr/bin/env sh
uv run manage.py migrate --settings=cbreader.settings.base
python manage.py collectstatic --settings=cbreader.settings.base --noinput --clear
uv run manage.py collectstatic --settings=cbreader.settings.base --noinput --clear
gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application
uv run gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application

12862
frontend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.1.1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "webpack-dev-server --config webpack.dev.js",
@@ -11,19 +11,19 @@
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/vue-fontawesome": "^3.0.1",
"axios": "^0.27.2",
"axios": "1.8.2",
"bootstrap": "^5.2.0",
"hammerjs": "^2.0.8",
"jwt-decode": "^3.1.2",
"pdfvuer": "^2.0.1",
"reveal.js": "^4.3.1",
"timeago.js": "^4.0.2",
"vue": "^3.2.26",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vue-toast-notification": "3.0",
"vuejs-paginate-next": "^1.0.2",
"vuex": "^4.0.0",
"webpack": "^5.76.0"
"webpack": "5.94.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
@@ -37,12 +37,12 @@
"eslint-plugin-vue": "^8.0.3",
"jshint": "^2.13.5",
"mini-css-extract-plugin": "^2.6.1",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.6",
"vue-loader": "^17.0.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-bundle-tracker": "^1.6.0",
"webpack-cli": "^4.10.0"
"style-loader": "^3.3.1",
"vue-loader": "^17.0.0"
},
"eslintConfig": {
"root": true,

View File

@@ -16,7 +16,6 @@ import UserEdit from "@/components/UserEdit";
import alertMessages from "@/components/AlertMessages";
import AddUser from "@/components/AddUser";
import router from "@/router";
import store from "@/store";
const default_crumbs = [
{id: 0, selector: '', name: 'Home'},

View File

@@ -2,7 +2,6 @@ const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
const BundleTracker = require('webpack-bundle-tracker');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpack = require('webpack')

1897
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +1,46 @@
[tool.black]
line_length = 119
[tool.poetry]
[project]
name = "cbwebreader"
version = "1.1.6"
version = "1.1.2"
description = "CBR/Z Web Reader"
authors = ["ajurna <ajurna@gmail.com>"]
license = "Creative Commons Attribution-ShareAlike 4.0 International License"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"dj-database-url>=2.3.0",
"django>=5.1.7",
"django-boost>=2.1",
"django-bootstrap4>=25.1",
"django-cors-headers>=4.7.0",
"django-csp>=3.8",
"django-extensions>=3.2.3",
"django-filter>=25.1",
"django-imagekit>=5.0.0",
"django-permissions-policy>=4.25.0",
"django-silk>=5.3.2",
"django-sri>=0.8.0",
"django-webpack-loader>=3.1.1",
"djangorestframework>=3.16.0",
"djangorestframework-simplejwt>=5.5.0",
"drf-yasg>=1.21.10",
"flake8>=7.2.0",
"flake8-annotations>=3.1.1",
"gunicorn>=23.0.0",
"loguru>=0.7.3",
"mysqlclient>=2.2.7",
"pillow>=11.1.0",
"psycopg2>=2.9.10",
"pymupdf>=1.25.5",
"python-dotenv>=1.1.0",
"rarfile>=4.2",
]
[tool.poetry.dependencies]
python = "^3.10"
Django = "^4.1"
gunicorn = "^20.0.4"
dj-database-url = "^1.3.0"
python-dotenv = "^1.0.0"
loguru = "^0.7.0"
django-silk = "^5.0.0"
mysqlclient = "^2.0.1"
psycopg2 = "^2.9.6"
rarfile = "^4.0"
django-extensions = "^3.2.1"
Pillow = "^9.3.0"
django-imagekit = "^4.0.2"
PyMuPDF = "~1.20.2"
django-bootstrap4 = "^23.1"
django-csp = "^3.7"
django-boost = "^2.1"
django-sri = "^0.5.0"
django-permissions-policy = "^4.15.0"
djangorestframework = "^3.13.1"
django-filter = "^23.1"
django-cors-headers = "^3.14.0"
djangorestframework-simplejwt = "^5.2.0"
django-webpack-loader = "^1.6.0"
drf-yasg = "^1.20.0"
drf-extensions = "^0.7.1"
[tool.poetry.dev-dependencies]
mypy = "^1.2.0"
Werkzeug = "^2.2"
pyOpenSSL = "^22.0.0"
ipython = "^8.12.0"
coverage = "^7.2.3"
pre-commit = "^3.2.2"
flake8 = "^6.0.0"
flake8-annotations = "^3.0.0"
[tool.poetry.group.dev.dependencies]
pylint = "^2.15.0"
pylint-django = "^2.5.3"
mypy = "^1.2.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[dependency-groups]
dev = [
"coverage>=7.8.0",
"ipython>=9.0.2",
"mypy>=1.15.0",
"pre-commit>=4.2.0",
"pylint>=3.3.6",
"pylint-django>=2.6.1",
"pyopenssl>=25.0.0",
"werkzeug>=3.1.3",
]

View File

@@ -1,49 +0,0 @@
asgiref==3.7.2 ; python_version >= "3.10" and python_version < "4.0"
autopep8==2.0.4 ; python_version >= "3.10" and python_version < "4.0"
beautifulsoup4==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
dj-database-url==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
django-appconf==1.0.5 ; python_version >= "3.10" and python_version < "4.0"
django-boost==2.1 ; python_version >= "3.10" and python_version < "4.0"
django-bootstrap4==23.2 ; python_version >= "3.10" and python_version < "4.0"
django-cors-headers==3.14.0 ; python_version >= "3.10" and python_version < "4.0"
django-csp==3.7 ; python_version >= "3.10" and python_version < "4.0"
django-extensions==3.2.3 ; python_version >= "3.10" and python_version < "4.0"
django-filter==23.2 ; python_version >= "3.10" and python_version < "4.0"
django-imagekit==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
django-permissions-policy==4.17.0 ; python_version >= "3.10" and python_version < "4.0"
django-silk==5.0.3 ; python_version >= "3.10" and python_version < "4.0"
django-sri==0.5.0 ; python_version >= "3.10" and python_version < "4.0"
django-webpack-loader==1.8.1 ; python_version >= "3.10" and python_version < "4.0"
django==4.2.4 ; python_version >= "3.10" and python_version < "4.0"
djangorestframework-simplejwt==5.3.0 ; python_version >= "3.10" and python_version < "4.0"
djangorestframework==3.14.0 ; python_version >= "3.10" and python_version < "4.0"
drf-extensions==0.7.1 ; python_version >= "3.10" and python_version < "4.0"
drf-yasg==1.21.7 ; python_version >= "3.10" and python_version < "4.0"
gprof2dot==2022.7.29 ; python_version >= "3.10" and python_version < "4.0"
gunicorn==20.1.0 ; python_version >= "3.10" and python_version < "4.0"
inflection==0.5.1 ; python_version >= "3.10" and python_version < "4.0"
loguru==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
mysqlclient==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==23.1 ; python_version >= "3.10" and python_version < "4.0"
pilkit==2.0 ; python_version >= "3.10" and python_version < "4.0"
pillow==9.5.0 ; python_version >= "3.10" and python_version < "4.0"
psycopg2==2.9.7 ; python_version >= "3.10" and python_version < "4.0"
pycodestyle==2.11.0 ; python_version >= "3.10" and python_version < "4.0"
pyjwt==2.8.0 ; python_version >= "3.10" and python_version < "4.0"
pymupdf==1.20.2 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
pytz==2023.3 ; python_version >= "3.10" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.10" and python_version < "4.0"
rarfile==4.0 ; python_version >= "3.10" and python_version < "4.0"
setuptools==68.1.2 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.4.1 ; python_version >= "3.10" and python_version < "4.0"
sqlparse==0.4.4 ; python_version >= "3.10" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.10" and python_version < "3.11"
typing-extensions==4.7.1 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
ua-parser==0.18.0 ; python_version >= "3.10" and python_version < "4.0"
uritemplate==4.1.1 ; python_version >= "3.10" and python_version < "4.0"
user-agents==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"

1193
uv.lock generated Normal file

File diff suppressed because it is too large Load Diff