# hrnskr/pfsense architecture

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

- Interactive diagram: https://gitdiagram.com/hrnskr/pfsense
- Repository: https://github.com/hrnskr/pfsense

## Overview

pfSense is a FreeBSD-based network firewall distribution managed primarily through a web interface. The user-facing workflow is to configure firewall policy, interfaces, network services, and VPNs, then inspect diagnostics and live status. The tree also shows account and certificate administration, captive portal, package management, and filesystem services. The README documents the web interface’s broad configuration role; sampled code confirms selected identity, certificate, VPN-authentication, dashboard, and filesystem behaviors. Most feature pages were not sampled, so their internal call relationships are not inferred.

Main entry points: [`src/usr/local/www/index.php`](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/index.php) (Configuration UI), [`src/usr/local/www/system_crlmanager.php`](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_crlmanager.php) (Revocation Lists), [`src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php`](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php) (Filesystem Model), [`src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php`](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php) (System Provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Web Management"]
  node_webui["Configuration UI<br/>[index.php]"]
end

subgraph group_network["Network Configuration"]
  node_firewall["Firewall Policy<br/>[firewall_rules.php]"]
  node_interfaces["Interfaces<br/>[interfaces.php]"]
  node_services["Network Services<br/>[services_dhcp.php]"]
end

subgraph group_operations["Operations and Status"]
  node_diagnostics["Diagnostics"]
  node_status["System Status<br/>[status.php]"]
  node_dashboard["Service Dashboard"]
  node_captive["Captive Portal<br/>[index.php]"]
end

subgraph group_identity["Identity and VPN"]
  node_users["User Management"]
  node_groups["Group Management"]
  node_ca["Certificate Authorities"]
  node_certificates["Certificates"]
  node_crls["Revocation Lists"]
  node_ipsec_auth["IPsec Authentication"]
  node_openvpn_auth["OpenVPN Authentication"]
end

subgraph group_filesystem["Filesystem Services"]
  node_filesystem_provider["System Provider<br/>[SystemProvider.php]"]
  node_filesystem_base["Provider Base"]
  node_filesystem_model["Filesystem Model<br/>[Filesystem.php]"]
end

node_operator(("Administrator"))

node_operator -->|"configures through"| node_webui
node_webui -->|"configures"| node_firewall
node_webui -->|"configures"| node_interfaces
node_webui -->|"configures"| node_services
node_webui -->|"accesses"| node_diagnostics
node_webui -->|"accesses"| node_status
node_webui -->|"manages"| node_captive
node_webui -->|"manages"| node_users
node_webui -->|"manages"| node_groups
node_webui -->|"manages"| node_ca
node_webui -->|"manages"| node_certificates
node_webui -->|"manages"| node_crls
node_webui -->|"views"| node_dashboard
node_crls -->|"refreshes VPN config"| node_ipsec_auth
node_crls -->|"refreshes VPN config"| node_openvpn_auth
node_filesystem_provider -->|"extends"| node_filesystem_base
node_filesystem_model -->|"builds child objects"| node_filesystem_model

click node_webui "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/index.php"
click node_firewall "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/firewall_rules.php"
click node_interfaces "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/interfaces.php"
click node_services "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/services_dhcp.php"
click node_diagnostics "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/diag_packet_capture.php"
click node_status "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/status.php"
click node_dashboard "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/widgets/widgets/services_status.widget.php"
click node_captive "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/captiveportal/index.php"
click node_users "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_usermanager.php"
click node_groups "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_groupmanager.php"
click node_ca "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_camanager.php"
click node_certificates "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_certmanager.php"
click node_crls "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_crlmanager.php"
click node_ipsec_auth "https://github.com/hrnskr/pfsense/blob/master/src/etc/inc/ipsec.auth-user.php"
click node_openvpn_auth "https://github.com/hrnskr/pfsense/blob/master/src/etc/inc/openvpn.auth-user.php"
click node_filesystem_provider "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php"
click node_filesystem_base "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Provider/AbstractProvider.php"
click node_filesystem_model "https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php"

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_webui toneBlue
class node_firewall,node_interfaces,node_services toneAmber
class node_diagnostics,node_status,node_dashboard,node_captive toneMint
class node_users,node_groups,node_ca,node_certificates,node_crls,node_ipsec_auth,node_openvpn_auth toneRose
class node_filesystem_provider,node_filesystem_base,node_filesystem_model,node_operator toneIndigo
```

## Components

### Web Management

- [Configuration UI](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/index.php): `src/usr/local/www/index.php`

### Network Configuration

- [Firewall Policy](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/firewall_rules.php): `src/usr/local/www/firewall_rules.php`
- [Interfaces](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/interfaces.php): `src/usr/local/www/interfaces.php`
- [Network Services](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/services_dhcp.php): `src/usr/local/www/services_dhcp.php`

### Operations and Status

- [Diagnostics](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/diag_packet_capture.php): `src/usr/local/www/diag_packet_capture.php`
- [System Status](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/status.php): `src/usr/local/www/status.php`
- [Service Dashboard](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/widgets/widgets/services_status.widget.php): `src/usr/local/www/widgets/widgets/services_status.widget.php`
- [Captive Portal](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/captiveportal/index.php): `src/usr/local/captiveportal/index.php`

### Identity and VPN

- [User Management](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_usermanager.php): `src/usr/local/www/system_usermanager.php`
- [Group Management](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_groupmanager.php): `src/usr/local/www/system_groupmanager.php`
- [Certificate Authorities](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_camanager.php): `src/usr/local/www/system_camanager.php`
- [Certificates](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_certmanager.php): `src/usr/local/www/system_certmanager.php`
- [Revocation Lists](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/www/system_crlmanager.php): `src/usr/local/www/system_crlmanager.php`
- [IPsec Authentication](https://github.com/hrnskr/pfsense/blob/master/src/etc/inc/ipsec.auth-user.php): `src/etc/inc/ipsec.auth-user.php`
- [OpenVPN Authentication](https://github.com/hrnskr/pfsense/blob/master/src/etc/inc/openvpn.auth-user.php): `src/etc/inc/openvpn.auth-user.php`

### Filesystem Services

- [System Provider](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php): `src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php`
- [Provider Base](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Provider/AbstractProvider.php): `src/usr/local/pfSense/include/Services/Filesystem/Provider/AbstractProvider.php`
- [Filesystem Model](https://github.com/hrnskr/pfsense/blob/master/src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php): `src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php`

### Other components

- **Administrator**

## Connections

- Administrator → Configuration UI: configures through
- Configuration UI → Firewall Policy: configures
- Configuration UI → Interfaces: configures
- Configuration UI → Network Services: configures
- Configuration UI → Diagnostics: accesses
- Configuration UI → System Status: accesses
- Configuration UI → Captive Portal: manages
- Configuration UI → User Management: manages
- Configuration UI → Group Management: manages
- Configuration UI → Certificate Authorities: manages
- Configuration UI → Certificates: manages
- Configuration UI → Revocation Lists: manages
- Configuration UI → Service Dashboard: views
- Revocation Lists → IPsec Authentication: refreshes VPN config (evidence: `src/usr/local/www/system_crlmanager.php`)
- Revocation Lists → OpenVPN Authentication: refreshes VPN config (evidence: `src/usr/local/www/system_crlmanager.php`)
- System Provider → Provider Base: extends (evidence: `src/usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php`)
- Filesystem Model → Filesystem Model: builds child objects (evidence: `src/usr/local/pfSense/include/Services/Filesystem/Filesystem.php`)
