mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Compare commits
1 Commits
b01eb60eeb
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50fee9ed9f |
@@ -14,6 +14,5 @@
|
||||
!package-lock.json
|
||||
!package.json
|
||||
!frontend
|
||||
!uv.lock
|
||||
/frontend/node_modules
|
||||
/frontend/dist
|
||||
/frontend/dist
|
||||
@@ -8,6 +8,12 @@ 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 +0,0 @@
|
||||
3.13
|
||||
17
Dockerfile
17
Dockerfile
@@ -1,5 +1,4 @@
|
||||
FROM python:3.13-slim-bookworm
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
FROM python:3.12-slim-bookworm
|
||||
|
||||
ENV PYTHONFAULTHANDLER=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
@@ -14,20 +13,12 @@ RUN mkdir /static
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
|
||||
COPY . /src/
|
||||
COPY pyproject.toml /src
|
||||
COPY uv.lock /src
|
||||
|
||||
RUN echo "deb http://ftp.uk.debian.org/debian bookworm 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 \
|
||||
&& uv sync --frozen \
|
||||
&& apt install -y npm cron unrar-free libmariadb-dev libpq-dev pkg-config swig \
|
||||
&& pip install --upgrade pip \
|
||||
&& pip install -r requirements.txt \
|
||||
&& cd frontend \
|
||||
&& npm install \
|
||||
&& npm run build \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
$version=uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version
|
||||
poetry export --without-hashes -f requirements.txt --output requirements.txt
|
||||
$version=poetry version -s
|
||||
docker build . -t ajurna/cbwebreader -t ajurna/cbwebreader:$version
|
||||
docker push ajurna/cbwebreader --all-tags
|
||||
|
||||
@@ -22,8 +22,7 @@ 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.routers import DefaultRouter
|
||||
# from rest_framework_extensions.routers import ExtendedDefaultRouter
|
||||
from rest_framework_extensions.routers import ExtendedDefaultRouter
|
||||
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
||||
|
||||
from comic import rest, feeds
|
||||
@@ -40,12 +39,12 @@ schema_view = get_schema_view(
|
||||
permission_classes=[permissions.AllowAny]
|
||||
)
|
||||
|
||||
router = DefaultRouter()
|
||||
router = ExtendedDefaultRouter()
|
||||
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')
|
||||
router.register(r'read/(?P<selector>[^/.]+)/image', rest.ImageViewSet, basename='image')
|
||||
router.register(r'read', rest.ReadViewSet, basename='read')\
|
||||
.register(r'image', rest.ImageViewSet, basename='image', parents_query_lookups=['selector'])
|
||||
router.register(r'recent', rest.RecentComicsView, basename="recent")
|
||||
router.register(r'history', rest.HistoryViewSet, basename='history')
|
||||
router.register(r'action', rest.ActionViewSet, basename='action')
|
||||
|
||||
@@ -7,7 +7,8 @@ import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
utc = datetime.timezone.utc
|
||||
from django.utils.timezone import utc
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class BrowseViewSet(viewsets.GenericViewSet):
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
lookup_field = 'selector'
|
||||
|
||||
def get_queryset(self) -> None:
|
||||
def get_queryset(self):
|
||||
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, selector: UUID, page: int) -> FileResponse:
|
||||
book = models.ComicBook.objects.get(selector=selector)
|
||||
def retrieve(self, _request: Request, parent_lookup_selector: UUID, page: int) -> FileResponse:
|
||||
book = models.ComicBook.objects.get(selector=parent_lookup_selector)
|
||||
img, content = book.get_image(int(page) - 1)
|
||||
self.renderer_classes[0].media_type = content
|
||||
return FileResponse(img, content_type=content)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
uv run manage.py migrate --settings=cbreader.settings.base
|
||||
python manage.py migrate --settings=cbreader.settings.base
|
||||
|
||||
uv run manage.py collectstatic --settings=cbreader.settings.base --noinput --clear
|
||||
python manage.py collectstatic --settings=cbreader.settings.base --noinput --clear
|
||||
|
||||
uv run gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application
|
||||
gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application
|
||||
7795
frontend/package-lock.json
generated
7795
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "webpack-dev-server --config webpack.dev.js",
|
||||
@@ -11,38 +11,38 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^6.1.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.1.2",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.1",
|
||||
"axios": "^1.8.4",
|
||||
"axios": "^1.6.0",
|
||||
"bootstrap": "^5.2.0",
|
||||
"hammerjs": "^2.0.8",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"pdfvuer": "^2.0.1",
|
||||
"reveal.js": "^5.2.1",
|
||||
"reveal.js": "^4.3.1",
|
||||
"timeago.js": "^4.0.2",
|
||||
"vue": "^3.5.13",
|
||||
"vue": "^3.2.26",
|
||||
"vue-router": "^4.0.3",
|
||||
"vue-toast-notification": "3.0",
|
||||
"vuejs-paginate-next": "^1.0.2",
|
||||
"vuex": "^4.0.0",
|
||||
"webpack": "^5.98.0"
|
||||
"webpack": "^5.76.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.26.10",
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "^5.0.8",
|
||||
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||
"@vue/cli-plugin-router": "^5.0.0",
|
||||
"@vue/cli-plugin-vuex": "^5.0.0",
|
||||
"@vue/cli-service": "^5.0.8",
|
||||
"eslint": "^9.23.0",
|
||||
"eslint-plugin-vue": "^10.0.0",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"jshint": "^2.13.5",
|
||||
"mini-css-extract-plugin": "^2.9.2",
|
||||
"style-loader": "^4.0.0",
|
||||
"terser-webpack-plugin": "^5.3.14",
|
||||
"vue-loader": "^17.4.2",
|
||||
"webpack-bundle-analyzer": "^4.10.2",
|
||||
"webpack-bundle-tracker": "^3.1.1",
|
||||
"webpack-cli": "^6.0.1"
|
||||
"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-bundle-tracker": "^1.6.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import router from "@/router";
|
||||
import store from "@/store";
|
||||
import { jwtDecode } from "jwt-decode";
|
||||
import jwtDecode from "jwt-decode";
|
||||
|
||||
async function get_access_token() {
|
||||
let access = jwtDecode(store.state.jwt.access)
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h2>Reading History</h2>
|
||||
<caption>
|
||||
<h2>Reading History</h2>
|
||||
</caption>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table table-striped table-bordered">
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<caption>
|
||||
<h2>Recent Comics - <a :href="'/feed/' + this.feed_id + '/'">Feed</a></h2>
|
||||
Mark selected issues as:
|
||||
<select class="form-select-sm" name="func" id="func_selector" @change="this.performFunction()" v-model="func_selected">
|
||||
@@ -30,6 +31,7 @@
|
||||
<option value="mark_read">Read</option>
|
||||
<option value="mark_unread">Un-Read</option>
|
||||
</select>
|
||||
</caption>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table table-striped table-bordered">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createStore } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { jwtDecode } from "jwt-decode";
|
||||
import jwtDecode from 'jwt-decode'
|
||||
import {useToast} from "vue-toast-notification";
|
||||
import router from "@/router";
|
||||
import api from "@/api";
|
||||
|
||||
@@ -16,6 +16,7 @@ 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'},
|
||||
|
||||
@@ -45,8 +45,7 @@ module.exports = () => {
|
||||
plugins: [
|
||||
new VueLoaderPlugin(),
|
||||
new BundleTracker({
|
||||
filename: 'webpack-stats.json',
|
||||
path: path.resolve(__dirname, './'),
|
||||
filename: './webpack-stats.json',
|
||||
publicPath: 'http://localhost:8080/'
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
@@ -61,4 +60,4 @@ module.exports = () => {
|
||||
hot: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ 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')
|
||||
|
||||
@@ -46,8 +47,7 @@ module.exports = (env = {}) => {
|
||||
plugins: [
|
||||
new VueLoaderPlugin(),
|
||||
new BundleTracker({
|
||||
filename: 'webpack-stats.json',
|
||||
path: path.resolve(__dirname, './'),
|
||||
filename: './webpack-stats.json',
|
||||
publicPath: '/static/bundles/',
|
||||
integrity: true
|
||||
}),
|
||||
|
||||
1931
poetry.lock
generated
Normal file
1931
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
100
pyproject.toml
100
pyproject.toml
@@ -1,46 +1,56 @@
|
||||
[project]
|
||||
name = "cbwebreader"
|
||||
version = "1.1.3"
|
||||
description = "CBR/Z Web Reader"
|
||||
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.black]
|
||||
line_length = 119
|
||||
|
||||
[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",
|
||||
]
|
||||
[tool.poetry]
|
||||
name = "cbwebreader"
|
||||
version = "1.1.7"
|
||||
description = "CBR/Z Web Reader"
|
||||
authors = ["ajurna <ajurna@gmail.com>"]
|
||||
license = "Creative Commons Attribution-ShareAlike 4.0 International License"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.12"
|
||||
Django = "^4.1"
|
||||
gunicorn = "^21.2.0"
|
||||
dj-database-url = "^2.1.0"
|
||||
python-dotenv = "^1.0.0"
|
||||
loguru = "^0.7.0"
|
||||
django-silk = "^5.0.0"
|
||||
mysqlclient = "^2.0.1"
|
||||
psycopg2-binary = "^2.9.6"
|
||||
rarfile = "^4.0"
|
||||
django-extensions = "^3.2.1"
|
||||
Pillow = "^10.0.1"
|
||||
django-imagekit = "^5.0.0"
|
||||
PyMuPDF = "~1.20.2"
|
||||
django-bootstrap4 = "^23.1"
|
||||
django-csp = "^3.7"
|
||||
django-boost = "^2.1"
|
||||
django-sri = "^0.7.0"
|
||||
django-permissions-policy = "^4.15.0"
|
||||
djangorestframework = "^3.13.1"
|
||||
django-filter = "^23.1"
|
||||
django-cors-headers = "^4.2.0"
|
||||
djangorestframework-simplejwt = "^5.2.0"
|
||||
django-webpack-loader = "^2.0.1"
|
||||
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"
|
||||
|
||||
46
requirements.txt
Normal file
46
requirements.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
asgiref==3.7.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
autopep8==2.0.4 ; python_version >= "3.12" and python_version < "4.0"
|
||||
beautifulsoup4==4.12.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
colorama==0.4.6 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32"
|
||||
dj-database-url==2.1.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-appconf==1.0.5 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-boost==2.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-bootstrap4==23.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-cors-headers==4.2.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-csp==3.7 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-extensions==3.2.3 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-filter==23.3 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-imagekit==5.0.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-permissions-policy==4.17.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-silk==5.0.4 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-sri==0.7.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django-webpack-loader==2.0.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
django==4.2.5 ; python_version >= "3.12" and python_version < "4.0"
|
||||
djangorestframework-simplejwt==5.3.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
djangorestframework==3.14.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
drf-extensions==0.7.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
drf-yasg==1.21.7 ; python_version >= "3.12" and python_version < "4.0"
|
||||
gprof2dot==2022.7.29 ; python_version >= "3.12" and python_version < "4.0"
|
||||
gunicorn==21.2.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
inflection==0.5.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
loguru==0.7.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
mysqlclient==2.2.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
packaging==23.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pilkit==3.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pillow==10.0.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
psycopg2-binary==2.9.9 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pycodestyle==2.11.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pyjwt==2.8.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pymupdf==1.20.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
python-dotenv==1.0.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pytz==2023.3.post1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pyyaml==6.0.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
rarfile==4.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
soupsieve==2.5 ; python_version >= "3.12" and python_version < "4.0"
|
||||
sqlparse==0.4.4 ; python_version >= "3.12" and python_version < "4.0"
|
||||
typing-extensions==4.8.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
tzdata==2023.3 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32"
|
||||
ua-parser==0.18.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
uritemplate==4.1.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
user-agents==2.2.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
win32-setctime==1.1.0 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32"
|
||||
Reference in New Issue
Block a user