Sign inSign up

webyhomelab/power-safety-ua

By webyhomelab

Updated 9 days ago

Autonomous monitoring of power outages, air raid alerts, AQI, and radiation.

Image
1

7.3K

webyhomelab/power-safety-ua repository overview

POWER⚡️ SAFETY (POWER-SAFETY-UA) - Docker Edition

Power-Safety-UA (formerly Flash Monitor Kyiv) is a professional autonomous monitoring system for critical infrastructure and environmental safety. The project provides precision real-time electricity monitoring, intelligent outage schedule processing (DTEK/Yasno), air raid alert tracking, air quality (AQI), and radiation background levels.

This is the official Docker Hub repository for Power-Safety-UA Docker Edition, optimized for rapid, isolated deployments.

🚀 Key Features & Innovations

  • Outage Monitoring: Dynamic tracking of electricity availability (online/offline) and analysis.
  • Smart Schedules: Intelligent parsing and merging of DTEK & Yasno outage schedules using "False Always Wins" logic (outages prioritized).
  • Environmental Security: Integrated real-time AQI (Air Quality Index), radiation, and weather monitoring.
  • Air Raid Alerts: Near-instant notifications for air raid status updates in Kyiv (Kyiv Air Raid Alert).
  • Web UI & Admin Panel: Elegant glassmorphic dashboard (PWA-enabled) and robust Admin panel for configuration and backups.
  • Telegram Bot Integration: Fully automated push reports, alerts, and graphs sent directly to your channel.

📦 Quick Start (Docker Compose)

Create a docker-compose.yml file with the following configuration:

services:
  flash-monitor:
    image: webyhomelab/power-safety-ua:latest
    container_name: flash-monitor
    restart: unless-stopped
    ports:
      - "5050:5050"
    volumes:
      - ./data:/app/data
    env_file:
      - .env
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5050/health', timeout=5)"]
      interval: 30s
      timeout: 10s
      retries: 3

  background-worker:
    image: webyhomelab/power-safety-ua:latest
    container_name: flash-monitor-worker
    restart: unless-stopped
    command: python app/run_background.py
    volumes:
      - ./data:/app/data
    env_file:
      - .env
    environment:
      - PYTHONPATH=/app
    healthcheck:
      disable: true

Create a .env file in the same directory:

TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
TELEGRAM_CHAT_ID="your_telegram_chat_or_channel_id"
SECRET_KEY="some_random_secure_string_for_sessions"

Start the containers:

docker compose up -d

🔑 Accessing the Admin Panel

The first time the container starts, it automatically generates a secure access token. You can retrieve it by running:

docker exec -it flash-monitor cat data/power_monitor_state.json | grep admin_token

Then navigate to: http://YOUR_SERVER_IP:5050/admin?t=YOUR_ADMIN_TOKEN


🇺🇦 Українська:

СВІТЛО⚡️ БЕЗПЕКА (POWER-SAFETY-UA) - Docker Edition

Power-Safety-UA — це професійна автономна система моніторингу критичної інфраструктури та екологічної безпеки. Проєкт забезпечує прецизійний моніторинг електропостачання в реальному часі, інтелектуальну обробку графіків відключень (DTEK/Yasno), відстеження повітряних тривог, якості повітря (AQI) та радіаційного фону.

🛠️ Встановлення та запуск

  1. Завантажте docker-compose.yml та створіть .env файл із токенами Telegram.
  2. Запустіть сервіс: docker compose up -d.
  3. Отримайте адмін-токен: docker exec -it flash-monitor cat data/power_monitor_state.json | grep admin_token.
  4. Відкрийте панель адміністрування: http://IP_СЕРВЕРА:5050/admin?t=ВАШ_ТОКЕН.

Tag summary

Content type

Image

Digest

sha256:1f8039547

Size

116.5 MB

Last updated

9 days ago

docker pull webyhomelab/power-safety-ua