diff --git a/centos/resources/config.sh b/centos/resources/config.sh
index 22da8da..b518759 100755
--- a/centos/resources/config.sh
+++ b/centos/resources/config.sh
@@ -1,19 +1,60 @@
# FusionPBX Settings
-system_username=admin # default username admin
-system_password=random # random or as a pre-set value
-system_branch=master # master, stable
+domain_name=ip_address # hostname, ip_address or a custom value
+system_username=admin # default username admin
+system_password=random # random or a custom value
+system_branch=master # master, stable
# FreeSWITCH Settings
-switch_branch=stable # master, stable
-switch_source=false # true or false
-switch_package=true # true or false
+switch_branch=stable # master, stable
+switch_source=false # true (source compile) or false (binary package)
+switch_package=true # true (binary package) or false (source compile)
+switch_version=1.10.8 # which source code to download, only for source
+switch_tls=true # true or false
+switch_token= # Get the auth token from https://signalwire.com
+ # Signup or Login -> Profile -> Personal Auth Token
+# Sofia-Sip Settings
+sofia_version=1.13.8 # release-version for sofia-sip to use
# Database Settings
database_name=fusionpbx # Database name (safe characters A-Z, a-z, 0-9)
database_username=fusionpbx # Database username (safe characters A-Z, a-z, 0-9)
database_password=random # random or a custom value (safe characters A-Z, a-z, 0-9)
-database_repo=official # PostgreSQL official, system, 2ndquadrant
+database_repo=system # PostgreSQL official, system
+database_version=latest # requires repo official
database_host=127.0.0.1 # hostname or IP address
database_port=5432 # port number
database_backup=false # true or false
+
+# General Settings
+php_version=7.4 # PHP version 7.1, 7.3, 7.4
+letsencrypt_folder=true # true or false
diff --git a/centos/resources/nginx/fusionpbx b/centos/resources/nginx/fusionpbx
index 18cf7d2..2a50496 100755
--- a/centos/resources/nginx/fusionpbx
+++ b/centos/resources/nginx/fusionpbx
@@ -2,7 +2,6 @@
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
-
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
@@ -15,22 +14,32 @@ server {
}
location ~ \.php$ {
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
}
- # Disable viewing .htaccess & .htpassword & .db
+ # Allow the upgrade routines to run longer than normal
+ location = /core/upgrade/index.php {
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
+ #fastcgi_pass 127.0.0.1:9000;
+ fastcgi_read_timeout 15m;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
+ }
+
+ # Disable viewing .htaccess & .htpassword & .db & .git
location ~ .htaccess {
- deny all;
+ deny all;
}
location ~ .htpassword {
- deny all;
+ deny all;
}
location ~^.+.(db)$ {
- deny all;
+ deny all;
}
location ~ /\.git {
deny all;
@@ -44,10 +53,18 @@ server {
}
server {
- listen 80;
+ listen [::]:80;
server_name fusionpbx;
- if ($uri !~* ^.*(provision|xml_cdr).*$) {
+ #redirect letsencrypt to dehydrated
+ location ^~ /.well-known/acme-challenge {
+ default_type "text/plain";
+ auth_basic "off";
+ alias /var/www/dehydrated;
+ }
+
+ #rewrite rule - send to https with an exception for provisioning
+ if ($uri !~* ^.*(provision|xml_cdr|firmware).*$) {
rewrite ^(.*) https://$host$1 permanent;
break;
}
@@ -59,7 +76,7 @@ server {
}
#algo
- rewrite "^.*/provision/algom([A-Fa-f0-9]{12})(\.(conf))?$" /app/provision/?mac=$1;
+ rewrite "^.*/provision/algom([A-Fa-f0-9]{12})\.conf" /app/provision/?mac=$1&file=algom%7b%24mac%7d.conf last;
#mitel
rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last;
@@ -67,7 +84,8 @@ server {
#grandstream
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
- rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+ rewrite "^.*/provision/([A-Fa-f0-9]{12})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+ rewrite "^.*/provision/(phonebook\.xml)?$" /app/provision/index.php?file=$1 last;
#grandstream-wave softphone by ext because Android doesn't pass MAC.
rewrite "^.*/provision/([0-9]{5})/cfg([A-Fa-f0-9]{12}).xml$" /app/provision/?ext=$1;
@@ -75,10 +93,9 @@ server {
rewrite "^.*/provision/aastra.cfg$" /app/provision/?mac=$1&file=aastra.cfg;
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
- #yealink common
+ #yealink
+ #rewrite "^.*/provision/(y[0-9]{12})(\.cfg|\.boot)?$" /app/provision/index.php?file=$1$2;
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1.cfg;
-
- #yealink mac
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
#polycom
@@ -92,6 +109,7 @@ server {
#cisco
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
+ rewrite "^.*/provision/directory\.xml$" /app/provision/?file=directory.xml;
#Escene
rewrite "^.*/provision/([0-9]{1,11})_Extern.xml$" "/app/provision/?ext=$1&file={%24mac}_extern.xml" last;
@@ -105,6 +123,9 @@ server {
rewrite "^.*/provision/([A-Fa-f0-9]{12})-contacts\.cfg$" "/app/provision/?mac=$1&file={%24mac}-contacts.cfg";
rewrite "^.*/provision/([A-Fa-f0-9]{12})-smartblf\.cfg$" "/app/provision/?mac=$1&file={%24mac}-smartblf.cfg";
+ #Snom
+ rewrite "^.*/provision/-([A-Fa-f0-9]{12})?$" /app/provision/index.php?mac=$1;
+
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
@@ -117,14 +138,25 @@ server {
}
location ~ \.php$ {
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
#fastcgi_pass 127.0.0.1:9000;
+ fastcgi_read_timeout 15m;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
+ }
+
+ # Allow the upgrade routines to run longer than normal
+ location = /core/upgrade/index.php {
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
+ #fastcgi_pass 127.0.0.1:9000;
+ fastcgi_read_timeout 15m;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
}
- # Disable viewing .htaccess & .htpassword & .db
+ # Disable viewing .htaccess & .htpassword & .db & .git
location ~ .htaccess {
deny all;
}
@@ -147,13 +179,24 @@ server {
server {
listen 443 ssl;
+ #listen 443 ssl http2;
server_name fusionpbx;
- #ssl on;
- ssl_certificate /etc/ssl/certs/nginx.crt;
- ssl_certificate_key /etc/ssl/private/nginx.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers HIGH:!ADH:!MD5:!aNULL;
+ ssl_certificate /etc/dehydrated/certs/my.domain.com/fullchain.pem;
+ ssl_certificate_key /etc/dehydrated/certs/my.domain.com/privkey.pem;
+ #ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
+ ssl_ciphers DHE-RSA-AES256-SHA:AES256-SHA:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305HE-RSA-AES128-GCM-SHA256HE-RSA-AES256-GCM-SHA384;
+ ssl_session_cache shared:SSL:40m;
+ ssl_session_timeout 2h;
+ ssl_session_tickets off;
+
+ #redirect letsencrypt to dehydrated
+ location ^~ /.well-known/acme-challenge {
+ default_type "text/plain";
+ auth_basic "off";
+ alias /var/www/dehydrated;
+ }
#REST api
if ($uri ~* ^.*/api/.*$) {
@@ -165,7 +208,7 @@ server {
rewrite "^/app/messages/media/(.*)/(.*)" /app/messages/message_media.php?id=$1&action=download last;
#algo
- rewrite "^.*/provision/algom([A-Fa-f0-9]{12})(\.(conf))?$" /app/provision/?mac=$1;
+ rewrite "^.*/provision/algom([A-Fa-f0-9]{12})\.conf" /app/provision/?mac=$1&file=algom%7b%24mac%7d.conf last;
#mitel
rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last;
@@ -173,7 +216,8 @@ server {
#grandstream
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
- rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+ rewrite "^.*/provision/([A-Fa-f0-9]{12})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+ rewrite "^.*/provision/(phonebook\.xml)?$" /app/provision/index.php?file=$1 last;
#grandstream-wave softphone by ext because Android doesn't pass MAC.
rewrite "^.*/provision/([0-9]{5})/cfg([A-Fa-f0-9]{12}).xml$" /app/provision/?ext=$1;
@@ -181,10 +225,9 @@ server {
rewrite "^.*/provision/aastra.cfg$" /app/provision/?mac=$1&file=aastra.cfg;
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
- #yealink common
+ #yealink
+ #rewrite "^.*/provision/(y[0-9]{12})(\.cfg|\.boot)?$" /app/provision/index.php?file=$1$2;
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1.cfg;
-
- #yealink mac
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
#polycom
@@ -198,6 +241,7 @@ server {
#cisco
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
+ rewrite "^.*/provision/directory\.xml$" /app/provision/?file=directory.xml;
#Escene
rewrite "^.*/provision/([0-9]{1,11})_Extern.xml$" "/app/provision/?ext=$1&file={%24mac}_extern.xml" last;
@@ -221,10 +265,17 @@ server {
root /var/www/fusionpbx;
index index.php;
}
+ location /vc {
+ root /var/www/html/;
+ index index.html;
+ access_log /var/log/nginx/verto-access.log;
+ error_log /var/log/nginx/verto-error.log;
+ }
location ~ \.php$ {
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
#fastcgi_pass 127.0.0.1:9000;
+ fastcgi_read_timeout 15m;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
@@ -232,15 +283,15 @@ server {
# Allow the upgrade routines to run longer than normal
location = /core/upgrade/index.php {
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+ fastcgi_pass unix:/var/run/php-fpm/www.sock;
#fastcgi_pass 127.0.0.1:9000;
+ fastcgi_read_timeout 15m;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
- fastcgi_read_timeout 15m;
}
- # Disable viewing .htaccess & .htpassword & .db
+ # Disable viewing .htaccess & .htpassword & .db & .git
location ~ .htaccess {
deny all;
}
diff --git a/centos/resources/php.sh b/centos/resources/php.sh
index 55261d5..92c932a 100755
--- a/centos/resources/php.sh
+++ b/centos/resources/php.sh
@@ -11,12 +11,14 @@ cd "$(dirname "$0")"
verbose "Install PHP and PHP-FPM"
#set the version of php
-#yum-config-manager --enable remi-php70
-#yum-config-manager --enable remi-php71
-yum-config-manager --enable remi-php72
+#dnf-config-manager --enable remi-php70
+#dnf-config-manager --enable remi-php71
+#dnf-config-manager --enable remi-php72
+dnf module reset php
+dnf module install php:remi-7.4
#install dependencies
-yum -y install php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli php-gd
+dnf -y install php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli php-gd
#send a message
verbose "Configuring php/nginx/php-fpm and permissions"
diff --git a/centos/resources/postgresql.sh b/centos/resources/postgresql.sh
index cd26af6..633805d 100755
--- a/centos/resources/postgresql.sh
+++ b/centos/resources/postgresql.sh
@@ -14,10 +14,11 @@ verbose "Installing PostgreSQL"
password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64)
# Install the repository
-sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+sudo dnf install -y https://download.postgresql.org/pub/repos/dnf/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+sudo dnf -qy module disable postgresql
# Install PostgreSQL:
-sudo yum install -y postgresql14-server postgresql14-contrib postgresql14 postgresql14-libs
+sudo dnf install -y postgresql14-server postgresql14-contrib postgresql14 postgresql14-libs
#send a message
verbose "Initalize PostgreSQL database"
diff --git a/centos/resources/switch/package-release.sh b/centos/resources/switch/package-release.sh
index 99d09c0..cf0d7d1 100755
--- a/centos/resources/switch/package-release.sh
+++ b/centos/resources/switch/package-release.sh
@@ -14,7 +14,7 @@ verbose "Installing FreeSWITCH"
yum -y install memcached curl gdb
#install freeswitch packages
-yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
+yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum install -y freeswitch freeswitch-lang-* freeswitch-sounds-* freeswitch-lua freeswitch-xml-cdr
#remove the music package to protect music on hold from package updates