From 06d2e9a42978a516865e6585217ff9bbdeed5355 Mon Sep 17 00:00:00 2001 From: hoelee Date: Fri, 7 Aug 2026 12:59:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20config.json=20must=20be=20read-write=20(?= =?UTF-8?q?not=20:ro)=20=E2=80=94=20program=20writes=20back=20to=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- docker-compose.yml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ec129b..b2bb605 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ services: restart: unless-stopped user: root volumes: - - ./config.json:/app/config.json:ro + - ./config.json:/app/config.json - ./telegram_session.session:/app/telegram_session.session - ./data:/app/data - ./channels:/app/channels @@ -86,7 +86,7 @@ cp config.example.json config.json docker run -d \ --name telegram-backup \ --restart unless-stopped \ - -v $(pwd)/config.json:/app/config.json:ro \ + -v $(pwd)/config.json:/app/config.json \ -v $(pwd)/telegram_session.session:/app/telegram_session.session \ -v $(pwd)/data:/app/data \ -v $(pwd)/channels:/app/channels \ @@ -131,6 +131,8 @@ docker compose logs -f telegram-backup | `channel_last_message_id_overrides` | No | `{}` | One-time per-channel sync cursor overrides. With `updateonce: true`, sets the channel's SQLite `last_message_id` to the specified value, then automatically changes `updateonce` to `false` in `config.json`. Use numeric Telegram peer IDs that are included in `channels`. | | `manual_downloads` | No | `{}` | Message IDs to prioritize, keyed by channel ID. Useful to force-retry specific messages. Example: `{"-1001":[42,43,44]}`. Change is detected by config watcher — no restart needed. | +`config.json` must be mounted read-write. The program writes back to it directly — for example, when `channel_last_message_id_overrides` runs with `updateonce: true`, the downloader updates the database and then flips `updateonce` to `false` in the same file. A read-only mount (`:ro`) would break this and any other live config update. + `config.json` is watched every 10 seconds. Changes to channels, overrides, cursor overrides, and manual downloads are applied without restarting. Do not set `status_port`, `db_path`, worker count, or API credentials expecting a live process to rebind/recreate those resources; restart after changing them. ### One-Time Sync Cursor Override diff --git a/docker-compose.yml b/docker-compose.yml index 3560c46..8d25095 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,8 @@ services: restart: unless-stopped user: root volumes: - - ./config.json:/app/config.json:ro + # config.json must be read-write — the program writes back to it (e.g. flips updateonce to false) + - ./config.json:/app/config.json - ./telegram_session.session:/app/telegram_session.session - ./channels:/app/channels - ./logs:/app/logs