No description
  • TypeScript 98.6%
  • Python 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yumeo 780761d2b3
All checks were successful
Build and Release / build (push) Successful in 10m35s
fix(ci): try to cache more stuff
2026-08-18 00:46:12 +02:00
.forgejo/workflows fix(ci): try to cache more stuff 2026-08-18 00:46:12 +02:00
.vscode chore: update dependencies 2026-06-14 14:06:53 +02:00
docker fix: prisma moved to src 2026-06-29 18:37:31 +02:00
scripts feat: linked items grid view 2026-08-17 17:14:20 +02:00
src feat: use super-entries in artist view 2026-08-18 00:19:00 +02:00
.dockerignore refactor workspace 2026-06-29 18:29:37 +02:00
.env.example feat: the bestest linking 2026-05-31 22:15:45 +02:00
.gitignore feat: use better model for embeddings 2026-06-17 16:15:45 +02:00
.npmrc fix: proxy implementation 2026-05-23 20:25:02 +02:00
AGENTS.md fix: remove stale .sql file 2026-08-17 17:34:31 +02:00
biome.json chore: update dependencies 2026-07-30 15:45:55 +02:00
bun.lock chore: bump version to 0.4.3 2026-08-17 17:21:50 +02:00
package.json chore: bump version to 0.5.0 2026-08-18 00:19:18 +02:00
prisma.config.ts refactor workspace 2026-06-29 18:29:37 +02:00
pyproject.toml feat: use better model for embeddings 2026-06-17 16:15:45 +02:00
README.md refactor workspace 2026-06-29 18:29:37 +02:00
tsconfig.json refactor workspace 2026-06-29 18:29:37 +02:00
uv.lock feat: use better model for embeddings 2026-06-17 16:15:45 +02:00

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: 2
  • mem_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/scrape re-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-After when 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 to false to 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 in protocol://ip:port format.
  • 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_ENABLED
  • NMANGA_NHENTAI_PROXY_LIST_URL
  • NMANGA_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.