From 94de8eddb1cc7111d8c9fb009b276d6834fcf38d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 3 Aug 2026 22:23:04 +0500 Subject: [PATCH] Document shared repo RAA deployment --- MULTI_PROJECT.md | 18 +++++--- RAA.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++ STATE.md | 24 ++++++---- 3 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 RAA.md diff --git a/MULTI_PROJECT.md b/MULTI_PROJECT.md index 6ba5143..743d2f1 100644 --- a/MULTI_PROJECT.md +++ b/MULTI_PROJECT.md @@ -4,10 +4,14 @@ Goal: keep one codebase and run separate deployments for each editorial project. ## Target model -- One canonical git repository for application code. +- One canonical git repository for application code: + `http://192.168.1.135:3000/exostring/new_vk_parser.git`. +- One canonical local workspace: `D:\DEVELOPMENT\new_vk_parser`. - One Coolify application per project. - One Postgres database per project. - Project differences live in Coolify env variables and database settings, not in code. +- The old RAA local copy `D:\DEVELOPMENT\raa-parser_poster` and old RAA Gitea repo + are not the source of truth. ## Per-project env @@ -43,14 +47,16 @@ RAA current social targets: - raw media Telegram channel: `tg_media_channel_id=-1004312015562` - final Telegram publication channel: `tg_poster_chat_id=-1001303630155` - VK owner: `vk_poster_owner_id=-36860851`, `vk_poster_from_group=true` +- More RAA-specific runtime notes are in `RAA.md`. ## Poster modules The site poster is selected by `site_poster_provider`. A project can disable the worker or leave the provider empty when there is no website poster yet. New website integrations should be added as provider modules behind the same interface instead of branching the worker by project name. -## Migration path +## Current Status -1. Finish removing project-specific constants from code. -2. Choose one canonical repo for both deployments. -3. Point both Coolify applications to that repo and branch. -4. Keep only env and database settings different between projects. +- FN-8 Coolify app `n6cnr60anmruiwkiey0pukye` points to `new_vk_parser.git`, branch `main`. +- RAA Coolify app `korokrhpoyqxf0nw2y8vk7lp` points to `new_vk_parser.git`, branch `main`. +- Both projects should deploy from the same commit SHA. +- Keep only env and database settings different between projects. +- Do not add project-specific defaults to migrations or `.env.example`. diff --git a/RAA.md b/RAA.md new file mode 100644 index 0000000..ede876b --- /dev/null +++ b/RAA.md @@ -0,0 +1,115 @@ +# RAA deployment + +Last updated: 2026-08-03. + +RAA is not a separate code project anymore. The source of truth for code and +documentation is: + +- local workspace: `D:\DEVELOPMENT\new_vk_parser` +- canonical Gitea repo: `http://192.168.1.135:3000/exostring/new_vk_parser.git` +- branch: `main` + +The old local copy `D:\DEVELOPMENT\raa-parser_poster` and old Gitea repo +`exostring/raa-parser_poster.git` are not the deployment source of truth. Do not +continue feature work there. + +## Runtime + +- Public admin URL: `https://raa.panel.f-n8.ru` +- Coolify project/environment: `n8_parser` / `production` +- Coolify app: `RAA admin` +- Coolify app UUID: `korokrhpoyqxf0nw2y8vk7lp` +- Coolify git repository: `http://192.168.1.135:3000/exostring/new_vk_parser.git` +- Coolify git branch: `main` +- Postgres container: `m9v14hzfh5mk9kelxzcqvhc6` +- Postgres DB/user: `raa_parser` / `raa_parser_user` +- Destination: `vk-parser-lxc`, CTID `105`, IP `192.168.1.105` +- Edge proxy: Caddy in CTID `110` proxies `raa.panel.f-n8.ru` to Coolify Traefik at `192.168.1.105:80` +- Health check: `https://raa.panel.f-n8.ru/health` + +## Per-Project Settings + +These values belong in Coolify env or the RAA database, not in code. + +Coolify env/secrets: + +- `ADMIN_SITE_TITLE=RAA Редакторская` +- `ADMIN_APP_TITLE=RAA Редакторская` +- `DB_*` for `raa_parser` +- `APP_SECRET_KEY` +- `ADMIN_BOOTSTRAP_LOGIN` +- `ADMIN_BOOTSTRAP_PASSWORD` +- `TG_BOT_TOKEN` copied from FN-8 +- `TELEGRAM_API_ID` copied from FN-8 +- `TELEGRAM_API_HASH` copied from FN-8 +- `VK_ACCESS_TOKEN` copied from FN-8 for parsing + +Database settings: + +- `local_bot_api_url=http://127.0.0.1:8081` +- `tg_media_channel_id=-1004312015562` (`VK RAW RAA`) +- `tg_poster_chat_id=-1001303630155` (`Red Airsoft | Страйкбол`) +- `publication_common_tags=#raa_news #страйкбол` +- `vk_poster_owner_id=-36860851` +- `vk_poster_from_group=true` +- `vk_poster_access_token` is the RAA community token +- `site_poster_enabled=false` +- `site_poster_provider=""` until a website adapter is configured + +## Workers + +As last checked on 2026-08-03: + +- `vk-parser=true` +- `vk-storage-uploader=true` +- `ai-qualifier=false` +- `ai-writer=false` +- `tg-poster=false` +- `vk-poster=false` +- `site-poster=false` +- `tg_poster_enabled=false` +- `vk_poster_enabled=false` + +AI qualifier/writer are configured with user-provided token, models, and prompts, +but both the worker controls and double-safety settings were still off. Turning +them on will spend LLM tokens and process the pending RAA raw posts. + +## RAA Categories + +RAA categories live in the RAA `content_categories` table. The UI has only +`name`, `tag`, `sort_order`, status, and actions; do not add separate category +description or site fields for RAA unless the user asks for a website taxonomy. + +Current active categories: + +- `1` `AEG — Страйкбольные электропневматические приводы: автоматы, пистолеты-пулемёты, карабины, дробовики на электроприводе. Новинки, обновления линеек, сравнения моделей.` / `aeg_страйкбол` +- `2` `GBB — Газовые страйкбольные приводы всех форм-факторов: пистолеты, автоматы, пистолеты-пулемёты на газовом приводе. GBB, GBBR, CO2, AEP.` / `gbb_страйкбол` +- `3` `СПРИНГ — Пружинные болтовые снайперские реплики. Новинки, апгрейд, обзоры болтовок.` / `спринг_страйкбол` +- `4` `HPA / ВВД — Системы на внешнем баллоне высокого давления: движки, регуляторы, линии, баллоны, переходники, настройка.` / `ввд_страйкбол` +- `5` `ПИРОТЕХНИКА — Страйкбольная пиротехника: дымовые гранаты, шумовые устройства, сигнальные шашки, петарды, страйкбольные гранаты и подствольники.` / `пиротехника_страйкбол` +- `6` `ТЮНИНГ — Внутреннее устройство и улучшение приводов: гирбоксы, хоп-апы, стволы, моторы, шестерни, поршни, электроника, платы управления, мастерские и сервисные центры.` / `тюнинг_страйкбол` +- `7` `ОБВЕС — Всё, что крепится снаружи реплики: цевья, рукоятки, приклады, крышки, трассерные насадки, глушители, фонари, ЛЦУ, сошки, антабки, крепления.` / `обвес_страйкбол` +- `8` `ПРИЦЕЛЬНЫЕ — Прицельная оптика: коллиматоры, прицелы, увеличители, голографические прицелы, ночная оптика, тепловизоры, целеуказатели.` / `прицел_страйкбол` +- `9` `РАСХОДНИКИ — Шары всех калибров и производителей, аккумуляторы, газ, масла, смазки, батарейки, зарядные устройства и всё для обслуживания привода.` / `расходники_страйкбол` +- `10` `НОЧНОЙ СТРАЙКБОЛ — Снаряжение, приводы и тактики для игры в тёмное время суток: ПНВ, тепловизоры, ИК-маркеры, трассеры, ИК-фонари, маскировка под ночь.` / `ночной_страйкбол` +- `11` `ЗАЩИТА — Защита игрока на полигоне: маски, очки, сетки, шлемы, наушники, налокотники, наколенники, перчатки, щитки.` / `защита_страйкбол` +- `12` `СНАРЯЖЕНИЕ И ЭКИПИРОВКА — Одежда, снаряжение и экипировка для страйкбола и поля: плитоносцы, разгрузки, подсумки, рюкзаки, боевые рубашки, штаны, берцы, флиски, панамы, балаклавы, ремни, медицина, связь.` / `снаряжение_страйкбол` +- `13` `СОБЫТИЯ — Страйкбольные игры, сценарники, турниры, соревнования, выставки, фестивали и любые мероприятия сообщества.` / `события_страйкбол` +- `14` `НОВОСТИ МАГАЗИНОВ — Поступления в магазины, новые позиции в каталогах, акции, распродажи, открытие новых точек продаж.` / `магазины_страйкбол` +- `18` `Не целевой контент` / `НЦК` + +`sort_order=18` is a service category used by the AI writer contract for +automatic rejection of non-target content. + +## Deployment Notes + +To deploy code changes for both FN-8 and RAA: + +1. Work only in `D:\DEVELOPMENT\new_vk_parser`. +2. Push to `gitea/main`. +3. Both Coolify applications should deploy from the same commit SHA. +4. Trigger deployment manually via Coolify API only when the webhook does not queue it. +5. Poll deployment status sparingly; full Docker rebuilds can take 7-11 minutes because Coolify currently rebuilds the image with `--no-cache` and reinstalls Debian/ffmpeg dependencies. + +Do not put project-specific defaults into migrations or `.env.example`. Put them +in Coolify env or each project's database settings. diff --git a/STATE.md b/STATE.md index 05ecb8e..26cb556 100644 --- a/STATE.md +++ b/STATE.md @@ -48,13 +48,15 @@ Current runtime is local infrastructure, not the old VPS. - New installs default `site-poster` to disabled and must explicitly set provider, base URL, secret, and `site_poster_enabled=true`. -## RAA Duplicate +## RAA Deployment -As of 2026-08-03, the RAA duplicate is a separate Coolify app/database using the -same codebase shape. +As of 2026-08-03, RAA is a second Coolify app/database deployed from the same +canonical git repository as FN-8. Code work for both projects must happen in +`D:\DEVELOPMENT\new_vk_parser`. -- Local copy path requested by user: `D:\DEVELOPMENT\raa-parser_poster`. -- Gitea repo: `http://192.168.1.135:3000/exostring/raa-parser_poster.git`. +- Canonical local workspace: `D:\DEVELOPMENT\new_vk_parser`. +- Canonical Gitea repo: `http://192.168.1.135:3000/exostring/new_vk_parser.git`. +- Old local copy `D:\DEVELOPMENT\raa-parser_poster` is not the source of truth. - Coolify app UUID: `korokrhpoyqxf0nw2y8vk7lp` (`RAA admin`). - Public admin URL: `https://raa.panel.f-n8.ru`. - RAA Postgres container: `m9v14hzfh5mk9kelxzcqvhc6`, DB `raa_parser`, user `raa_parser_user`. @@ -63,9 +65,11 @@ same codebase shape. - VK publication owner: `vk_poster_owner_id=-36860851`, `vk_poster_from_group=true`. - `TG_BOT_TOKEN`, `TELEGRAM_API_ID`, and `TELEGRAM_API_HASH` were copied from FN-8 Coolify env. - Local Bot API app setting: `local_bot_api_url=http://127.0.0.1:8081`. -- As last checked, publication workers were intentionally disabled: - `vk-storage-uploader=false`, `tg-poster=false`, `vk-poster=false`, - `tg_poster_enabled=false`, `vk_poster_enabled=false`. +- As last checked, RAA has `vk-parser=true`, `vk-storage-uploader=true`. + AI and publication workers are intentionally disabled until explicitly started: + `ai-qualifier=false`, `ai-writer=false`, `tg-poster=false`, `vk-poster=false`, + `site-poster=false`, `tg_poster_enabled=false`, `vk_poster_enabled=false`. +- Detailed RAA notes live in `RAA.md`. ## Important Text Rules @@ -157,7 +161,11 @@ As of 2026-07-29: - Before any deploy/server operation, read `D:\DEVELOPMENT\.infra.md` first. - Before pushing or deploying, run `git pull --rebase gitea main`. - For this project, push deployable changes to `gitea/main`; Coolify handles deployment. +- FN-8 and RAA should deploy from the same `new_vk_parser.git` commit SHA. + Differences between projects belong in Coolify env variables and each project's DB settings. - Prefer small targeted file reads with `rg` and narrow ranges. +- Deployment status polling should be sparse. Coolify rebuilds can take 7-11 minutes + because the Docker build currently runs without cache and reinstalls system deps. - Avoid dumping long post texts from DB unless explicitly needed. - For runtime checks, use the current Coolify/Gitea/LXC 105 path from `D:\DEVELOPMENT\.infra.md`. - Do not `git reset --hard` or revert user/server hotfixes.