Remove Home Assistant addon integration

- Remove homeassistant-addon directory
- Remove addon workflow
- Remove repository.yaml
- Update README to focus on Docker and source installation
- Keep ARM/Raspberry Pi support (arm64, armv7)
This commit is contained in:
eduard256
2025-11-18 00:09:00 +03:00
parent 95a0fc2096
commit 1163af6fac
15 changed files with 1 additions and 1766 deletions
-155
View File
@@ -1,155 +0,0 @@
name: Home Assistant Add-on
on:
push:
branches:
- main
paths:
- 'homeassistant-addon/**'
- 'cmd/**'
- 'internal/**'
- 'pkg/**'
- 'data/**'
- 'webui/**'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- '.github/workflows/addon.yml'
tags:
- 'v*'
workflow_dispatch:
env:
BUILD_NAME: strix
jobs:
build:
name: Build Add-on
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
arch: [aarch64, amd64, armv7]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Get version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION="dev-$(git rev-parse --short HEAD)"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Build binary for ${{ matrix.arch }}
run: |
case "${{ matrix.arch }}" in
aarch64)
GOARCH=arm64
;;
amd64)
GOARCH=amd64
;;
armv7)
GOARCH=arm
GOARM=7
;;
esac
CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH GOARM=${GOARM:-} go build \
-ldflags="-s -w -X main.Version=${{ steps.version.outputs.version }}" \
-o homeassistant-addon/strix \
cmd/strix/main.go
- name: Copy required files
run: |
cp -r data homeassistant-addon/
cp -r webui homeassistant-addon/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./homeassistant-addon
file: ./homeassistant-addon/Dockerfile
platforms: linux/${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch == 'amd64' && 'amd64' || 'arm/v7' }}
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.repository_owner }}/strix-addon-${{ matrix.arch }}:latest
ghcr.io/${{ github.repository_owner }}/strix-addon-${{ matrix.arch }}:${{ steps.version.outputs.version }}
build-args: |
BUILD_FROM=ghcr.io/home-assistant/${{ matrix.arch }}-base:3.20
STRIX_VERSION=${{ steps.version.outputs.version }}
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
update-repository:
name: Update Repository File
needs: build
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION="dev-$(git rev-parse --short HEAD)"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update config.yaml version
run: |
sed -i "s/^version:.*/version: \"${{ steps.version.outputs.version }}\"/" homeassistant-addon/config.yaml
- name: Create/Update repository.yaml
run: |
cat > repository.yaml <<EOF
name: Strix Home Assistant Add-ons
url: https://github.com/${{ github.repository }}
maintainer: ${{ github.repository_owner }}
EOF
- name: Commit changes
if: startsWith(github.ref, 'refs/tags/')
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add homeassistant-addon/config.yaml repository.yaml
git diff --quiet && git diff --staged --quiet || git commit -m "Update add-on to version ${{ steps.version.outputs.version }}"
- name: Push changes
if: startsWith(github.ref, 'refs/tags/')
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
-310
View File
@@ -1,310 +0,0 @@
# 🎉 Home Assistant Add-on для Strix - Готов!
## ✅ Что сделано
Создан полностью функциональный Home Assistant Add-on с автоматизацией через GitHub Actions.
### 📦 Созданные файлы
```
homeassistant-addon/
├── config.yaml # HA конфигурация аддона
├── Dockerfile # Multi-arch Docker сборка
├── build.yaml # Настройки сборки (aarch64/amd64/armv7)
├── run.sh # Стартовый скрипт с интеграцией HA
├── README.md # Документация для пользователей (EN)
├── README-RU.md # Документация для пользователей (RU)
├── DOCS.md # Подробная инструкция по использованию
├── CHANGELOG.md # История изменений
├── INSTALLATION.md # Гайд по установке и публикации
├── icon.png.todo # Заметка - нужна иконка 128x128px
└── logo.png.todo # Заметка - нужен логотип 256x256px
.github/workflows/
└── addon.yml # GitHub Actions для автосборки
repository.yaml # Файл репозитория для HA
README.md (обновлен) # Добавлена секция про HA Add-on
```
## 🚀 Как это работает
### Автоматизация через GitHub Actions
При пуше в `main` или создании тега `v*`:
1. **Сборка для каждой архитектуры** (aarch64, amd64, armv7):
- Компиляция Go бинарника
- Копирование data и webui
- Создание Docker образа
- Публикация в GitHub Container Registry (ghcr.io)
2. **Обновление репозитория**:
- Автоматическое обновление версии в config.yaml
- Обновление repository.yaml
- Коммит изменений (только для тегов)
### Docker образы
Публикуются автоматически:
- `ghcr.io/eduard256/strix-addon-aarch64:latest`
- `ghcr.io/eduard256/strix-addon-amd64:latest`
- `ghcr.io/eduard256/strix-addon-armv7:latest`
С версионированием:
- `ghcr.io/eduard256/strix-addon-aarch64:1.0.0`
- и т.д.
## 🎯 Что дальше
### 1. Добавить иконки (опционально, но рекомендуется)
```bash
# Создать или добавить:
homeassistant-addon/icon.png # 128x128px
homeassistant-addon/logo.png # 256x256px
# Стиль: сова или камера, синий/белый (Home Assistant theme)
```
### 2. Первый релиз
```bash
# Закоммитить все изменения
git add .
git commit -m "Add Home Assistant Add-on v1.0.0"
git push origin main
# Создать тег релиза
git tag v1.0.0
git push origin v1.0.0
```
### 3. Дождаться сборки
GitHub Actions автоматически:
- Соберет все архитектуры
- Создаст Docker образы
- Опубликует в ghcr.io
Проверить статус: https://github.com/eduard256/Strix/actions
### 4. Установить в Home Assistant
#### Для пользователей:
1. **Supervisor****Add-on Store****⋮** (меню) → **Repositories**
2. Добавить репозиторий: `https://github.com/eduard256/Strix`
3. Найти **Strix Camera Discovery** в списке аддонов
4. Нажать **Install**
5. Настроить (если нужно)
6. Нажать **Start**
7. Нажать **Open Web UI**
## 🎨 Особенности реализации
### 1. Максимальное использование существующей инфраструктуры
- ✅ Использует существующий Dockerfile как основу
- ✅ Переиспользует Docker workflow
- ✅ Встраивается в существующий CI/CD пайплайн
- ✅ Не требует дублирования кода
### 2. Автоматизация
- ✅ Автоматическая сборка при пуше/теге
- ✅ Multi-arch сборка (3 архитектуры параллельно)
- ✅ Автоматическая публикация образов
- ✅ Автоматическое обновление версий
### 3. Интеграция с Home Assistant
- ✅ Ingress поддержка (встроенный iframe)
- ✅ Иконка в боковой панели
- ✅ Настройка через HA UI
- ✅ Логирование в HA
- ✅ Health check мониторинг
- ✅ Auto-start при загрузке
### 4. Безопасность
- ✅ Non-root пользователь (UID 1000)
- ✅ Минимальный Alpine образ
- ✅ Credentials не сохраняются
- ✅ Работа только в локальной сети
- ✅ Health check для мониторинга
## ⚙️ Конфигурация для пользователей
```yaml
log_level: info # debug, info, warn, error
port: 4567 # Порт веб-интерфейса (default: 4567)
strict_validation: true # Строгая валидация потоков
```
## 📊 Возможности аддона
- 🔍 **3,600+ камер** в базе данных
- 🌐 **ONVIF discovery** - автопоиск камер
-**Real-time SSE** - живые обновления
- 🎨 **WebUI** - красивый интерфейс
- 🔌 **RESTful API** - для автоматизации
- 🚀 **Fast concurrent testing** - параллельная проверка
- 📦 **All-in-one** - всё включено
## 🔄 Обновления
### Разработка (dev builds)
```bash
git add .
git commit -m "feat: new feature"
git push origin main
```
Создаст dev-сборку с тегом `dev-<git-hash>`.
### Релизы (production)
```bash
# 1. Обновить версию
sed -i 's/^version:.*/version: "1.1.0"/' homeassistant-addon/config.yaml
# 2. Обновить CHANGELOG.md
nano homeassistant-addon/CHANGELOG.md
# 3. Закоммитить и создать тег
git add .
git commit -m "release: v1.1.0"
git tag v1.1.0
git push origin main v1.1.0
```
Создаст релиз-сборку с тегом `1.1.0`.
## 📚 Документация
| Файл | Описание |
|------|----------|
| `README.md` | Краткое описание для пользователей (EN) |
| `README-RU.md` | Краткое описание для пользователей (RU) |
| `DOCS.md` | Полная документация по использованию |
| `CHANGELOG.md` | История версий и изменений |
| `INSTALLATION.md` | Инструкция для разработчиков/публикации |
## 🐛 Troubleshooting
### Сборка не прошла
1. Проверить GitHub Actions: https://github.com/eduard256/Strix/actions
2. Проверить логи ошибок
3. Частые проблемы:
- Ошибки компиляции Go → исправить в коде
- Ошибки Docker → проверить Dockerfile
- Права доступа → проверить GITHUB_TOKEN permissions
### Аддон не устанавливается
1. Проверить repository.yaml в корне репозитория
2. Убедиться что config.yaml валиден (YAML syntax)
3. Проверить что Docker образы опубликованы в ghcr.io
4. Проверить что URL репозитория правильный
### Аддон не запускается
1. Открыть логи в HA: **Addon page****Log** tab
2. Частые проблемы:
- Порт 4567 занят → изменить port в настройках
- Отсутствуют файлы data → проверить сборку
- Permission denied → проверить права в Dockerfile
## ✅ Чеклист перед первым релизом
- [x] Создана структура аддона
- [x] Настроен Dockerfile
- [x] Настроен GitHub Actions workflow
- [x] Создана документация (EN)
- [x] Создана документация (RU)
- [x] Обновлен основной README
- [x] Создан repository.yaml
- [ ] Добавлены иконки (icon.png, logo.png)
- [ ] Протестирована локальная сборка
- [ ] Создан git tag v1.0.0
- [ ] Проверена публикация в ghcr.io
- [ ] Протестирована установка в HA
## 🎁 Дополнительные возможности (будущее)
Можно добавить в будущих версиях:
- ✨ Автоматическое добавление камер как entities в HA
- 🔧 Генератор конфигов для go2rtc
- 📹 Генератор конфигов для Frigate
- 🔔 ONVIF события и уведомления
- 📸 Галерея снимков камер
- 🔍 Сетевой сканер для массового поиска
## 🤝 Распространение
### Вариант 1: Кастомный репозиторий (рекомендуется)
Пользователи добавляют репозиторий вручную.
**Преимущества:**
- Полный контроль
- Быстрые обновления
- Нет процесса одобрения
**Недостатки:**
- Нужно добавлять вручную
- Не в официальном store
### Вариант 2: Home Assistant Community Add-ons
Подать заявку в официальный репозиторий:
https://github.com/home-assistant/addons
**Преимущества:**
- Официальное признание
- Легче найти пользователям
- Автообновления
**Недостатки:**
- Строгие требования
- Процесс ревью
- Медленные обновления
## 🎉 Готово к использованию!
Всё готово для первого релиза. После добавления иконок и создания тега v1.0.0, аддон будет полностью готов к работе.
### Команды для быстрого старта:
```bash
# 1. Добавить иконки (опционально)
# Поместить icon.png и logo.png в homeassistant-addon/
# 2. Закоммитить
git add .
git commit -m "Add Home Assistant Add-on v1.0.0"
git push origin main
# 3. Создать релиз
git tag v1.0.0
git push origin v1.0.0
# 4. Дождаться окончания GitHub Actions
# https://github.com/eduard256/Strix/actions
# 5. Установить в Home Assistant
# Добавить репозиторий: https://github.com/eduard256/Strix
```
---
**Поделиться с сообществом:**
- 💬 Home Assistant Community Forum
- 🔴 Reddit r/homeassistant
- 💭 GitHub Discussions
- 💬 Discord серверы
+1 -18
View File
@@ -21,24 +21,7 @@ Strix is an intelligent IP camera stream discovery system that acts as a bridge
## 🚀 Quick Start ## 🚀 Quick Start
### Home Assistant Add-on (Recommended) ### Docker (Recommended)
The easiest way to use Strix is as a Home Assistant Add-on:
1. Add this repository to your Home Assistant:
- Go to **Supervisor****Add-on Store**
- Click **⋮** (menu) → **Repositories**
- Add: `https://github.com/eduard256/Strix`
2. Install the **Strix Camera Discovery** add-on
3. Start the add-on and open the Web UI
4. Start discovering your cameras!
For detailed installation instructions, see [Home Assistant Add-on Documentation](homeassistant-addon/DOCS.md).
### Docker
```bash ```bash
# Using Docker Compose (recommended) # Using Docker Compose (recommended)
-69
View File
@@ -1,69 +0,0 @@
# Changelog
All notable changes to this Home Assistant add-on will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.1] - 2025-11-17
### Fixed
- GitHub Actions permissions for publishing Docker images to ghcr.io
- Added `packages: write` permission to build job
- Added `contents: write` permission to update-repository job
## [1.0.0] - 2025-01-15
### Added
- Initial release of Strix Home Assistant Add-on
- Support for aarch64, amd64, and armv7 architectures
- Web UI integration with Home Assistant panel
- Ingress support for seamless integration
- Configurable port and logging options
- Strict validation mode toggle
- Health check monitoring
- Comprehensive documentation
- Multi-arch Docker builds via GitHub Actions
- Automatic updates through Home Assistant Supervisor
### Features
- 3,600+ camera models in database
- ONVIF discovery support
- Real-time stream discovery via SSE
- RESTful API for automation
- Fuzzy search for camera models
- Multiple stream protocol support (RTSP, HTTP, MJPEG, JPEG)
- FFProbe integration for stream validation
- Concurrent stream testing with worker pool
- Camera database with popular stream patterns
### Security
- Runs as non-root user (UID 1000)
- Minimal Alpine-based container
- No credential storage
- Local network only operation
- Read-only filesystem where possible
### Documentation
- Complete installation guide
- Configuration reference
- API documentation
- Troubleshooting guide
- Integration examples for HA, go2rtc, and Frigate
## [Unreleased]
### Planned
- Auto-discovery integration with Home Assistant
- Automatic camera entity creation
- go2rtc configuration generator
- Frigate configuration generator
- ONVIF event monitoring
- Motion detection API
- Camera snapshot gallery
- Network scanner for bulk discovery
- Custom camera database additions
---
**Full Changelog**: https://github.com/eduard256/Strix/commits/main/homeassistant-addon
-391
View File
@@ -1,391 +0,0 @@
# Strix Camera Discovery - Documentation
## Installation
### Method 1: Add Repository (Recommended)
1. Navigate to **Supervisor****Add-on Store** in your Home Assistant
2. Click the **⋮** menu (top right) → **Repositories**
3. Add repository URL: `https://github.com/eduard256/Strix`
4. Find **Strix Camera Discovery** in the store
5. Click **Install**
6. Configure the add-on (optional)
7. Click **Start**
8. Click **Open Web UI**
### Method 2: Manual Installation
1. SSH into your Home Assistant server
2. Navigate to the addons directory:
```bash
cd /addons
```
3. Clone the repository:
```bash
git clone https://github.com/eduard256/Strix
cd Strix/homeassistant-addon
```
4. Restart Home Assistant Supervisor
5. Find the add-on in the **Local Add-ons** section
## Configuration
The add-on can be configured through the Home Assistant UI:
```yaml
log_level: info
port: 4567
strict_validation: true
```
### Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `log_level` | string | `info` | Logging level: `debug`, `info`, `warn`, `error` |
| `port` | integer | `4567` | Port for web interface and API |
| `strict_validation` | boolean | `true` | Enable strict stream validation |
### Advanced Configuration
For advanced users, you can modify environment variables:
- `STRIX_LOG_LEVEL` - Log level (debug, info, warn, error)
- `STRIX_LOG_FORMAT` - Log format (json, text)
- `STRIX_API_LISTEN` - Server listen address (set via `port` option)
- `STRIX_DATA_PATH` - Camera database path (default: `/app/data`)
## Usage
### Quick Start Guide
1. **Open the Web UI**
- Click "Open Web UI" in the add-on panel
- Or navigate to: `http://homeassistant.local:4567`
2. **Find Your Camera Model**
- Use the search bar to find your camera
- Example: "Hikvision DS-2CD2032"
- Supports fuzzy search (typos are okay!)
3. **Discover Streams**
- Enter camera IP address (e.g., `192.168.1.100`)
- Enter credentials (username/password)
- Select discovered camera model
- Click "Discover Streams"
4. **Real-time Progress**
- Watch live updates as Strix tests different URLs
- See which streams are working
- Get detailed validation results
5. **Copy Stream URLs**
- Copy working URLs to use in Home Assistant
- Supports RTSP, HTTP, MJPEG, JPEG snapshots
### Camera Search
The search functionality includes:
- **3,600+ camera models** in database
- **Fuzzy matching** - handles typos and variations
- **Brand and model search** - search by manufacturer or model number
- **Popular cameras** - common models are prioritized
Example searches:
- "hikvision" - finds all Hikvision cameras
- "ds-2cd2032" - finds specific model
- "axis m1045" - finds AXIS camera
- "dahua ipc" - finds Dahua IP cameras
### Stream Discovery
Discovery process:
1. **ONVIF Discovery** - Attempts automatic detection via ONVIF protocol
2. **Model Patterns** - Tests URL patterns specific to camera model
3. **Popular Patterns** - Tests 150+ common stream URL patterns
4. **Validation** - Verifies each stream using ffprobe
Stream types discovered:
- RTSP streams (`rtsp://`)
- HTTP streams (`http://`)
- MJPEG streams (`http://.../video.cgi`)
- JPEG snapshots (`http://.../snapshot.jpg`)
### API Usage
#### Health Check
```bash
curl http://homeassistant.local:4567/api/v1/health
```
Response:
```json
{
"status": "ok",
"timestamp": "2025-01-15T10:30:00Z"
}
```
#### Camera Search
```bash
curl -X POST http://homeassistant.local:4567/api/v1/cameras/search \
-H "Content-Type: application/json" \
-d '{
"query": "hikvision",
"limit": 10
}'
```
Response:
```json
{
"cameras": [
{
"brand": "Hikvision",
"model": "DS-2CD2032-I",
"score": 0.95
}
],
"count": 1
}
```
#### Stream Discovery (Server-Sent Events)
```bash
curl -N -X POST http://homeassistant.local:4567/api/v1/streams/discover \
-H "Content-Type: application/json" \
-d '{
"target": "192.168.1.100",
"model": "hikvision ds-2cd2032",
"username": "admin",
"password": "password",
"timeout": 240,
"max_streams": 10
}'
```
SSE Events:
```
event: progress
data: {"message": "Testing RTSP stream...", "percent": 25}
event: stream_found
data: {"url": "rtsp://192.168.1.100:554/stream1", "type": "rtsp"}
event: complete
data: {"total_found": 3, "duration": 45.2}
```
## Integration with Home Assistant
### Generic Camera Platform
```yaml
camera:
- platform: generic
name: Front Door
still_image_url: http://192.168.1.100/snapshot.jpg
stream_source: rtsp://admin:password@192.168.1.100:554/stream1
verify_ssl: false
```
### go2rtc Integration
```yaml
go2rtc:
streams:
front_door:
- rtsp://admin:password@192.168.1.100:554/stream1
back_yard:
- rtsp://admin:password@192.168.1.101:554/stream1
```
### Frigate Integration
```yaml
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://admin:password@192.168.1.100:554/stream1
roles:
- detect
- record
```
## Troubleshooting
### Add-on won't start
Check the logs:
1. Go to **Supervisor** → **Strix Camera Discovery** → **Log**
2. Look for error messages
3. Common issues:
- Port 4567 already in use
- Insufficient resources
- Database files missing
### Can't find camera model
- Try different search terms (brand name, model number)
- Use partial model numbers
- Check the full database at: `/app/data/brands/`
- If camera not in database, use "Generic" or similar brand camera
### Discovery finds no streams
Possible causes:
1. **Wrong IP address** - Verify camera is reachable: `ping 192.168.1.100`
2. **Wrong credentials** - Double-check username/password
3. **Firewall blocking** - Ensure RTSP port (554) is accessible
4. **ONVIF disabled** - Enable ONVIF in camera settings
5. **Network isolation** - Camera and HA must be on same network
Debug steps:
```bash
# Test if camera responds
curl -u admin:password http://192.168.1.100/
# Test RTSP stream manually
ffprobe rtsp://admin:password@192.168.1.100:554/stream1
```
### FFProbe warnings
If you see "ffprobe not found" warnings:
- This is normal if ffprobe isn't installed
- Stream validation will be limited to HTTP checks
- RTSP streams may not be validated properly
- The add-on includes ffprobe by default
### Slow discovery
Discovery can take 2-4 minutes because:
- Testing 150+ URL patterns
- Validating each stream with ffprobe
- Network latency to camera
- Camera response time
To speed up:
- Select specific camera model (reduces URLs to test)
- Reduce `timeout` value (default: 240 seconds)
- Reduce `max_streams` (stops after N streams found)
### Port conflicts
If port 4567 is in use:
1. Change the `port` option in add-on configuration
2. Restart the add-on
3. Access Web UI at new port
## Performance
### Resource Usage
Typical resource consumption:
- **Memory**: 50-100 MB
- **CPU**: Low (spikes during discovery)
- **Disk**: ~50 MB (including database)
- **Network**: Depends on discovery activity
### Concurrent Discoveries
The add-on can handle multiple concurrent discovery requests:
- Uses worker pool (20 concurrent workers)
- Queues excess requests
- No limit on simultaneous users
## Security
### Network Security
- Add-on runs in Home Assistant network
- No external internet access required
- All traffic is local to your network
### Credentials
- Camera credentials never stored
- Sent only during discovery session
- Not logged (even in debug mode)
- Transmitted over local network only
### Container Security
- Runs as non-root user (UID 1000)
- Minimal attack surface (Alpine base)
- No unnecessary packages
- Read-only filesystem where possible
## Database
### Camera Database
Location: `/app/data/brands/`
Contains:
- 3,600+ camera models
- Organized by brand (JSON files)
- Stream URL patterns
- Query parameter variations
Format example:
```json
{
"brand": "Hikvision",
"models": [
{
"model": "DS-2CD2032-I",
"patterns": [
"/Streaming/channels/101",
"/h264/ch1/main/av_stream"
]
}
]
}
```
### Updating Database
Database updates come with add-on updates:
- Check for updates in Add-on Store
- Updates include new camera models
- No manual database updates needed
## Support
### Getting Help
1. **Documentation**: Read this guide thoroughly
2. **Logs**: Check add-on logs for errors
3. **GitHub Issues**: https://github.com/eduard256/Strix/issues
4. **Community**: Home Assistant Community Forum
### Reporting Bugs
Include in bug reports:
1. Home Assistant version
2. Add-on version
3. Full logs from add-on
4. Camera brand/model
5. Steps to reproduce
### Feature Requests
Submit feature requests on GitHub with:
- Clear description of feature
- Use case / why it's needed
- Any relevant examples
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for version history.
## License
MIT License - See [LICENSE](https://github.com/eduard256/Strix/blob/main/LICENSE)
-44
View File
@@ -1,44 +0,0 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}
# Install runtime dependencies
RUN apk add --no-cache \
ffmpeg \
ca-certificates \
tzdata \
wget \
&& rm -rf /var/cache/apk/*
# Set working directory
WORKDIR /app
# Copy binary from build context
COPY strix /app/strix
# Copy camera database (CRITICAL)
COPY data /app/data
# Copy WebUI files
COPY webui /app/webui
# Copy run script
COPY run.sh /
RUN chmod a+x /run.sh
# Create non-root user for security
RUN addgroup -g 1000 strix && \
adduser -D -u 1000 -G strix strix && \
chown -R strix:strix /app
# Switch to non-root user
USER strix
# Expose default port
EXPOSE 4567
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:4567/api/v1/health || exit 1
# Start application
CMD ["/run.sh"]
-274
View File
@@ -1,274 +0,0 @@
# Home Assistant Add-on Installation Guide
This guide explains how to set up and publish the Strix Home Assistant Add-on.
## 📋 Overview
The add-on structure is ready and includes:
-`config.yaml` - Add-on configuration
-`Dockerfile` - Multi-arch Docker build
-`build.yaml` - Build configuration for aarch64/amd64/armv7
-`run.sh` - Startup script with HA integration
-`README.md` - User-facing documentation
-`DOCS.md` - Comprehensive usage guide
-`CHANGELOG.md` - Version history
- ✅ GitHub Actions workflow for automated builds
## 🚀 Quick Deployment
### Step 1: Enable GitHub Actions
The `.github/workflows/addon.yml` workflow will automatically:
1. Build binaries for all architectures (aarch64, amd64, armv7)
2. Create multi-arch Docker images
3. Push to GitHub Container Registry (ghcr.io)
4. Update version numbers on tags
No manual setup needed - just push to GitHub!
### Step 2: Create First Release
```bash
# Make sure all changes are committed
git add .
git commit -m "Add Home Assistant Add-on"
# Push to main branch (this will trigger a dev build)
git push origin main
# Create and push a version tag (this will trigger a release build)
git tag v1.0.0
git push origin v1.0.0
```
The GitHub Action will automatically build and publish Docker images to:
- `ghcr.io/eduard256/strix-addon-aarch64:latest`
- `ghcr.io/eduard256/strix-addon-amd64:latest`
- `ghcr.io/eduard256/strix-addon-armv7:latest`
### Step 3: Add Icons (Optional but Recommended)
Add these files to `homeassistant-addon/`:
- `icon.png` - 128x128px icon for the add-on store
- `logo.png` - 256x256px logo for the add-on page
Recommended: Simple owl or camera icon in Home Assistant style (blue/white theme).
### Step 4: Test Installation
After the GitHub Action completes:
1. In Home Assistant, go to **Supervisor****Add-on Store**
2. Click **⋮** (menu) → **Repositories**
3. Add: `https://github.com/eduard256/Strix`
4. Find "Strix Camera Discovery" in the store
5. Click **Install**
6. Configure and start the add-on
7. Click **Open Web UI**
## 🔄 Updating the Add-on
### For New Features/Fixes
```bash
# Make your changes to the codebase
git add .
git commit -m "feat: add new feature"
git push origin main
```
The dev build will automatically trigger, creating images tagged with `dev-<git-hash>`.
### For New Releases
```bash
# Update version in homeassistant-addon/config.yaml
sed -i 's/^version:.*/version: "1.1.0"/' homeassistant-addon/config.yaml
# Update CHANGELOG.md
# Add new version section
# Commit and tag
git add homeassistant-addon/config.yaml homeassistant-addon/CHANGELOG.md
git commit -m "release: v1.1.0"
git tag v1.1.0
git push origin main
git push origin v1.1.0
```
The release build will automatically create versioned images.
## 📦 Manual Build (Optional)
If you need to build locally for testing:
```bash
# Build for your architecture
cd homeassistant-addon
# Build the Go binary
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -w" \
-o strix \
../cmd/strix/main.go
# Copy required files
cp -r ../data .
cp -r ../webui .
# Build Docker image
docker build \
--build-arg BUILD_FROM=ghcr.io/home-assistant/amd64-base:3.20 \
-t strix-addon:test .
# Test the image
docker run --rm -p 4567:4567 strix-addon:test
```
## 🔧 Configuration Options
Users can configure the add-on through the Home Assistant UI:
### Default Configuration
```yaml
log_level: info
port: 4567
strict_validation: true
```
### Advanced Options
Edit `homeassistant-addon/config.yaml` to add more options:
```yaml
options:
log_level: info
port: 4567
strict_validation: true
# Add new options here
schema:
log_level: list(debug|info|warn|error)
port: port
strict_validation: bool
# Add new option schemas here
```
Then update `run.sh` to use the new options:
```bash
NEW_OPTION=$(bashio::config 'new_option')
export STRIX_NEW_OPTION="${NEW_OPTION}"
```
## 🌐 Publishing to Community
### Option 1: Keep as Custom Repository (Recommended for Start)
Users add your repository manually:
```
https://github.com/eduard256/Strix
```
**Pros:**
- Full control
- Faster updates
- No approval process
**Cons:**
- Users must add repository manually
- Not in official add-on store
### Option 2: Submit to Home Assistant Community Add-ons
To get listed in the official community store:
1. Follow Home Assistant Add-on guidelines:
https://developers.home-assistant.io/docs/add-ons/
2. Submit to Community Add-ons repository:
https://github.com/home-assistant/addons
3. Wait for review and approval
**Pros:**
- Official recognition
- Easier for users to find
- Auto-update support
**Cons:**
- Strict guidelines
- Review process
- Slower updates
## 📊 Monitoring Builds
Check GitHub Actions status:
```
https://github.com/eduard256/Strix/actions
```
View published images:
```
https://github.com/eduard256/Strix/pkgs/container/strix-addon-amd64
https://github.com/eduard256/Strix/pkgs/container/strix-addon-aarch64
https://github.com/eduard256/Strix/pkgs/container/strix-addon-armv7
```
## 🐛 Troubleshooting
### Build Fails
Check GitHub Actions logs for errors. Common issues:
- Go build errors → Fix in main codebase
- Docker build errors → Check Dockerfile
- Permission errors → Ensure GITHUB_TOKEN has required permissions
### Add-on Won't Install
- Verify config.yaml syntax
- Check Docker images are published to ghcr.io
- Ensure repository.yaml is in root directory
- Verify architecture support matches user's system
### Add-on Won't Start
Check add-on logs in Home Assistant:
- Go to add-on page → **Log** tab
- Look for startup errors
- Common issues:
- Port already in use
- Missing data files
- Permission errors
## 📚 Resources
- [Home Assistant Add-on Documentation](https://developers.home-assistant.io/docs/add-ons/)
- [Add-on Configuration](https://developers.home-assistant.io/docs/add-ons/configuration)
- [Add-on Testing](https://developers.home-assistant.io/docs/add-ons/testing)
- [GitHub Actions](https://docs.github.com/en/actions)
## ✅ Checklist
Before first release:
- [ ] All code tested and working
- [ ] Version set in config.yaml
- [ ] CHANGELOG.md updated
- [ ] Icons added (icon.png, logo.png)
- [ ] README.md reviewed
- [ ] DOCS.md reviewed
- [ ] GitHub Actions workflow tested
- [ ] Repository URL correct in config files
- [ ] Git tag created (v1.0.0)
- [ ] Docker images published to ghcr.io
- [ ] Test installation in Home Assistant
## 🎉 You're Ready!
Once you've completed the checklist above, your Home Assistant Add-on is ready for users!
Share it with the community:
- Home Assistant Forums
- Reddit r/homeassistant
- GitHub Discussions
- Discord servers
-261
View File
@@ -1,261 +0,0 @@
# Strix - Home Assistant Add-on
## 🎯 Что создано
Полностью готовый Home Assistant Add-on для Strix с автоматической сборкой и публикацией.
## 📁 Структура
```
homeassistant-addon/
├── config.yaml # Конфигурация аддона для HA
├── Dockerfile # Multi-arch Docker образ
├── build.yaml # Настройки сборки (aarch64/amd64/armv7)
├── run.sh # Скрипт запуска с интеграцией HA
├── README.md # Документация для пользователей (EN)
├── README-RU.md # Документация для пользователей (RU)
├── DOCS.md # Подробная документация
├── CHANGELOG.md # История версий
├── INSTALLATION.md # Инструкция по установке и публикации
├── icon.png.todo # Заметка про иконку 128x128
└── logo.png.todo # Заметка про логотип 256x256
```
## ✨ Возможности
-**Автоматическая сборка** через GitHub Actions
-**Multi-arch поддержка**: aarch64, amd64, armv7
-**Web UI интеграция** в боковую панель Home Assistant
-**Ingress поддержка** для бесшовной интеграции
-**Настройка через UI** Home Assistant
-**Автообновления** через Supervisor
-**Полная документация** на русском и английском
## 🚀 Быстрый старт
### 1. Завершить подготовку
```bash
# Добавить иконки (опционально, но рекомендуется)
# - icon.png (128x128px)
# - logo.png (256x256px)
# Закоммитить все изменения
git add .
git commit -m "Add Home Assistant Add-on"
git push origin main
```
### 2. Создать релиз
```bash
# Создать тег версии
git tag v1.0.0
git push origin v1.0.0
```
GitHub Actions автоматически:
- Соберет бинарники для всех архитектур
- Создаст Docker образы
- Опубликует в GitHub Container Registry
### 3. Установить в Home Assistant
1. **Supervisor****Add-on Store****⋮** → **Repositories**
2. Добавить: `https://github.com/eduard256/Strix`
3. Найти **Strix Camera Discovery**
4. Нажать **Install**
5. Нажать **Start**
6. Нажать **Open Web UI**
## ⚙️ Конфигурация
Пользователи могут настроить через UI Home Assistant:
```yaml
log_level: info # debug, info, warn, error
port: 4567 # Порт веб-интерфейса
strict_validation: true # Строгая валидация потоков
```
## 🔄 Обновление
### Новые функции/исправления
```bash
git add .
git commit -m "feat: новая функция"
git push origin main
```
Автоматически создастся dev-сборка.
### Новый релиз
```bash
# Обновить версию
sed -i 's/^version:.*/version: "1.1.0"/' homeassistant-addon/config.yaml
# Обновить CHANGELOG.md
nano homeassistant-addon/CHANGELOG.md
# Закоммитить и создать тег
git add .
git commit -m "release: v1.1.0"
git tag v1.1.0
git push origin main v1.1.0
```
## 🏗️ Как это работает
### GitHub Actions Workflow
Файл: `.github/workflows/addon.yml`
При пуше в `main` или создании тега `v*`:
1. **Build Stage** (для каждой архитектуры):
- Собирает Go бинарник
- Копирует данные и WebUI
- Создает Docker образ
- Публикует в ghcr.io
2. **Update Repository**:
- Обновляет версию в config.yaml
- Обновляет repository.yaml
- Коммитит изменения (только для тегов)
### Docker Images
Публикуются в GitHub Container Registry:
- `ghcr.io/eduard256/strix-addon-aarch64:latest`
- `ghcr.io/eduard256/strix-addon-amd64:latest`
- `ghcr.io/eduard256/strix-addon-armv7:latest`
Версионные теги:
- `ghcr.io/eduard256/strix-addon-aarch64:1.0.0`
- и т.д.
## 📦 Что включено
### Runtime зависимости
- **ffmpeg** - для валидации RTSP потоков
- **ca-certificates** - для HTTPS
- **tzdata** - для корректных временных меток
- **wget** - для healthcheck
### Данные приложения
- **База камер** - 3,600+ моделей
- **WebUI** - встроенный веб-интерфейс
- **API** - RESTful API для автоматизации
## 🔒 Безопасность
- Запуск от non-root пользователя (UID 1000)
- Минимальный Alpine образ
- Отсутствие хранения credentials
- Работа только в локальной сети
## 📚 Документация
- **README.md** - Краткое описание для пользователей
- **DOCS.md** - Полная документация по использованию
- **CHANGELOG.md** - История изменений
- **INSTALLATION.md** - Инструкция для разработчиков
## 🎨 TODO (опционально)
1. **Иконки**:
- Создать `icon.png` (128x128px)
- Создать `logo.png` (256x256px)
- Стиль: сова или камера, синий/белый (Home Assistant style)
2. **Улучшения**:
- Добавить скриншоты в README.md
- Создать видео-инструкцию
- Перевести DOCS.md на русский
3. **Интеграции**:
- Автоматическое добавление камер в HA
- Генератор конфигов для go2rtc
- Генератор конфигов для Frigate
## 🤝 Публикация
### Вариант 1: Кастомный репозиторий (Рекомендуется)
Пользователи добавляют вручную:
```
https://github.com/eduard256/Strix
```
**Плюсы**:
- Полный контроль
- Быстрые обновления
- Нет процесса одобрения
### Вариант 2: Home Assistant Community Add-ons
Отправить в официальный репозиторий:
https://github.com/home-assistant/addons
**Плюсы**:
- Официальное признание
- Проще найти пользователям
- Автообновления
**Минусы**:
- Строгие требования
- Процесс ревью
- Медленные обновления
## 🐛 Решение проблем
### Сборка не прошла
Проверить GitHub Actions:
```
https://github.com/eduard256/Strix/actions
```
### Аддон не устанавливается
- Проверить синтаксис config.yaml
- Убедиться что образы опубликованы в ghcr.io
- Проверить repository.yaml в корне
### Аддон не запускается
Смотреть логи в Home Assistant:
- Страница аддона → вкладка **Log**
- Частые проблемы:
- Порт занят
- Отсутствуют файлы данных
- Ошибки прав доступа
## ✅ Чеклист перед релизом
- [ ] Код протестирован
- [ ] Версия установлена в config.yaml
- [ ] CHANGELOG.md обновлен
- [ ] Иконки добавлены (опционально)
- [ ] README.md проверен
- [ ] DOCS.md проверен
- [ ] GitHub Actions протестирован
- [ ] Создан git тег (v1.0.0)
- [ ] Docker образы опубликованы
- [ ] Тестовая установка в Home Assistant
## 🎉 Готово!
После выполнения чеклиста ваш Home Assistant Add-on готов к использованию!
Поделитесь с сообществом:
- Форум Home Assistant
- Reddit r/homeassistant
- GitHub Discussions
- Discord серверы
---
**Вопросы?** Создайте Issue на GitHub: https://github.com/eduard256/Strix/issues
-145
View File
@@ -1,145 +0,0 @@
# Home Assistant Add-on: Strix Camera Discovery
![Supports aarch64 Architecture][aarch64-shield]
![Supports amd64 Architecture][amd64-shield]
![Supports armv7 Architecture][armv7-shield]
Strix is a smart IP camera stream discovery system that automatically finds and validates camera streams. It eliminates the need for manual URL configuration by using ONVIF discovery, comprehensive camera database, and intelligent stream testing.
## About
This add-on provides Strix - an intelligent camera discovery service for Home Assistant. It includes:
- **3,600+ Camera Models Database** - Comprehensive coverage of IP camera brands and models
- **ONVIF Discovery** - Automatic camera detection on your network
- **Smart Stream Testing** - Validates RTSP, HTTP, MJPEG, and JPEG snapshot URLs
- **Real-time Updates** - Server-Sent Events (SSE) for live discovery progress
- **Web Interface** - Beautiful UI for easy camera management
- **RESTful API** - Integrate with your automation workflows
## Installation
1. Add this repository to your Home Assistant Add-on Store:
- Click on "Add-on Store" in the Home Assistant Supervisor panel
- Click the three dots menu (top right) and select "Repositories"
- Add the URL: `https://github.com/eduard256/Strix`
- Click "Add"
2. Find "Strix Camera Discovery" in the add-on store and click "Install"
3. After installation, click "Start" to run the add-on
4. Open the Web UI by clicking "Open Web UI" button
## Configuration
```yaml
log_level: info
port: 4567
strict_validation: true
```
### Option: `log_level`
The `log_level` option controls the level of log output by the addon.
- `debug` - Shows detailed debug information
- `info` - Normal (default) log level
- `warn` - Only warnings and errors
- `error` - Only errors
### Option: `port`
The `port` option allows you to change the port on which Strix runs. Default is `4567`.
### Option: `strict_validation`
When enabled (default), Strix performs stricter stream validation:
- Verifies minimum image sizes for snapshots
- Requires at least one video stream in RTSP sources
- Reduces false positives
## How to use
1. **Open the Web UI** - Click "Open Web UI" in the add-on panel or navigate to `http://homeassistant.local:4567`
2. **Search for Camera** - Enter your camera brand/model (e.g., "Hikvision DS-2CD2032")
3. **Discover Streams** - Enter camera IP, credentials, and click "Discover"
4. **Get Stream URLs** - Copy working stream URLs for use in Home Assistant
## Example: Adding discovered camera to Home Assistant
After discovering a camera stream, add it to your `configuration.yaml`:
```yaml
camera:
- platform: generic
name: Front Door Camera
still_image_url: http://192.168.1.100/snapshot.jpg
stream_source: rtsp://admin:password@192.168.1.100:554/stream1
```
Or use with go2rtc for better performance:
```yaml
go2rtc:
streams:
front_door: rtsp://admin:password@192.168.1.100:554/stream1
```
## API Endpoints
The add-on exposes the following API endpoints:
### Health Check
```bash
GET http://homeassistant.local:4567/api/v1/health
```
### Camera Search
```bash
POST http://homeassistant.local:4567/api/v1/cameras/search
Content-Type: application/json
{
"query": "hikvision",
"limit": 10
}
```
### Stream Discovery (SSE)
```bash
POST http://homeassistant.local:4567/api/v1/streams/discover
Content-Type: application/json
{
"target": "192.168.1.100",
"model": "hikvision ds-2cd2032",
"username": "admin",
"password": "password",
"timeout": 240,
"max_streams": 10
}
```
## Support
Got questions or issues?
- [GitHub Issues](https://github.com/eduard256/Strix/issues)
- [Home Assistant Community](https://community.home-assistant.io/)
## Contributing
This is an active open-source project. We are always open to people who want to
use the code or contribute to it.
## License
MIT License - see the [LICENSE](https://github.com/eduard256/Strix/blob/main/LICENSE) file for details
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
-11
View File
@@ -1,11 +0,0 @@
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base:3.20
amd64: ghcr.io/home-assistant/amd64-base:3.20
armv7: ghcr.io/home-assistant/armv7-base:3.20
labels:
org.opencontainers.image.title: "Strix Camera Discovery"
org.opencontainers.image.description: "Smart IP camera stream discovery system"
org.opencontainers.image.source: "https://github.com/eduard256/Strix"
org.opencontainers.image.licenses: "MIT"
args:
STRIX_VERSION: "1.0.0"
-33
View File
@@ -1,33 +0,0 @@
name: Strix - Camera Stream Discovery
version: "1.0.1"
slug: strix
description: Smart IP camera stream discovery system with ONVIF support and comprehensive camera database
url: https://github.com/eduard256/Strix
arch:
- aarch64
- amd64
- armv7
init: false
startup: application
boot: auto
host_network: true
panel_icon: mdi:cctv
panel_title: Strix
panel_admin: false
webui: http://[HOST]:4567
ingress: true
ingress_port: 4567
ingress_stream: true
ports:
4567/tcp: 4567
ports_description:
4567/tcp: Web interface and API
options:
log_level: info
port: 4567
strict_validation: true
schema:
log_level: list(debug|info|warn|error)
port: port
strict_validation: bool
image: ghcr.io/eduard256/strix-addon-{arch}
-6
View File
@@ -1,6 +0,0 @@
TODO: Add 128x128px PNG icon for the add-on
The icon should represent Strix (owl/camera theme)
Recommended: Use a simple owl silhouette or camera icon in Home Assistant style
Place the file as: homeassistant-addon/icon.png
For now, you can use any 128x128 PNG image as a placeholder.
-6
View File
@@ -1,6 +0,0 @@
TODO: Add 256x256px PNG logo for the add-on
The logo should represent Strix branding
Recommended: Higher resolution version of the icon
Place the file as: homeassistant-addon/logo.png
For now, you can use any 256x256 PNG image as a placeholder.
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/with-contenv bashio
# Get configuration from Home Assistant
LOG_LEVEL=$(bashio::config 'log_level')
PORT=$(bashio::config 'port')
STRICT_VALIDATION=$(bashio::config 'strict_validation')
# Print banner
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
bashio::log.info " ____ _ _ "
bashio::log.info " / ___|| |_ _ __(_)_ __"
bashio::log.info " \___ \| __| '__| \ \/ /"
bashio::log.info " ___) | |_| | | |> < "
bashio::log.info " |____/ \__|_| |_/_/\_\\"
bashio::log.info ""
bashio::log.info " Smart IP Camera Stream Discovery System"
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Set environment variables
export STRIX_LOG_LEVEL="${LOG_LEVEL}"
export STRIX_LOG_FORMAT="json"
export STRIX_API_LISTEN=":${PORT}"
export STRIX_DATA_PATH="/app/data"
bashio::log.info "Starting Strix with the following configuration:"
bashio::log.info " - Log Level: ${LOG_LEVEL}"
bashio::log.info " - Port: ${PORT}"
bashio::log.info " - Strict Validation: ${STRICT_VALIDATION}"
bashio::log.info " - Data Path: ${STRIX_DATA_PATH}"
# Check if ffprobe is available
if command -v ffprobe &> /dev/null; then
bashio::log.info "FFProbe found: $(ffprobe -version | head -n1)"
else
bashio::log.warning "FFProbe not found, stream validation will be limited"
fi
# Start Strix
bashio::log.info "Starting Strix server..."
exec /app/strix
-3
View File
@@ -1,3 +0,0 @@
name: Strix Home Assistant Add-ons
url: https://github.com/eduard256/Strix
maintainer: eduard256