# hypertrophic/hostlog architecture

> Architecture diagram of the GitHub repository hypertrophic/hostlog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hypertrophic/hostlog
- Repository: https://github.com/hypertrophic/hostlog

## Overview

HostLog logs PHP-site requests into per-domain daily files, then offers two analysis routes: a local Python report/blocklist workflow and a server-side PHP dashboard for live review and log management. The dashboard flow includes password login, analysis, alerts and flagged-request views, IP blocking, whitelist management, log download/deletion, and custom-field export. Logger behavior and dashboard analysis/action calls are visible in excerpts; other dashboard UI wiring and several local-analyzer details are documented but not fully sampled.

Main entry points: [`PUBLIC/dashboard/actions.php`](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/actions.php) (Dashboard actions), [`local-analyzer/analyzer.py`](https://github.com/hypertrophic/hostlog/blob/main/local-analyzer/analyzer.py) (Local analyzer), [`PUBLIC/dashboard/dashboard.php`](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/dashboard.php) (Dashboard analysis view), [`PRIVATE/hostinger-logger/logger.php`](https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostinger-logger/logger.php) (Request logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Request Capture"]
  node_logger["Request logger<br/>[logger.php]"]
  node_log_files[("Daily log files")]
end

subgraph group_local["Local Analysis"]
  node_local_analyzer["Local analyzer<br/>[analyzer.py]"]
  node_report["Analysis report"]
  node_blocklist["Generated blocklist"]
end

subgraph group_dashboard["Dashboard"]
  node_login["Login and lockout<br/>[index.php]"]
  node_dashboard_view["Dashboard analysis view<br/>[dashboard.php]"]
  node_php_analyzer["PHP analysis engine<br/>[analyzer.php]"]
  node_dashboard_actions["Dashboard actions<br/>[actions.php]"]
  node_dashboard_js["Dashboard interactions<br/>[app.js]"]
  node_htaccess["Site access rules"]
  node_whitelist_store[("Whitelist data")]
end

subgraph group_config["Configuration"]
  node_logger_config["Logger settings<br/>[config.php]"]
  node_local_config["Local analyzer settings<br/>[config.json]"]
  node_dashboard_config["Dashboard settings<br/>[config.php]"]
end

node_visitor(("Site visitor"))
node_local_operator(("Local operator"))
node_dashboard_user(("Dashboard user"))

node_visitor -->|"triggers request logging"| node_logger
node_logger -->|"loads settings"| node_logger_config
node_logger -->|"writes request logs"| node_log_files
node_local_operator -.->|"downloads logs"| node_log_files
node_local_operator -->|"runs analysis"| node_local_analyzer
node_local_analyzer -.->|"reads settings"| node_local_config
node_local_analyzer -.->|"reads downloaded logs"| node_log_files
node_local_analyzer -->|"generates report"| node_report
node_local_analyzer -->|"writes blocklist"| node_blocklist
node_dashboard_user -->|"submits credentials"| node_login
node_login -->|"redirects on success"| node_dashboard_view
node_dashboard_view -->|"loads settings"| node_dashboard_config
node_dashboard_view -->|"runs analysis"| node_php_analyzer
node_php_analyzer -->|"reads log files"| node_log_files
node_dashboard_view -.->|"requests actions"| node_dashboard_actions
node_dashboard_js -.->|"sends AJAX requests"| node_dashboard_actions
node_dashboard_actions -->|"loads settings"| node_dashboard_config
node_dashboard_actions -->|"analyzes custom data"| node_php_analyzer
node_dashboard_actions -->|"downloads or deletes"| node_log_files
node_dashboard_actions -->|"updates IP blocks"| node_htaccess
node_dashboard_actions -->|"updates whitelist"| node_whitelist_store

click node_logger "https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostinger-logger/logger.php"
click node_logger_config "https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostinger-logger/config.php"
click node_local_analyzer "https://github.com/hypertrophic/hostlog/blob/main/local-analyzer/analyzer.py"
click node_local_config "https://github.com/hypertrophic/hostlog/blob/main/local-analyzer/config.json"
click node_login "https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/index.php"
click node_dashboard_view "https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/dashboard.php"
click node_php_analyzer "https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostlog-config/analyzer.php"
click node_dashboard_config "https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostlog-config/config.php"
click node_dashboard_actions "https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/actions.php"
click node_dashboard_js "https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/assets/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_logger,node_log_files,node_dashboard_user toneBlue
class node_local_analyzer,node_report,node_blocklist toneAmber
class node_login,node_dashboard_view,node_php_analyzer,node_dashboard_actions,node_dashboard_js,node_htaccess,node_whitelist_store toneMint
class node_logger_config,node_local_config,node_dashboard_config toneRose
class node_visitor,node_local_operator toneIndigo
```

## Components

### Request Capture

- [Request logger](https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostinger-logger/logger.php): `PRIVATE/hostinger-logger/logger.php`
- **Daily log files**

### Local Analysis

- [Local analyzer](https://github.com/hypertrophic/hostlog/blob/main/local-analyzer/analyzer.py): `local-analyzer/analyzer.py`
- **Analysis report**
- **Generated blocklist**

### Dashboard

- [Login and lockout](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/index.php): `PUBLIC/dashboard/index.php`
- [Dashboard analysis view](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/dashboard.php): `PUBLIC/dashboard/dashboard.php`
- [PHP analysis engine](https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostlog-config/analyzer.php): `PRIVATE/hostlog-config/analyzer.php`
- [Dashboard actions](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/actions.php): `PUBLIC/dashboard/actions.php`
- [Dashboard interactions](https://github.com/hypertrophic/hostlog/blob/main/PUBLIC/dashboard/assets/app.js): `PUBLIC/dashboard/assets/app.js`
- **Site access rules**
- **Whitelist data**

### Configuration

- [Logger settings](https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostinger-logger/config.php): `PRIVATE/hostinger-logger/config.php`
- [Local analyzer settings](https://github.com/hypertrophic/hostlog/blob/main/local-analyzer/config.json): `local-analyzer/config.json`
- [Dashboard settings](https://github.com/hypertrophic/hostlog/blob/main/PRIVATE/hostlog-config/config.php): `PRIVATE/hostlog-config/config.php`

### Other components

- **Site visitor**
- **Local operator**
- **Dashboard user**

## Connections

- Site visitor → Request logger: triggers request logging (evidence: `README.md`)
- Request logger → Logger settings: loads settings (evidence: `PRIVATE/hostinger-logger/logger.php`)
- Request logger → Daily log files: writes request logs (evidence: `PRIVATE/hostinger-logger/logger.php`)
- Local operator → Daily log files: downloads logs (evidence: `README.md`)
- Local operator → Local analyzer: runs analysis (evidence: `local-analyzer/analyzer.py`)
- Local analyzer → Local analyzer settings: reads settings (evidence: `local-analyzer/analyzer.py`)
- Local analyzer → Daily log files: reads downloaded logs (evidence: `README.md`)
- Local analyzer → Analysis report: generates report (evidence: `README.md`)
- Local analyzer → Generated blocklist: writes blocklist (evidence: `local-analyzer/analyzer.py`)
- Dashboard user → Login and lockout: submits credentials (evidence: `PUBLIC/dashboard/index.php`)
- Login and lockout → Dashboard analysis view: redirects on success (evidence: `PUBLIC/dashboard/index.php`)
- Dashboard analysis view → Dashboard settings: loads settings (evidence: `PUBLIC/dashboard/dashboard.php`)
- Dashboard analysis view → PHP analysis engine: runs analysis (evidence: `PUBLIC/dashboard/dashboard.php`)
- PHP analysis engine → Daily log files: reads log files (evidence: `PRIVATE/hostlog-config/analyzer.php`)
- Dashboard analysis view → Dashboard actions: requests actions (evidence: `README.md`)
- Dashboard interactions → Dashboard actions: sends AJAX requests (evidence: `README.md`)
- Dashboard actions → Dashboard settings: loads settings (evidence: `PUBLIC/dashboard/actions.php`)
- Dashboard actions → PHP analysis engine: analyzes custom data (evidence: `PUBLIC/dashboard/actions.php`)
- Dashboard actions → Daily log files: downloads or deletes (evidence: `PUBLIC/dashboard/actions.php`)
- Dashboard actions → Site access rules: updates IP blocks (evidence: `PUBLIC/dashboard/actions.php`)
- Dashboard actions → Whitelist data: updates whitelist (evidence: `PUBLIC/dashboard/actions.php`)
