How danroc/geoblock works
Main Components Identification
The system should be represented with these key components:
a) Core Service Components:
• Forward Auth Server (main HTTP service)
• Configuration Manager
• Rules Engine
• IP Resolution Service
• Metrics Collector
b) External Dependencies:
• GeoLite2 Database
• IP Location DB
• Reverse Proxies (Traefik/NGINX/Caddy)
Flow Representation
a) Request Flow:
Response back to Reverse Proxy (204 or 403)
b) Configuration Flow:
Auto-reload trigger → Rules Engine update
c) Database Updates:
• Daily automatic updates for GeoLite2 databases
Component Details
For each major component, include:
a) Forward Auth Server:
• HTTP endpoints
• Request validation
• Headers processing (X-Forwarded-*)
b) Rules Engine:
• Policy evaluation
• Country checking
• ASN verification
• Network matching
• Domain validation
c) IP Resolution:
• Geolocation lookup
• ASN resolution
• Network matching
Additional Elements
Include:
• Metrics collection flow
• Health check endpoint
• Configuration auto-reload mechanism
• Database update schedule
Technical Details
• Port 8080 for service
• Configuration file location (/etc/geoblock/config.yaml)
• Supported HTTP methods
• Response status codes (204, 403)
• Metrics format (JSON)
This system design should effectively communicate how Geoblock processes requests, evaluates rules, and integrates with reverse proxies while maintaining its configuration and databases.