Source code for different (mostly, monitoring) services running on https://terrty.net which is primarily my blog.
Contains Zabbix Server , Plausible, Remark42, Adminer, Newscope, Lighthouse CI, a small answers store for private pages, and Nginx serving https://terrty.net and https://ksinia.net, together with their databases (MySQL, PostgreSQL, ClickHouse).
For IPv6 work on Oracle Linux inside Oracle Cloud run:
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/udp --permanent
sudo firewall-cmd --reloadThe Zabbix server port 10051 stays out of the public zone: Docker publishes it past firewalld, so agent addresses are allow-listed in the DOCKER-USER chain with firewalld direct rules (sudo firewall-cmd --permanent --direct --get-all-rules).
The telegram-notifier service monitors Docker containers and sends Telegram alerts when they stop, restart, or become unhealthy. Currently configured to monitor zabbix-server, zabbix-web, and lhci containers.
Setup:
-
Create a Telegram bot:
- Message @BotFather on Telegram
- Send
/newbotand follow the instructions - Copy the bot token
-
Get your chat ID:
- Message @userinfobot on Telegram
- Copy your chat ID
-
Update
private/environment/telegram-notifier.env:- Set
TELEGRAM_NOTIFIER_BOT_TOKENto your bot token - Set
TELEGRAM_NOTIFIER_CHAT_IDto your chat ID
- Set
-
Start the monitoring service:
docker compose up -d telegram-notifier
To monitor additional containers: Add the label telegram-notifier.monitor: true to any service in docker-compose.yml.
config/cron/docker-prune.cron removes dangling images and week-old build cache every night. Install it after cloning, and again after editing it:
sudo install -o root -g root -m 0644 config/cron/docker-prune.cron /etc/cron.d/docker-prunerodnya-api (config/rodnya-api) stores what visitors select and write on the private static pages under /rodnya/<16 hex>/; nginx sends /rodnya/<page>/api/ to it. It accepts a page only if private/rodnya/<page>/index.html exists, keeps one append-only log per page in private/rodnya-data/<page>.jsonl, and shows all answers at /rodnya/<page>/api/admin/<ADMIN_KEY>/ with export.json and log.jsonl downloads there. Setup after cloning:
openssl rand -hex 16 | sed 's/^/ADMIN_KEY=/' > private/environment/rodnya-api.env
mkdir -p private/rodnya-data
docker run --rm -v "$PWD/private/rodnya-data:/d" alpine chown 65534:65534 /d
docker compose up -d --build rodnya-apiThe image is built on the server, so rerun the last command after changing its code.
Zabbix Agent setup for monitored hosts is in the separate file, docker-compose-zabbix-agent.yml.