# Deployment Guide

## cPanel
1. Upload ZIP and extract.
2. Create database, import sql/schema.sql and sql/seed.sql.
3. Rename .env.example to .env and update DB and live API credentials.
4. Use PHP 8.1+.
5. Configure cron from install/CPANEL_CRON.txt.

## VPS FreeRADIUS
1. Copy freeradius folder to VPS.
2. Run install_ubuntu_vps.sh as root.
3. Import freeradius_schema.sql.
4. Configure FreeRADIUS SQL module to point to radius DB.
5. Put sync_from_saas.php in cron every minute.
6. Add each MikroTik NAS into nas table with matching secret.

## MikroTik
Import mikrotik/routeros-radius-setup.rsc after replacing VPS IP and secret.

## Security
- Use HTTPS.
- Change all default passwords/secrets.
- Restrict MySQL and RADIUS ports using firewall.
- Only allow MikroTik public IPs to RADIUS ports 1812/1813.
