update with DOckerfile and docs
continuous-integration/drone/tag Build is failing

This commit is contained in:
2025-09-18 19:01:03 +02:00
parent f3b2f50fbf
commit 230694d131
5 changed files with 382 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
.git
repos/
*.md
*.log
*.sh
*.j2
+23
View File
@@ -0,0 +1,23 @@
kind: pipeline
type: docker
name: build-control-container
steps:
- name: build and push
image: plugins/docker
settings:
repo: registry.example.com/youruser/controlla
registry: git.kolspace.cc
tags:
- ${DRONE_TAG}
dockerfile: Dockerfile
context: .
platforms: linux/amd64
username:
from_secret: registry_user
password:
from_secret: registry_pass
trigger:
event:
- tag
+166
View File
@@ -0,0 +1,166 @@
# Controlla
**Controlla** — это инструмент для автоматического мониторинга и обновления Docker-образов в ваших инфраструктурных репозиториях.
Он анализирует ваши docker-compose файлы, проверяет наличие новых версий образов, уведомляет через Telegram и может автоматически обновлять теги и пушить изменения в git.
---
## Возможности
- Поиск и анализ всех сервисов и образов в docker-compose файлах
- Проверка наличия новых версий образов (SemVer и digest fallback)
- Гибкая фильтрация по ключевым словам (например, `rc`, `nightly`, `test`)
- Скип-лист и глобальный ignore для образов (через `skipped.yaml`)
- Интерактивные уведомления в Telegram (обновить/игнорировать)
- Автоматическое обновление тегов и пуш в git-репозиторий
- Готовый Docker-образ, CI/CD через DroneCI
---
## Быстрый старт
### 1. Клонируйте репозиторий
```sh
git clone https://git.kolspace.cc/victor.kolomin/controlla.git
cd controlla
```
### 2. Настройте конфиг
Отредактируйте `config.yaml`:
```yaml
git:
repo_url: "git@git.kolspace.cc:victor.kolomin/test-homelab.git"
local_repo_path: ./repos/myrepo
branch: "main"
ssh_key_path: "/app/id_rsa"
checker:
watch_folder: services
proposed_tags_count: 3
interval_minutes: 15
skip_list_file: "skipped.yaml"
ignore_keywords:
- rc
- alpha
- nightly
- test
- debug
- arm64v8
- arm32v7
- ubuntu
```
### 3. Заполните `skipped.yaml` (опционально)
```yaml
updates:
- image: ghcr.io/lldap/lldap
new_tag: 2024.0.0-01-16
ignored_images:
- ghcr.io/immich-app/postgres
```
### 4. Соберите и запустите через Docker
```sh
docker build -t controlla .
docker run --rm \
-v $(pwd)/config.yaml:/app/config.yaml \
-v $(pwd)/skipped.yaml:/app/skipped.yaml \
-v ~/.ssh/id_rsa:/app/id_rsa:ro \
-e TELEGRAM_TOKEN=your_telegram_token \
-e TELEGRAM_CHAT_ID=your_chat_id \
controlla
```
---
## Telegram-бот
- Получайте уведомления о новых версиях образов
- Интерактивные кнопки: "Обновить", "Игнорировать"
- Команда `/ignore_image <image>` — добавить образ в глобальный ignore
---
## CI/CD (DroneCI)
Пример `.drone.yml` для автоматической сборки и публикации Docker-образа по git-тегу:
```yaml
kind: pipeline
type: docker
name: build-control-container
steps:
- name: build and push
image: plugins/docker
settings:
repo: registry.example.com/youruser/controlla
registry: git.kolspace.cc
tags:
- ${DRONE_TAG}
dockerfile: Dockerfile
context: .
platforms: linux/amd64,linux/arm64
username:
from_secret: registry_user
password:
from_secret: registry_pass
trigger:
event:
- tag
```
---
## Переменные окружения
- `TELEGRAM_TOKEN` — токен Telegram-бота
- `TELEGRAM_CHAT_ID` — ID чата для уведомлений
- `DOCKER_USER` / `DOCKER_PASS` — если нужен приватный доступ к DockerHub
---
## Структура проекта
```
internal/
checker/ — поиск и парсинг сервисов
config/ — работа с конфигом
gitrepo/ — git-операции
notifier/ — Telegram-уведомления
registry/ — работа с реестрами образов (dockerhub, ghcr, quay и др.)
skiplist/ — skiplist и глобальный ignore
updater/ — обновление тегов и git push
versionutils/ — сортировка и фильтрация версий
main.go — основной сервис и логика опроса
Dockerfile — сборка контейнера
.drone.yml — CI/CD pipeline
config.yaml — основной конфиг
skipped.yaml — skiplist и ignore-образы
```
---
## TODO / Roadmap
- [ ] Web-интерфейс для управления skiplist
- [ ] Поддержка других мессенджеров
- [ ] Расширенная аналитика по обновлениям
---
## Лицензия
MIT
---
**Контакты:**
[Telegram](https://t.me/yourusername)
[Git.Kolspace](https://git.kolspace.cc/victor.kolomin/controlla)
+22
View File
@@ -0,0 +1,22 @@
FROM public.ecr.aws/docker/library/golang:1.25.1-alpine3.22 AS builder
WORKDIR /app
COPY . .
# Binary compilation
RUN go build -o controlla .
# Final minimal image
FROM public.ecr.aws/docker/library/alpine:3.22.1
WORKDIR /app
# Копируем бинарник и всё нужное (например, config.yaml, skipped.yaml)
COPY --from=builder /app/controlla /app/
COPY config.yaml skipped.yaml /app/
# Если нужны ssh-ключи или другие файлы — добавь COPY
# Установи bash, если нужен (например, для скриптов)
RUN apk add --no-cache bash
CMD ["./controlla"]
+165 -1
View File
@@ -1,3 +1,167 @@
# Controlla
Custom image update controller with Telegram integration.
**Controlla** is an automated tool for monitoring and updating Docker images in your infrastructure repositories.
It scans your docker-compose files, checks for new image versions (using SemVer or digest fallback), notifies you via Telegram, and can automatically update tags and push changes to your git repository.
---
## Features
- Scans and parses all services and images in docker-compose files (YAML/Jinja2)
- Checks for new image versions (SemVer-aware, with digest fallback)
- Flexible filtering by keywords (e.g., `rc`, `nightly`, `test`, etc.)
- Skip list and global ignore for images (`skipped.yaml`)
- Interactive Telegram notifications (update/ignore buttons)
- Automatic tag update and git push
- Ready-to-use Docker image, CI/CD via DroneCI
---
## Quick Start
### 1. Clone the repository
```sh
git clone https://git.kolspace.cc/victor.kolomin/controlla.git
cd controlla
```
### 2. Configure
Edit `config.yaml`:
```yaml
git:
repo_url: "git@git.kolspace.cc:victor.kolomin/test-homelab.git"
local_repo_path: ./repos/myrepo
branch: "main"
ssh_key_path: "/app/id_rsa"
checker:
watch_folder: services
proposed_tags_count: 3
interval_minutes: 15
skip_list_file: "skipped.yaml"
ignore_keywords:
- rc
- alpha
- nightly
- test
- debug
- arm64v8
- arm32v7
- ubuntu
```
### 3. Fill in `skipped.yaml` (optional)
```yaml
updates:
- image: ghcr.io/lldap/lldap
new_tag: 2024.0.0-01-16
ignored_images:
- ghcr.io/immich-app/postgres
```
### 4. Build and run with Docker
```sh
docker build -t controlla .
docker run --rm \
-v $(pwd)/config.yaml:/app/config.yaml \
-v $(pwd)/skipped.yaml:/app/skipped.yaml \
-v ~/.ssh/id_rsa:/app/id_rsa:ro \
-e TELEGRAM_TOKEN=your_telegram_token \
-e TELEGRAM_CHAT_ID=your_chat_id \
controlla
```
---
## Telegram Bot
- Receive notifications about new image versions
- Interactive buttons: "Update", "Ignore"
- `/ignore_image <image>` command — add image to global ignore
---
## CI/CD (DroneCI)
Example `.drone.yml` for automatic Docker image build and push on git tag:
```yaml
kind: pipeline
type: docker
name: build-control-container
steps:
- name: build and push
image: plugins/docker
settings:
repo: registry.example.com/youruser/controlla
registry: git.kolspace.cc
tags:
- ${DRONE_TAG}
dockerfile: Dockerfile
context: .
platforms: linux/amd64,linux/arm64
username:
from_secret: registry_user
password:
from_secret: registry_pass
trigger:
event:
- tag
```
- The Docker image will be tagged with your git tag (e.g., `v0.1.0`).
---
## Environment Variables
- `TELEGRAM_TOKEN` — Telegram bot token
- `TELEGRAM_CHAT_ID` — Chat ID for notifications
- `DOCKER_USER` / `DOCKER_PASS` — for private DockerHub access (if needed)
---
## Project Structure
```
internal/
checker/ — service/image discovery and parsing
config/ — configuration management
gitrepo/ — git operations
notifier/ — Telegram notifications
registry/ — registry clients (dockerhub, ghcr, etc.)
skiplist/ — skiplist and global ignore logic
updater/ — tag update and git push
versionutils/ — version sorting and filtering
main.go — main service and polling logic
Dockerfile — container build
.drone.yml — CI/CD pipeline
config.yaml — main config
skipped.yaml — skiplist and ignored images
```
---
## Roadmap
- [ ] Web UI for skiplist management
- [ ] Support for other messengers
- [ ] Extended update analytics
---
## License
MIT
---
**Contacts:**
[Git.Kolspace](https://git.kolspace.cc/victor.kolomin/controlla)