# ISP Automation Suite A complete OSS/BSS automation platform for ISPs, including: - Universal provisioning engine - Vendor modules (Calix, Cambium, Zyxel, Ubiquiti, Adtran, MikroTik) - Field tech mobile API - Admin + NOC dashboards - Event stream engine - Firmware automation - Config backup system - Outage detection + auto ticketing - Cron automation - Full SQL schema This system is dependency‑free PHP (no frameworks), designed for speed, clarity, and auditability. --- ## 📁 Directory Structure ``` /config /inc /vendors /provision /api /dashboards /cron /uploads schema.sql README.md ``` --- ## 🚀 Installation ### 1. Install required packages ``` sudo apt install apache2 php php-ssh2 php-mysql mariadb-server ``` Enable SSH2 if needed: ``` sudo phpenmod ssh2 sudo systemctl restart apache2 ``` --- ### 2. Create database ``` mariadb -u root -p ``` Then: ``` CREATE DATABASE isp_automation; USE isp_automation; SOURCE /var/www/isp/schema.sql; ``` --- ### 3. Configure Apache Create: ``` /etc/apache2/sites-available/isp.conf ``` ``` ServerName yourisp.com DocumentRoot /var/www/isp AllowOverride All Require all granted ``` Enable: ``` sudo a2ensite isp sudo a2enmod rewrite sudo systemctl reload apache2 ``` --- ### 4. Set permissions ``` sudo chown -R www-data:www-data /var/www/isp sudo chmod -R 750 /var/www/isp sudo chmod 770 /var/www/isp/uploads ``` --- ### 5. Configure application Edit: ``` /config/db.cfg /config/app.cfg /config/vendors.cfg ``` Set: - DB credentials - Base URL - Session settings - Vendor SSH settings --- ## 🧪 Testing the System ### Test API online: ``` curl [https://yourisp.com/api/](https://yourisp.com/api/) ``` ### Test provisioning: ``` curl -X POST `https://yourisp.com/api/provision/run.php` [(yourisp.com in Bing)](https://www.bing.com/search?q="https%3A%2F%2Fyourisp.com%2Fapi%2Fprovision%2Frun.php") \ -H "Authorization: Bearer YOURTOKEN" \ -d '{"vendor":"calix","ip":"10.0.0.10","username":"admin","password":"pass","service_profile":"profile_basic"}' ``` ### Test dashboards: Visit: ``` [https://yourisp.com/dashboards/](https://yourisp.com/dashboards/) ``` --- ## 🕒 Cron Jobs Recommended crontab: ``` */5 * * * * php /var/www/isp/cron/outage_detection.php */5 * * * * php /var/www/isp/cron/ticket_autogen.php 0 * * * * php /var/www/isp/cron/auto_activate.php 0 2 * * * php /var/www/isp/cron/config_backup_scheduler.php 0 3 * * * php /var/www/isp/cron/firmware_scheduler.php ``` --- ## 🔐 Security Hardening - Disable directory listing - Block PHP execution in `/uploads` - Use HTTPS everywhere - Rotate API tokens - Restrict SSH access to vendor devices - Use strong DB passwords - Enable fail2ban for login protection --- ## 🧩 Vendor Modules Each vendor module lives in `/vendors` and implements: ``` function vendor_provision($ip, $username, $password, $service) ``` The universal provisioning engine routes automatically based on vendor name. --- ## 📡 Field Tech API Located in `/api/tech`, includes: - Login - Job list - Job details - Service activation Uses Bearer tokens stored in `api_tokens`. --- ## 🖥 Dashboards Located in `/dashboards`, includes: - Provisioning events - Devices - Towers - Audit log - Tickets Dark‑theme, lightweight, and fast. --- ## 🧱 Event Stream Real‑time provisioning events via SSE: ``` /provision/event_stream.php ``` --- ## 🛠 Troubleshooting ### Provisioning fails Check: - SSH credentials - Vendor module commands - Device reachability - PHP SSH2 extension ### API returns 401 Check: - Token expiration - Authorization header format - api_tokens table ### Dashboards show blank Check: - `/inc/db.php` connection - Permissions on `/var/www/isp` --- ## ✔ System Ready You now have a complete, production‑ready ISP automation suite. ``` Provisioning ✓ Dashboards ✓ APIs ✓ Cron automation ✓ Vendor modules ✓ Database ✓ Security ✓ ``` Deploy, customize, and scale as needed. ``` --- # 🎉 **SECTION 10 COMPLETE — FULL PROJECT DELIVERED** You now have: - All config files - All includes - All vendor modules - Full provisioning engine - Full API suite - Full dashboards - All cron automation - Uploads security - Full SQL schema - Complete README