Files
2026-08-11 00:46:11 +05:00

153 lines
9.5 KiB
Markdown

# RAA deployment
Last updated: 2026-08-11.
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: `raa-fn8`, 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`
- Current verified deploy: `f866a13a8a83598e26a7a6a3406b8bc1c01c9a80`
## 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
- Site parser settings are stored here as well:
`site_parser_url`, `site_parser_token`, `site_parser_rucaptcha_token`,
`site_parser_timeout_sec`, `site_parser_interval_minutes`, and
`site_parser_min_text_length`.
- Optional social text headers/footers:
- `tg_poster_header_text` / `tg_poster_footer_text`
- `vk_poster_header_text` / `vk_poster_footer_text`
- `max_poster_header_text` / `max_poster_footer_text`
Empty header/footer settings add nothing.
MAX sends wrapper text as HTML. For clickable text use:
`<a href="https://example.com">Link text</a>`.
Wrapper HTML is normalized before publishing: broken/unsupported tags are
stripped, readable text is kept.
## Workers
As last checked on 2026-08-03:
- `vk-parser=true`
- `media-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.
## Website Sources
Website sources use the existing `vk-parser` scheduling loop but are sent one
at a time to a stateless external worker in LXC `108` (`192.168.1.113:8080`).
All source records, JSON configs, schedules, errors, raw posts, and media state
remain in the RAA database. The worker is managed by Docker Compose from
`/opt/site-parser` and should be healthy as `site-parser-worker`.
PopularAirsoft source id `72` uses `https://popularairsoft.com/` and the full
v1 config from `site_parser_worker/README.md`. Its RSS is not used for
discovery because it mixes short video pages with full articles. HTML discovery
selects the `The Latest News` cards and the worker then opens every `/news/...`
detail. Verified live 2026-08-11: nine details parsed, zero errors.
Cloudflare session state is returned to the main app and is also reused by
`media-uploader` for protected images. Admin previews remain authenticated
Telegram-backed `/raw/media/{media_id}` URLs.
## 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
Legacy CT cleanup:
- CT `107` (`raa-parser-poster`) was stopped and removed on 2026-08-04.
- CT `104` (`raa-sender`) is not an error: it still runs the legacy VK reposting app (`vk-reposter`) and can legitimately post to its configured Telegram channel.
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.