32 lines
1.4 KiB
Desktop File
32 lines
1.4 KiB
Desktop File
# FitOS — agent auto-deployu stagingu (webhook Gitea -> hostdeploy.py).
|
|
# Instalacja na hoście (runbook: ops/docs/srodowiska.md, sekcja Auto-deploy):
|
|
# 1. user: useradd -m -G docker fitosdeploy
|
|
# 2. repo agenta: git clone http://127.0.0.1:11000/Tisachi/FitOS.git ~fitosdeploy/fitos-staging-agent/repo
|
|
# 3. plik agenta: cp agent.env.example ~fitosdeploy/.config/fitos-deploy-agent/agent.env (uzpelnij sekret, chmod 600)
|
|
# 4. unit: cp ops/deploy/agent/fitos-deploy-agent.service /etc/systemd/system/
|
|
# systemctl daemon-reload && systemctl enable --now fitos-deploy-agent
|
|
# SELinux enforcing: pierwsze kontakty z docker socketem moga wymagac local policy:
|
|
# ausearch -c fitosdeploy --raw | audit2allow -M fitos-deploy && semodule -i fitos-deploy.pp
|
|
|
|
[Unit]
|
|
Description=FitOS deploy agent (webhook Gitea -> auto-deploy staging)
|
|
After=network-online.target docker.service gitea.service
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=fitosdeploy
|
|
Group=fitosdeploy
|
|
ExecStart=/usr/bin/python3 /home/fitosdeploy/fitos-staging-agent/repo/ops/deploy/agent/listener.py
|
|
Restart=always
|
|
RestartSec=5
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
Environment=PYTHONUNBUFFERED=1
|
|
# sekret + konfiguracja poza repo; plik chmod 600 wlasnoscia fitosdeploy.
|
|
# "optional=-" zeby komunikat sluzby byl czytelny (listener sam zglosi brak sekretu).
|
|
EnvironmentFile=-/home/fitosdeploy/.config/fitos-deploy-agent/agent.env
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|