Compare commits

...

6 Commits

Author SHA1 Message Date
d4bf867657 Merge branch 'main' into feature/picsur-workflow
All checks were successful
Picsur Deploy / Validate Picsur Compose (pull_request) Successful in 10m7s
Picsur Deploy / Deploy Picsur to Dockerino (pull_request) Has been skipped
2026-04-09 10:00:51 -03:00
dc436b3518 feat(gitea-runner): add systemd service file + binary download (no secrets) 2026-04-09 03:06:33 -03:00
cc88ad5c05 fix(gitea-runner): fix config.yaml format and registration script 2026-04-09 02:17:25 -03:00
775ad3fcd6 fix: runner runs on Hestia, not Dockerino
- Changed network_mode to host (local execution)
- Updated labels and names to gitea-runner-hestia
- Fixed README references
- Removed external network dependency
2026-04-09 01:55:44 -03:00
af13a920c8 Merge pull request 'feat: Add Gitea Actions runner configuration' (#2) from feature/gitea-runner into main
Reviewed-on: #2
2026-04-09 01:50:09 -03:00
12d9fa08db feat: add Gitea Actions runner configuration
- docker-compose.yml for act_runner
- config.yaml template
- register.sh script
- README with installation instructions
2026-04-09 01:49:14 -03:00
7 changed files with 177 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.runner
token.txt

91
gitea-runner/README.md Normal file
View File

@ -0,0 +1,91 @@
# Gitea Actions Runner — Hestia
Este diretório contém a configuração do runner de Gitea Actions para executar workflows CI/CD.
## Visão Geral
O **act_runner** é o agente que executa os jobs definidos nos workflows `.gitea/workflows/*.yml`. Ele roda no Hestia (10.0.0.50) usando Docker.
## Arquivos
```
gitea-runner/
├── docker-compose.yml # Serviço do runner
├── config.yaml # Configuração (gerado no registro)
├── register.sh # Script de registro
└── data/ # Dados persistentes do runner
```
## Instalação
### 1. Obter Token de Registro
Acesse o Gitea como admin:
```
https://gitea.hackerfortress.cc/admin/runners
```
Clique em **"New Runner"** e copie o token.
### 2. Registrar o Runner
```bash
cd gitea-runner
export RUNNER_TOKEN="seu-token-aqui"
./register.sh
```
### 3. Iniciar o Runner
```bash
docker compose up -d
```
### 4. Verificar
Acesse:
```
https://gitea.hackerfortress.cc/admin/runners
```
O runner deve aparecer como **"Active"**.
## Labels Disponíveis
| Label | Descrição |
|-------|-----------|
| `gitea-runner-Hestia` | Runner principal |
| `ubuntu-latest` | Container Ubuntu para jobs |
## Troubleshooting
### Runner não aparece como active
```bash
# Ver logs
docker compose logs -f act_runner
# Verificar configuração
cat config.yaml
```
### Docker socket permission denied
```bash
# No host (Hestia), adicionar usuário ao grupo docker
sudo usermod -aG docker $USER
```
### Jobs ficam em "Pending"
- Verificar se runner está online
- Verificar se o token está correto
- Verificar se o runner tem labels necessárias
## Atualização
```bash
cd gitea-runner
docker compose pull
docker compose up -d
```

BIN
gitea-runner/act_runner Executable file

Binary file not shown.

18
gitea-runner/config.yaml Normal file
View File

@ -0,0 +1,18 @@
log:
level: info
formatting: text
runner:
capacity: 2
name: gitea-runner-hestia
labels:
- gitea-runner-hestia
- ubuntu-latest:docker://ubuntu:latest
cache:
enabled: false
docker:
host: unix:///var/run/docker.sock
network: ""
privileged: false

View File

@ -0,0 +1,18 @@
version: '3.8'
services:
act_runner:
image: gitea/act_runner:latest
container_name: gitea-runner
restart: unless-stopped
environment:
- CONFIG_FILE=/runner/config.yaml
- INSTANCE_URL=https://gitea.hackerfortress.cc
- RUNNER_TOKEN=${RUNNER_TOKEN}
- RUNNER_NAME=gitea-runner-hestia
- RUNNER_LABELS=gitea-runner-hestia
volumes:
- ./data:/data
- ./config.yaml:/runner/config.yaml
- /var/run/docker.sock:/var/run/docker.sock
network_mode: host

View File

@ -0,0 +1,14 @@
[Unit]
Description=Gitea Actions Runner
After=network.target
[Service]
Type=simple
User=iamferreirajp
WorkingDirectory=/home/iamferreirajp/homelab/gitea-runner
ExecStart=/home/iamferreirajp/homelab/gitea-runner/act_runner daemon
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target

34
gitea-runner/register.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# ============================================
# Gitea Runner Registration Script
# ============================================
# Usage:
# 1. Get token from Gitea Admin > Runners
# 2. Run: RUNNER_TOKEN="your-token" ./register.sh
set -e
GITEA_URL="${INSTANCE_URL:-https://gitea.hackerfortress.cc}"
TOKEN="${RUNNER_TOKEN}"
if [ -z "$TOKEN" ]; then
echo "❌ RUNNER_TOKEN not set"
echo " Get token from: ${GITEA_URL}/admin/runners"
exit 1
fi
echo "📡 Registering runner with Gitea at ${GITEA_URL}..."
# Register and get the runner config
docker compose run --rm act_runner \
act_runner generate-config \
--instance "${GITEA_URL}" \
--token "${TOKEN}" \
--name "gitea-runner-dockerino" \
> config.yaml
echo "✅ Runner registered successfully!"
echo ""
echo "Next steps:"
echo "1. Review config.yaml"
echo "2. Run: docker compose up -d"