Step by step guide to scratch install the vidial dynamic portal in Debian 11 or ubuntu based vicidial scratch installations. If you have installed vicidial using scratch installation instead of using the default vicibox iso then you need to manually install and configure the dynamic portal , follow this blog tutorial to scratch install the vicidial dynamic portal.
Here's the steps to install and configure the vicidial dynamic portal in scratch installations.
Steps to install vicidial dynamic portal
cd /usr/src
git clone https://github.com/manish23k/vicidial-dynamicportal.git
cd vicidial-dynamicportal
chmod +x vici_dynportal.sh
./vici_dynportal.sh
or you can install manually.
Follow the below steps to install and configure the vicidial dynamic portal in your scratch installations,
Step 1: Install the firewalld and ipset
Step 2: Download the Dynamic portal files from my Github
cd /usr/src/
mkdir dynamicportal
cd dynamicportal
wget https://github.com/manish23k/vicidial-dynamicportal/archive/refs/heads/main.zipStep 3: Copy the Firewall zones , services, ipset rules
cd vicidial-dynamicportal-main
cp -r zones /etc/firewalld/
**note: if prompts for override for public give yes
cp -r ipsets /etc/firewalld/
cd services
cp *.xml /usr/lib/firewalld/services/
Step 4: Copy the Dynamic portal files to web folder
Step 5: Copy the ssl file to the http config folder
sudo a2ensite vicidial.conf
sudo a2ensite vicidial-ssl.conf
Step 6: Edit the vicidial-ssl.conf
Edit the vicidial-ssl.conf file and replace the ssl certificate and ssl key with your domain key.
/etc/apache2/sites-available/vicidial-ssl.conf
SSLCertificateFile /etc/letsencrypt/live/examples.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/examples.com/privkey.pem
Step 7: Add the 81 and 446 as listen port in apache
Listen 80
Listen 81
<IfModule ssl_module>
Listen 443
Listen 446
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
Listen 446
</IfModule>
Port 446 is used to access the dynamic portal over https
Port 81 is used to access the dynamic portal over http
Step 8: Copy the VB-firewall script to bin
cp VB-firewall /usr/bin/
chmod +x /usr/bin/VB-firewall
Step 9: Restart and run on startup the Firewalld
Run the below command to enable and restart the firewall service
systemctl enable firewalld
Step 10: Enable the IP List in Vicidial
mysql -e "use asterisk; INSERT INTO `vicidial_ip_lists` (`ip_list_id`, `ip_list_name`, `active`, `user_group`) VALUES
('ViciWhite', 'ViciWhite', 'Y', 'ADMIN'),
('ViciBlack', 'ViciBlack', 'Y', 'ADMIN');
mysql -e "use asterisk; INSERT INTO `vicidial_ip_list_entries` (`ip_list_id`, `ip_address`) VALUES
('ViciWhite', 'ADD.YOUR.PUBLIC.IP'),
('ViciWhite', 'ADD.YOUR.PUBLIC.IP');
OR Create manually
Log in to your Vicidial Admin portal
Navigate to Admin > System Settings
Enable the IP List
Allow IP Lists: 1
Submit
Next Navigate to Users and edit the Admin user who wants the access to add ip whitelist
Modify any admin user (6666 i am using) and set 1 for Modify IP Lists:
Modify IP Lists::1submit
Next Create ViciWhite IP list to add static IP's for whitelist
navigate to ADMIN > IP Lists
Create a new IP list with the name as ViciWhite and ViciBlack
make sure to set the ViciWhite and ViciBlack iplist to active.
submit.
Step 11: Cronjob entry to run VB-firewall every minute
you need to add the VB-firewall script in the cronjob to run every minute to add the static whitelist ip list and dynamic ip list to the Firewall white list rules.
Also you need to run the VB-firewall script on reboot
edit the crontab by typing below command
nano /var/spool/cron/crontabs/root
add the below at the end of the crontab file.
#Entry for ViciWhite and Dynamic Portal
Conclusion: Dynamic portal Testing
$DYNAMICAGE=14; # Number of 14 days for dynamic IPs stored.
nano /usr/bin/VB-firewall
Change
$DYNAMICAGE=30; For 30 Days.
Comments
Post a Comment