Skip to content

Websites monitoring via GitHub Actions/API (expiration, security, performances, privacy, SEO)

Notifications You must be signed in to change notification settings

fabriziosalmi/websites-monitor

Repository files navigation

Website Monitor

GitHub Workflow Status

A comprehensive website monitoring framework with both automated daily checks and a powerful web interface. Monitor the health, security, performance, and compliance of your websites with 53+ different checks organized into logical categories.

Screenshot

screenshot

πŸš€ Quick Start

Web Interface

Run the local web interface for immediate testing:

python api.py

Then visit http://localhost:8000 for the interactive web interface.

Docker

Run with Docker for easy deployment:

docker run -p 8000:8000 fabriziosalmi/websites-monitor

GitHub Actions

Use the automated daily monitoring by configuring config.yaml and enabling GitHub Actions.

✨ Features

🌐 Web Interface

  • Interactive HTML interface for real-time website analysis
  • Category-based check selection for easier management
  • Mobile-responsive design
  • Real-time results display
  • No setup required - just run and test

πŸ”„ Automated Monitoring

  • Daily automated checks via GitHub Actions
  • Configurable scheduling and reporting
  • Automatic markdown report generation
  • GitHub integration with commit updates

πŸ“Š Comprehensive Analysis - 53+ Checks

Organized into 7 logical categories:

πŸ›‘οΈ Security & Protection (10 checks)

  • SSL Certificate validation
  • SSL Cipher Strength analysis
  • Security Headers assessment
  • HSTS (HTTP Strict Transport Security)
  • XSS Protection verification
  • CORS Headers analysis
  • Mixed Content detection
  • Subresource Integrity check
  • Rate Limiting detection
  • Data Leakage prevention

⚑ Performance & Speed (8 checks)

  • PageSpeed Insights score
  • Website Load Time measurement
  • Server Response Time analysis
  • Brotli Compression detection
  • Asset Minification verification
  • CDN Detection
  • Redirect Chains analysis
  • Redirects optimization

🎯 SEO & Content (9 checks)

  • Sitemap validation
  • Robots.txt verification
  • Open Graph Protocol compliance
  • Alt Tags for images
  • Semantic Markup analysis
  • URL Canonicalization
  • Favicon presence
  • Broken Links detection
  • External Links analysis

🌍 Domain & DNS (7 checks)

  • Domain Expiration monitoring
  • DNSSEC validation
  • DNS Blacklist checking
  • Domain Breach detection
  • Domain Blacklists verification
  • Subdomain Enumeration
  • Email Domain validation

πŸ”’ Privacy & Tracking (10 checks)

  • Cookie Policy compliance
  • Cookie Flags verification
  • Cookie Duration analysis
  • Cookie SameSite attributes
  • Ad & Tracking detection
  • FLoC (Federated Learning of Cohorts) detection
  • Privacy Exposure assessment
  • WHOIS Protection verification
  • Third-Party Requests monitoring
  • Third-Party Resources analysis

πŸ“± Accessibility & Mobile (5 checks)

  • Accessibility compliance
  • Mobile Friendly testing
  • AMP Compatibility
  • Internationalization support
  • Browser Compatibility

πŸ”§ Technical & Infrastructure (4 checks)

  • Content-Type Headers validation
  • CMS Detection
  • Client-Side Rendering analysis
  • Deprecated Libraries detection

πŸ› οΈ Multiple Interfaces

  • Web UI: Interactive browser-based interface
  • API: RESTful endpoints for integration
  • CLI: Command-line interface for automation
  • GitHub Actions: Automated daily monitoring

πŸ“š Documentation & API

  • Swagger UI at /docs for interactive API testing
  • ReDoc documentation at /redoc for detailed API reference
  • Comprehensive API endpoints for all monitoring functions
  • Docker support for easy deployment

πŸ“– How to Use

🌐 Web Interface Usage

  1. Quick Start:

    python api.py

    Open http://localhost:8000 in your browser.

  2. Using the Interface:

    • Enter a website URL in the input field
    • Select check categories you want to run
    • Click "Run Checks" to analyze the website
    • View real-time results with detailed explanations
  3. Categories Available:

    • Toggle entire categories on/off for easier management
    • Each category contains multiple related checks
    • Mobile-responsive interface works on all devices

🐳 Docker Usage

  1. Run with Docker:

    docker run -p 8000:8000 fabriziosalmi/websites-monitor
  2. Build from Source:

    docker build -t websites-monitor .
    docker run -p 8000:8000 websites-monitor

πŸ”„ GitHub Actions Setup

  1. Fork This Repository: Start by forking this repository to your GitHub account.

  2. Configure Websites:

    • Edit the config.yaml file
    • Add the websites you want to monitor:
    websites:
      - audiolibri.org
      - example.com
  3. Enable GitHub Actions:

    • Navigate to the "Actions" tab in your repository
    • Enable GitHub Actions with write permissions
  4. Set API Key Secret (Optional):

    • Get a Google PageSpeed Insights API key
    • Add it as a repository secret named PAGESPEED_API_KEY
  5. Create Report Template:

    • Create report_template.md in the root directory
    • Add your desired report template content
  6. Commit Changes:

    • Commit and push to trigger the initial report generation

πŸ› οΈ API Usage

Available Endpoints:

  • GET / - Web interface
  • POST /check - Run checks on a website
  • GET /docs - Swagger UI documentation
  • GET /redoc - ReDoc API documentation
  • GET /health - Health check endpoint

Example API Call:

curl -X POST "http://localhost:8000/check" \
     -H "Content-Type: application/json" \
     -d '{
       "url": "example.com",
       "checks": ["ssl_certificate", "security_headers", "performance"]
     }'

βš™οΈ Configuration Options

The config.yaml file supports:

  • websites: List of URLs to monitor
  • output_file: Report filename (default: README.md)
  • max_workers: Concurrent tasks for checks
  • timeout: Default timeout in seconds
  • report_template: Template filename (default: report_template.md)
  • github_workflow_badge: Workflow badge URL
  • pagespeed_api_key: Google PageSpeed API key

πŸ”§ Customizing Checks

  1. Add New Checks: Create new check functions in the checks directory
  2. Modify Existing: Edit files in checks/ directory
  3. Update Categories: Modify the category organization in main.py
  4. Check Format: Ensure functions return status emojis (🟒, πŸ”΄, 🟑, βšͺ)

πŸ“Š Understanding Results

Status Indicators:

  • 🟒 Success: Check passed successfully
  • πŸ”΄ Failed: Check failed or issue detected
  • 🟑 Warning: Check completed with warnings
  • βšͺ Error: Check could not be completed

Web Interface:

  • Real-time results display
  • Detailed explanations for each check
  • Category-based organization
  • Mobile-friendly responsive design

GitHub Reports:

  • Automatic markdown table generation
  • Daily updates via GitHub Actions
  • Historical tracking through git commits
  • Badge integration for status overview

πŸ›‘οΈ Security Features

  • SSL/TLS Analysis: Certificate validation, cipher strength, HSTS
  • Header Security: Security headers, XSS protection, CORS
  • Content Security: Mixed content detection, subresource integrity
  • Privacy Protection: Cookie analysis, tracking detection, data leakage

⚑ Performance Monitoring

  • Speed Analysis: Load times, server response, PageSpeed scores
  • Optimization: Compression, minification, CDN detection
  • Network: Redirect chains, external resource analysis

πŸ” SEO & Accessibility

  • SEO Compliance: Sitemaps, robots.txt, meta tags, structured data
  • Accessibility: WCAG compliance, mobile-friendly testing
  • Content Quality: Alt tags, semantic markup, internationalization

🐳 Docker Deployment

The project includes full Docker support for easy deployment:

# Available on Docker Hub
docker pull fabriziosalmi/websites-monitor

# Run with custom port
docker run -p 3000:8000 fabriziosalmi/websites-monitor

# Run with environment variables
docker run -e PAGESPEED_API_KEY=your_key fabriziosalmi/websites-monitor

πŸ“š API Documentation

Interactive Documentation:

  • Swagger UI: Visit /docs for interactive API testing
  • ReDoc: Visit /redoc for detailed API reference

Integration Examples:

  • REST API endpoints for all monitoring functions
  • JSON response format for easy integration
  • Comprehensive error handling and status codes

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add new checks in the checks/ directory
  4. Update documentation
  5. Submit a pull request

πŸ“„ License

This project is open source. See the license file for details.

πŸ’¬ Support

For issues or suggestions:

  • Open a GitHub issue
  • Check the documentation at /docs
  • Review existing issues and discussions

This comprehensive monitoring framework provides everything you need to keep your websites secure, fast, and compliant. Whether you prefer the interactive web interface, automated GitHub Actions, or API integration - Website Monitor has you covered.