Documentation
¶
Overview ¶
============================================================================= NFTBan v1.73 - Installer Conflict Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-conflicts" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Conflicting firewall detection (services + ghost nft tables)" meta:inventory.files="internal/installer/detect/conflicts.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
============================================================================= NFTBan v1.73 - Installer CT Limits Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-ctlimits" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="DDoS connection tracking limit reads from config" meta:inventory.files="internal/installer/detect/ctlimits.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/etc/nftban/conf.d/ddos/classic.conf" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
============================================================================= NFTBan v1.73 - Installer Distro Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-distro" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="OS distribution detection and nftables.conf path resolution" meta:inventory.files="internal/installer/detect/distro.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/etc/os-release" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
============================================================================= NFTBan v1.73 - Installer Panel Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-panel" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="Control panel detection by directory existence" meta:inventory.files="internal/installer/detect/panel.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="none" =============================================================================
============================================================================= NFTBan v1.73 - Installer SSH Port Detection ============================================================================= SPDX-License-Identifier: MPL-2.0 meta:name="installer-detect-ssh" meta:type="lib" meta:owner="Antonios Voulvoulis <contact@nftban.com>" meta:created_date="2026-04-04" meta:description="4-source SSH port detection chain for installer" meta:inventory.files="internal/installer/detect/ssh.go" meta:inventory.binaries="" meta:inventory.env_vars="" meta:inventory.config_files="/etc/ssh/sshd_config" meta:inventory.systemd_units="" meta:inventory.network="" meta:inventory.privileges="root" =============================================================================
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConflictNames ¶
ConflictNames returns a deduplicated list of conflict names.
func SSHPort ¶
SSHPort detects the active SSH port using a 4-source priority chain. Returns the port number (1-65535) or an error if no source yields a valid port.
Priority:
- ss listener (most authoritative — reflects actual running sshd)
- sshd_config + drop-in dirs (config-declared)
- State file from previous install (/var/lib/nftban/state/ssh_port_active.state)
- nftban.conf.local override (/etc/nftban/nftban.conf.local SSH_PORT=)
Types ¶
type CTLimits ¶
type CTLimits struct {
SSH int // DDOS_CLASSIC_SSH_CONN_LIMIT, default 15
HTTP int // DDOS_CLASSIC_HTTP_CONN_LIMIT, default 200
Mail int // DDOS_CLASSIC_SMTP_CONN_LIMIT, default 30
}
CTLimits holds DDoS connection tracking limits used in nftables template rendering.
func DefaultCTLimits ¶
func DefaultCTLimits() CTLimits
DefaultCTLimits returns the defaults matching the shell %post.
type Conflict ¶
type Conflict struct {
Name string // e.g., "CSF", "UFW", "firewalld", "iptables", "iptables-nft"
Service string // systemd unit name (may be empty for ghost table conflicts)
Active bool // true if service is currently running or table exists
}
Conflict represents a detected conflicting firewall.
type DistroInfo ¶
type DistroInfo struct {
ID string // normalized: "rocky", "almalinux", "centos", "rhel", "debian", "ubuntu", "fedora"
VersionID string // e.g., "9", "10", "24.04"
PrettyName string // e.g., "AlmaLinux 9.7 (Moss Jungle Cat)"
NftConfPath string // system nftables.conf path for this distro
}
DistroInfo holds detected OS distribution information.
func DetectDistro ¶
DetectDistro parses /etc/os-release and determines the nftables.conf path.
type PanelType ¶
type PanelType string
PanelType identifies a hosting control panel.
const ( PanelNone PanelType = "" PanelDirectAdmin PanelType = "directadmin" PanelCPanel PanelType = "cpanel" PanelPlesk PanelType = "plesk" PanelCyberPanel PanelType = "cyberpanel" PanelHestia PanelType = "hestia" PanelVesta PanelType = "vesta" PanelCWP PanelType = "cwp" PanelInterWorx PanelType = "interworx" )