- TypeScript 98.6%
- Python 1.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| .vscode | ||
| docker | ||
| scripts | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .npmrc | ||
| AGENTS.md | ||
| biome.json | ||
| bun.lock | ||
| package.json | ||
| prisma.config.ts | ||
| pyproject.toml | ||
| README.md | ||
| tsconfig.json | ||
| uv.lock | ||
nmanga-list
To install dependencies:
bun install
To run:
bun run index.ts
This project was created using bun init in bun v1.3.12. Bun is a fast all-in-one JavaScript runtime.
Resource limits for large manga
Large manga can use a lot of RAM/CPU because image conversion + embedding run in worker threads.
Docker limits
docker/docker-compose.yml now includes an app service with hard caps:
cpus: 2mem_limit: 2g
Tune those values based on your machine. Example:
app:
cpus: 1.5
mem_limit: 1536m
App-level throttles
Use these environment variables to reduce workload:
IMAGE_QUEUE_WORKERS(default:1)
Number of manga processed at same time.IMAGE_PAGE_CONCURRENCY(default:2)
Number of pages fetched/converted at same time per worker.MANGA_REFRESH_INTERVAL_HOURS(default:2)
Minimum hours before/api/scrapere-fetches manga metadata/tags again. Within this interval, scrape request returns fresh and skips re-fetch.
Safe low-memory profile:
IMAGE_QUEUE_WORKERS=1
IMAGE_PAGE_CONCURRENCY=1
nhentai 429 handling with temporary proxies
When nhentai responds with HTTP 429, the app now:
- Reads
Retry-Afterwhen available (falls back to 60s, capped at 10m) - Shares one cooldown across all concurrent workers in the same app process
- Uses rotating proxies only while that cooldown is active
Proxy list is loaded once on app startup from ProxyScrape by default.
Optional env vars:
NMANGA_NHENTAI_PROXY_ENABLED(default:true)
Set tofalseto disable proxy usage entirely.NMANGA_NHENTAI_PROXY_LIST_URL(default: ProxyScrape elite list URL)
Override with your own provider URL that returns one proxy per line inprotocol://ip:portformat.NMANGA_NHENTAI_FETCH_TIMEOUT_MS(default:15000)
Per-request timeout for nhentai direct/proxy fetches. Increase if your network/proxy path is slow; decrease to fail over faster.
Remote worker via CLI
You can run additional queue workers on another machine using the same database and S3/MinIO bucket:
bun run cli remote-worker
By default this command starts a worker subprocess with:
- env file:
.env.remote - concurrency:
1 - poll interval:
1000ms
Examples:
# 2 worker loops
bun run cli remote-worker --concurrency 2
# custom env file
bun run cli remote-worker --env-file /etc/nmanga/worker.env --concurrency 2
.env.remote must point to the same DATABASE_URL and MinIO/S3 settings used
by your server so the worker can claim jobs and upload page data directly.
All normal scraper/proxy env vars are supported, including:
NMANGA_NHENTAI_PROXY_ENABLEDNMANGA_NHENTAI_PROXY_LIST_URLNMANGA_NHENTAI_FETCH_TIMEOUT_MS
Nginx Proxy Manager setup
This app serves HTTP API on port 3000 and tRPC WebSocket on port 3001.
In Nginx Proxy Manager, create a Proxy Host:
- Domain Names:
nmanga.domain.dev - Scheme:
http - Forward Hostname / IP: your app container or host (example:
app) - Forward Port:
3000 - Websockets Support: enabled
Then add this in Advanced:
location /trpc {
set $nmanga_upstream http://app:3000;
if ($http_upgrade = "websocket") {
set $nmanga_upstream http://app:3001;
}
proxy_pass $nmanga_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 600s;
}
Replace app with your actual upstream hostname/IP used by NPM.