From b4463f8a1f62692a588474f5ccc8c11d4db1ad8f Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Tue, 22 Sep 2026 19:35:20 +0600 Subject: [PATCH] [2026-09-22] eagle: personal/tech/lampac-torrserver.md --- personal/tech/lampac-torrserver.md | 33 ++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/personal/tech/lampac-torrserver.md b/personal/tech/lampac-torrserver.md index c1319ce5..8aa42add 100644 --- a/personal/tech/lampac-torrserver.md +++ b/personal/tech/lampac-torrserver.md @@ -163,14 +163,39 @@ http://127.0.0.1:9118/ts/download/ -> скачивание ### Метод запроса ВАЖЕН ``` -POST /ts/torrents с телом [] -> [] ✅ список раздач -POST /ts/torrents с телом {} -> 400 (неверный формат) -GET /ts/torrents -> 404 (метода нет) -GET /ts/settings -> 403 (нужна авторизация ts:tspass) +POST /ts/torrents -d '{"action":"list"}' -> 200, [] ✅ ТОЛЬКО ТАК +POST /ts/torrents с телом [] -> 400 +POST /ts/torrents без тела -> 400 +POST /ts/torrents с телом {} -> 400 +GET /ts/torrents -> 404 (метода нет) +GET /ts/torrents/list -> 404 +GET /ts/settings -> 403 (нужна авторизация ts:tspass) ``` **400 вместо 404 = маршрут существует.** Это ключевой признак при диагностике. +🔴 **Проверено 2026-09-22:** список раздач отдаёт ТОЛЬКО `-d '{"action":"list"}'` +с заголовком `Content-Type: application/json`. Пустое тело, `[]` и `{}` → 400. +Верный вызов: + +```bash +ssh kraken "curl -s -m 15 -X POST http://127.0.0.1:9118/ts/torrents \ + -H 'Content-Type: application/json' -d '{\"action\":\"list\"}'" +``` + +### Удаление раздачи + +```bash +ssh kraken "curl -s -X POST http://127.0.0.1:9118/ts/torrents \ + -H 'Content-Type: application/json' \ + -d '{\"action\":\"rem\",\"hash\":\"\"}'" +``` + +⚠️ **Раздачи живут в памяти процесса TorrServer.** `docker restart lampac` +их выгружает — тестовая раздача `probe` (Big Buck Bunny), добавленная +2026-09-22, после рестарта исчезла сама, список вернулся пустым. Убирать +вручную не потребовалось. + ## 🔴 Конфиг: где что лежит ### `current.conf` (эффективный, слитый из base.conf + init.conf)