From 76714d799e27359b184dbb8940be3ef1e3055d92 Mon Sep 17 00:00:00 2001 From: openclawd Date: Mon, 16 Feb 2026 08:36:55 +0000 Subject: [PATCH] Fix: nginx duplicate MIME type, update version to 0.2.1, improve log rotation - Remove duplicate text/html from nginx gzip_types (fixes nginx -t warning) - Update hardcoded API version from 0.2.0 to 0.2.1 to match package.json - Update logrotate config: daily rotation, 7 days retention, improved postrotate - Add Docker logging configuration with size/file limits --- docker-compose.yml | 5 +++++ logrotate-docfast | 10 +++++----- nginx-docfast.conf | 1 - src/index.ts | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1e77d47..1f63b04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,11 @@ services: - PAGES_PER_BROWSER=15 volumes: - docfast-data:/app/data + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" mem_limit: 2560m cpus: 1.5 diff --git a/logrotate-docfast b/logrotate-docfast index 2714cca..b2f66d6 100644 --- a/logrotate-docfast +++ b/logrotate-docfast @@ -1,13 +1,13 @@ -/var/log/docfast*.log { - weekly - rotate 4 +/var/log/docfast/*.log { + daily + rotate 7 compress delaycompress missingok notifempty create 644 root root postrotate - # Send USR1 signal to dockerized apps to reopen log files - /bin/kill -USR1 $(cat /var/run/docker.pid 2>/dev/null) 2>/dev/null || true + # Restart docker container to reopen log files + docker restart docfast-docfast-1 >/dev/null 2>&1 || true endscript } \ No newline at end of file diff --git a/nginx-docfast.conf b/nginx-docfast.conf index 846c1d0..d0422c6 100644 --- a/nginx-docfast.conf +++ b/nginx-docfast.conf @@ -9,7 +9,6 @@ server { gzip_min_length 1024; gzip_types text/plain - text/html text/css application/json application/javascript diff --git a/src/index.ts b/src/index.ts index 4c373c1..ab865cc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -183,7 +183,7 @@ app.get("/docs", (_req, res) => { app.get("/api", (_req, res) => { res.json({ name: "DocFast API", - version: "0.2.0", + version: "0.2.1", endpoints: [ "POST /v1/signup/free — Get a free API key", "POST /v1/convert/html",