Document the Forgejo Actions CI setup in both READMEs
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
32ccb22c88
commit
0da7aa5a14
2 changed files with 51 additions and 0 deletions
25
README.md
25
README.md
|
|
@ -480,6 +480,31 @@ The scheduler checks every 60s, so the Discord message can take up to a
|
||||||
minute to arrive. Check Graylog's Alerts page and the configured Discord
|
minute to arrive. Check Graylog's Alerts page and the configured Discord
|
||||||
channel.
|
channel.
|
||||||
|
|
||||||
|
## CI/CD via Forgejo Actions
|
||||||
|
|
||||||
|
This project's Forgejo repo (`git.zotac.keenetic.link/zotac/graylog-deploy`)
|
||||||
|
has a manually-triggered deploy workflow: `.forgejo/workflows/deploy.yml`.
|
||||||
|
Running it (Actions tab → Deploy Graylog config → Run workflow) clones the
|
||||||
|
repo fresh and re-runs `install-graylog.sh` - the same idempotent script
|
||||||
|
described throughout this README, just automated instead of scp'd by hand.
|
||||||
|
|
||||||
|
- **Trigger is manual on purpose** (`workflow_dispatch` only, no
|
||||||
|
`on: push`) - this repo drives a production monitoring system, so a
|
||||||
|
human reviews the diff and clicks "Run workflow" rather than every push
|
||||||
|
silently redeploying.
|
||||||
|
- **The runner lives inside the Graylog container itself** (VMID 200,
|
||||||
|
`self-hosted:host` label, installed at `/usr/local/bin/forgejo-runner`,
|
||||||
|
running as a systemd service). No new SSH keys or cross-host access were
|
||||||
|
needed - the workflow just clones the repo into `/tmp/graylog-deploy-ci`
|
||||||
|
and runs the script locally, exactly like a human operator would.
|
||||||
|
- **No `actions/checkout`** - that action needs Node.js, which this
|
||||||
|
appliance container doesn't have and shouldn't need just for CI. The
|
||||||
|
workflow does a plain `git clone --depth 1` instead.
|
||||||
|
- **Secrets** (`GRAYLOG_ADMIN_PASSWORD`, `DISCORD_WEBHOOK_URL`) are stored
|
||||||
|
as repo-level Forgejo Actions secrets, not in any tracked file.
|
||||||
|
`GRAYLOG_EXTERNAL_URI` isn't secret (it's the public Web UI address) so
|
||||||
|
it's inlined directly in the workflow.
|
||||||
|
|
||||||
## What's still NOT included
|
## What's still NOT included
|
||||||
|
|
||||||
- **D-Link switch parsing** — no sample logs were available.
|
- **D-Link switch parsing** — no sample logs were available.
|
||||||
|
|
|
||||||
26
README.uk.md
26
README.uk.md
|
|
@ -499,6 +499,32 @@ logger -n 127.0.0.1 -P 5140 -d 'kernel: nf_conntrack: table full, dropping packe
|
||||||
із затримкою до хвилини. Перевірте сторінку Alerts у Graylog та відповідний
|
із затримкою до хвилини. Перевірте сторінку Alerts у Graylog та відповідний
|
||||||
Discord-канал.
|
Discord-канал.
|
||||||
|
|
||||||
|
## CI/CD через Forgejo Actions
|
||||||
|
|
||||||
|
Forgejo-репозиторій проєкту (`git.zotac.keenetic.link/zotac/graylog-deploy`)
|
||||||
|
має вручну-запускний деплой-workflow: `.forgejo/workflows/deploy.yml`.
|
||||||
|
Його запуск (вкладка Actions → Deploy Graylog config → Run workflow)
|
||||||
|
клонує репо наново й повторно запускає `install-graylog.sh` — той самий
|
||||||
|
ідемпотентний скрипт, описаний по всьому цьому README, просто
|
||||||
|
автоматизований замість ручного scp.
|
||||||
|
|
||||||
|
- **Тригер навмисно ручний** (тільки `workflow_dispatch`, без
|
||||||
|
`on: push`) — це репо керує продакшн-системою моніторингу, тож людина
|
||||||
|
переглядає диф і сама натискає "Run workflow", а не кожен push тихо
|
||||||
|
передеплоює систему.
|
||||||
|
- **Раннер живе прямо всередині контейнера Graylog** (VMID 200, лейбл
|
||||||
|
`self-hosted:host`, встановлений у `/usr/local/bin/forgejo-runner`,
|
||||||
|
працює як systemd-сервіс). Нових SSH-ключів чи міжхостового доступу не
|
||||||
|
знадобилося — workflow просто клонує репо в `/tmp/graylog-deploy-ci` і
|
||||||
|
запускає скрипт локально, точно як це робив би оператор вручну.
|
||||||
|
- **Без `actions/checkout`** — ця дія вимагає Node.js, якого немає (і не
|
||||||
|
повинно бути) на цьому appliance-контейнері лише заради CI. Замість неї
|
||||||
|
workflow робить звичайний `git clone --depth 1`.
|
||||||
|
- **Секрети** (`GRAYLOG_ADMIN_PASSWORD`, `DISCORD_WEBHOOK_URL`) зберігаються
|
||||||
|
як repo-level секрети Forgejo Actions, а не в жодному відстежуваному
|
||||||
|
файлі. `GRAYLOG_EXTERNAL_URI` не є секретом (це публічна адреса Web UI),
|
||||||
|
тож вказаний прямо у workflow.
|
||||||
|
|
||||||
## Що ще НЕ реалізовано
|
## Що ще НЕ реалізовано
|
||||||
|
|
||||||
- **Парсинг D-Link switch** — не було зразків логів.
|
- **Парсинг D-Link switch** — не було зразків логів.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue