Infrastructure monitoring and automation platform built with Rust
Weatherust is a comprehensive Rust-based monitoring and automation platform for infrastructure management, featuring weather monitoring, speed testing, health checks, and system updates across multiple servers.
- π€οΈ Weather Monitoring - OpenWeatherMap integration with 7-day forecasts
- β‘ Speed Testing - Ookla Speedtest CLI with threshold alerts
- π₯ Health Monitoring - Docker container health and resource tracking
- π¦ Update Monitoring - Multi-server OS and Docker image update detection
- π Update Automation - Remote update application and cleanup operations
- π Dual Notifications - Gotify and ntfy.sh support with action buttons
- π³ Docker-First - Containerized services with Ofelia scheduling
- π Security-Focused - Constant-time comparisons, minimal key exposure
- π Observable - Structured logging with tracing and metrics
- Docker and Docker Compose
- OpenWeatherMap API key (for weather service)
- Notification backend: Gotify and/or ntfy.sh
- SSH key for remote server access (for update services)
-
Clone and configure:
git clone https://github.com/jsprague84/weatherust.git cd weatherust cp .env.example .env -
Edit
.envand configure:# OpenWeatherMap OWM_API_KEY=your_api_key # Notifications (choose one or both) GOTIFY_URL=https://gotify.example.com/message WEATHERUST_GOTIFY_KEY=your_token # OR/AND NTFY_URL=https://ntfy.sh WEATHERUST_NTFY_TOPIC=weather # SSH for remote operations UPDATE_SSH_KEY=/home/user/.ssh/id_ed25519 UPDATE_SERVERS=server1:user@host1,server2:user@host2
-
Start the stack:
docker compose pull docker compose up -d
-
Verify:
docker compose logs -f ofelia docker compose ps
# Weather check
docker compose run --rm weatherust --zip 52726 --units imperial
# Speed test
docker compose run --rm speedynotify
# Health check
docker compose exec healthmon_runner /app/healthmon health
# Update monitor
docker compose exec updatemon_runner /app/updatemon --docker --local
# Update controller (list servers)
docker compose exec updatectl_runner /app/updatectl list servers| Service | Purpose | Schedule | Details |
|---|---|---|---|
| weatherust | Weather monitoring | Daily 05:30 | README |
| speedynotify | Internet speed tests | Daily 02:10 | Threshold alerts |
| healthmon | Container health | Every 5 min | CPU/MEM monitoring |
| updatemon | Update detection | Daily 03:00 | README |
| Service | Purpose | Access | Details |
|---|---|---|---|
| updatectl | Update controller | CLI + Webhook | README |
| updatectl_webhook | HTTP API | Port 8080 | API Docs |
- README.md (full) - Complete user documentation
- updatectl/README.md - Update controller guide
- updatemon/README.md - Update monitor guide
- Webhook API - Webhook API reference
- CLI Commands - Command reference
- CLAUDE.md - Quick reference for AI assistants
- Claude Code Guide - START HERE - Comprehensive development guide
- Architecture - System architecture and design
- Contributing - Development workflow and standards
- Modernization Summary - Recent improvements
- Code Examples - Code examples
- Documentation Index - Complete documentation navigation
# Build
cargo build --workspace
# Test
cargo test --workspace
# Run specific service
cargo run --bin updatectl -- list servers
# Format and lint
cargo fmt --all
cargo clippy --workspace -- -D warnings# Build all services
docker build -t weatherust:local .
docker build -f Dockerfile.updatectl -t updatectl:local .
docker build -f Dockerfile.healthmon -t healthmon:local .# Generate API docs
cargo doc --openFor detailed development instructions, see CONTRIBUTING.md.
GOTIFY_URL=https://gotify.example.com/message
# Service-specific tokens
WEATHERUST_GOTIFY_KEY=token1
UPDATEMON_GOTIFY_KEY=token2
UPDATECTL_GOTIFY_KEY=token3
HEALTHMON_GOTIFY_KEY=token4
SPEEDY_GOTIFY_KEY=token5NTFY_URL=https://ntfy.sh # or your server
NTFY_AUTH=token # optional for self-hosted
# Service-specific topics
WEATHERUST_NTFY_TOPIC=weather
UPDATEMON_NTFY_TOPIC=updates
UPDATECTL_NTFY_TOPIC=update-actions
HEALTHMON_NTFY_TOPIC=docker-health
SPEEDY_NTFY_TOPIC=speedtest# Format: name:user@host or user@host
UPDATE_SERVERS=Office-WS:user@192.168.1.10,Cloud-VM:user@remote.com
# SSH key (only this key is mounted to containers)
UPDATE_SSH_KEY=/home/user/.ssh/id_ed25519
# Local server name (optional)
UPDATE_LOCAL_NAME=docker-vmEdit docker-compose.yml Ofelia labels:
# Example: Run weatherust at 06:00 instead of 05:30
ofelia.job-exec.weatherust.schedule: "0 0 6 * * *"Cron format: second minute hour day month weekday
-
Pin versions in
.env:WEATHERUST_TAG=v1.0.0 UPDATECTL_TAG=v1.0.0 HEALTHMON_TAG=v1.0.0 UPDATEMON_TAG=v1.0.0 SPEEDYNOTIFY_TAG=v1.0.0
-
Configure secrets properly (see Security)
-
Deploy:
docker compose pull docker compose up -d
β DO:
- Mount only specific SSH key (
UPDATE_SSH_KEY) - Use service-specific notification tokens
- Pin Docker image versions for production
- Rotate secrets periodically
- Enable
--dry-runfor testing
β DON'T:
- Mount entire
.sshdirectory - Commit
.envfile - Use
latesttag in production - Share secrets between environments
# View logs
docker compose logs -f
# Check service status
docker compose ps
# View Ofelia schedule
docker compose logs ofelia
# Check specific service
docker compose logs -f updatectl_webhookβββββββββββββββββββββββββββββββββββββββββββ
β Ofelia Scheduler β
β (Cron-like for Docker) β
ββββββ¬βββββ¬βββββ¬βββββ¬βββββββββββββββββββββ
β β β β
βΌ βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββ
β weatherust speedynotify healthmon β
β updatemon β
ββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββ
β Notifications (Gotify / ntfy.sh) β
ββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββ ββββββββββββββββ
β updatectl β β updatectl β
β (CLI) β β (Webhook) β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β
βββββββββββ¬ββββββββββ
βΌ
βββββββββββββββββ
β Remote Serversβ
β via SSH β
βββββββββββββββββ
For detailed architecture, see ARCHITECTURE.md.
weatherust/
βββ common/ # Shared library
β βββ error.rs # Structured error types
β βββ constants.rs # Configuration constants
β βββ security.rs # Security utilities
β βββ retry.rs # Retry logic
β βββ ...
βββ weatherust/ # Weather monitoring
βββ speedynotify/ # Speed testing
βββ healthmon/ # Health monitoring
βββ updatemon/ # Update monitoring
βββ updatectl/ # Update controller
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our code standards
- Test thoroughly (
cargo test --workspace) - Commit using conventional commits
- Push and create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenWeatherMap - Weather data API
- Ookla Speedtest - Speed test CLI
- Ofelia - Docker job scheduler
- Gotify - Self-hosted notification server
- ntfy.sh - Open-source notification service
- Documentation: Check the docs section
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: For detailed user documentation including all configuration options, troubleshooting, and examples, see the full README.md.