Add licensing system for ISP customers

- Add license.php with tiered licensing (Trial, Basic, Professional, Enterprise)
- Add license_info table to database schema
- Add license management UI to settings (License tab)
- Add license status, activation, and usage API endpoints
- Add entry and user limit enforcement based on license tier
- Add feature flags for webhooks, IP enrichment, whitelabel, PTR records
- Update README with licensing documentation and customer deployment guide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Purple
2026-01-18 13:21:44 +00:00
parent a8e3be2e66
commit 753661a34c
5 changed files with 1074 additions and 2 deletions

View File

@@ -214,3 +214,20 @@ ALTER TABLE geofeed_entries ADD COLUMN IF NOT EXISTS flag_threat TINYINT(1) DEFA
ALTER TABLE geofeed_entries ADD INDEX IF NOT EXISTS idx_sort_order (sort_order);
ALTER TABLE geofeed_entries ADD INDEX IF NOT EXISTS idx_isp (ipr_isp);
ALTER TABLE geofeed_entries ADD INDEX IF NOT EXISTS idx_asn (ipr_asn);
-- License information table
CREATE TABLE IF NOT EXISTS license_info (
id INT AUTO_INCREMENT PRIMARY KEY,
license_key VARCHAR(64) NOT NULL,
licensee_name VARCHAR(255) NOT NULL,
licensee_email VARCHAR(255) NOT NULL,
license_type ENUM('trial', 'basic', 'professional', 'enterprise') DEFAULT 'trial',
max_entries INT DEFAULT 100,
max_users INT DEFAULT 3,
features JSON DEFAULT NULL,
issued_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
expires_at TIMESTAMP NULL,
last_validated_at TIMESTAMP NULL,
is_active TINYINT(1) DEFAULT 1,
UNIQUE KEY unique_license (license_key)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;