diff --git a/debian/resources/config.sh b/debian/resources/config.sh index e54c675..f552b10 100755 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -9,7 +9,7 @@ system_branch=5.5 # master, 5.5 switch_branch=stable # master, stable switch_source=true # true (source compile) or false (binary package) switch_package=false # true (binary package) or false (source compile) -switch_version=1.10.12 # which source code to download, only for source +switch_version=1.11 # 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 diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 2f0c057..5a613cc 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -17,6 +17,15 @@ if [ ."$cpu_architecture" = ."arm" ]; then if [ ."$os_codename" = ."bullseye" ]; then php_version=7.4 fi + if [ ."$os_codename" = ."bookworm" ]; then + php_version=8.2 + fi + if [ ."$os_codename" = ."trixie" ]; then + php_version=8.4 + fi + if [ ."$os_codename" = ."forky" ]; then + php_version=8.4 + fi fi #set the version of php @@ -86,6 +95,15 @@ if [ .$letsencrypt_folder = .true ]; then mkdir -p /var/www/letsencrypt/ fi +# Ensure apache2 is stopped and cannot start +if systemctl is-active --quiet apache2; then + verbose "Stopping Apache to clear port 80/443..." + systemctl stop apache2 +fi + +# Prevent apache from starting at boot +systemctl disable apache2 + #flush systemd cache systemctl daemon-reload diff --git a/debian/resources/php.sh b/debian/resources/php.sh index f2005df..681c3f9 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -34,6 +34,12 @@ elif [ ."$cpu_architecture" = ."arm" ]; then if [ ."$os_codename" = ."bookworm" ]; then php_version=8.2 fi + if [ ."$os_codename" = ."trixie" ]; then + php_version=8.4 + fi + if [ ."$os_codename" = ."forky" ]; then + php_version=8.4 + fi else #11.x - bullseye #10.x - buster @@ -154,7 +160,8 @@ if [ ."$php_version" = ."8.3" ]; then apt-get install -y --no-install-recommends php8.3 php8.3-common php8.3-cli php8.3-dev php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-imap php8.3-xml php8.3-gd php8.3-mbstring php8.3-ldap php8.3-inotify php8.3-snmp fi if [ ."$php_version" = ."8.4" ]; then - apt-get install -y --no-install-recommends php8.4 php8.4-common php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-imap php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap php8.4-inotify php8.4-snmp + apt-get install -y --no-install-recommends php8.4 php8.4-common php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap php8.4-inotify php8.4-snmp + apt-get install -y --no-install-recommends php8.4-imap fi #update config if source is being used diff --git a/debian/resources/sngrep.sh b/debian/resources/sngrep.sh index 167bc28..e2f3b92 100755 --- a/debian/resources/sngrep.sh +++ b/debian/resources/sngrep.sh @@ -11,7 +11,8 @@ cd "$(dirname "$0")" #add sngrep if [ ."$cpu_architecture" = ."arm" ]; then #source install - apt-get install -y git autoconf automake gcc make libncurses5-dev libpcap-dev libssl-dev libpcre3-dev + apt-get install -y git autoconf automake gcc make libncurses5-dev libpcap-dev libssl-dev + apt-get install -y libpcre3-dev cd /usr/src && git clone https://github.com/irontec/sngrep cd /usr/src/sngrep && ./bootstrap.sh cd /usr/src/sngrep && ./configure diff --git a/debian/resources/switch/source-master.sh b/debian/resources/switch/source-master.sh index 3b86043..7b51add 100755 --- a/debian/resources/switch/source-master.sh +++ b/debian/resources/switch/source-master.sh @@ -1,7 +1,8 @@ #!/bin/sh echo "Installing the FreeSWITCH source" -DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y ntpdate libapache2-mod-log-sql-ssl libfreetype6-dev git-buildpackage doxygen yasm nasm gdb git build-essential automake autoconf 'libtool-bin|libtool' python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libvlccore-dev vlc-nox pkg-config ccache libpng-dev libvpx-dev libyuv-dev libopenal-dev libbroadvoice-dev libcodec2-dev libflite-dev libg7221-dev libilbc-dev libmongoc-dev libsilk-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libopus-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libmemcached-dev libperl-dev portaudio19-dev python-dev libsnmp-dev libyaml-dev libmp4v2-dev +DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y libapache2-mod-log-sql-ssl libfreetype6-dev git-buildpackage doxygen yasm nasm gdb git build-essential automake autoconf 'libtool-bin|libtool' uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libvlccore-dev vlc-nox pkg-config ccache libpng-dev libvpx-dev libyuv-dev libopenal-dev libbroadvoice-dev libcodec2-dev libflite-dev libg7221-dev libilbc-dev libmongoc-dev libsilk-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libopus-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libmemcached-dev libperl-dev portaudio19-dev libsnmp-dev libyaml-dev apt-get install -y unzip libpq-dev libvlc-dev memcached libshout3-dev libvpx-dev libmpg123-dev libmp3lame-dev +apt-get install -y ntpdate python libpcre3-dev python-dev libmp4v2-dev apt-get update && apt-get install -y ntp curl haveged curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index ed260c7..1dc10cd 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -13,10 +13,12 @@ apt update && apt upgrade -y # install dependencies apt install -y autoconf automake devscripts g++ git-core libncurses5-dev libtool libtool-bin make libjpeg-dev apt install -y pkg-config flac libgdbm-dev libdb-dev gettext sudo equivs git dpkg-dev libpq-dev -apt install -y liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev +apt install -y liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev apt install -y devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev apt install -y libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev apt install -y libavformat-dev libswscale-dev libvlc-dev sox libsox-fmt-all +apt install -y libtiff5-dev +apt install -y libpcre3-dev #install dependencies that depend on the operating system version if [ ."$os_codename" = ."noble" ]; then @@ -32,23 +34,17 @@ if [ ."$os_codename" = ."bullseye" ]; then apt install -y python3-distutils mlocate libvpx6 swig4.0 fi if [ ."$os_codename" = ."trixie" ]; then - apt install -y python3-distutils-extra plocate -fi - -#use master branch for Debian 13 for now -if [ ."$os_codename" = ."trixie" ]; then - switch_branch=master - switch_version=1.10.13 + apt install -y python3-distutils-extra plocate libtiff-dev libpcre2-dev swig fi # additional dependencies apt install -y sqlite3 unzip -#we are about to move out of the executing directory so we need to preserve it to return after we are done +# preserve the executing directory, so we need to return after we are done CWD=$(pwd) -#install the following dependencies if the switch version is greater than 1.10.0 -if [ ."$switch_branch" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then +# install libks - dependency for switch versions greater than 1.10.0 +if [ ! -d /usr/src/libks ]; then # libks build-requirements apt install -y cmake uuid-dev @@ -63,27 +59,39 @@ if [ ."$switch_branch" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') # libks C includes export C_INCLUDE_PATH=/usr/include/libks +fi - # sofia-sip +# sofia-sip - dependency for switch versions greater than 1.10.0 +if [ ! -d /usr/src/sofia-sip ]; then cd /usr/src if [ ."$sofia_version" = ."master" ]; then git clone https://github.com/freeswitch/sofia-sip.git sofia-sip cd sofia-sip + elif [ ."$os_codename" = ."trixie" ]; then + git clone https://github.com/freeswitch/sofia-sip.git sofia-sip + cd sofia-sip else wget https://github.com/freeswitch/sofia-sip/archive/refs/tags/v$sofia_version.zip unzip v$sofia_version.zip - cd sofia-sip-$sofia_version + mv sofia-sip-$sofia_version sofia-sip + cd sofia-sip fi sh autogen.sh ./configure --enable-debug make -j $(getconf _NPROCESSORS_ONLN) make install +fi - # spandsp +# spandsp - dependency for switch versions greater than 1.10.0 +if [ ! -d /usr/src/spandsp ]; then cd /usr/src git clone https://github.com/freeswitch/spandsp.git spandsp cd spandsp - if [ ."$sofia_version" != ."master" ] && [ ."$switch_branch" != ."master" ]; then + if [ ."$sofia_version" != ."master" ]; then + echo "" + elif [ ."$os_codename" = ."trixie" ]; then + echo "" + else git reset --hard 0d2e6ac65e0e8f53d652665a743015a88bf048d4 fi #/usr/bin/sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' /usr/src/spandsp/configure.ac @@ -115,19 +123,20 @@ fi #check for stable release if [ ."$switch_branch" != ."master" ] && [ ."$switch_branch" = ."stable" ]; then echo "Using version $switch_version" - #1.8 and older - if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then - wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.zip - unzip freeswitch-$switch_version.zip + + # Get the source code using git + if [ ."$switch_version" = ."1.11" ]; then + git clone https://github.com/signalwire/freeswitch.git freeswitch-$switch_version + + # Change the working directory cd /usr/src/freeswitch-$switch_version - # Reset repo just-in-case we are rebuilding - #git reset --hard HEAD && git clean -fdx + # Get the stable branch + git checkout v$switch_version fi - #1.10.0 and newer - if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then - # Get the source code using git + # Get the source code using git + if [ ."$switch_version" = ."1.10.12" ]; then git clone https://github.com/fusionpbx/freeswitch freeswitch-$switch_version # Change the working directory @@ -135,26 +144,26 @@ if [ ."$switch_branch" != ."master" ] && [ ."$switch_branch" = ."stable" ]; then # Get the stable branch git checkout $switch_version - - # Reset repo just-in-case we are rebuilding - #git reset --hard origin/master && git clean -fdx - - #wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip - #unzip freeswitch-$switch_version.-release.zip - #mv freeswitch-$switch_version.-release freeswitch-$switch_version - - # bootstrap is needed if using git - ./bootstrap.sh -j - - #apply rtp timestamp patch - Fix RTP audio issues use the following for additional information. https://github.com/briteback/freeswitch/commit/9f8968ccabb8a4e0353016d4ea0ff99561b005f1 - #patch -u /usr/src/freeswitch-$switch_version/src/switch_rtp.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/switch_rtp.diff - - #apply pull request 2300 to Fix session deadlock that results in stale or stuck calls. https://github.com/signalwire/freeswitch/pull/2300 - #patch -d /usr/src/freeswitch-$switch_version/src -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/pull_2300.diff - - #apply mod_pgsql patch - #patch -u /usr/src/freeswitch-$switch_version/src/mod/databases/mod_pgsql/mod_pgsql.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/mod_pgsql.patch fi + + # Reset repo just-in-case we are rebuilding + #git reset --hard origin/master && git clean -fdx + + #wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip + #unzip freeswitch-$switch_version.-release.zip + #mv freeswitch-$switch_version.-release freeswitch-$switch_version + + # bootstrap is needed if using git + ./bootstrap.sh -j + + #apply rtp timestamp patch - Fix RTP audio issues use the following for additional information. https://github.com/briteback/freeswitch/commit/9f8968ccabb8a4e0353016d4ea0ff99561b005f1 + #patch -u /usr/src/freeswitch-$switch_version/src/switch_rtp.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/switch_rtp.diff + + #apply pull request 2300 to Fix session deadlock that results in stale or stuck calls. https://github.com/signalwire/freeswitch/pull/2300 + #patch -d /usr/src/freeswitch-$switch_version/src -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/pull_2300.diff + + #apply mod_pgsql patch + #patch -u /usr/src/freeswitch-$switch_version/src/mod/databases/mod_pgsql/mod_pgsql.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/mod_pgsql.patch fi # enable required modules diff --git a/debian/resources/switch/source-sounds.sh b/debian/resources/switch/source-sounds.sh index d2ad211..89fc4a0 100755 --- a/debian/resources/switch/source-sounds.sh +++ b/debian/resources/switch/source-sounds.sh @@ -7,6 +7,9 @@ cd "$(dirname "$0")" . ../config.sh . ../environment.sh +# Make the sounds directory +mkdir -p /usr/share/freeswitch/sounds + # Change the working directory cd /usr/share/freeswitch/sounds @@ -25,7 +28,10 @@ for sample_rate in $sample_rates; do /usr/bin/tar xvzf "freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" done -# Change to directory to the music directory +# Make the music directory +mkdir -p /usr/share/freeswitch/sounds/music + +# Change the current directory to the music directory cd /usr/share/freeswitch/sounds/music # Loop through each sample rate diff --git a/debian/resources/upgrade/php.sh b/debian/resources/upgrade/php.sh index cc3a393..304734f 100755 --- a/debian/resources/upgrade/php.sh +++ b/debian/resources/upgrade/php.sh @@ -7,34 +7,34 @@ cd "$(dirname "$0")" . ../config.sh #remove php5 -/usr/bin/apt remove -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-gd +/usr/bin/apt remove -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-gd php5-imap #remove php 7.0 -/usr/bin/apt remove -y php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-imap php7.0-xml php7.0-gd +/usr/bin/apt remove -y php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-xml php7.0-gd php7.0-imap #remove php 7.1 -/usr/bin/apt remove -y php7.1 php7.1-cli php7.1-fpm php7.1-pgsql php7.1-sqlite3 php7.1-odbc php7.1-curl php7.1-imap php7.1-xml php7.1-gd +/usr/bin/apt remove -y php7.1 php7.1-cli php7.1-fpm php7.1-pgsql php7.1-sqlite3 php7.1-odbc php7.1-curl php7.1-xml php7.1-gd php7.1-imap #remove php 7.2 -/usr/bin/apt remove -y php7.2 php7.2-cli php7.2-fpm php7.2-pgsql php7.2-sqlite3 php7.2-odbc php7.2-curl php7.2-imap php7.2-xml php7.2-gd +/usr/bin/apt remove -y php7.2 php7.2-cli php7.2-fpm php7.2-pgsql php7.2-sqlite3 php7.2-odbc php7.2-curl php7.2-xml php7.2-gd php7.2-imap #remove php 7.3 -/usr/bin/apt remove -y php7.3 php7.3-cli php7.3-fpm php7.3-pgsql php7.3-sqlite3 php7.3-odbc php7.3-curl php7.3-imap php7.3-xml php7.3-gd +/usr/bin/apt remove -y php7.3 php7.3-cli php7.3-fpm php7.3-pgsql php7.3-sqlite3 php7.3-odbc php7.3-curl php7.3-xml php7.3-gd php7.3-imap #remove php 7.4 -/usr/bin/apt remove -y php7.4 php7.4-cli php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd +/usr/bin/apt remove -y php7.4 php7.4-cli php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-xml php7.4-gd php7.4-imap #remove php 8.1 -/usr/bin/apt remove -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap +/usr/bin/apt remove -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap php8.1-imap #remove php 8.2 -/usr/bin/apt remove -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-imap php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap +/usr/bin/apt remove -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap php8.2-imap #remove php 8.3 -/usr/bin/apt remove -y php8.3 php8.3-cli php8.3-dev php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-imap php8.3-xml php8.3-gd php8.3-mbstring php8.3-ldap +/usr/bin/apt remove -y php8.3 php8.3-cli php8.3-dev php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-xml php8.3-gd php8.3-mbstring php8.3-ldap php8.3-imap #remove php 8.4 -/usr/bin/apt remove -y php8.4 php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-imap php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap +/usr/bin/apt remove -y php8.4 php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap php8.4-imap #install php update and set the unix socket if [ ."$php_version" = ."8.4" ]; then @@ -45,7 +45,8 @@ if [ ."$php_version" = ."8.4" ]; then /usr/bin/apt-get update #install php 8.4 - apt-get install -y php8.4 php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-imap php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap + apt-get install -y php8.4 php8.4-cli php8.4-dev php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-xml php8.4-gd php8.4-mbstring php8.4-ldap + apt-get install -y php8.4-imap #update the unix socket name /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.2-fpm.sock;#g' @@ -61,7 +62,7 @@ if [ ."$php_version" = ."8.3" ]; then /usr/bin/apt-get update #install php 8.2 - apt-get install -y php8.3 php8.3-cli php8.3-dev php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-imap php8.3-xml php8.3-gd php8.3-mbstring php8.3-ldap + apt-get install -y php8.3 php8.3-cli php8.3-dev php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-xml php8.3-gd php8.3-mbstring php8.3-ldap php8.3-imap #update the unix socket name /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.2-fpm.sock;#g' @@ -77,7 +78,7 @@ if [ ."$php_version" = ."8.2" ]; then /usr/bin/apt-get update #install php 8.2 - apt-get install -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-imap php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap + apt-get install -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap php8.2-imap #update the unix socket name /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.2-fpm.sock;#g' @@ -93,7 +94,7 @@ if [ ."$php_version" = ."8.1" ]; then /usr/bin/apt-get update #install php 8.1 - /usr/bin/apt-get install -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap + /usr/bin/apt-get install -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap php8.1-imap #update the unix socket name /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.1-fpm.sock;#g' @@ -107,7 +108,7 @@ if [ ."$php_version" = ."7.4" ]; then /usr/bin/apt update #install php 7.4 - /usr/bin/apt-get install -y php7.4 php7.4-cli php7.4-dev php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring php7.4-ldap + /usr/bin/apt-get install -y php7.4 php7.4-cli php7.4-dev php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-xml php7.4-gd php7.4-mbstring php7.4-ldap php7.4-imap #update the unix socket name /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.4-fpm.sock;#g' diff --git a/freebsd/resources/config.sh b/freebsd/resources/config.sh index 4b71768..1e20a06 100755 --- a/freebsd/resources/config.sh +++ b/freebsd/resources/config.sh @@ -16,7 +16,7 @@ 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_enabled=true # true or false -database_version=15 # Postgres 16, 15, 14, 13, 12 +database_version=18 # Postgres 18, 17, 16, 15, 14, 13, 12 database_host=127.0.0.1 # hostname or IP address database_port=5432 # port number database_backup=false # true or false @@ -26,7 +26,7 @@ firewall_enabled=true # true or false # General Settings interface_name=auto # auto, em0, igb0, vtnet0, or other valid names -php_version=8.1 # PHP version 8.1, 7.4 +php_version=8.2 # PHP version 8.3, 8.2, 8.1, 7.4 portsnap_enabled=false # true or false sngrep_enabled=true # true or false fail2ban_enabled=false # true or false diff --git a/freebsd/resources/finish.sh b/freebsd/resources/finish.sh index 01aaaf5..0c1a231 100755 --- a/freebsd/resources/finish.sh +++ b/freebsd/resources/finish.sh @@ -68,7 +68,7 @@ if [ .$nginx_enabled = .'true' ]; then #update application defaults if [ .$nginx_enabled = .'true' ]; then - cd /usr/local/www/fusionpbx && /usr/bin/php /var/www/fusionpbx/core/upgrade/upgrade.php --defaults + cd /usr/local/www/fusionpbx && /usr/local/bin/php /usr/local/www/fusionpbx/core/upgrade/upgrade.php --defaults fi #add the user @@ -97,11 +97,11 @@ if [ .$nginx_enabled = .'true' ]; then #update application defaults if [ .$nginx_enabled = .'true' ]; then - cd /usr/local/www/fusionpbx && /usr/bin/php /var/www/fusionpbx/core/upgrade/upgrade.php --defaults + cd /usr/local/www/fusionpbx && /usr/local/bin/php /usr/local/www/fusionpbx/core/upgrade/upgrade.php --defaults fi #update permissions - #cd /var/www/fusionpbx && /usr/bin/php /var/www/fusionpbx/core/upgrade/upgrade.php --permissions + #cd /usr/local/www/fusionpbx && /usr/local/bin/php /usr/local/www/fusionpbx/core/upgrade/upgrade.php --permissions #reset the current working directory cd $cwd diff --git a/freebsd/resources/fusionpbx.sh b/freebsd/resources/fusionpbx.sh index 647cc2c..46d1dce 100755 --- a/freebsd/resources/fusionpbx.sh +++ b/freebsd/resources/fusionpbx.sh @@ -29,3 +29,5 @@ chown -R www:www /var/cache/fusionpbx #get the source code git clone $branch https://git.nsinnovations.net/nsinnovations/fusionpbx.gitusr/local/www/fusionpbx chown -R www:www /usr/local/www/fusionpbx +cd /usr/local/www/fusionpbx +git config --global --add safe.directory /usr/local/www/fusionpbx diff --git a/freebsd/resources/php.sh b/freebsd/resources/php.sh index b5668c3..c3fce82 100755 --- a/freebsd/resources/php.sh +++ b/freebsd/resources/php.sh @@ -14,27 +14,52 @@ echo "DEFAULT_VERSIONS+=ssl=openssl" >> /etc/make.conf #install dependencies if [ ."$php_version" = ."7.3" ]; then pkg install --yes php73 php73-phar php73-pdo php73-pdo_odbc php73-pdo_sqlite php73-json php73-gd php73-imap - pkg install --yes php73-ldap php73-openssl php73-sockets php73-simplexml php73-xml php73-session php73-iconv - pkg install --yes php73-zlib php73-filter php73-pdo_pgsql php73-pgsql php73-curl php73-mbstring + pkg install --yes php73-posix php73-ldap php73-openssl php73-sockets php73-simplexml php73-xml php73-session php73-iconv + pkg install --yes php73-pcntl php73-zlib php73-filter php73-pdo_pgsql php73-pgsql php73-curl php73-mbstring fi if [ ."$php_version" = ."7.4" ]; then pkg install --yes php74 php74-phar php74-pdo php74-pdo_odbc php74-pdo_sqlite php74-json php74-gd php74-imap pkg install --yes php74-ldap php74-openssl php74-sockets php74-simplexml php74-xml php74-session php74-iconv - pkg install --yes php74-zlib php74-filter php74-pdo_pgsql php74-pgsql php74-curl php74-mbstring + pkg install --yes php74-posix php74-pcntl php74-zlib php74-filter php74-pdo_pgsql php74-pgsql php74-curl php74-mbstring pkg install --yes php74-pdo_pgsql php74-pgsql fi if [ ."$php_version" = ."8.0" ]; then pkg install --yes php80 php80-phar php80-pdo php80-pdo_odbc php80-pdo_sqlite php80-gd php80-imap pkg install --yes php80-ldap php80-sockets php80-simplexml php80-xml php80-session php80-iconv - pkg install --yes php80-zlib php80-filter php80-curl php80-mbstring + pkg install --yes php80-posix php80-pcntl php80-zlib php80-filter php80-curl php80-mbstring pkg install --yes php80-pdo_pgsql php80-pgsql fi if [ ."$php_version" = ."8.1" ]; then pkg install --yes php81 php81-phar php81-pdo php81-pdo_odbc php81-pdo_sqlite php81-gd php81-imap pkg install --yes php81-ldap php81-sockets php81-simplexml php81-xml php81-session php81-iconv - pkg install --yes php81-zlib php81-filter php81-curl php81-mbstring + pkg install --yes php81-posix php81-pcntl php81-zlib php81-filter php81-curl php81-mbstring pkg install --yes php81-pdo_pgsql php81-pgsql fi +if [ ."$php_version" = ."8.2" ]; then + pkg install --yes php82 php82-phar php82-pdo php82-pdo_odbc php82-pdo_sqlite php82-gd php82-imap + pkg install --yes php82-ldap php82-sockets php82-simplexml php82-xml php82-session php82-iconv + pkg install --yes php82-posix php82-pcntl php82-zlib php82-filter php82-curl php82-mbstring + pkg install --yes php82-pdo_pgsql php82-pgsql +fi +if [ ."$php_version" = ."8.3" ]; then + pkg install --yes php83 php83-phar php83-pdo php83-pdo_odbc php83-pdo_sqlite php83-gd php83-imap + pkg install --yes php83-ldap php83-sockets php83-simplexml php83-xml php83-session php83-iconv + pkg install --yes php83-posix php83-pcntl php83-zlib php83-filter php83-curl php83-mbstring + pkg install --yes php83-pdo_pgsql php83-pgsql +fi +if [ ."$php_version" = ."8.4" ]; then + pkg install --yes php84 php84-phar php84-pdo php84-pdo_odbc php84-pdo_sqlite php84-gd + pkg install --yes php84-ldap php84-sockets php84-simplexml php84-xml php84-session php84-iconv + pkg install --yes php84-posix php84-pcntl php84-zlib php84-filter php84-curl php84-mbstring + pkg install --yes php84-pdo_pgsql php84-pgsql + pkg install --yes php84-imap +fi +if [ ."$php_version" = ."8.5" ]; then + pkg install --yes php85 php85-phar php85-pdo php85-pdo_odbc php85-pdo_sqlite php85-gd php85-imap + pkg install --yes php85-ldap php85-sockets php85-simplexml php85-xml php85-session php85-iconv + pkg install --yes php85-posix php85-pcntl php85-zlib php85-filter php85-curl php85-mbstring + pkg install --yes php85-pdo_pgsql php85-pgsql +fi #send a message verbose "Configuring PHP" diff --git a/freebsd/resources/postgresql.sh b/freebsd/resources/postgresql.sh index 34a5cb7..ec83e3e 100755 --- a/freebsd/resources/postgresql.sh +++ b/freebsd/resources/postgresql.sh @@ -24,6 +24,14 @@ password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20) echo "Install PostgreSQL and create the database and users\n" #postgres install +if [ ."$database_version" = ."18" ]; then + pkg install --yes postgresql18-server + #cd /usr/ports/databases/postgresql18-server/ && make install clean BATCH=yes +fi +if [ ."$database_version" = ."17" ]; then + pkg install --yes postgresql17-server + #cd /usr/ports/databases/postgresql17-server/ && make install clean BATCH=yes +fi if [ ."$database_version" = ."16" ]; then echo "IGNORE_DEPENDS=postgresql15-client" >> /usr/local/etc/pkg.conf pkg install --yes postgresql16-server @@ -53,6 +61,12 @@ echo 'postgresql_enable=true' >> /etc/rc.conf /usr/local/etc/rc.d/postgresql initdb #start postgresql +if [ ."$database_version" = ."18" ]; then + sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data18 start +fi +if [ ."$database_version" = ."17" ]; then + sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data17 start +fi if [ ."$database_version" = ."16" ]; then sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data16 start fi diff --git a/ubuntu/resources/php.sh b/ubuntu/resources/php.sh index 5af1db4..fc0bc5b 100755 --- a/ubuntu/resources/php.sh +++ b/ubuntu/resources/php.sh @@ -75,7 +75,8 @@ if [ ."$php_version" = ."8.3" ]; then apt-get install -y php8.3 php8.3-cli php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-imap php8.3-xml php8.3-gd php8.3-mbstring fi if [ ."$php_version" = ."8.4" ]; then - apt-get install -y php8.4 php8.4-cli php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-imap php8.4-xml php8.4-gd php8.4-mbstring + apt-get install -y php8.4 php8.4-cli php8.4-fpm php8.4-pgsql php8.4-sqlite3 php8.4-odbc php8.4-curl php8.4-xml php8.4-gd php8.4-mbstring + apt-get install -y php8.4-imap fi #update config if source is being used