0.1.6B bugfix
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Remote;
|
||||
|
||||
use DOMDocument;
|
||||
use Dom\HTMLDocument;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
@@ -16,7 +16,7 @@ class CopyManga
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array Caching options
|
||||
* @var array{caching: bool, cachingTimeout: int} Caching options
|
||||
* @deprecated
|
||||
*/
|
||||
protected array $options = [
|
||||
@@ -36,8 +36,10 @@ class CopyManga
|
||||
|
||||
/**
|
||||
* @var string Encryption for legacy image fetch
|
||||
*
|
||||
* Since 17/Jun/2025, the key is updated dynamically, added function to fetch the key now
|
||||
*/
|
||||
protected string $encryptionKey = "xxxmanga.woo.key";
|
||||
protected string $encryptionKey = "";
|
||||
|
||||
/**
|
||||
* @var bool Use old method to fetch images list
|
||||
@@ -326,13 +328,23 @@ class CopyManga
|
||||
$responses = $this->execute($this->legacyBuildUrl("comic/{$comic}/chapter/{$chapter}"), "GET", $userAgent, ttl: 24 * 60 * 60 * 30);
|
||||
|
||||
// Get Content Key
|
||||
$dom = new DOMDocument();
|
||||
$dom->loadHTML($responses);
|
||||
$dataNode = $dom->getElementsByTagName("div");
|
||||
$dom = HTMLDocument::createFromString($responses, LIBXML_NOERROR);
|
||||
|
||||
$scriptNodes = $dom->getElementsByTagName('script');
|
||||
|
||||
foreach ($scriptNodes as $node) {
|
||||
if (strpos($node->textContent, 'var jojo') !== false) {
|
||||
if (preg_match("/var\s+jojo\s*=\s*'([^']+)'/", trim($node->textContent), $matches)) {
|
||||
$this->encryptionKey = $matches[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dataNodes = $dom->getElementsByTagName("div");
|
||||
|
||||
$encryptedData = "";
|
||||
|
||||
foreach ($dataNode as $node) {
|
||||
foreach ($dataNodes as $node) {
|
||||
if ($node->getAttribute("class") === 'imageData') {
|
||||
$encryptedData = $node->attributes->item(1)->value;
|
||||
break;
|
||||
|
||||
@@ -6,6 +6,7 @@ use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
|
||||
use Illuminate\Http\Middleware\TrustProxies;
|
||||
use Sentry\Laravel\Integration;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
@@ -19,9 +20,10 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
$middleware->web(append: [
|
||||
HandleInertiaRequests::class,
|
||||
AddLinkHeadersForPreloadedAssets::class,
|
||||
TrustProxies::class,
|
||||
]);
|
||||
$middleware->statefulApi();
|
||||
//
|
||||
$middleware->trustProxies(at: '*');
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
$exceptions->render(function (ServerException $e, Request $request) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.3",
|
||||
"php": "^8.4",
|
||||
"ext-dom": "*",
|
||||
"ext-openssl": "*",
|
||||
"inertiajs/inertia-laravel": "^2.0",
|
||||
@@ -17,7 +17,8 @@
|
||||
"plesk/ext-laravel-integration": "^7.0",
|
||||
"predis/predis": "^2.0",
|
||||
"sentry/sentry-laravel": "^4.10",
|
||||
"tightenco/ziggy": "^2.0"
|
||||
"tightenco/ziggy": "^2.0",
|
||||
"ext-libxml": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
|
||||
453
composer.lock
generated
453
composer.lock
generated
File diff suppressed because it is too large
Load Diff
178
nixpacks.toml
Normal file
178
nixpacks.toml
Normal file
@@ -0,0 +1,178 @@
|
||||
[phases.setup]
|
||||
nixPkgs = ["...", "python311Packages.supervisor"]
|
||||
|
||||
[phases.build]
|
||||
cmds = [
|
||||
"mkdir -p /etc/supervisor/conf.d/",
|
||||
"cp /assets/worker-*.conf /etc/supervisor/conf.d/",
|
||||
"cp /assets/supervisord.conf /etc/supervisord.conf",
|
||||
"chmod +x /assets/start.sh",
|
||||
"..."
|
||||
]
|
||||
|
||||
[start]
|
||||
cmd = '/assets/start.sh'
|
||||
|
||||
[staticAssets]
|
||||
"start.sh" = '''
|
||||
#!/bin/bash
|
||||
|
||||
# Transform the nginx configuration
|
||||
node /assets/scripts/prestart.mjs /assets/nginx.template.conf /etc/nginx.conf
|
||||
|
||||
# Start supervisor
|
||||
supervisord -c /etc/supervisord.conf -n
|
||||
'''
|
||||
|
||||
"supervisord.conf" = '''
|
||||
[unix_http_server]
|
||||
file=/assets/supervisor.sock
|
||||
|
||||
[supervisord]
|
||||
logfile=/var/log/supervisord.log
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=info
|
||||
pidfile=/assets/supervisord.pid
|
||||
nodaemon=false
|
||||
silent=false
|
||||
minfds=1024
|
||||
minprocs=200
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///assets/supervisor.sock
|
||||
|
||||
[include]
|
||||
files = /etc/supervisor/conf.d/*.conf
|
||||
'''
|
||||
|
||||
"worker-nginx.conf" = '''
|
||||
[program:worker-nginx]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=nginx -c /etc/nginx.conf
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/worker-nginx.log
|
||||
stderr_logfile=/var/log/worker-nginx.log
|
||||
'''
|
||||
|
||||
"worker-phpfpm.conf" = '''
|
||||
[program:worker-phpfpm]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php-fpm -y /assets/php-fpm.conf -F
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/worker-phpfpm.log
|
||||
stderr_logfile=/var/log/worker-phpfpm.log
|
||||
'''
|
||||
|
||||
"worker-laravel.conf" = '''
|
||||
[program:worker-laravel]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=bash -c 'exec php /app/artisan queue:work --sleep=3 --tries=3 --max-time=3600'
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
numprocs=2 # To reduce memory/CPU usage, change to 2.
|
||||
startsecs=0
|
||||
stopwaitsecs=3600
|
||||
stdout_logfile=/var/log/worker-laravel.log
|
||||
stderr_logfile=/var/log/worker-laravel.log
|
||||
'''
|
||||
|
||||
"php-fpm.conf" = '''
|
||||
[www]
|
||||
listen = 127.0.0.1:9000
|
||||
user = www-data
|
||||
group = www-data
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
pm = dynamic
|
||||
pm.max_children = 50
|
||||
pm.min_spare_servers = 4
|
||||
pm.max_spare_servers = 32
|
||||
pm.start_servers = 18
|
||||
clear_env = no
|
||||
php_admin_value[post_max_size] = 35M
|
||||
php_admin_value[upload_max_filesize] = 30M
|
||||
'''
|
||||
|
||||
"nginx.template.conf" = '''
|
||||
user www-data www-data;
|
||||
worker_processes 5;
|
||||
daemon off;
|
||||
|
||||
worker_rlimit_nofile 8192;
|
||||
|
||||
events {
|
||||
worker_connections 4096; # Default: 1024
|
||||
}
|
||||
|
||||
http {
|
||||
include $!{nginx}/conf/mime.types;
|
||||
index index.html index.htm index.php;
|
||||
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] $status '
|
||||
'"$request" $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx-access.log;
|
||||
error_log /var/log/nginx-error.log;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
|
||||
|
||||
server {
|
||||
listen ${PORT};
|
||||
listen [::]:${PORT};
|
||||
server_name localhost;
|
||||
|
||||
$if(NIXPACKS_PHP_ROOT_DIR) (
|
||||
root ${NIXPACKS_PHP_ROOT_DIR};
|
||||
) else (
|
||||
root /app;
|
||||
)
|
||||
|
||||
add_header X-Content-Type-Options "nosniff";
|
||||
|
||||
client_max_body_size 35M;
|
||||
|
||||
index index.php;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
$if(NIXPACKS_PHP_FALLBACK_PATH) (
|
||||
location / {
|
||||
try_files $uri $uri/ ${NIXPACKS_PHP_FALLBACK_PATH}?$query_string;
|
||||
}
|
||||
) else (
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
)
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
$if(IS_LARAVEL) (
|
||||
error_page 404 /index.php;
|
||||
) else ()
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_buffer_size 8k;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include $!{nginx}/conf/fastcgi_params;
|
||||
include $!{nginx}/conf/fastcgi.conf;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
}
|
||||
'''
|
||||
14
package.json
14
package.json
@@ -7,14 +7,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@headlessui/react": "^2.2.4",
|
||||
"@inertiajs/react": "^2.0.11",
|
||||
"@inertiajs/react": "^2.0.12",
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"@vitejs/plugin-react": "^4.5.0",
|
||||
"@vitejs/plugin-react": "^4.5.2",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"axios": "^1.9.0",
|
||||
"axios": "^1.10.0",
|
||||
"concurrently": "^9.1.2",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"postcss": "^8.5.3",
|
||||
"laravel-vite-plugin": "^1.3.0",
|
||||
"postcss": "^8.5.6",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
@@ -43,11 +43,11 @@
|
||||
"lodash": "^4.17.21",
|
||||
"lucide-react": "^0.468.0",
|
||||
"luxon": "^3.6.1",
|
||||
"react-hook-form": "^7.56.4",
|
||||
"react-hook-form": "^7.58.1",
|
||||
"tailwind-merge": "^2.6.0",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"use-double-tap": "^1.3.7",
|
||||
"use-long-press": "^3.3.0",
|
||||
"zod": "^3.25.32"
|
||||
"zod": "^3.25.67"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import { Star } from 'lucide-react';
|
||||
|
||||
@@ -13,7 +13,6 @@ import { useToast } from '@/hooks/use-toast.js';
|
||||
export default function Index({ comics = [], offset = 0, auth = {} }) {
|
||||
|
||||
const url = new URL(window.location); // searchParams
|
||||
|
||||
const [favourites, setFavourites] = useState((auth?.user?.favourites !== null) ? auth.user.favourites : []);
|
||||
const { toast } = useToast();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user