├── debian-buster ├── install │ ├── etc │ │ ├── fix-attrs.d │ │ │ ├── 02-zabbix │ │ │ ├── 03-logrotate │ │ │ ├── 00-functions │ │ │ └── 01-s6 │ │ ├── zabbix │ │ │ ├── zabbix_agentd.conf.d │ │ │ │ ├── container_os.conf │ │ │ │ └── updated_packages.conf │ │ │ └── zabbix_agentd.conf │ │ ├── cont-init.d │ │ │ ├── 01-timezone │ │ │ ├── 04-cron │ │ │ ├── 00-startup │ │ │ ├── 05-smtp │ │ │ ├── 03-zabbix │ │ │ ├── 99-container │ │ │ └── 02-permissions │ │ └── services.available │ │ │ ├── 03-zabbix │ │ │ └── run │ │ │ ├── 05-smtp │ │ │ └── run │ │ │ └── 04-cron │ │ │ └── run │ └── assets │ │ └── defaults │ │ ├── 01-permissions │ │ ├── 04-cron │ │ ├── 05-smtp │ │ ├── 00-container │ │ └── 03-zabbix ├── LICENSE ├── Dockerfile ├── CHANGELOG.md ├── README.md └── zabbix_templates │ └── zabbix_agent_container.xml ├── freepbx-15 ├── install │ ├── assets │ │ ├── defaults │ │ │ ├── 05-fail2ban │ │ │ └── 10-freepbx │ │ └── functions │ │ │ └── 10-freepbx │ ├── etc │ │ ├── zabbix │ │ │ └── zabbix_agentd.conf.d │ │ │ │ ├── apache.conf │ │ │ │ ├── asterisk.conf │ │ │ │ └── scripts │ │ │ │ ├── asterisk.sh │ │ │ │ └── apache.sh │ │ ├── fail2ban │ │ │ └── filter.d │ │ │ │ ├── freepbx.conf │ │ │ │ ├── asterisk-security.conf │ │ │ │ └── asterisk.conf │ │ ├── logrotate.d │ │ │ ├── fop │ │ │ ├── fail2ban │ │ │ ├── asterisk │ │ │ └── apache2 │ │ ├── odbcinst.ini │ │ ├── cont-finish.d │ │ │ ├── 10-freepbx │ │ │ ├── 11-mariadb │ │ │ └── 12-mongo │ │ ├── odbc.ini │ │ ├── cont-init.d │ │ │ ├── 04-cron │ │ │ ├── 15-socat │ │ │ ├── 08-mongodb │ │ │ ├── 09-mariadb │ │ │ ├── 05-fail2ban │ │ │ └── 10-freepbx │ │ ├── services.available │ │ │ ├── 15-socat │ │ │ │ └── run │ │ │ └── 08-mongodb │ │ │ │ └── run │ │ └── locale.gen │ └── usr │ │ └── sbin │ │ ├── upgrade-core │ │ ├── upgrade-cdr │ │ └── watson-transcription ├── LICENSE ├── examples │ └── docker-compose.yml ├── README.md ├── Dockerfile └── CHANGELOG.md ├── dockerfile-export.bat ├── dockerfile.bat ├── nodejs-10-debian ├── CHANGELOG.md ├── Dockerfile ├── LICENSE └── README.md ├── docker-compose.yaml ├── README.md ├── patches.txt └── Dockerfile /debian-buster/install/etc/fix-attrs.d/02-zabbix: -------------------------------------------------------------------------------- 1 | /etc/zabbix/ true zabbix 0755 0755 2 | -------------------------------------------------------------------------------- /debian-buster/install/etc/fix-attrs.d/03-logrotate: -------------------------------------------------------------------------------- 1 | /etc/logrotate.d true root 0644 0644 2 | -------------------------------------------------------------------------------- /freepbx-15/install/assets/defaults/05-fail2ban: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | ENABLE_FAIL2BAN=${ENABLE_FAIL2BAN:-"TRUE"} -------------------------------------------------------------------------------- /debian-buster/install/etc/fix-attrs.d/00-functions: -------------------------------------------------------------------------------- 1 | /assets/defaults/* true root 0755 0755 2 | /assets/functions/* true root 0755 0755 3 | -------------------------------------------------------------------------------- /debian-buster/install/etc/fix-attrs.d/01-s6: -------------------------------------------------------------------------------- 1 | /etc/cont-init.d/* true root 0755 0755 2 | /etc/s6/services.available/*/ true root 0755 0755 3 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/zabbix/zabbix_agentd.conf.d/apache.conf: -------------------------------------------------------------------------------- 1 | UserParameter=apache[*],/etc/zabbix/zabbix_agentd.conf.d/scripts/apache.sh \$1 2 | -------------------------------------------------------------------------------- /debian-buster/install/etc/zabbix/zabbix_agentd.conf.d/container_os.conf: -------------------------------------------------------------------------------- 1 | UserParameter=agent.os,grep "PRETTY_NAME" /etc/os-release | cut -d '"' -f2 2 | -------------------------------------------------------------------------------- /debian-buster/install/etc/zabbix/zabbix_agentd.conf.d/updated_packages.conf: -------------------------------------------------------------------------------- 1 | UserParameter=packages.upgradable,sudo apt-get update >/dev/null && sudo aptitude search '~U' | wc -l 2 | 3 | -------------------------------------------------------------------------------- /debian-buster/install/assets/defaults/01-permissions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | DEBUG_PERMISSIONS=${DEBUG_PERMISSIONS:-"FALSE"} 4 | ENABLE_PERMISSIONS=${ENABLE_PERMISSIONS:-"FALSE"} 5 | -------------------------------------------------------------------------------- /dockerfile-export.bat: -------------------------------------------------------------------------------- 1 | docker buildx create --name mybuilder --use 2 | docker buildx build --platform linux/arm/v7 -t epandi/asterisk-freepbx-arm:17.15.2 --output type=tar,dest=release.tar . 3 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/fail2ban/filter.d/freepbx.conf: -------------------------------------------------------------------------------- 1 | [INCLUDES] 2 | 3 | [Definition] 4 | 5 | failregex = .* Authentication failure for .* from \. 6 | 7 | ignoreregex = 8 | 9 | 10 | -------------------------------------------------------------------------------- /dockerfile.bat: -------------------------------------------------------------------------------- 1 | docker buildx create --name mybuilder --use 2 | docker buildx build --platform linux/arm/v7 -t epandi/asterisk-freepbx-arm:17.15.2 -t epandi/asterisk-freepbx-arm:17.15-latest --push . 3 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/logrotate.d/fop: -------------------------------------------------------------------------------- 1 | /var/log/fop/fop2_debug.log { 2 | daily 3 | ifempty 4 | rotate 7 5 | missingok 6 | compress 7 | dateext 8 | copytruncate 9 | } 10 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/odbcinst.ini: -------------------------------------------------------------------------------- 1 | [MySQL] 2 | Description = ODBC for MariaDB 3 | Driver = /usr/local/lib/libmaodbc.so 4 | Setup = /usr/lib/arm-linux-gnueabihf/odbc/libodbcmyS.so 5 | FileUsage = 1 6 | 7 | -------------------------------------------------------------------------------- /debian-buster/install/assets/defaults/04-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | ENABLE_CRON=${ENABLE_CRON:-"TRUE"} 4 | ENABLE_LOGROTATE=${ENABLE_LOGROTATE:-"TRUE"} 5 | LOGROTATE_FORCE=${LOGROTATE_FORCE:-"TRUE"} -------------------------------------------------------------------------------- /freepbx-15/install/etc/logrotate.d/fail2ban: -------------------------------------------------------------------------------- 1 | /var/log/fail2ban/fail2ban.log { 2 | daily 3 | ifempty 4 | rotate 7 5 | missingok 6 | compress 7 | dateext 8 | copytruncate 9 | } 10 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-finish.d/10-freepbx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | 6 | silent fwconsole stop --immediate 7 | rm -f /tmp/state/*-freepbx* 8 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/odbc.ini: -------------------------------------------------------------------------------- 1 | [MySQL-asteriskcdrdb] 2 | Description = MariaDB connection to 'asteriskcdrdb' database 3 | driver = MySQL 4 | server = localhost 5 | database = asteriskcdrdb 6 | Port = 3306 7 | Socket = /var/run/mysqld/mysqld.sock 8 | option = 3 9 | -------------------------------------------------------------------------------- /nodejs-10-debian/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.1 2020-03-11 2 | 3 | ### Added 4 | - NodeJS 10 5 | - Debian Buster 6 | 7 | 8 | ## 1.0 2017-12-01 9 | 10 | * Node 9.2 11 | * Yarn 12 | * Debian Stretch 13 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-finish.d/11-mariadb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | 6 | if var_true "$DB_EMBEDDED" ; then 7 | silent service mysql stop 8 | rm -f /tmp/state/*-mariadb* 9 | fi 10 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/01-timezone: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | PROCESS_NAME="timezone" 5 | 6 | ### Timezone setup 7 | if [ -n "$TIMEZONE" ]; then 8 | set_timezone "${TIMEZONE}" 9 | fi 10 | 11 | liftoff 12 | -------------------------------------------------------------------------------- /freepbx-15/install/assets/functions/10-freepbx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | check_process() { 4 | while true; do 5 | pid=$(pgrep php | wc -l) 6 | if [ "$pid" = "1" ]; then 7 | sleep 3 8 | else 9 | sleep 1 10 | break 11 | fi 12 | done 13 | } -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-finish.d/12-mongo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | 6 | if var_true "$ENABLE_XMPP" ; then 7 | silent mongod --unixSocketPrefix=/var/run/mongodb --shutdown 8 | rm -f /tmp/state/*-mongo* 9 | fi -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/04-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | 6 | ### Check to see if enabled/disabled 7 | if var_true "$ENABLE_CRON" ; then 8 | print_debug "Creating Cron folder" 9 | silent mkdir -p /var/spool/cron 10 | fi 11 | 12 | liftoff -------------------------------------------------------------------------------- /freepbx-15/install/etc/services.available/15-socat/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | # shellcheck disable=SC2034 5 | PROCESS_NAME="socat" 6 | 7 | check_container_initialized 8 | check_service_initialized init 9 | exec socat tcp-listen:25,bind=127.0.0.1,fork,reuseaddr tcp:"$SMTP_HOST":"$SMTP_PORT" -------------------------------------------------------------------------------- /freepbx-15/install/etc/logrotate.d/asterisk: -------------------------------------------------------------------------------- 1 | /var/log/asterisk/full 2 | /var/log/asterisk/freepbx.log 3 | /var/log/asterisk/freepbx_security.log 4 | /var/log/asterisk/ucp_err.log 5 | /var/log/asterisk/ucp_out.log { 6 | daily 7 | ifempty 8 | rotate 7 9 | missingok 10 | su asterisk asterisk 11 | compress 12 | dateext 13 | copytruncate 14 | } 15 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/services.available/08-mongodb/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | # shellcheck disable=SC2034 5 | PROCESS_NAME="mongo" 6 | 7 | check_container_initialized 8 | check_service_initialized init 9 | chown -R mongodb. /var/log/mongodb 10 | rm -rf /var/run/mongodb/* 11 | exec mongod --unixSocketPrefix=/var/run/mongodb run -------------------------------------------------------------------------------- /debian-buster/install/etc/services.available/03-zabbix/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | PROCESS_NAME="zabbix" 5 | 6 | output_off 7 | check_container_initialized 8 | check_service_initialized init 9 | liftoff 10 | output_on 11 | 12 | ### Start Zabbix 13 | print_info "Starting Zabbix Agent" 14 | silent exec s6-setuidgid zabbix zabbix_agentd -f 15 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/logrotate.d/apache2: -------------------------------------------------------------------------------- 1 | /var/log/apache2/*.log 2 | { 3 | daily 4 | ifempty 5 | rotate 7 6 | missingok 7 | compress 8 | dateext 9 | copytruncate 10 | sharedscripts 11 | postrotate 12 | if /etc/init.d/apache2 status > /dev/null ; then \ 13 | /etc/init.d/apache2 reload > /dev/null; \ 14 | fi; 15 | endscript 16 | 17 | } 18 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/04-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | PROCESS_NAME="cron" 6 | 7 | output_off 8 | ### Check to see if Enabled/Disabled 9 | if var_false "$ENABLE_CRON" ; then 10 | print_notice "Disabling Cron" 11 | service_stop "$(basename "$0")" 12 | else 13 | touch /assets/cron/crontab.txt 14 | fi 15 | 16 | output_on 17 | liftoff -------------------------------------------------------------------------------- /debian-buster/install/assets/defaults/05-smtp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | DEBUG_SMTP=${DEBUG_SMTP:-"FALSE"} 4 | ENABLE_SMTP=${ENABLE_SMTP:-"TRUE"} 5 | SMTP_HOST=${SMTP_HOST:-"postfix-relay"} 6 | SMTP_PORT=${SMTP_PORT:-"25"} 7 | SMTP_DOMAIN=${SMTP_DOMAIN:-"docker"} 8 | SMTP_MAILDOMAIN=${SMTP_MAILDOMAIN:-"local"} 9 | SMTP_TLS=${SMTP_TLS:-"off"} 10 | SMTP_STARTTLS=${SMTP_STARTTLS:-"off"} 11 | SMTP_TLSCERTCHECK=${SMTP_TLSCERTCHECK:-"off"} 12 | -------------------------------------------------------------------------------- /debian-buster/install/assets/defaults/00-container: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | ### Set defaults 4 | CONTAINER_ENABLE_DOCKER_SECRETS=${CONTAINER_ENABLE_DOCKER_SECRETS:-"TRUE"} 5 | CONTAINER_LOG_LEVEL=${CONTAINER_LOG_LEVEL:-"NOTICE"} 6 | DEBUG_MODE=${DEBUG_MODE:-"FALSE"} 7 | PROCESS_NAME=${PROCESS_NAME:-"container"} 8 | # shellcheck disable=SC2034 9 | SCRIPTPATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 || exit ; pwd -P)" 10 | SKIP_SANITY_CHECK=${SKIP_SANITY_CHECK:-"FALSE"} -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/15-socat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | # shellcheck disable=SC2034 6 | PROCESS_NAME="socat" 7 | 8 | if [ "$SMTP_HOST" != "localhost" -a "$SMTP_HOST" != "127.0.0.1" -o "$SMTP_PORT" != 25 ] && var_true "$ENABLE_SMTP" ; then 9 | print_notice "Custom SMTP relay detected, enabling proxy" 10 | service_start 15-socat 11 | else 12 | service_stop 15-socat 13 | fi 14 | 15 | liftoff -------------------------------------------------------------------------------- /freepbx-15/install/etc/fail2ban/filter.d/asterisk-security.conf: -------------------------------------------------------------------------------- 1 | [INCLUDES] 2 | 3 | [Definition] 4 | 5 | failregex = SECURITY.* SecurityEvent="FailedACL".*RemoteAddress=".+?/.+?//.+?".* 6 | SECURITY.* SecurityEvent="InvalidAccountID".*RemoteAddress=".+?/.+?//.+?".* 7 | SECURITY.* SecurityEvent="ChallengeResponseFailed".*RemoteAddress=".+?/.+?//.+?".* 8 | SECURITY.* SecurityEvent="InvalidPassword".*RemoteAddress=".+?/.+?//.+?".* 9 | 10 | ignoreregex = 11 | -------------------------------------------------------------------------------- /debian-buster/install/etc/services.available/05-smtp/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service defaults single 5 | 6 | output_off 7 | check_container_initialized 8 | check_service_initialized init 9 | liftoff 10 | 11 | if var_true "$DEBUG_SMTP" ; then 12 | print_info "Starting MailHog - enabled at port 1025, map an exposed port and visit Visit http://127.0.0.1:8025 for web interface" 13 | silent exec s6-setuidgid mailhog MailHog; 14 | fi 15 | 16 | output_on 17 | -------------------------------------------------------------------------------- /debian-buster/install/etc/zabbix/zabbix_agentd.conf: -------------------------------------------------------------------------------- 1 | LogFile=/var/log/zabbix/zabbix_agentd.log 2 | LogFileSize=1 3 | DebugLevel=3 4 | AllowKey=system.run[] 5 | LogRemoteCommands=1 6 | Server=0.0.0.0/0 7 | ListenPort=10050 8 | ListenIP=0.0.0.0 9 | StartAgents=3 10 | ServerActive=zabbix-proxy 11 | Hostname= 12 | RefreshActiveChecks=120 13 | BufferSend=5 14 | BufferSize=100 15 | MaxLinesPerSecond=20 16 | AllowRoot=1 17 | User=zabbix 18 | Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf 19 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/00-startup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | PROCESS_NAME="container-init" 5 | 6 | ### Routine to check if container has been restarted or not 7 | if [ -d "/tmp/state" ] ; then 8 | print_notice "Detected Container that has been restarted - Cleaning '/tmp/state' files" 9 | rm -rf /tmp/state/* 10 | rm -rf /etc/services.d/* 11 | else 12 | print_debug "Cold Container startup detected - Proceeding to initialize services normally" 13 | fi 14 | 15 | liftoff 16 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/08-mongodb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | # shellcheck disable=SC2034 5 | PROCESS_NAME="mongo" 6 | 7 | if var_true "$ENABLE_XMPP" ; then 8 | print_notice "Enabling MongoDB for XMPP support" 9 | mkdir -p /data/db 10 | mkdir -p /data/var/lib/mongodb 11 | mkdir -p /var/log/mongodb 12 | chown -R mongodb. /var/log/mongodb 13 | rm -rf /var/run/mongodb/* 14 | touch /var/log/mongodb/mongod.log 15 | service_start 08-mongodb 16 | else 17 | service_stop 08-mongodb 18 | fi 19 | 20 | liftoff -------------------------------------------------------------------------------- /freepbx-15/install/usr/sbin/upgrade-core: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv /bin/bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service defaults 5 | 6 | ## When updating core or the framework modules, FreePBX will fail due to the in the `featurecodes` table `helptext` column being corrupt. 7 | ## This is a simple script to update FreePBX framework and core modules 8 | 9 | mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" -P"$DB_PORT" -e 'USE '"$DB_NAME"'; UPDATE featurecodes SET helptext = "";' 10 | fwconsole ma upgrade framework 11 | fwconsole ma upgrade core 12 | fwconsole chown 13 | fwconsole reload 14 | chown -R asterisk. /etc/asterisk 15 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/09-mariadb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service 10-freepbx 5 | # shellcheck disable=SC2034 6 | PROCESS_NAME="mariadb" 7 | 8 | if var_true "$DB_EMBEDDED" ; then 9 | silent service mysql stop 10 | mkdir -p /var/lib/mysql 11 | 12 | if [ ! -d /var/lib/mysql/mysql ]; then 13 | print_info "New embedded database detected, setting up.." 14 | cp -R /assets/config/var/lib/mysql/* /var/lib/mysql 15 | fi 16 | 17 | chown -R mysql. /var/lib/mysql 18 | silent service mysql start 19 | else 20 | print_info "No embedded database detected, skip.." 21 | fi 22 | 23 | liftoff -------------------------------------------------------------------------------- /freepbx-15/install/assets/defaults/10-freepbx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | ADMIN_DIRECTORY=${ADMIN_DIRECTORY:-"/admin"} 4 | DB_EMBEDDED=${DB_EMBEDDED:-"TRUE"} 5 | DB_PORT=${DB_PORT:-3306} 6 | ENABLE_FOP=${ENABLE_FOP:-"FALSE"} 7 | ENABLE_SMTP=${ENABLE_SMTP:-"TRUE"} 8 | ENABLE_SSL=${ENABLE_SSL:-"TRUE"} 9 | ENABLE_VM_TRANSCRIBE=${ENABLE_VM_TRANSCRIBE:-"FALSE"} 10 | ENABLE_XMPP=${ENABLE_XMPP:-"FALSE"} 11 | FOP_DIRECTORY=${FOP_DIRECTORY:-"/fop"} 12 | FREEPBX_VERSION=${FREEPBX_VERSION:-"15.0.16.56"} 13 | HTTPS_PORT=${HTTPS_PORT:-443} 14 | HTTP_PORT=${HTTP_PORT:-80} 15 | UCP_FIRST=${UCP_FIRST:-"TRUE"} 16 | VM_TRANSCRIBE_MODEL=${VM_TRANSCRIBE_MODEL:-"en-GB_NarrowbandModel"} 17 | WEBROOT=${WEBROOT:-"/var/www/html"} -------------------------------------------------------------------------------- /nodejs-10-debian/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tiredofit/debian:buster 2 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 3 | 4 | ### Environment variables 5 | ENV ENABLE_CRON=FALSE \ 6 | ENABLE_SMTP=FALSE 7 | 8 | ### Add users 9 | RUN adduser --home /app --gecos "Node User" --disabled-password nodejs && \ 10 | 11 | ### Install NodeJS 12 | curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ 13 | echo 'deb https://deb.nodesource.com/node_10.x buster main' > /etc/apt/sources.list.d/nodesource.list && \ 14 | echo 'deb-src https://deb.nodesource.com/node_10.x buster main' >> /etc/apt/sources.list.d/nodesource.list && \ 15 | apt-get update && \ 16 | apt-get install -y \ 17 | nodejs \ 18 | yarn \ 19 | && \ 20 | \ 21 | apt-get clean && \ 22 | apt-get autoremove -y && \ 23 | rm -rf /var/lib/apt/lists/* -------------------------------------------------------------------------------- /debian-buster/install/etc/services.available/04-cron/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service defaults single 5 | PROCESS_NAME="cron" 6 | 7 | output_off 8 | check_container_initialized 9 | check_service_initialized init 10 | 11 | if [ ! -f /tmp/state/"$(basename "$0")" ]; then 12 | if var_true "$ENABLE_LOGROTATE" ; then 13 | if var_true "${LOGROTATE_FORCE}" ; then 14 | logrotate_force="-f" 15 | fi 16 | sleep 60 17 | print_debug "Enabling log rotation" 18 | echo "59 23 * * * logrotate ${logrotate_force} /etc/logrotate.d >/dev/null 2>&1" >>/assets/cron/crontab.txt 19 | fi 20 | fi 21 | 22 | if [ -d /assets/cron-custom ]; then 23 | print_info "Found custom crontab - merging" 24 | cat /assets/cron-custom/* >>/assets/cron/crontab.txt 25 | fi 26 | 27 | liftoff 28 | 29 | print_info "Starting cron" 30 | touch /assets/cron/crontab.txt 31 | /usr/bin/crontab /assets/cron/crontab.txt 32 | output_on 33 | silent exec /usr/sbin/cron -f -l 8 34 | -------------------------------------------------------------------------------- /debian-buster/install/assets/defaults/03-zabbix: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | ENABLE_ZABBIX=${ENABLE_ZABBIX:-"TRUE"} 4 | ZABBIX_ALLOW_ROOT=${ZABBIX_ALLOW_ROOT:-"1"} 5 | ZABBIX_BUFFER_SEND=${ZABBIX_BUFFER_SEND:-"5"} 6 | ZABBIX_BUFFER_SIZE=${ZABBIX_BUFFER_SIZE:-"100"} 7 | ZABBIX_DEBUGLEVEL=${ZABBIX_DEBUGLEVEL:-"1"} 8 | ZABBIX_HOSTNAME=${ZABBIX_HOSTNAME:-"docker"} 9 | ZABBIX_LISTEN_IP=${ZABBIX_LISTEN_IP:-"0.0.0.0"} 10 | ZABBIX_LISTEN_PORT=${ZABBIX_LISTEN_PORT:-"10050"} 11 | ZABBIX_LOGFILE=${ZABBIX_LOGFILE:-"/var/log/zabbix/zabbix_agentd.log"} 12 | ZABBIX_LOGFILESIZE=${ZABBIX_LOGFILESIZE:-"1"} 13 | ZABBIX_MAXLINES_SECOND=${ZABBIX_MAXLINES_SECOND:-"20"} 14 | ZABBIX_REFRESH_ACTIVE_CHECKS=${ZABBIX_REFRESH_ACTIVE_CHECKS:-"120"} 15 | ZABBIX_REMOTECOMMANDS_ALLOW=${ZABBIX_REMOTECOMMANDS:-"*"} 16 | ZABBIX_REMOTECOMMANDS_LOG=${ZABBIX_REMOTECOMMANDS_LOG:-"1"} 17 | ZABBIX_SERVER=${ZABBIX_SERVER:-"0.0.0.0/0"} 18 | ZABBIX_SERVER_ACTIVE=${ZABBIX_SERVER_ACTIVE:-"zabbix-proxy"} 19 | ZABBIX_START_AGENTS=${ZABBIX_START_AGENTS:-"2"} 20 | ZABBIX_USER=${ZABBIX_USER:-"zabbix"} -------------------------------------------------------------------------------- /debian-buster/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Dave Conroy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /nodejs-10-debian/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Dave Conroy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /freepbx-15/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Dave Conroy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /freepbx-15/install/usr/sbin/upgrade-cdr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv /bin/bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service defaults 5 | 6 | if var_false "$DB_EMBEDDED" ; then 7 | ## This is a dirty hack to allow for updating the CDR Module to use a separate DB Host and the same DB as FreePBX. 8 | echo '** [freepbx] Performing Manual Upgrade of CDR Module' 9 | cp -R "$WEBROOT"/admin/modules/cdr/install.php "$WEBROOT"/admin/modules/cdr/.install.php 10 | # shellcheck disable=SC2016 11 | sed -i -e 's/\$db_host = !empty(\$db_host) ? \$db_host : "localhost";/\$db_host = !empty(\$db_host) ? \$db_host : "'"$DB_HOST"'";/g' "$WEBROOT"/admin/modules/cdr/install.php 12 | # shellcheck disable=SC2016 13 | sed -i -e 's/\$db_name = !empty(\$db_name) ? \$db_name : "asteriskcdrdb";/\$db_name = !empty(\$db_name) ? \$db_name : "'"$DB_NAME"'";/g' "$WEBROOT"/admin/modules/cdr/install.php 14 | fwconsole ma upgrade cdr 15 | cp -R "$WEBROOT"/admin/modules/cdr/.install.php "$WEBROOT"/admin/modules/cdr/install.php 16 | fwconsole chown 17 | fwconsole reload 18 | chown -R asterisk. /etc/asterisk 19 | else 20 | echo '** [freepbx] There is no need for you to run this script as you are using the embedded database' 21 | fi -------------------------------------------------------------------------------- /freepbx-15/install/etc/zabbix/zabbix_agentd.conf.d/asterisk.conf: -------------------------------------------------------------------------------- 1 | UserParameter=calls.active,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh calls.active 2 | UserParameter=calls.processed,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh calls.processed 3 | UserParameter=calls.longest, /etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh calls.longest 4 | UserParameter=channels.active,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh channels.active 5 | UserParameter=status,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh status 6 | UserParameter=status.crashes,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh status.crashes 7 | UserParameter=status.reload,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh status.reload 8 | UserParameter=status.uptime,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh status.uptime 9 | UserParameter=status.version,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh status.version 10 | UserParameter=iax.register.time,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh iax.register.time 11 | UserParameter=iax.trunk.down,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh iax.trunk.down 12 | UserParameter=sip.register.time,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh sip.register.time 13 | UserParameter=sip.trunk.down,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh sip.trunk.down 14 | UserParameter=wrong.password,/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh wrong.password 15 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/05-fail2ban: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | # shellcheck disable=SC2034 6 | PROCESS_NAME="fail2ban" 7 | 8 | if var_true "$ENABLE_FAIL2BAN" ; then 9 | sed -i -e "s/logtarget = \/var\/log\/fail2ban.log/logtarget = \/var\/log\/fail2ban\/fail2ban.log/g" /etc/fail2ban/fail2ban.conf 10 | rm -rf /etc/fail2ban/jail.d/* 11 | mkdir -p /var/log/asterisk/ 12 | mkdir -p /var/log/fail2ban/ 13 | touch /var/log/asterisk/full 14 | touch /var/log/asterisk/freepbx_security.log 15 | cat < /etc/fail2ban/jail.conf 16 | 17 | #[asterisk-iptables] 18 | #backend = auto 19 | #enabled = true 20 | #filter = asterisk 21 | #logpath = /var/log/asterisk/full 22 | #maxretry = 3 23 | #bantime = 86400 24 | #findtime = 3600 25 | #action = iptables-allports[name=ASTERISK, protocol=all] 26 | #ignoreip = 127.0.0.1/8 27 | 28 | [asterisk-security-iptables] 29 | backend = auto 30 | enabled = true 31 | filter = asterisk-security 32 | logpath = /var/log/asterisk/full 33 | maxretry = 5 34 | bantime = 86400 35 | findtime = 3600 36 | action = iptables-allports[name=ASTERISK-security, protocol=all] 37 | ignoreip = 127.0.0.1/8 38 | 39 | [freepbx-iptables] 40 | backend = auto 41 | enabled = true 42 | filter = asterisk 43 | logpath = /var/log/asterisk/freepbx_security.log 44 | maxretry = 5 45 | bantime = 86400 46 | findtime = 3600 47 | action = iptables-allports[name=ASTERISK, protocol=all] 48 | ignoreip = 127.0.0.1/8 49 | EOF 50 | 51 | print_info "Starting Fail2ban" 52 | silent service fail2ban start 53 | fi 54 | 55 | liftoff -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/05-smtp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | # shellcheck disable=SC2034 6 | PROCESS_NAME="smtp" 7 | 8 | output_off 9 | ### Debug mode - enable mailHog 10 | if var_true "$DEBUG_SMTP" ; then 11 | print_notice "SMTP debugging mode activated" 12 | SMTP_HOST="localhost" 13 | SMTP_PORT=1025 14 | else 15 | service_stop "$(basename "$0")" 16 | fi 17 | 18 | rm -f /usr/sbin/sendmail 19 | ln -s /usr/bin/msmtp /usr/sbin/sendmail 20 | 21 | if var_true "$ENABLE_SMTP" ; then 22 | rm -f /usr/sbin/sendmail 23 | ln -s /usr/bin/msmtp /usr/sbin/sendmail 24 | 25 | echo "### Automatically generated on container start. See documentation on how to set!" > /etc/msmtprc 26 | { 27 | echo "account default " 28 | echo "host ${SMTP_HOST}" 29 | echo "port ${SMTP_PORT}" 30 | echo "domain ${SMTP_DOMAIN}" 31 | if [ -n "SMTP_FROM" ]; then echo "from ${SMTP_FROM}"; fi 32 | echo "maildomain ${SMTP_MAILDOMAIN}" 33 | if [ -n "$SMTP_AUTHENTICATION" ]; then echo "auth ${SMTP_AUTHENTICATION}"; fi 34 | if [ -n "$SMTP_USER" ]; then echo "user ${SMTP_USER}"; fi 35 | if [ -n "$SMTP_PASS" ]; then echo "password ${SMTP_PASS}"; fi 36 | echo "tls ${SMTP_TLS}" 37 | echo "tls_starttls ${SMTP_STARTTLS}" 38 | echo "tls_certcheck ${SMTP_TLSCERTCHECK}" 39 | ### Gmail Specific SMTP Config 40 | if var_true "$ENABLE_SMTP_GMAIL" ; then echo "auto_from on"; fi 41 | } >> /etc/msmtprc 42 | 43 | print_notice "Sendmail replaced and enabled to route mail to: '${SMTP_HOST}'" 44 | else 45 | print_notice "Disabling SMTP Features" 46 | fi 47 | 48 | output_on 49 | liftoff 50 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | freepbx-app: 5 | container_name: freepbx-app 6 | image: epandi/asterisk-freepbx-arm:17.15.1 7 | ports: 8 | #### If you aren't using a reverse proxy 9 | - 8099:80 10 | #### If you want SSL Support and not using a reverse proxy 11 | #- 443:443 12 | - 5060:5060/udp 13 | - 5160:5160/udp 14 | - 18000-18100:18000-18100/udp 15 | #### Flash Operator Panel 16 | - 4445:4445 17 | volumes: 18 | - /home/pi/Docker/asterisk17/certs:/certs 19 | - /home/pi/Docker/asterisk17/data:/data 20 | - /home/pi/Docker/asterisk17/logs:/var/log 21 | - /home/pi/Docker/asterisk17/data/www:/var/www/html 22 | ### Only Enable this option below if you set DB_EMBEDDED=TRUE 23 | - /home/pi/Docker/asterisk17/db:/var/lib/mysql 24 | ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care 25 | #- ./assets/custom:/assets/custom 26 | 27 | environment: 28 | - VIRTUAL_HOST=asterisk.local 29 | - VIRTUAL_NETWORK=nginx-proxy 30 | ### If you want to connect to the SSL Enabled Container 31 | #- VIRTUAL_PORT=443 32 | #- VIRTUAL_PROTO=https 33 | - VIRTUAL_PORT=80 34 | - LETSENCRYPT_HOST=hostname.example.com 35 | - LETSENCRYPT_EMAIL=email@example.com 36 | 37 | - ZABBIX_HOSTNAME=freepbx-app 38 | 39 | - RTP_START=18000 40 | - RTP_FINISH=18100 41 | 42 | ## Use for External MySQL Server 43 | - DB_EMBEDDED=TRUE 44 | 45 | ### These are only necessary if DB_EMBEDDED=FALSE 46 | # - DB_HOST=freepbx-db 47 | # - DB_PORT=3306 48 | # - DB_NAME=asterisk 49 | # - DB_USER=asterisk 50 | # - DB_PASS=asteriskpass 51 | 52 | ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these: 53 | #- TLS_CERT=cert.pem 54 | #- TLS_KEY=key.pem 55 | 56 | restart: always 57 | network_mode: "bridge" 58 | 59 | ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment 60 | cap_add: 61 | - NET_ADMIN 62 | privileged: true 63 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/03-zabbix: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | PROCESS_NAME="zabbix" 6 | 7 | output_off 8 | ### Debug Mode 9 | if var_true "$DEBUG_MODE" ; then 10 | ZABBIX_DEBUGLEVEL=4 11 | fi 12 | 13 | ### Check to see if Enabled/Disabled 14 | if var_true "$ENABLE_ZABBIX" ; then 15 | sed -i -e "s||$ZABBIX_LOGFILE|g" /etc/zabbix/zabbix_agentd.conf 16 | sed -i -e "s//$ZABBIX_LOGFILESIZE/g" /etc/zabbix/zabbix_agentd.conf 17 | sed -i -e "s//$ZABBIX_DEBUGLEVEL/g" /etc/zabbix/zabbix_agentd.conf 18 | sed -i -e "s//$ZABBIX_REMOTECOMMANDS_ALLOW/g" /etc/zabbix/zabbix_agentd.conf 19 | sed -i -e "s//$ZABBIX_REMOTECOMMANDS_LOG/g" /etc/zabbix/zabbix_agentd.conf 20 | sed -i -e "s||$ZABBIX_SERVER|g" /etc/zabbix/zabbix_agentd.conf 21 | sed -i -e "s//$ZABBIX_LISTEN_PORT/g" /etc/zabbix/zabbix_agentd.conf 22 | sed -i -e "s//$ZABBIX_LISTEN_IP/g" /etc/zabbix/zabbix_agentd.conf 23 | sed -i -e "s//$ZABBIX_START_AGENTS/g" /etc/zabbix/zabbix_agentd.conf 24 | sed -i -e "s//$ZABBIX_SERVER_ACTIVE/g" /etc/zabbix/zabbix_agentd.conf 25 | sed -i -e "s//$ZABBIX_HOSTNAME/g" /etc/zabbix/zabbix_agentd.conf 26 | sed -i -e "s//$ZABBIX_REFRESH_ACTIVE_CHECKS/g" /etc/zabbix/zabbix_agentd.conf 27 | sed -i -e "s//$ZABBIX_BUFFER_SEND/g" /etc/zabbix/zabbix_agentd.conf 28 | sed -i -e "s//$ZABBIX_BUFFER_SIZE/g" /etc/zabbix/zabbix_agentd.conf 29 | sed -i -e "s//$ZABBIX_MAXLINES_SECOND/g" /etc/zabbix/zabbix_agentd.conf 30 | sed -i -e "s//$ZABBIX_ALLOW_ROOT/g" /etc/zabbix/zabbix_agentd.conf 31 | sed -i -e "s//$ZABBIX_USER/g" /etc/zabbix/zabbix_agentd.conf 32 | 33 | if [ -n "${ZABBIX_REMOTECOMMANDS_DENY}" ]; then 34 | echo "DenyKey=system.run[${ZABBIX_REMOTECOMMANDS_DENY}]" >> /etc/zabbix/zabbix_agentd.conf 35 | fi 36 | 37 | mkdir -p "${ZABBIX_LOGFILE%/*}" 38 | chown -R "${ZABBIX_USER}" "${ZABBIX_LOGFILE%/*}" 39 | chown -R "${ZABBIX_USER}" /etc/zabbix/ 40 | else 41 | print_notice "Disabling Zabbix Monitoring Functionality" 42 | service_stop "$(basename "$0")" 43 | fi 44 | 45 | output_on 46 | liftoff 47 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/fail2ban/filter.d/asterisk.conf: -------------------------------------------------------------------------------- 1 | [INCLUDES] 2 | 3 | [Definition] 4 | 5 | #failregex = NOTICE.* .*: Registration from '.*' failed for ':.*' - Wrong password 6 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - No matching peer found 7 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - Username/auth name mismatch 8 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - Device does not match ACL 9 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - Not a local domain 10 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - Peer is not supposed to register 11 | # NOTICE.* .*: Registration from '.*' failed for ':.*' - ACL error (permit/deny) 12 | # NOTICE.* .*: Registration from '.*' failed for '' - Wrong password 13 | # NOTICE.* .*: Registration from '.*' failed for '' - No matching peer found 14 | # NOTICE.* .*: Registration from '.*' failed for '' - Username/auth name mismatch 15 | # NOTICE.* .*: Registration from '.*' failed for '' - Device does not match ACL 16 | # NOTICE.* .*: Registration from '.*' failed for '' - Not a local domain 17 | # NOTICE.* .*: Registration from '.*' failed for '' - Peer is not supposed to register 18 | # NOTICE.* .*: Registration from '.*' failed for '' - ACL error (permit/deny) 19 | # NOTICE.* .*: Registration from '\".*\".*' failed for ':.*' - No matching peer found 20 | # NOTICE.* .*: Registration from '\".*\".*' failed for ':.*' - Wrong password 21 | # NOTICE.* .*: Request '.*' from '.*' failed for ':.*' .* - Failed to authenticate 22 | # NOTICE.* .*: Request '.*' from '.*' failed for ':.*' .* - No matching endpoint found 23 | # NOTICE.* .*: No registration for peer '.*' \(from \) 24 | # NOTICE.* .*: Host failed MD5 authentication for '.*' (.*) 25 | # NOTICE.* .*: Failed to authenticate user .*@.* 26 | # NOTICE.* failed to authenticate as '.*'$ 27 | # NOTICE.* .*: Sending fake auth rejection for device .*\\>;tag=.* 28 | # NOTICE.* .*: tried to authenticate with nonexistent user '.*' 29 | # VERBOSE.*SIP/-.*Received incoming SIP connection from unknown peer 30 | # NOTICE.* .*: Call from '.*' \(:.*\) to extension '.*' rejected because extension not found in context '.*'\. 31 | 32 | 33 | ignoreregex = 34 | 35 | 36 | -------------------------------------------------------------------------------- /debian-buster/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster 2 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 3 | 4 | ### Set defaults 5 | ENV ZABBIX_VERSION=5.2 \ 6 | S6_OVERLAY_VERSION=v2.1.0.2 \ 7 | DEBUG_MODE=FALSE \ 8 | TIMEZONE=Etc/GMT \ 9 | DEBIAN_FRONTEND=noninteractive \ 10 | ENABLE_CRON=TRUE \ 11 | ENABLE_SMTP=TRUE \ 12 | ENABLE_ZABBIX=TRUE \ 13 | ZABBIX_HOSTNAME=debian.buster 14 | 15 | ### Dependencies addon 16 | RUN set -x && \ 17 | apt-get update && \ 18 | apt-get upgrade -y && \ 19 | apt-get install -y --no-install-recommends \ 20 | apt-transport-https \ 21 | aptitude \ 22 | bash \ 23 | ca-certificates \ 24 | curl \ 25 | dirmngr \ 26 | dos2unix \ 27 | gnupg \ 28 | less \ 29 | logrotate \ 30 | msmtp \ 31 | nano \ 32 | net-tools \ 33 | netcat-openbsd \ 34 | procps \ 35 | sudo \ 36 | tzdata \ 37 | vim-tiny \ 38 | && \ 39 | curl https://repo.zabbix.com/zabbix-official-repo.key | apt-key add - && \ 40 | echo "deb http://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian buster main" >>/etc/apt/sources.list && \ 41 | echo "deb-src http://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian buster main" >>/etc/apt/sources.list && \ 42 | apt-get update && \ 43 | apt-get install -y --no-install-recommends \ 44 | zabbix-agent && \ 45 | rm -rf /etc/zabbix/zabbix-agentd.conf.d/* && \ 46 | curl -sSLo /usr/local/bin/MailHog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64 && \ 47 | curl -sSLo /usr/local/bin/mhsendmail https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 && \ 48 | chmod +x /usr/local/bin/MailHog && \ 49 | chmod +x /usr/local/bin/mhsendmail && \ 50 | useradd -r -s /bin/false -d /nonexistent mailhog && \ 51 | apt-get autoremove -y && \ 52 | apt-get clean -y && \ 53 | rm -rf /var/lib/apt/lists/* /root/.gnupg /var/log/* /etc/logrotate.d && \ 54 | mkdir -p /assets/cron && \ 55 | rm -rf /etc/timezone && \ 56 | ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \ 57 | echo "${TIMEZONE}" > /etc/timezone && \ 58 | dpkg-reconfigure -f noninteractive tzdata && \ 59 | echo '%zabbix ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 60 | \ 61 | ### S6 installation 62 | curl -sSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz | tar xfz - --strip 0 -C / 63 | 64 | ### Networking configuration 65 | EXPOSE 1025 8025 10050/TCP 66 | 67 | ### Add folders 68 | ADD install / 69 | 70 | ### Entrypoint configuration 71 | ENTRYPOINT ["/init"] 72 | -------------------------------------------------------------------------------- /freepbx-15/examples/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | freepbx-app: 5 | container_name: freepbx-app 6 | image: tiredofit/freepbx 7 | ports: 8 | #### If you aren't using a reverse proxy 9 | #- 80:80 10 | #### If you want SSL Support and not using a reverse proxy 11 | #- 443:443 12 | - 5060:5060/udp 13 | - 5160:5160/udp 14 | - 18000-18100:18000-18100/udp 15 | #### Flash Operator Panel 16 | - 4445:4445 17 | volumes: 18 | - ./certs:/certs 19 | - ./data:/data 20 | - ./logs:/var/log 21 | - ./data/www:/var/www/html 22 | ### Only Enable this option below if you set DB_EMBEDDED=TRUE 23 | #- ./db:/var/lib/mysql 24 | ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care 25 | #- ./assets/custom:/assets/custom 26 | 27 | environment: 28 | - VIRTUAL_HOST=hostname.example.com 29 | - VIRTUAL_NETWORK=nginx-proxy 30 | ### If you want to connect to the SSL Enabled Container 31 | #- VIRTUAL_PORT=443 32 | #- VIRTUAL_PROTO=https 33 | - VIRTUAL_PORT=80 34 | - LETSENCRYPT_HOST=hostname.example.com 35 | - LETSENCRYPT_EMAIL=email@example.com 36 | 37 | - ZABBIX_HOSTNAME=freepbx-app 38 | 39 | - RTP_START=18000 40 | - RTP_FINISH=18100 41 | 42 | ## Use for External MySQL Server 43 | - DB_EMBEDDED=FALSE 44 | 45 | ### These are only necessary if DB_EMBEDDED=FALSE 46 | - DB_HOST=freepbx-db 47 | - DB_PORT=3306 48 | - DB_NAME=asterisk 49 | - DB_USER=asterisk 50 | - DB_PASS=asteriskpass 51 | 52 | ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these: 53 | #- TLS_CERT=cert.pem 54 | #- TLS_KEY=key.pem 55 | 56 | restart: always 57 | networks: 58 | - proxy-tier 59 | 60 | ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment 61 | cap_add: 62 | - NET_ADMIN 63 | privileged: true 64 | 65 | freepbx-db: 66 | container_name: freepbx-db 67 | image: tiredofit/mariadb 68 | restart: always 69 | volumes: 70 | - ./db:/var/lib/mysql 71 | environment: 72 | - MYSQL_ROOT_PASSWORD=password 73 | - MYSQL_DATABASE=asterisk 74 | - MYSQL_USER=asterisk 75 | - MYSQL_PASSWORD=asteriskpass 76 | networks: 77 | - proxy-tier 78 | 79 | freepbx-db-backup: 80 | container_name: freepbx-db-backup 81 | image: tiredofit/db-backup 82 | links: 83 | - freepbx-db 84 | volumes: 85 | - ./dbbackup:/backup 86 | environment: 87 | - ZABBIX_HOSTNAME=freepbx-db-backup 88 | - DB_HOST=freepbx-db 89 | - DB_TYPE=mariadb 90 | - DB_NAME=asterisk 91 | - DB_USER=asterisk 92 | - DB_PASS=asteriskpass 93 | - DB_DUMP_FREQ=1440 94 | - DB_DUMP_BEGIN=0000 95 | - DB_CLEANUP_TIME=8640 96 | - COMPRESSION=BZ 97 | - MD5=TRUE 98 | networks: 99 | - proxy-tier 100 | restart: always 101 | 102 | networks: 103 | proxy-tier: 104 | external: 105 | name: nginx-proxy 106 | 107 | -------------------------------------------------------------------------------- /nodejs-10-debian/README.md: -------------------------------------------------------------------------------- 1 | # hub.docker.com/r/tiredofit/nodejs 2 | 3 | [![Build Status](https://img.shields.io/docker/build/tiredofit/nodejs.svg)](https://hub.docker.com/r/tiredofit/nodejs) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/nodejs.svg)](https://hub.docker.com/r/tiredofit/nodejs) 5 | [![Docker Stars](https://img.shields.io/docker/stars/tiredofit/nodejs.svg)](https://hub.docker.com/r/tiredofit/nodejs) 6 | [![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/nodejs.svg)](https://microbadger.com/images/tiredofit/nodejs) 7 | 8 | ## Introduction 9 | 10 | Dockerfile to build a [NodeJS](https://nodejs.org) base image for building/serving applications. 11 | This container uses [Alpine](https://hub.docker.com/r/tiredofit/alpine) and [Debian](https://hub.docker.com/r/tiredofit/debian) as a base. 12 | 13 | [Changelog](CHANGELOG.md) 14 | 15 | ## Authors 16 | 17 | - [Dave Conroy](https://github.com/tiredofit) 18 | 19 | ## Table of Contents 20 | 21 | - [Introduction](#introduction) 22 | - [Changelog](CHANGELOG.md) 23 | - [Prerequisites](#prerequisites) 24 | - [Dependencies](#dependendcies) 25 | - [Installation](#installation) 26 | - [Quick Start](#quick-start) 27 | - [Configuration](#configuration) 28 | - [Data Volumes](#data-volumes) 29 | - [Database](#database) 30 | - [Environment Variables](#environmentvariables) 31 | - [Networking](#networking) 32 | - [Maintenance](#maintenance) 33 | - [Shell Access](#shell-access) 34 | - [References](#references) 35 | 36 | 37 | ## Prerequisites 38 | 39 | None. 40 | 41 | # Dependencies 42 | 43 | None. 44 | 45 | ## Installation 46 | 47 | Automated builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/nodejs) and is the recommended method of installation. 48 | 49 | 50 | ```bash 51 | docker pull tiredofit/nodejs:(image tag) 52 | ``` 53 | 54 | 55 | The following image tags are available: 56 | 57 | * `4:latest` - Node JS 4 - Alpine 3.6 58 | * `4:debian-latest` - Node JS 4 - Debian Stretch 59 | * `6:latest` - Node JS 6 - Alpine 3.6 60 | * `6:debian-latest` - Node JS 6 - Debian Stretch 61 | * `8:latest` - Node JS 8 - Alpine 3.12 62 | * `8:debian-latest` - Node JS 8 - Debian Stretch 63 | * `10:latest` - Node JS 10 - Alpine 3.12 64 | * `10:debian-latest` - Node JS 10 - Debian Buster 65 | * `12:latest` - Node JS 12 - Alpine 3.12 66 | * `12:debian-latest` - Node JS 12 - Debian Buster 67 | * `14:latest` - Node JS 14 - Alpine 3.12 68 | * `14:debian-latest` - Node JS 14 - Debian bBuster 69 | 70 | 71 | 72 | ### Quick Start 73 | 74 | * The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). 75 | * Set various [environment variables](#environment-variables) to understand the capabilities of this image. 76 | * Map [persistent storage](#data-volumes) for access to configuration and data files for backup. 77 | * Map [Network Ports](#networking) to allow external access. 78 | 79 | Start the container using: 80 | 81 | ```bash 82 | docker-compose up 83 | ``` 84 | 85 | ### Data-Volumes 86 | 87 | This a base image, so no data volumes are exposed. 88 | 89 | 90 | ### Environment Variables 91 | 92 | No environment variables are exposed other than the [base environment variables](https://hub.docker.com/r/alpine). 93 | 94 | ### Networking 95 | 96 | No networking ports are exposed. 97 | 98 | ### Shell Access 99 | 100 | For debugging and maintenance purposes you may want access the containers shell. 101 | 102 | ```bash 103 | docker exec -it nodejs bash 104 | ``` 105 | 106 | ## References 107 | 108 | * https://nodejs.org -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FreePBX 15, Asterisk 17/18 on Docker (Raspberry Pi). 2 | 3 | Properly working with IVR and call forwarding to an extension on a Raspberry pi 4 32-bit architecture. 4 | 5 | Quick tips: 6 | No 2-way sound on outgoing calls but sound is available on inbound calls? Check if the RTP start/end ports in "Settings - Asterisk SIP Settings" match the ports defined in the docker-compose file. 7 | Check documentation on: https://hub.docker.com/r/tiredofit/freepbx 8 | 9 | Changelog: 10 | 26-03-2021 - tag 18.15-alpha: 11 | 12 | Asterisk 18.3.0 13 | FreePBX 15.0.17.24 14 | PHP 7.3 15 | Tested with IVR / Queues / Conferences 16 | 24-03-2021 - tag 17.15.2 / 17.15-latest: 17 | 18 | updated Asterisk to 17.9.3 19 | FreePBX 15.0.16.56 20 | PHP 5.6 21 | ODBC mariadb driver updated to self compiled version instead of using the deprecated mysql driver 22 | XMPP is now installing and the daemon is running after integrating an armv7 mongodb supported version and tweeking some startup scripts 23 | Not working: 24 | FOP - automatic intallation script can't find the proper package. 25 | Example docker-compose.yaml (change tag to 18.15-alpha instead of 17.15-latest, if you want Asterisk 18 instead of Asterisk 17) 26 | 27 | ``` 28 | version: '2' 29 | 30 | services: 31 | freepbx-app: 32 | container_name: freepbx-app 33 | image: epandi/asterisk-freepbx-arm:17.15-latest 34 | ports: 35 | #### If you aren't using a reverse proxy 36 | - 80:80 37 | #### If you want SSL Support and not using a reverse proxy 38 | #- 443:443 39 | - 5060:5060/udp 40 | - 5160:5160/udp 41 | - 18000-18100:18000-18100/udp 42 | #### Flash Operator Panel 43 | - 4445:4445 44 | volumes: 45 | - /home/pi/Docker/asterisk17/certs:/certs 46 | - /home/pi/Docker/asterisk17/data:/data 47 | - /home/pi/Docker/asterisk17/logs:/var/log 48 | - /home/pi/Docker/asterisk17/data/www:/var/www/html 49 | ### Only Enable this option below if you set DB_EMBEDDED=TRUE 50 | - /home/pi/Docker/asterisk17/db:/var/lib/mysql 51 | ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care 52 | #- ./assets/custom:/assets/custom 53 | ### Only Enable this if you use Chan_dongle/USB modem. 54 | #- /dev:/dev 55 | 56 | environment: 57 | - VIRTUAL_HOST=asterisk.local 58 | - VIRTUAL_NETWORK=nginx-proxy 59 | ### If you want to connect to the SSL Enabled Container 60 | #- VIRTUAL_PORT=443 61 | #- VIRTUAL_PROTO=https 62 | - VIRTUAL_PORT=80 63 | - LETSENCRYPT_HOST=hostname.example.com 64 | - LETSENCRYPT_EMAIL=email@example.com 65 | 66 | - ZABBIX_HOSTNAME=freepbx-app 67 | 68 | - RTP_START=18000 69 | - RTP_FINISH=18100 70 | 71 | ## Use for External MySQL Server 72 | - DB_EMBEDDED=TRUE 73 | 74 | ### These are only necessary if DB_EMBEDDED=FALSE 75 | # - DB_HOST=freepbx-db 76 | # - DB_PORT=3306 77 | # - DB_NAME=asterisk 78 | # - DB_USER=asterisk 79 | # - DB_PASS=asteriskpass 80 | 81 | ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these: 82 | #- TLS_CERT=cert.pem 83 | #- TLS_KEY=key.pem 84 | ### Set your desired timezone 85 | - TZ= 'TimeZone' 86 | restart: always 87 | network_mode: "bridge" 88 | 89 | ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment 90 | cap_add: 91 | - NET_ADMIN 92 | privileged: true 93 | ``` 94 | # Accessing the USB modem: 95 | 96 | You need to use sudo chmod 777 /dev/ttyUSB* on the host machine. 97 | But, this is not persistent after reboot. To make it persistent after boot on your host machine 98 | 99 | sudo nano /etc/udev/rules.d/92-dongle.rules and add 100 | ``` 101 | KERNEL=="ttyUSB*" 102 | MODE="0666" 103 | OWNER="asterisk" 104 | GROUP="uucp" 105 | ``` 106 | This will make the permission persistent. Source: https://wiki.e1550.mobi/doku.php?id=troubleshooting# 107 | 108 | Credits https://github.com/tiredofit/docker-freepbx 109 | -------------------------------------------------------------------------------- /patches.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Dockerfile.patch 3 | ------------------------------------------------------ 4 | 1c1 5 | < FROM tiredofit/nodejs:10-debian-latest 6 | --- 7 | > FROM epandi-nodejs-10-debian-latest 8 | 17c17,18 9 | < RUN echo "Package: libxml2*" > /etc/apt/preferences.d/libxml2 && \ 10 | --- 11 | > RUN c_rehash && \ 12 | > echo "Package: libxml2*" > /etc/apt/preferences.d/libxml2 && \ 13 | 26,27c27,28 14 | < curl https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc | apt-key add - && \ 15 | < echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGODB_VERSION} main" > /etc/apt/sources.list.d/mongodb-org.list && \ 16 | --- 17 | > # curl https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc | apt-key add - && \ 18 | > # echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGODB_VERSION} main" > /etc/apt/sources.list.d/mongodb-org.list && \ 19 | 29a31,33 20 | > wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add - && \ 21 | > echo "deb http://archive.raspbian.org/raspbian buster main contrib non-free" >>/etc/apt/sources.list && \ 22 | > echo "deb-src http://archive.raspbian.org/raspbian buster main contrib non-free" >>/etc/apt/sources.list && \ 23 | 87c91 24 | < linux-headers-amd64 \ 25 | --- 26 | > linux-headers-armmp \ 27 | 133c137 28 | < mongodb-org \ 29 | --- 30 | > mongodb \ 31 | 135d138 32 | < odbc-mariadb \ 33 | 166a170,182 34 | > ### Build MardiaDB connector 35 | > apt-get install -y cmake gcc && \ 36 | > cd /usr/src && \ 37 | > git clone https://github.com/MariaDB/mariadb-connector-odbc.git && \ 38 | > cd mariadb-connector-odbc && \ 39 | > git checkout tags/3.1.1-ga && \ 40 | > mkdir build && \ 41 | > cd build && \ 42 | > cmake ../ -LH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_SSL=OPENSSL\ 43 | > -DDM_DIR=/usr/lib/arm-linux-gnueabihf -DCMAKE_C_FLAGS_RELEASE:STRING="-w" && \ 44 | > cmake --build . --config Release && \ 45 | > make install && \ 46 | > \ 47 | 244c260 48 | < ./configure --prefix=/usr --with-bcg729 --enable-$G72X_CPUHOST && \ 49 | --- 50 | > ./configure CFLAGS='-march=armv7' --prefix=/usr --with-bcg729 --enable-$G72X_CPUHOST && \ 51 | 308c324 52 | < ADD install / 53 | --- 54 | > ADD freepbx-15/install / 55 | \ No newline at end of file 56 | 57 | 58 | ------------------------------------------------------ 59 | \freepbx-15\install\etc\odbcinst.ini.patch 60 | ------------------------------------------------------ 61 | 3,4c3,4 62 | < Driver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so 63 | < Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so 64 | --- 65 | > Driver = /usr/local/lib/libmaodbc.so 66 | > Setup = /usr/lib/arm-linux-gnueabihf/odbc/libodbcmyS.so 67 | 5a6 68 | > 69 | 70 | 71 | ------------------------------------------------------ 72 | \freepbx-15\install\etc\services.available\08-mongodb\run.patch 73 | ------------------------------------------------------ 74 | 11c11 75 | < exec mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongod.conf run 76 | \ No newline at end of file 77 | --- 78 | > exec mongod --unixSocketPrefix=/var/run/mongodb run 79 | \ No newline at end of file 80 | 81 | 82 | ------------------------------------------------------ 83 | \freepbx-15\install\etc\cont-finish.d\12-mongo.patch 84 | ------------------------------------------------------ 85 | 7c7 86 | < silent mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongod.conf --shutdown 87 | --- 88 | > silent mongod --unixSocketPrefix=/var/run/mongodb --shutdown 89 | 90 | 91 | ------------------------------------------------------ 92 | \freepbx-15\install\etc\cont-init.d\10-freepbx.patch 93 | ------------------------------------------------------ 94 | 16c16 95 | < mkdir -p /data 96 | --- 97 | > mkdir -p /data/db 98 | 244c244 99 | < silent mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongod.conf run & 100 | --- 101 | > silent mongod --unixSocketPrefix=/var/run/mongodb run & 102 | 598c598 103 | < silent mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongod.conf --shutdown 104 | --- 105 | > silent mongod --unixSocketPrefix=/var/run/mongodb --shutdown 106 | 107 | 108 | ------------------------------------------------------ 109 | \freepbx-15\install\etc\cont-init.d\08-mongodb.patch 110 | ------------------------------------------------------ 111 | 8a9 112 | > mkdir -p /data/db 113 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/99-container: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | PROCESS_NAME="container" 5 | 6 | if var_false "$SKIP_SANITY_CHECK" ; then 7 | output_off 8 | ### Final sanity check to make sure all scripts have executed and initialized properly, otherwise stop 9 | files_init=$(find /etc/cont-init.d/ -maxdepth 1 -type f | wc -l) 10 | files_init=$(( "$files_init" - 1 )) 11 | declare -a files_init_name 12 | declare -a length_of_files_init_name 13 | for f in /etc/cont-init.d/*; do 14 | files_init_name[length_of_files_init_name + 1]=filename 15 | files_init_name[${#files_init_name[@]}+1]=$(echo "$f" | sed "s#filename##g" | sed "s#/etc/cont-init.d/##g" | sed "s#99-container##g" ); 16 | done 17 | 18 | init_complete=$(find /tmp/state/*-init -maxdepth 1 -type f | wc -l) 19 | declare -a init_complete_name 20 | declare -a length_of_init_complete_name 21 | for f in /tmp/state/*-init; do 22 | init_complete_name[length_of_init_complete_name + 1]=filename 23 | init_complete_name[${#init_complete_name[@]}+1]=$(echo "$f" | sed "s#filename##g" | sed "s#/tmp/state/##g" | sed "s#-init##g"); 24 | done 25 | 26 | uninitialized_scripts=() 27 | for i in "${files_init_name[@]}"; do 28 | skip= 29 | for j in "${init_complete_name[@]}"; do 30 | [[ $i == "$j" ]] && { skip=1; break; } 31 | done 32 | [[ -n $skip ]] || uninitialized_scripts+=("$i") 33 | done 34 | declare uninitialized_scripts 35 | 36 | if [ $files_init != "$init_complete" ]; then 37 | if [ "$init_complete" -gt "$files_init" ] ; then 38 | : 39 | else 40 | echo "**********************************************************************************************************************" 41 | echo "**********************************************************************************************************************" 42 | echo "**** ****" 43 | echo "**** ERROR - Some initialization scripts haven't completed - All services are now halted ****" 44 | echo "**** - The following scripts in '/etc/cont-init.d' did not pass their completion check ****" 45 | echo "**** ****" 46 | echo "**********************************************************************************************************************" 47 | echo "**********************************************************************************************************************" 48 | echo "" 49 | echo "${uninitialized_scripts[@]}" | tr ' ' '\n' | uniq -u 50 | echo "" 51 | echo "**********************************************************************************************************************" 52 | echo "**********************************************************************************************************************" 53 | echo "**** ****" 54 | echo "**** This could have happened for a variety of reasons. Please make sure you have followed the README ****" 55 | echo "**** relating to this image and have proper configuration such as environment variables and volumes set ****" 56 | echo "**** ****" 57 | echo "**** If you feel that you have encountered a bug, please submit an issue on the revision control system ****" 58 | echo "**** and provide full debug logs by setting the environment variable 'DEBUG_MODE=TRUE' ****" 59 | echo "**** ****" 60 | echo "**********************************************************************************************************************" 61 | echo "**********************************************************************************************************************" 62 | exit 1 63 | fi 64 | fi 65 | output_on 66 | fi 67 | 68 | for services in /etc/services.available/*/ 69 | do 70 | service=${services%*/} 71 | if [ -f "/tmp/state/${service##*/}-init" ]; then 72 | if grep -q "DONOTSTART" "/tmp/state/${service##*/}-init"; then 73 | print_debug "Skipping '${service##*/}' service for startup routines" 74 | else 75 | print_debug "Getting ready to start '${service##*/}' service" 76 | ln -sf "${service}" /etc/services.d 77 | fi 78 | else 79 | print_debug "No Initialization Script Found - Getting ready to start '${service##*/}' service" 80 | ln -sf "${service}" /etc/services.d 81 | fi 82 | done 83 | 84 | liftoff 85 | -------------------------------------------------------------------------------- /debian-buster/install/etc/cont-init.d/02-permissions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | PROCESS_NAME="permissions" 5 | 6 | output_off 7 | if var_true "$DEBUG_PERMISSIONS" = "TRUE" ; then 8 | set -x 9 | CONTAINER_LOG_LEVEL="DEBUG" 10 | fi 11 | 12 | ### Enable or Disable permissions 13 | if var_true "$ENABLE_PERMISSIONS" = "TRUE" ; then 14 | print_notice "Enabling permissions features" 15 | # handle the following: 16 | # 1. change uid in /etc/passwd with the ones defined in Docker's environment settings 17 | # 2. change gid in /etc/group and /etc/passwd with the ones defined in Docker's environment settings 18 | # 3. add users defined in Docker's environment settings to groups in /etc/group 19 | 20 | # start to handle USER_ 21 | varenvusername=(`env | grep USER_ | awk -F= '{print tolower($1)}' | awk -F_ '{print $2}'`) 22 | varenvuid=(`env | grep USER_ | awk -F= '{print tolower($2)}'`) 23 | strusers=`echo "${varenvusername[*]}" | sed 's/ /\\\|/g'` 24 | 25 | if [[ ! -z $strusers ]]; then 26 | varpassuser=(`cat /etc/passwd | grep ^"$strusers" | awk -F: '{print $1}'`) 27 | varpassuserid=(`cat /etc/passwd | grep ^"$strusers" | awk -F: '{print $3}'`) 28 | fi 29 | 30 | print_debug "Users (varenvusername) from Docker env are: ${varenvusername[*]}" 31 | print_debug "UIDs (varenvuid) from Docker env are: ${varenvuid[*]}" 32 | print_debug "The string (strusers) used to grep the users is: $strusers" 33 | print_debug "Users (varpassuser) from /etc/passwd are: ${varpassuser[*]}" 34 | print_debug "UIDs (varpassuserid) from /etc/passwd are: ${varpassuserid[*]}" 35 | 36 | counter=0 37 | 38 | for i in ${!varenvusername[*]} 39 | do 40 | for j in ${!varpassuser[*]} 41 | do 42 | if [ "${varenvusername[$i]}" == "${varpassuser[$j]}" ]; then 43 | if [ "$DEBUG_PERMISSIONS" = "TRUE" ] || [ "$DEBUG_PERMISSIONS" = "true" ] || [ "$DEBUG_MODE" = "TRUE" ] || [ "$DEBUG_MODE" = "true" ]; then 44 | print_debug "current loop is $i==$j and ${varenvusername[$i]} == ${varpassuser[$j]}" 45 | print_debug "use sed to replace ${varpassuserid[$j]} with ${varenvuid[$i]} in /etc/passwd" 46 | fi 47 | 48 | sed -i 's/'"${varpassuser[$j]}:x:${varpassuserid[$j]}:"'/'"${varpassuser[$j]}:x:${varenvuid[$i]}:"'/' /etc/passwd 49 | 50 | print_notice "uid of user ${varpassuser[$j]} has been changed to ${varenvuid[$i]}." 51 | let counter++ 52 | fi 53 | done 54 | done 55 | 56 | if [ "$counter" -gt "0" ] ; then 57 | print_notice "Total $counter UIDs modified" 58 | fi 59 | 60 | counter=0 61 | 62 | # start to handle GROUP_ 63 | varenvgroupname=(`env | grep ^GROUP_ | grep -v GROUP_ADD_ | awk -F= '{print tolower($1)}' | awk -F_ '{print $2}'`) 64 | varenvgid=(`env | grep ^GROUP_ | grep -v GROUP_ADD_ | awk -F= '{print tolower($2)}'`) 65 | strgroups=`echo "${varenvgroupname[*]}" | sed 's/ /\\\|/g'` 66 | 67 | if [[ ! -z $strgroups ]]; then 68 | vargroupname=(`cat /etc/group | grep ^"$strgroups" | awk -F: '{print $1}'`) 69 | vargroupid=(`cat /etc/group | grep ^"$strgroups" | awk -F: '{print $3}'`) 70 | fi 71 | 72 | print_debug "Group names (varenvgroupname) from Docker environment settings are: ${varenvgroupname[*]}" 73 | print_debug "GIDs (grvarenvgid) from Docker environment settings are: ${varenvgid[*]}" 74 | print_debug "The string (strgroup) used to grep the groups is: $strgroups" 75 | print_debug "Group names (vargroupname) from /etc/group are: ${vargroupname[*]}" 76 | print_debug "GIDs (vargroupid) from /etc/group are: ${vargroupid[*]}" 77 | 78 | for i in ${!varenvgroupname[*]} 79 | do 80 | for j in ${!vargroupname[*]} 81 | do 82 | if [ "${varenvgroupname[$i]}" == "${vargroupname[$j]}" ]; then 83 | if [ "$DEBUG_PERMISSIONS" = "TRUE" ] || [ "$DEBUG_PERMISSIONS" = "true" ] || [ "$DEBUG_MODE" = "TRUE" ] || [ "$DEBUG_MODE" = "true" ]; then 84 | print_debug "current loop is: $i==$j and ${varenvgroupname[$i]} == ${vargroupname[$j]}" 85 | print_debug "use sed to replace ${vargroupid[$j]} with ${varenvgid[$i]} in /etc/group" 86 | fi 87 | 88 | oldstr=`cat /etc/group | grep ^${vargroupname[$j]}` 89 | strarr=(`cat /etc/group | grep ^${vargroupname[$j]} | awk '{n=split($0, tmparr, ":"); \ 90 | for (i=0; i++ < n;) print tmparr[i]}'`) 91 | strarr[2]=${varenvgid[$i]} # the third one is gid 92 | deststr=`echo ${strarr[*]} | awk -v OFS=":" '{$1=$1; print}'` 93 | sed -i 's/'"$oldstr"'/'"$deststr"'/' /etc/group 94 | 95 | oldstr=`cat /etc/passwd | grep ^${vargroupname[$j]}` 96 | strarr=(`cat /etc/passwd | grep ^${vargroupname[$j]} | awk '{n=split($0, tmparr, ":"); \ 97 | for (i=0; i++ < n;) print tmparr[i]}'`) 98 | strarr[3]=${varenvgid[$i]} # the fourth one is gid 99 | deststr=`echo ${strarr[*]} | awk -v OFS=":" '{$1=$1; print}'` 100 | sed -i 's|'"$oldstr"'|'"$deststr"'|' /etc/passwd 101 | 102 | print_notice "gid of group ${vargroupname[$j]} has been changed to ${varenvgid[$i]}." 103 | 104 | let counter++ 105 | fi 106 | done 107 | done 108 | 109 | if [ "$counter" -gt "0" ] ; then 110 | print_notice "total $counter GIDs modified" 111 | fi 112 | 113 | counter=0 114 | 115 | 116 | # start to handle adding multiple users to a group 117 | varenvuser2add=(`env | grep ^GROUP_ADD_ | awk -F= '{print $1}' | awk -F_ '{print tolower($3)}'`) 118 | varenvdestgroup=(`env | grep ^GROUP_ADD_ | awk -F= '{print tolower($2)}'`) 119 | 120 | if [ "$DEBUG_PERMISSIONS" = "TRUE" ] || [ "$DEBUG_PERMISSIONS" = "true" ] || [ "$DEBUG_MODE" = "TRUE" ] || [ "$DEBUG_MODE" = "true" ]; then 121 | print_debug "Users (varenvuser2add) to add to groups are: ${varenvuser2add[*]}" 122 | print_debug "Groups (varenvdestgroup) to add users are: ${varenvdestgroup[*]}" 123 | fi 124 | 125 | for i in ${!varenvuser2add[*]} 126 | do 127 | varthegroupstr=`cat /etc/group | grep ^${varenvdestgroup[i]}` 128 | if [[ "$varthegroupstr" == *: ]]; then 129 | # append without comma "," 130 | sed -i 's/$/"${varenvuser2add[$i]}"/' /etc/group 131 | else 132 | sed -i 's/'"$varthegroupstr"'/'"$varthegroupstr,${varenvuser2add[$i]}"'/' /etc/group 133 | fi 134 | done 135 | fi 136 | 137 | output_on 138 | liftoff 139 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/zabbix/zabbix_agentd.conf.d/scripts/asterisk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## Asterisk Zabbix Check Script 3 | ## Dave Conroy 2018-04-07 4 | 5 | if [ ! -n "$1" ]; then 6 | echo "I'm ready for an argument!" 7 | exit 1 8 | fi 9 | 10 | function calls.active(){ 11 | CALL=`sudo -u asterisk /usr/sbin/asterisk -rx "core show channels" |grep "active calls"|awk '{print$1}'` 12 | echo "$CALL" 13 | } 14 | 15 | function calls.processed(){ 16 | CALL=`sudo -u asterisk /usr/sbin/asterisk -rx "core show channels" |grep "calls processed"|awk '{print$1}'` 17 | echo "$CALL" 18 | } 19 | 20 | function calls.longest(){ 21 | CHANNEL="$(asterisk -rx 'core show channels concise' | cut -f12,1 -d'!' | sed 's/!/ /g' | sort -n -k 2 | tail -1)" 22 | CHANNEL_NAME=$(echo $CHANNEL |awk '{print$1}') 23 | CHANNEL_TIME=$(echo $CHANNEL |awk '{print$2}') 24 | CHANNEL_TIME=${CHANNEL_TIME:-"0"} 25 | 26 | if [ "$CHANNEL_TIME" -gt 7200 ]; then 27 | asterisk -rx "channel request hangup $CHANNEL_NAME" >> /var/log/asterisk/full 28 | sleep 1 29 | 30 | if [ "`asterisk -rx 'core show channels concise' | grep $CHANNEL_NAME`" ]; then 31 | echo "$CHANNEL_NAME is $CHANNEL_TIME long" 32 | else 33 | echo 1 34 | fi 35 | else 36 | echo 1 37 | fi 38 | } 39 | 40 | function channels.active(){ 41 | CHANNEL=`sudo -u asterisk /usr/sbin/asterisk -rx "core show channels" | grep "active channels" | awk '{print $1}'` 42 | echo "$CHANNEL" 43 | } 44 | 45 | function iax.peers(){ 46 | TRUNK=`sudo -u asterisk /usr/sbin/asterisk -rx "iax2 show peers" | grep UNREACHABLE | awk '{print$1}'| grep [A-Za-z]` 47 | if [ -n "$TRUNK" ]; then 48 | sudo -u asterisk /usr/sbin/asterisk -rx "module unload chan_iax2.so" >> /dev/null 49 | sudo -u asterisk /usr/sbin/asterisk -rx "module load chan_iax2.so" >> /dev/null 50 | sleep 1 51 | echo $TRUNK 52 | else 53 | echo "1" 54 | fi 55 | } 56 | 57 | 58 | function iax.register.time(){ 59 | MS=$(sudo -u asterisk /usr/sbin/asterisk -rx "iax2 show peers" | grep OK | grep -oP '\(\K[^\)]+' | sed 's/ms//g' | sort -n | awk '$1>199') 60 | LOG=$(for i in $(sudo -u asterisk /usr/sbin/asterisk -rx "iax2 show peers" | grep OK | grep -oP '\(\K[^\)]+' | sed 's/ms//g' | sort -n | awk '$1>199'); do sudo -u asterisk /usr/sbin/asterisk -rx "iax2 show peers" | grep OK | grep $i; done) 61 | DATE=$(date +"%Y-%m-%d %H:%M:%S") 62 | 63 | if [[ -n "$MS" ]]; then 64 | echo "0" 65 | echo $DATE "The Problematic Extensions are : " $LOG>> /var/log/asterisk/monitor.log 66 | else 67 | echo "1" 68 | fi 69 | } 70 | 71 | function iax.trunk.down(){ 72 | TRUNK=`sudo -u asterisk /usr/sbin/asterisk -rx "iax2 show peers" | grep UNREACHABLE | awk '{print$1}' | grep [A-Za-z]` 73 | if [ -n "$TRUNK" ]; then 74 | echo $TRUNK 75 | else 76 | echo "1" 77 | fi 78 | } 79 | 80 | function status(){ 81 | proc_status=`ps -AF | grep 'sudo -u asterisk /usr/sbin/asterisk'` 82 | if [ -n "$proc_status" ]; then 83 | echo "1" 84 | else 85 | echo "0" 86 | fi 87 | } 88 | 89 | function status.crashes(){ 90 | if [ -n "`find /tmp/ -type f -mtime -1 -name 'core*'`" ]; then 91 | echo 1 92 | else 93 | echo 0 94 | fi 95 | } 96 | 97 | function status.reload(){ 98 | reload_time=`sudo -u asterisk /usr/sbin/asterisk -rx "core show uptime seconds" | awk -F": " '/Last reload/{print$2}'` 99 | if [ -z "$reload_time" ];then 100 | echo "Asterisk has not been reloaded yet" 101 | else 102 | printf '%dd:%dh:%dm:%ds\n' $(($reload_time/86400)) $(($reload_time%86400/3600)) $(($reload_time%3600/60)) $(($reload_time%60)) 103 | fi 104 | } 105 | 106 | function status.uptime(){ 107 | uptime=`sudo -u asterisk /usr/sbin/asterisk -rx "core show uptime seconds" | awk -F": " '/System uptime/{print$2}'` 108 | if [ -z "$uptime" ];then 109 | echo "Asterisk is not up" 110 | else 111 | printf '%dd:%dh:%dm:%ds\n' $(($uptime/86400)) $(($uptime%86400/3600)) $(($uptime%3600/60)) $(($uptime%60)) 112 | fi 113 | } 114 | 115 | function status.version(){ 116 | version=`sudo -u asterisk /usr/sbin/asterisk -rx "core show version" |grep "Asterisk"|awk '{print$2}'` 117 | echo "$version" 118 | } 119 | 120 | function sip.trunk.down(){ 121 | TRUNK=`sudo -u asterisk /usr/sbin/asterisk -rx "sip show peers" | grep UNREACHABLE | awk '{print$1}'| grep [A-Za-z]` 122 | if [ -n "$TRUNK" ]; then 123 | echo $TRUNK 124 | else 125 | echo "1" 126 | fi 127 | } 128 | 129 | 130 | 131 | function sip.peers(){ 132 | TRUNK=`sudo -u asterisk /usr/sbin/asterisk -rx "sip show peers" | grep UNREACHABLE | awk '{print$1}'| grep [A-Za-z]` 133 | if [ -n "$TRUNK" ]; then 134 | sudo -u asterisk /usr/sbin/asterisk -rx "module unload chan_sip.so" >> /dev/null 135 | sudo -u asterisk /usr/sbin/asterisk -rx "module unload chan_pjsip.so" >> /dev/null 136 | sudo -u asterisk /usr/sbin/asterisk -rx "module load chan_sip.so" >> /dev/null 137 | sudo -u asterisk /usr/sbin/asterisk -rx "module load chan_pjsip.so" >> /dev/null 138 | sleep 1 139 | echo $TRUNK 140 | else 141 | echo "1" 142 | fi 143 | } 144 | 145 | function sip.register.time(){ 146 | MS=$(sudo -u asterisk /usr/sbin/asterisk -rx "sip show peers" | grep OK | grep -oP '\(\K[^\)]+' | sed 's/ms//g' | sort -n | awk '$1>199') 147 | LOG=$(for i in $(sudo -u asterisk /usr/sbin/asterisk -rx "sip show peers" | grep OK | grep -oP '\(\K[^\)]+' | sed 's/ms//g' | sort -n | awk '$1>199'); do sudo -u asterisk /usr/sbin/asterisk -rx "sip show peers" | grep OK | grep $i; done) 148 | DATE=$(date +"%Y-%m-%d %H:%M:%S") 149 | 150 | if [[ -n "$MS" ]]; then 151 | echo "0" 152 | echo $DATE "The Problematic Extensions are : " $LOG>> /var/log/asterisk/monitor.log 153 | else 154 | echo "1" 155 | fi 156 | } 157 | 158 | function wrong.password(){ 159 | DATE=`date '+%Y-%m-%d %H:%M' -d "1 hour ago"` 160 | PASS=`awk -v DT="$DATE" '$1 " " $2 >= DT' /var/log/asterisk/full | grep "Wrong password"` 161 | 162 | if [[ -n "$PASS" ]]; then 163 | echo "0" 164 | else 165 | echo "1" 166 | fi 167 | } 168 | 169 | ### Execute the argument 170 | $1 171 | -------------------------------------------------------------------------------- /freepbx-15/install/usr/sbin/watson-transcription: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # Asterisk voicemail attachment conversion script 4 | # Revision history : 5 | # 22/11/2010 - V1.0 - Creation by N. Bernaerts 6 | # 07/02/2012 - V1.1 - Add handling of mails without attachment (thanks to Paul Thompson) 7 | # 01/05/2012 - V1.2 - Use mktemp, pushd & popd 8 | # 08/05/2012 - V1.3 - Change mp3 compression to CBR to solve some smartphone compatibility (thanks to Luca Mancino) 9 | # 01/08/2012 - V1.4 - Add PATH definition to avoid any problem (thanks to Christopher Wolff) 10 | # 16/07/2015 - V1.5 - Handle natively GSM WAV (thanks to Michael Munger) 11 | # 01/08/2020 - V2.0 - Modded for revised IBM Watson URLs and Docker tiredofit/docker-freepbx 12 | # 01/08/2020 - V2.1 - Further tweaks to integrate within tiredofit/docker-freepbx 13 | # 15/08/2020 - V2.2 - Add Debug statements (Set environment variable CONTAINER_LOG_LEVEL=DEBUG to see) 14 | 15 | # Requires 16 | # dos2unix 17 | # sed 18 | # awk 19 | # lame 20 | 21 | # Grab functions and defaults from Docker Image 22 | source /assets/functions/00-container 23 | source /assets/defaults/10-freepbx 24 | 25 | print_debug "Set Path" 26 | # set PATH 27 | PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 28 | 29 | print_debug "Create Temporary Directory" 30 | # create a temporary directory and cd to it 31 | TMPDIR=$(mktemp -d) 32 | cd "$TMPDIR" 33 | print debug "Now working in ${TMPDIR}" 34 | 35 | # dump the stream to a temporary file 36 | print_debug "Dumping Stream to Temporary File" 37 | cat >>stream.org 38 | print_debug "Temporary file is $(du -k "stream.org" | cut -f 1) kilobytes" 39 | 40 | print_debug "Getting Boundaries" 41 | # get the boundary 42 | BOUNDARY=$(grep "boundary=" stream.org | cut -d'"' -f 2) 43 | 44 | # cut the file into parts 45 | # stream.part - header before the boundary 46 | # stream.part1 - header after the bounday 47 | # stream.part2 - body of the message 48 | # stream.part3 - attachment in base64 (WAV file) 49 | # stream.part4 - footer of the message 50 | print_debug "Cutting file into parts" 51 | awk '/'$BOUNDARY'/{i++}{print > "stream.part"i}' stream.org 52 | 53 | # if mail is having no audio attachment (plain text) 54 | PLAINTEXT=$(cat stream.part1 | grep 'plain') 55 | if [ "$PLAINTEXT" != "" ]; then 56 | print_debug "File has no audio attachment" 57 | 58 | # prepare to send the original stream 59 | cat stream.org >stream.new 60 | print_debug "Sending to new Stream" 61 | # else, if mail is having audio attachment 62 | else 63 | print_debug "File has audio attachment" 64 | # cut the attachment into parts 65 | # stream.part3.head - header of attachment 66 | # stream.part3.wav.base64 - wav file of attachment (encoded base64) 67 | print_debug "Cutting Attachment into parts" 68 | sed '7,$d' stream.part3 >stream.part3.wav.head 69 | sed '1,6d' stream.part3 >stream.part3.wav.base64 70 | 71 | # convert the base64 file to a wav file 72 | print_debug "Converting Base64 information into WAV file" 73 | dos2unix -o stream.part3.wav.base64 74 | base64 -di stream.part3.wav.base64 >stream.part3.wav 75 | 76 | # convert wave file (GSM encoded or not) to PCM wav file 77 | print_debug "Convert WAV file to PCM" 78 | sox stream.part3.wav stream.part3-pcm.wav 79 | 80 | if var_true "$ENABLE_VM_TRANSCRIBE"; then 81 | print_debug "Voicemail Transcription Enabled" 82 | CURL_OPTS="" 83 | # Do not change the API_USERNAME 84 | API_USERNAME="apikey" 85 | # Set the API_PASSWORD to relevant $ENV variable 86 | # IBM Watson PAYG account with speech transcription enabled - is required 87 | # More info at https://www.ibm.com/uk-en/cloud/watson-speech-to-text 88 | # See also http://nerdvittles.com/?page_id=25616 for more info on how to setup the IBM account 89 | API_PASSWORD="$VM_TRANSCRIBE_APIKEY" 90 | # Set the voice model to a valid IBM model 91 | # All models available via https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models 92 | API_MODEL=$VM_TRANSCRIBE_MODEL 93 | print_debug "Using API_MODEL ${VM_TRANSCRIBE_MODEL}" 94 | 95 | print_debug "Sending Payload to Watson" 96 | curl -s "$CURL_OPTS" -k -u $API_USERNAME:$API_PASSWORD -X POST \ 97 | --limit-rate 40000 \ 98 | --header "Content-Type: audio/wav" \ 99 | --data-binary @stream.part3.wav \ 100 | "https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true&model=$VM_TRANSCRIBE_MODEL" 1>audio.txt 101 | 102 | print_debug "Extracting Transcript Results" 103 | # Extract transcript results from JSON response 104 | TRANSCRIPT=$(cat audio.txt | grep transcript | sed 's#^.*"transcript": "##g' | sed 's# "$##g') 105 | else 106 | print_debug "Skipping Watson Transcription" 107 | fi 108 | 109 | # convert PCM wav file to mp3 file 110 | # -b 24 is using CBR, giving better compatibility on smartphones (you can use -b 32 to increase quality) 111 | # -V 2 is using VBR, a good compromise between quality and size for voice audio files 112 | print_debug "Converting WAV to MP3" 113 | lame -m m -b 24 stream.part3-pcm.wav stream.part3.mp3 114 | 115 | # convert back mp3 to base64 file 116 | print_debug "Converting MP3 to Base64" 117 | base64 stream.part3.mp3 >stream.part3.mp3.base64 118 | 119 | # generate the new mp3 attachment header 120 | # change Type: audio/x-wav or audio/x-WAV to Type: audio/mpeg 121 | # change name="msg----.wav" or name="msg----.WAV" to name="msg----.mp3" 122 | print_debug "Creating Mp3 Attachment Header" 123 | sed 's/x-[wW][aA][vV]/mpeg/g' stream.part3.wav.head | sed 's/.[wW][aA][vV]/.mp3/g' >stream.part3.mp3.head 124 | 125 | # generate first part of mail body, converting it to LF only 126 | print_debug "Generate 1st part of mail body" 127 | mv stream.part stream.new 128 | cat stream.part1 >>stream.new 129 | cat stream.part2 >>stream.new 130 | 131 | if var_true "$ENABLE_VM_TRANSCRIBE"; then 132 | print_debug "Showing Transcribe Details" 133 | echo "--- Automated transcription result ---" >>stream.new 134 | echo "$TRANSCRIPT" >>stream.new 135 | fi 136 | 137 | print_debug "Generate third part of mail body" 138 | cat stream.part3.mp3.head >>stream.new 139 | dos2unix -o stream.new 140 | 141 | print_debug "Appending Base64 MP3 to mail body" 142 | # append base64 mp3 to mail body, keeping CRLF 143 | unix2dos -o stream.part3.mp3.base64 144 | cat stream.part3.mp3.base64 >>stream.new 145 | 146 | # append end of mail body, converting it to LF only 147 | print_debug "Append end of mail body" 148 | echo "" >>stream.tmp 149 | echo "" >>stream.tmp 150 | cat stream.part4 >>stream.tmp 151 | dos2unix -o stream.tmp 152 | cat stream.tmp >>stream.new 153 | fi 154 | 155 | # send the mail thru sendmail 156 | print_debug "Sending stream via sendmail" 157 | cat stream.new | sendmail -t 158 | 159 | # remove all temporary files and temporary directory 160 | print_debug "Cleaning up" 161 | rm -rf "$TMPDIR" 162 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/zabbix/zabbix_agentd.conf.d/scripts/apache.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # Name: zapache 4 | # 5 | # Checks Apache activity. 6 | # 7 | # Author: Alejandro Michavila 8 | # Modified for Scoreboard Values: Murat Koc, murat@profelis.com.tr 9 | # Modified for using also as external script: Murat Koc, murat@profelis.com.tr 10 | # Modified for outputting usage or ZBX_NOTSUPPORTED: Alejandro Michavila 11 | # Modified to do cacheing for performance, dmitry.frolov@gmail.com 12 | # 13 | # Version: 1.5 14 | # 15 | 16 | zapachever="1.5" 17 | rval=0 18 | value="" 19 | cache_seconds="60" 20 | [ "$TMPDIR" ] || TMPDIR=/tmp 21 | 22 | function usage() 23 | { 24 | echo "zapache version: $zapachever" 25 | echo "usage:" 26 | echo " $0 [] TotalAccesses - Check total accesses." 27 | echo " $0 [] TotalKBytes - Check total KBytes." 28 | echo " $0 [] CPULoad - Check CPU load." 29 | echo " $0 [] Uptime - Check uptime." 30 | echo " $0 [] ReqPerSec - Check requests per second." 31 | echo " $0 [] BytesPerSec - Check Bytes per second." 32 | echo " $0 [] BytesPerReq - Check Bytes per request." 33 | echo " $0 [] BusyWorkers - Check busy workers." 34 | echo " $0 [] IdleWorkers - Check idle workers." 35 | echo " $0 [] version - Version of this script." 36 | echo " $0 [] ping - Check if Apache is up." 37 | echo " $0 [] WaitingForConnection - Check Waiting for Connection processess." 38 | echo " $0 [] StartingUp - Check Starting Up processess." 39 | echo " $0 [] ReadingRequest - Check Reading Request processess." 40 | echo " $0 [] SendingReply - Check Sending Reply processess." 41 | echo " $0 [] KeepAlive - Check KeepAlive Processess." 42 | echo " $0 [] DNSLookup - Check DNSLookup Processess." 43 | echo " $0 [] ClosingConnection - Check Closing Connection Processess." 44 | echo " $0 [] Logging - Check Logging Processess." 45 | echo " $0 [] GracefullyFinishing - Check Gracefully Finishing Processess." 46 | echo " $0 [] IdleCleanupOfWorker - Check Idle Cleanup of Worker Processess." 47 | echo " $0 [] OpenSlotWithNoCurrentProcess - Check Open Slots with No Current Process." 48 | } 49 | 50 | ######## 51 | # Main # 52 | ######## 53 | 54 | if [[ $# == 1 ]];then 55 | #Agent Mode 56 | STATUS_URL="http://localhost:73/server-status?auto" 57 | CASE_VALUE="$1" 58 | elif [[ $# == 2 ]];then 59 | #External Script Mode 60 | STATUS_URL="$1" 61 | case "$STATUS_URL" in 62 | http://*|https://*) ;; 63 | *) STATUS_URL="http://$STATUS_URL/server-status?auto";; 64 | esac 65 | CASE_VALUE="$2" 66 | else 67 | #No Parameter 68 | usage 69 | exit 0 70 | fi 71 | 72 | case "$CASE_VALUE" in 73 | 'version') 74 | echo "$zapachever" 75 | exit 0;; 76 | esac 77 | 78 | umask 077 79 | 80 | # $UID is bash-specific 81 | cache_prefix="zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}" 82 | cache="$TMPDIR/$cache_prefix.cache" 83 | cache_timestamp_check="$TMPDIR/$cache_prefix.ts" 84 | # This assumes touch from coreutils 85 | touch -d "@$((`date +%s` - ($cache_seconds - 1)))" "$cache_timestamp_check" 86 | 87 | if [ "$cache" -ot "$cache_timestamp_check" ]; then 88 | curl="`which curl`" 89 | if [ "$curl" ]; then 90 | fetch_url() { $curl --insecure --silent --location -H "Cache-Control: no-cache" "$@"; } 91 | else 92 | wget="`which wget`" 93 | if [ "$wget" ]; then 94 | fetch_url() { $wget --no-check-certificate --quiet --header "Cache-Control: no-cache" -O - "$@"; } 95 | else 96 | echo "ZBX_NOTSUPPORTED" 97 | exit 1 98 | fi 99 | fi 100 | 101 | fetch_url "$STATUS_URL" > "$cache" 102 | rval=$? 103 | if [ $rval != 0 ]; then 104 | echo "ZBX_NOTSUPPORTED" 105 | exit 1 106 | fi 107 | fi 108 | 109 | case "$CASE_VALUE" in 110 | 'ping') 111 | if [ ! -s "$cache" -o "$cache" -ot "$cache_timestamp_check" ]; then 112 | echo "0" 113 | else 114 | echo "1" 115 | fi 116 | exit 0;; 117 | esac 118 | 119 | if ! [ -s "$cache" ]; then 120 | echo "ZBX_NOTSUPPORTED" 121 | exit 1 122 | fi 123 | 124 | case "$CASE_VALUE" in 125 | 'TotalAccesses') 126 | value="`awk '/^Total Accesses:/ {print $3}' < \"$cache\"`" 127 | rval=$?;; 128 | 'TotalKBytes') 129 | value="`awk '/^Total kBytes:/ {print $3}' < \"$cache\"`" 130 | rval=$?;; 131 | 'CPULoad') 132 | value="`awk '/^CPULoad:/ {print $2}' < \"$cache\"`" 133 | rval=$?;; 134 | 'Uptime') 135 | value="`awk '/^Uptime:/ {print $2}' < \"$cache\"`" 136 | rval=$?;; 137 | 'ReqPerSec') 138 | value="`awk '/^ReqPerSec:/ {print $2}' < \"$cache\"`" 139 | rval=$?;; 140 | 'BytesPerSec') 141 | value="`awk '/^BytesPerSec:/ {print $2}' < \"$cache\"`" 142 | rval=$?;; 143 | 'BytesPerReq') 144 | value="`awk '/^BytesPerReq:/ {print $2}' < \"$cache\"`" 145 | rval=$?;; 146 | 'BusyWorkers') 147 | value="`awk '/^BusyWorkers:/ {print $2}' < \"$cache\"`" 148 | rval=$?;; 149 | 'IdleWorkers') 150 | value="`awk '/^IdleWorkers:/ {print $2}' < \"$cache\"`" 151 | rval=$?;; 152 | 'WaitingForConnection') 153 | value="`awk '/^Scoreboard:/ {print split($2,notused,"_")-1}' < \"$cache\"`" 154 | rval=$?;; 155 | 'StartingUp') 156 | value="`awk '/^Scoreboard:/ {print split($2,notused,"S")-1}' < \"$cache\"`" 157 | rval=$?;; 158 | 'ReadingRequest') 159 | value="`awk '/^Scoreboard:/ {print split($2,notused,"R")-1}' < \"$cache\"`" 160 | rval=$?;; 161 | 'SendingReply') 162 | value="`awk '/^Scoreboard:/ {print split($2,notused,"W")-1}' < \"$cache\"`" 163 | rval=$?;; 164 | 'KeepAlive') 165 | value="`awk '/^Scoreboard:/ {print split($2,notused,"K")-1}' < \"$cache\"`" 166 | rval=$?;; 167 | 'DNSLookup') 168 | value="`awk '/^Scoreboard:/ {print split($2,notused,"D")-1}' < \"$cache\"`" 169 | rval=$?;; 170 | 'ClosingConnection') 171 | value="`awk '/^Scoreboard:/ {print split($2,notused,"C")-1}' < \"$cache\"`" 172 | rval=$?;; 173 | 'Logging') 174 | value="`awk '/^Scoreboard:/ {print split($2,notused,"L")-1}' < \"$cache\"`" 175 | rval=$?;; 176 | 'GracefullyFinishing') 177 | value="`awk '/^Scoreboard:/ {print split($2,notused,"G")-1}' < \"$cache\"`" 178 | rval=$?;; 179 | 'IdleCleanupOfWorker') 180 | value="`awk '/^Scoreboard:/ {print split($2,notused,"I")-1}' < \"$cache\"`" 181 | rval=$?;; 182 | 'OpenSlotWithNoCurrentProcess') 183 | value="`awk '/^Scoreboard:/ {print split($2,notused,".")-1}' < \"$cache\"`" 184 | rval=$?;; 185 | *) 186 | usage 187 | exit 1;; 188 | esac 189 | 190 | if [ "$rval" -eq 0 -a -z "$value" ]; then 191 | case "$CASE_VALUE" in 192 | # Theese metrics are output only if non-zero 193 | 'CPULoad' | 'ReqPerSec' | 'BytesPerSec' | 'BytesPerReq') 194 | value=0 195 | ;; 196 | *) 197 | rval=1 198 | ;; 199 | esac 200 | fi 201 | 202 | if [ "$rval" -ne 0 ]; then 203 | echo "ZBX_NOTSUPPORTED" 204 | fi 205 | 206 | echo "$value" 207 | exit $rval 208 | 209 | # 210 | # end zapache 211 | 212 | -------------------------------------------------------------------------------- /debian-buster/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 5.1.1 2021-01-04 2 | 3 | ### Changed 4 | - Fix Group ID altering function 5 | 6 | 7 | ## 5.1.0 2020-11-14 8 | 9 | ### Added 10 | - S6 Overlay 2.1.0.2 11 | - Zabbix Agent 5.2 12 | 13 | 14 | ## 5.0.11 2020-09-15 15 | 16 | ### Added 17 | - Add LOGROTATE_FORCE environment variable 18 | 19 | 20 | ## 5.0.10 2020-08-25 21 | 22 | ### Changed 23 | - Fix warning with Zabbix Agent 24 | 25 | 26 | ## 5.0.9 2020-08-15 27 | 28 | ### Changed 29 | - Reapply SMTP_FROM statement 30 | 31 | 32 | ## 5.0.8 2020-08-11 33 | 34 | ### Changed 35 | - Fix container startup routine check 36 | 37 | 38 | ## 5.0.7 2020-08-01 39 | 40 | ### Added 41 | - Add dos2unix tool 42 | - Add SMTP_FROM environment variable to solve missing from address mail errors with msmtp 43 | 44 | 45 | ## 5.0.6 2020-06-15 46 | 47 | ### Changed 48 | - Fix broken db_ready function 49 | 50 | 51 | ## 5.0.5 2020-06-15 52 | 53 | ### Changed 54 | - Bugfixes and code cleanup 55 | 56 | 57 | ## 5.0.4 2020-06-13 58 | 59 | ### Added 60 | - Ability to disable logrotate 61 | 62 | 63 | ## 5.0.3 2020-06-11 64 | 65 | ### Changed 66 | - Change logrotate to be called from absolute path in cron 67 | 68 | 69 | ## 5.0.2 2020-06-11 70 | 71 | ### Changed 72 | - Delete /etc/logrotate.d/ contents 73 | 74 | 75 | ## 5.0.1 2020-06-11 76 | 77 | ### Added 78 | - Added netcat-openbsd package 79 | 80 | 81 | ## 5.0.0 2020-06-10 82 | 83 | ### Added 84 | - Split Defaults and Functions into seperate files for cleanliness 85 | - Additional functions to load defaults/functions per script 86 | - Additional functions for checking if files/directories/sockets/ports are available before proceeding 87 | - Cleanup Container functions file to satisy shellcheck 88 | 89 | ### Changed 90 | - All /etc/s6/services files moved to /etc/services.available - Legacy images that have not been updated will still function but will always execute 91 | 92 | 93 | ## 4.6.1 2020-06-08 94 | 95 | ### Added 96 | - Zabbix Agent 5.0.x 97 | 98 | 99 | ## 4.6.0 2020-06-06 100 | 101 | ### Added 102 | - S6 Overlay 2.0.0.1 103 | 104 | ### Changed 105 | - Timezone changed to `Etc/GMT` 106 | - Default mail domain changed to non internet-domain 'local' 107 | 108 | ## 4.5.0 2020-05-01 109 | 110 | ### Added 111 | - Update to latest functions 112 | 113 | 114 | ## 4.4.4 2020-03-16 115 | 116 | ### Changed 117 | - Spelling mistake in 4.4.3 118 | 119 | 120 | ## 4.4.3 2020-03-16 121 | 122 | ### Changed 123 | - Patchup for Services that do not have initialization scripts 124 | 125 | 126 | ## 4.4.2 2020-03-16 127 | 128 | ### Changed 129 | - Change msmtp configuraiton file location 130 | 131 | 132 | ## 4.4.1 2020-03-14 133 | 134 | ### Changed 135 | - Fix when trying to disable Zabbix Monitoring throwing errors 136 | 137 | 138 | ## 4.4.0 2020-03-04 139 | 140 | ### Added 141 | - Added new functions for service starting and stopping 142 | - Reworked how services are stopped and started to ensure nothing in services are executed until successful completion of init scripts. This bhas the potential of breaking all downstream images if they are not updated. 143 | - Rewrote SMTP confgiuration 144 | 145 | 146 | ## 4.3.0 2020-03-02 147 | 148 | ### Added 149 | - New routine to cleanup /tmp/state for users who only restart the container, not fully bring down and remove. 150 | 151 | 152 | ## 4.2.0 2020-02-12 153 | 154 | ### Added 155 | - Reworked Debug Mode to quiet down output on core services and cut down on unnecessary noise 156 | - Reworked Container Initialization Check to clearly show which file hasn't successfully completed 157 | 158 | 159 | ## 4.1.5 2020-01-11 160 | 161 | ### Changed 162 | - Additional fix for check_service_initialized function to properly look for finished /etc/s6/services processes 163 | 164 | ## 4.1.4 2020-01-11 165 | 166 | ### Changed 167 | - Fix for check_service_initialized function to properly look for finished /etc/s6/services processes 168 | 169 | ## 4.1.3 2020-01-10 170 | 171 | ### Changed 172 | - Remove code showing $dirname erronously on process startup 173 | 174 | ## 4.1.2 2020-01-10 175 | 176 | ### Added 177 | - Quiet down sudo error 178 | - Zabbix 4.4.4 Agent 179 | 180 | 181 | ## 4.1.1 2020-01-02 182 | 183 | ### Changed 184 | - check_service_initialized was throwing false information 185 | 186 | 187 | ## 4.1.0 2020-01-01 188 | 189 | ### Added 190 | - Start splitting out Defaults into seperate /assets/functions/* files 191 | 192 | ### Changed 193 | - Cleanup of Permissions Changing routines 194 | 195 | ## 4.0.1 2020-01-01 196 | 197 | ### Added 198 | - New text output for Notices 199 | 200 | ### Changed 201 | - Additional checks to ensure cont-init.d scripts have finished executing 202 | 203 | ## 4.0.0 2020-01-01 204 | 205 | ### Added 206 | - Now relying on Container Level functions file 207 | - Easier methods for displaying console output 208 | - Colorized Prompts 209 | - Cleaner Startup Routines 210 | - Sanity Check to not start any processes until all startup scripts completed 211 | 212 | ### Changed 213 | - When DEBUG_MODE set stop taking over SMTP functionality. Require DEBUG_SMTP=TRUE instead 214 | 215 | ## 3.9.3 2019-12-20 216 | 217 | ### Added 218 | - Alpine 3.11 Base 219 | 220 | 221 | ## 3.9.2 2019-08-23 222 | 223 | * Cleanup lines subversion. 224 | 225 | ## 3.9.1 2019-08-23 226 | 227 | * Cleanup variable. 228 | 229 | ## 3.9 2019-07-15 230 | 231 | * Add Busybox Extras 232 | 233 | ## 3.8.2 2019-04-06 234 | 235 | * S6 Overlay 1.22.1.0 236 | 237 | ## 3.8.1 2019-01-13 238 | 239 | * Cleanup Cache 240 | 241 | ## 3.8 2018-10-17 242 | 243 | * Force executible permissions on S6 Directories 244 | 245 | ## 3.7 2018-10-14 246 | 247 | * Bump Zabbix to 4.0 248 | 249 | ## 3.6 2018-09-19 250 | 251 | * Set +x on all descendents of /etc/s6/services 252 | 253 | ## 3.5 2018-07-27 254 | 255 | * Add TERM=xterm 256 | 257 | ## 3.4 2018-07-02 258 | 259 | * Revert back to using && \ instead of ; \ in Dockerfile 260 | * Add ENABLE_GMAIL_SMTP environment variable thanks to @joeyberkovitz 261 | 262 | ## 3.3 2018-04-22 263 | 264 | * Update 01-permissions to quiet down if no UIDs changed. 265 | * Refinements to MailHog, to always route through msmtp 266 | 267 | ## 3.2 2018-04-15 268 | 269 | * Update Zabbix UID/GID 270 | 271 | ## 3.1 2018-03-25 272 | 273 | * Update MailHog Test Server Startup 274 | 275 | ## 3.0 2018-03-14 276 | 277 | * Add 01-permissions script to support change uid & gid and add user to group: 278 | * USER_= 279 | * GROUP_= 280 | * GROUP_ADD_= 281 | * UID & GID in /etc/passwd & /etc/group will be modified. 282 | * Old 01- 02- 03- scripts renamed after the new 01-permissions as 02- 03- 04- 283 | 284 | ## 2.18 2017-02-15 285 | 286 | * Update File Permissions for logrotate.d 287 | 288 | ## 2.17 2017-02-01 289 | 290 | * Init Scripts Update 291 | * msmtp Update 292 | 293 | ## 2.16 2017-01-29 294 | 295 | * More Permissions Fixes 296 | 297 | ## 2.15 2017-01-29 298 | 299 | * Add Grep, sudo 300 | * Fix Permissions 301 | 302 | ## 2.14 2017-01-29 303 | 304 | * Add Container Package Check 305 | 306 | ## 2.13 2017-01-28 307 | 308 | * Add zabbix-utils to edge 309 | * Update S6 Overlay to 1.21.2.2 310 | 311 | ## 2.12 2017-01-28 312 | 313 | * Add Zabbix Check for Updated Packages 314 | 315 | ## 2.11 2017-12-24 316 | 317 | * Check for custom cron files in /assets/cron-custom/ on startup 318 | 319 | ## 2.10 2017-12-01 320 | 321 | * Update S6 overlay to 1.21.2.1 322 | * Add Alpine 3.7 323 | * Remove Alpine 3.2 324 | 325 | ## 2.9 2017-10-23 326 | 327 | * Update S6 overlay to 1.21.1.1 328 | 329 | ## 2.8 2017-09-27 330 | 331 | * Updated Alpine Edge to Zabbix-Agent Package as opposed to Compiling 332 | * Quieted down service startup to avoid duplication 333 | 334 | ## 2.7 2017-09-26 335 | 336 | * Added more verbosity to services being enabled/disabled 337 | 338 | ## 2.6 2017-09-18 339 | 340 | * Add Alpine 3.2, 3.3 for legacy purposes 341 | * Fix Scripts for checking enabling services 342 | 343 | ## 2.5 2017-09-02 344 | 345 | * Move to Zabbix 3.4.1 instead of compiling from TRUNK 346 | 347 | ## 2.4 2017-09-01 348 | 349 | * Update S6 Overlay to 1.2.0.0 350 | 351 | ## 2.3 2017-08-28 352 | 353 | * Added `DEBUG_SMTP` environment variable to trap SMTP messages accesible via port 8025 354 | 355 | ## 2.2 2017-08-27 356 | 357 | * Added MSMTP to be able to route mail to external hosts 358 | 359 | ## 2.1 2017-08-27 360 | 361 | * Added DEBUG_MODE environment variable 362 | * Added TIMEZONE environment variable 363 | * Added ENABLE_CRON, ENABLE_ZABBIX switches 364 | * Built mechanisms to not start processes until container initialized 365 | * Zabbix Agent Configuration can be controlled and adjusted via Environment Variables 366 | * General Tidying Up 367 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/locale.gen: -------------------------------------------------------------------------------- 1 | bg_BG CP1251 2 | bg_BG.UTF-8 UTF-8 3 | cs_CZ ISO-8859-2 4 | cs_CZ.UTF-8 UTF-8 5 | de_DE ISO-8859-1 6 | de_DE.UTF-8 UTF-8 7 | de_DE@euro ISO-8859-15 8 | es_ES ISO-8859-1 9 | es_ES.UTF-8 UTF-8 10 | es_ES@euro ISO-8859-15 11 | fa_IR UTF-8 12 | fr_FR ISO-8859-1 13 | fr_FR.UTF-8 UTF-8 14 | fr_FR@euro ISO-8859-15 15 | he_IL ISO-8859-8 16 | he_IL.UTF-8 UTF-8 17 | hu_HU ISO-8859-2 18 | hu_HU.UTF-8 UTF-8 19 | it_IT ISO-8859-1 20 | it_IT.UTF-8 UTF-8 21 | it_IT@euro ISO-8859-15 22 | ja_JP.EUC-JP EUC-JP 23 | ja_JP.UTF-8 UTF-8 24 | nl_NL ISO-8859-1 25 | nl_NL.UTF-8 UTF-8 26 | nl_NL@euro ISO-8859-15 27 | pt_BR ISO-8859-1 28 | pt_BR.UTF-8 UTF-8 29 | pt_PT ISO-8859-1 30 | pt_PT.UTF-8 UTF-8 31 | pt_PT@euro ISO-8859-15 32 | ro_RO ISO-8859-2 33 | ro_RO.UTF-8 UTF-8 34 | ru_RU ISO-8859-5 35 | ru_RU.CP1251 CP1251 36 | ru_RU.KOI8-R KOI8-R 37 | ru_RU.UTF-8 UTF-8 38 | sv_SE ISO-8859-1 39 | sv_SE.ISO-8859-15 ISO-8859-15 40 | sv_SE.UTF-8 UTF-8 41 | uk_UA KOI8-U 42 | uk_UA.UTF-8 UTF-8 43 | vi_VN UTF-8 44 | zh_CN GB2312 45 | zh_CN.GB18030 GB18030 46 | zh_CN.GBK GBK 47 | zh_CN.UTF-8 UTF-8 48 | 49 | # aa_DJ ISO-8859-1 50 | # aa_DJ.UTF-8 UTF-8 51 | # aa_ER UTF-8 52 | # aa_ER@saaho UTF-8 53 | # aa_ET UTF-8 54 | # af_ZA ISO-8859-1 55 | # af_ZA.UTF-8 UTF-8 56 | # ak_GH UTF-8 57 | # am_ET UTF-8 58 | # an_ES ISO-8859-15 59 | # an_ES.UTF-8 UTF-8 60 | # anp_IN UTF-8 61 | # ar_AE ISO-8859-6 62 | # ar_AE.UTF-8 UTF-8 63 | # ar_BH ISO-8859-6 64 | # ar_BH.UTF-8 UTF-8 65 | # ar_DZ ISO-8859-6 66 | # ar_DZ.UTF-8 UTF-8 67 | # ar_EG ISO-8859-6 68 | # ar_EG.UTF-8 UTF-8 69 | # ar_IN UTF-8 70 | # ar_IQ ISO-8859-6 71 | # ar_IQ.UTF-8 UTF-8 72 | # ar_JO ISO-8859-6 73 | # ar_JO.UTF-8 UTF-8 74 | # ar_KW ISO-8859-6 75 | # ar_KW.UTF-8 UTF-8 76 | # ar_LB ISO-8859-6 77 | # ar_LB.UTF-8 UTF-8 78 | # ar_LY ISO-8859-6 79 | # ar_LY.UTF-8 UTF-8 80 | # ar_MA ISO-8859-6 81 | # ar_MA.UTF-8 UTF-8 82 | # ar_OM ISO-8859-6 83 | # ar_OM.UTF-8 UTF-8 84 | # ar_QA ISO-8859-6 85 | # ar_QA.UTF-8 UTF-8 86 | # ar_SA ISO-8859-6 87 | # ar_SA.UTF-8 UTF-8 88 | # ar_SD ISO-8859-6 89 | # ar_SD.UTF-8 UTF-8 90 | # ar_SS UTF-8 91 | # ar_SY ISO-8859-6 92 | # ar_SY.UTF-8 UTF-8 93 | # ar_TN ISO-8859-6 94 | # ar_TN.UTF-8 UTF-8 95 | # ar_YE ISO-8859-6 96 | # ar_YE.UTF-8 UTF-8 97 | # as_IN UTF-8 98 | # ast_ES ISO-8859-15 99 | # ast_ES.UTF-8 UTF-8 100 | # ayc_PE UTF-8 101 | # az_AZ UTF-8 102 | # be_BY CP1251 103 | # be_BY.UTF-8 UTF-8 104 | # be_BY@latin UTF-8 105 | # bem_ZM UTF-8 106 | # ber_DZ UTF-8 107 | # ber_MA UTF-8 108 | # bhb_IN.UTF-8 UTF-8 109 | # bho_IN UTF-8 110 | # bn_BD UTF-8 111 | # bn_IN UTF-8 112 | # bo_CN UTF-8 113 | # bo_IN UTF-8 114 | # br_FR ISO-8859-1 115 | # br_FR.UTF-8 UTF-8 116 | # br_FR@euro ISO-8859-15 117 | # brx_IN UTF-8 118 | # bs_BA ISO-8859-2 119 | # bs_BA.UTF-8 UTF-8 120 | # byn_ER UTF-8 121 | # ca_AD ISO-8859-15 122 | # ca_AD.UTF-8 UTF-8 123 | # ca_ES ISO-8859-1 124 | # ca_ES.UTF-8 UTF-8 125 | # ca_ES.UTF-8@valencia UTF-8 126 | # ca_ES@euro ISO-8859-15 127 | # ca_ES@valencia ISO-8859-15 128 | # ca_FR ISO-8859-15 129 | # ca_FR.UTF-8 UTF-8 130 | # ca_IT ISO-8859-15 131 | # ca_IT.UTF-8 UTF-8 132 | # ce_RU UTF-8 133 | # chr_US UTF-8 134 | # cmn_TW UTF-8 135 | # crh_UA UTF-8 136 | # csb_PL UTF-8 137 | # cv_RU UTF-8 138 | # cy_GB ISO-8859-14 139 | # cy_GB.UTF-8 UTF-8 140 | # da_DK ISO-8859-1 141 | # da_DK.UTF-8 UTF-8 142 | # de_AT ISO-8859-1 143 | # de_AT.UTF-8 UTF-8 144 | # de_AT@euro ISO-8859-15 145 | # de_BE ISO-8859-1 146 | # de_BE.UTF-8 UTF-8 147 | # de_BE@euro ISO-8859-15 148 | # de_CH ISO-8859-1 149 | # de_CH.UTF-8 UTF-8 150 | # de_IT ISO-8859-1 151 | # de_IT.UTF-8 UTF-8 152 | # de_LI.UTF-8 UTF-8 153 | # de_LU ISO-8859-1 154 | # de_LU.UTF-8 UTF-8 155 | # de_LU@euro ISO-8859-15 156 | # doi_IN UTF-8 157 | # dv_MV UTF-8 158 | # dz_BT UTF-8 159 | # el_CY ISO-8859-7 160 | # el_CY.UTF-8 UTF-8 161 | # el_GR ISO-8859-7 162 | # el_GR.UTF-8 UTF-8 163 | # en_AG UTF-8 164 | # en_AU ISO-8859-1 165 | # en_AU.UTF-8 UTF-8 166 | # en_BW ISO-8859-1 167 | # en_BW.UTF-8 UTF-8 168 | # en_CA ISO-8859-1 169 | # en_CA.UTF-8 UTF-8 170 | # en_DK ISO-8859-1 171 | # en_DK.ISO-8859-15 ISO-8859-15 172 | # en_DK.UTF-8 UTF-8 173 | # en_GB ISO-8859-1 174 | # en_GB.ISO-8859-15 ISO-8859-15 175 | # en_GB.UTF-8 UTF-8 176 | # en_HK ISO-8859-1 177 | # en_HK.UTF-8 UTF-8 178 | # en_IE ISO-8859-1 179 | # en_IE.UTF-8 UTF-8 180 | # en_IE@euro ISO-8859-15 181 | # en_IL UTF-8 182 | # en_IN UTF-8 183 | # en_NG UTF-8 184 | # en_NZ ISO-8859-1 185 | # en_NZ.UTF-8 UTF-8 186 | # en_PH ISO-8859-1 187 | # en_PH.UTF-8 UTF-8 188 | # en_SG ISO-8859-1 189 | # en_SG.UTF-8 UTF-8 190 | # en_US ISO-8859-1 191 | # en_US.ISO-8859-15 ISO-8859-15 192 | # en_US.UTF-8 UTF-8 193 | # en_ZA ISO-8859-1 194 | # en_ZA.UTF-8 UTF-8 195 | # en_ZM UTF-8 196 | # en_ZW ISO-8859-1 197 | # en_ZW.UTF-8 UTF-8 198 | # eo UTF-8 199 | # es_AR ISO-8859-1 200 | # es_AR.UTF-8 UTF-8 201 | # es_BO ISO-8859-1 202 | # es_BO.UTF-8 UTF-8 203 | # es_CL ISO-8859-1 204 | # es_CL.UTF-8 UTF-8 205 | # es_CO ISO-8859-1 206 | # es_CO.UTF-8 UTF-8 207 | # es_CR ISO-8859-1 208 | # es_CR.UTF-8 UTF-8 209 | # es_CU UTF-8 210 | # es_DO ISO-8859-1 211 | # es_DO.UTF-8 UTF-8 212 | # es_EC ISO-8859-1 213 | # es_EC.UTF-8 UTF-8 214 | # es_GT ISO-8859-1 215 | # es_GT.UTF-8 UTF-8 216 | # es_HN ISO-8859-1 217 | # es_HN.UTF-8 UTF-8 218 | # es_MX ISO-8859-1 219 | # es_MX.UTF-8 UTF-8 220 | # es_NI ISO-8859-1 221 | # es_NI.UTF-8 UTF-8 222 | # es_PA ISO-8859-1 223 | # es_PA.UTF-8 UTF-8 224 | # es_PE ISO-8859-1 225 | # es_PE.UTF-8 UTF-8 226 | # es_PR ISO-8859-1 227 | # es_PR.UTF-8 UTF-8 228 | # es_PY ISO-8859-1 229 | # es_PY.UTF-8 UTF-8 230 | # es_SV ISO-8859-1 231 | # es_SV.UTF-8 UTF-8 232 | # es_US ISO-8859-1 233 | # es_US.UTF-8 UTF-8 234 | # es_UY ISO-8859-1 235 | # es_UY.UTF-8 UTF-8 236 | # es_VE ISO-8859-1 237 | # es_VE.UTF-8 UTF-8 238 | # et_EE ISO-8859-1 239 | # et_EE.ISO-8859-15 ISO-8859-15 240 | # et_EE.UTF-8 UTF-8 241 | # eu_ES ISO-8859-1 242 | # eu_ES.UTF-8 UTF-8 243 | # eu_ES@euro ISO-8859-15 244 | # eu_FR ISO-8859-1 245 | # eu_FR.UTF-8 UTF-8 246 | # eu_FR@euro ISO-8859-15 247 | # ff_SN UTF-8 248 | # fi_FI ISO-8859-1 249 | # fi_FI.UTF-8 UTF-8 250 | # fi_FI@euro ISO-8859-15 251 | # fil_PH UTF-8 252 | # fo_FO ISO-8859-1 253 | # fo_FO.UTF-8 UTF-8 254 | # fr_BE ISO-8859-1 255 | # fr_BE.UTF-8 UTF-8 256 | # fr_BE@euro ISO-8859-15 257 | # fr_CA ISO-8859-1 258 | # fr_CA.UTF-8 UTF-8 259 | # fr_CH ISO-8859-1 260 | # fr_CH.UTF-8 UTF-8 261 | # fr_LU ISO-8859-1 262 | # fr_LU.UTF-8 UTF-8 263 | # fr_LU@euro ISO-8859-15 264 | # fur_IT UTF-8 265 | # fy_DE UTF-8 266 | # fy_NL UTF-8 267 | # ga_IE ISO-8859-1 268 | # ga_IE.UTF-8 UTF-8 269 | # ga_IE@euro ISO-8859-15 270 | # gd_GB ISO-8859-15 271 | # gd_GB.UTF-8 UTF-8 272 | # gez_ER UTF-8 273 | # gez_ER@abegede UTF-8 274 | # gez_ET UTF-8 275 | # gez_ET@abegede UTF-8 276 | # gl_ES ISO-8859-1 277 | # gl_ES.UTF-8 UTF-8 278 | # gl_ES@euro ISO-8859-15 279 | # gu_IN UTF-8 280 | # gv_GB ISO-8859-1 281 | # gv_GB.UTF-8 UTF-8 282 | # ha_NG UTF-8 283 | # hak_TW UTF-8 284 | # hi_IN UTF-8 285 | # hne_IN UTF-8 286 | # hr_HR ISO-8859-2 287 | # hr_HR.UTF-8 UTF-8 288 | # hsb_DE ISO-8859-2 289 | # hsb_DE.UTF-8 UTF-8 290 | # ht_HT UTF-8 291 | # hy_AM UTF-8 292 | # hy_AM.ARMSCII-8 ARMSCII-8 293 | # ia_FR UTF-8 294 | # id_ID ISO-8859-1 295 | # id_ID.UTF-8 UTF-8 296 | # ig_NG UTF-8 297 | # ik_CA UTF-8 298 | # is_IS ISO-8859-1 299 | # is_IS.UTF-8 UTF-8 300 | # it_CH ISO-8859-1 301 | # it_CH.UTF-8 UTF-8 302 | # iu_CA UTF-8 303 | # ka_GE GEORGIAN-PS 304 | # ka_GE.UTF-8 UTF-8 305 | # kk_KZ PT154 306 | # kk_KZ.RK1048 RK1048 307 | # kk_KZ.UTF-8 UTF-8 308 | # kl_GL ISO-8859-1 309 | # kl_GL.UTF-8 UTF-8 310 | # km_KH UTF-8 311 | # kn_IN UTF-8 312 | # ko_KR.EUC-KR EUC-KR 313 | # ko_KR.UTF-8 UTF-8 314 | # kok_IN UTF-8 315 | # ks_IN UTF-8 316 | # ks_IN@devanagari UTF-8 317 | # ku_TR ISO-8859-9 318 | # ku_TR.UTF-8 UTF-8 319 | # kw_GB ISO-8859-1 320 | # kw_GB.UTF-8 UTF-8 321 | # ky_KG UTF-8 322 | # lb_LU UTF-8 323 | # lg_UG ISO-8859-10 324 | # lg_UG.UTF-8 UTF-8 325 | # li_BE UTF-8 326 | # li_NL UTF-8 327 | # lij_IT UTF-8 328 | # ln_CD UTF-8 329 | # lo_LA UTF-8 330 | # lt_LT ISO-8859-13 331 | # lt_LT.UTF-8 UTF-8 332 | # lv_LV ISO-8859-13 333 | # lv_LV.UTF-8 UTF-8 334 | # lzh_TW UTF-8 335 | # mag_IN UTF-8 336 | # mai_IN UTF-8 337 | # mg_MG ISO-8859-15 338 | # mg_MG.UTF-8 UTF-8 339 | # mhr_RU UTF-8 340 | # mi_NZ ISO-8859-13 341 | # mi_NZ.UTF-8 UTF-8 342 | # mk_MK ISO-8859-5 343 | # mk_MK.UTF-8 UTF-8 344 | # ml_IN UTF-8 345 | # mn_MN UTF-8 346 | # mni_IN UTF-8 347 | # mr_IN UTF-8 348 | # ms_MY ISO-8859-1 349 | # ms_MY.UTF-8 UTF-8 350 | # mt_MT ISO-8859-3 351 | # mt_MT.UTF-8 UTF-8 352 | # my_MM UTF-8 353 | # nan_TW UTF-8 354 | # nan_TW@latin UTF-8 355 | # nb_NO ISO-8859-1 356 | # nb_NO.UTF-8 UTF-8 357 | # nds_DE UTF-8 358 | # nds_NL UTF-8 359 | # ne_NP UTF-8 360 | # nhn_MX UTF-8 361 | # niu_NU UTF-8 362 | # niu_NZ UTF-8 363 | # nl_AW UTF-8 364 | # nl_BE ISO-8859-1 365 | # nl_BE.UTF-8 UTF-8 366 | # nl_BE@euro ISO-8859-15 367 | # nn_NO ISO-8859-1 368 | # nn_NO.UTF-8 UTF-8 369 | # nr_ZA UTF-8 370 | # nso_ZA UTF-8 371 | # oc_FR ISO-8859-1 372 | # oc_FR.UTF-8 UTF-8 373 | # om_ET UTF-8 374 | # om_KE ISO-8859-1 375 | # om_KE.UTF-8 UTF-8 376 | # or_IN UTF-8 377 | # os_RU UTF-8 378 | # pa_IN UTF-8 379 | # pa_PK UTF-8 380 | # pap_AW UTF-8 381 | # pap_CW UTF-8 382 | # pl_PL ISO-8859-2 383 | # pl_PL.UTF-8 UTF-8 384 | # ps_AF UTF-8 385 | # quz_PE UTF-8 386 | # raj_IN UTF-8 387 | # ru_UA KOI8-U 388 | # ru_UA.UTF-8 UTF-8 389 | # rw_RW UTF-8 390 | # sa_IN UTF-8 391 | # sat_IN UTF-8 392 | # sc_IT UTF-8 393 | # sd_IN UTF-8 394 | # sd_IN@devanagari UTF-8 395 | # se_NO UTF-8 396 | # sgs_LT UTF-8 397 | # shs_CA UTF-8 398 | # si_LK UTF-8 399 | # sid_ET UTF-8 400 | # sk_SK ISO-8859-2 401 | # sk_SK.UTF-8 UTF-8 402 | # sl_SI ISO-8859-2 403 | # sl_SI.UTF-8 UTF-8 404 | # so_DJ ISO-8859-1 405 | # so_DJ.UTF-8 UTF-8 406 | # so_ET UTF-8 407 | # so_KE ISO-8859-1 408 | # so_KE.UTF-8 UTF-8 409 | # so_SO ISO-8859-1 410 | # so_SO.UTF-8 UTF-8 411 | # sq_AL ISO-8859-1 412 | # sq_AL.UTF-8 UTF-8 413 | # sq_MK UTF-8 414 | # sr_ME UTF-8 415 | # sr_RS UTF-8 416 | # sr_RS@latin UTF-8 417 | # ss_ZA UTF-8 418 | # st_ZA ISO-8859-1 419 | # st_ZA.UTF-8 UTF-8 420 | # sv_FI ISO-8859-1 421 | # sv_FI.UTF-8 UTF-8 422 | # sv_FI@euro ISO-8859-15 423 | # sw_KE UTF-8 424 | # sw_TZ UTF-8 425 | # szl_PL UTF-8 426 | # ta_IN UTF-8 427 | # ta_LK UTF-8 428 | # tcy_IN.UTF-8 UTF-8 429 | # te_IN UTF-8 430 | # tg_TJ KOI8-T 431 | # tg_TJ.UTF-8 UTF-8 432 | # th_TH TIS-620 433 | # th_TH.UTF-8 UTF-8 434 | # the_NP UTF-8 435 | # ti_ER UTF-8 436 | # ti_ET UTF-8 437 | # tig_ER UTF-8 438 | # tk_TM UTF-8 439 | # tl_PH ISO-8859-1 440 | # tl_PH.UTF-8 UTF-8 441 | # tn_ZA UTF-8 442 | # tr_CY ISO-8859-9 443 | # tr_CY.UTF-8 UTF-8 444 | # tr_TR ISO-8859-9 445 | # tr_TR.UTF-8 UTF-8 446 | # ts_ZA UTF-8 447 | # tt_RU UTF-8 448 | # tt_RU@iqtelif UTF-8 449 | # ug_CN UTF-8 450 | # unm_US UTF-8 451 | # ur_IN UTF-8 452 | # ur_PK UTF-8 453 | # uz_UZ ISO-8859-1 454 | # uz_UZ.UTF-8 UTF-8 455 | # uz_UZ@cyrillic UTF-8 456 | # ve_ZA UTF-8 457 | # wa_BE ISO-8859-1 458 | # wa_BE.UTF-8 UTF-8 459 | # wa_BE@euro ISO-8859-15 460 | # wae_CH UTF-8 461 | # wal_ET UTF-8 462 | # wo_SN UTF-8 463 | # xh_ZA ISO-8859-1 464 | # xh_ZA.UTF-8 UTF-8 465 | # yi_US CP1255 466 | # yi_US.UTF-8 UTF-8 467 | # yo_NG UTF-8 468 | # yue_HK UTF-8 469 | # zh_HK BIG5-HKSCS 470 | # zh_HK.UTF-8 UTF-8 471 | # zh_SG GB2312 472 | # zh_SG.GBK GBK 473 | # zh_SG.UTF-8 UTF-8 474 | # zh_TW BIG5 475 | # zh_TW.EUC-TW EUC-TW 476 | # zh_TW.UTF-8 UTF-8 477 | # zu_ZA ISO-8859-1 478 | # zu_ZA.UTF-8 UTF-8 479 | -------------------------------------------------------------------------------- /debian-buster/README.md: -------------------------------------------------------------------------------- 1 | # hub.docker.com/tiredofit/debian 2 | 3 | [![Build Status](https://img.shields.io/docker/build/tiredofit/debian.svg)](https://hub.docker.com/r/tiredofit/debian) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/debian.svg)](https://hub.docker.com/r/tiredofit/debian) 5 | [![Docker Stars](https://img.shields.io/docker/stars/tiredofit/debian.svg)](https://hub.docker.com/r/tiredofit/debian) 6 | [![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/debian.svg)](https://microbadger.com/images/tiredofit/debian) 7 | 8 | ## Introduction 9 | 10 | Dockerfile to build an [debian](https://www.debian.org/) container image. 11 | 12 | * Currently tracking Jessie (8), Stretch (9), Buster (10). 13 | * [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 init capabilities. 14 | * [zabbix-agent](https://zabbix.org) for individual container monitoring. 15 | * Cron installed along with other tools (curl, less, logrotate, nano, vim) for easier management. 16 | * Ability to update User ID and Group ID permissions for development purposes dynamically. 17 | 18 | ## Authors 19 | 20 | - [Dave Conroy](dave at tiredofit dot ca) [https://github.com/tiredofit] 21 | 22 | ## Table of Contents 23 | 24 | - [Introduction](#introduction) 25 | - [Authors](#authors) 26 | - [Table of Contents](#table-of-contents) 27 | - [Prerequisites](#prerequisites) 28 | - [Installation](#installation) 29 | - [Quick Start](#quick-start) 30 | - [Configuration](#configuration) 31 | - [Data-Volumes](#data-volumes) 32 | - [Environment Variables](#environment-variables) 33 | - [Networking](#networking) 34 | - [Maintenance](#maintenance) 35 | - [Shell Access](#shell-access) 36 | - [References](#references) 37 | 38 | ## Prerequisites 39 | 40 | No prerequisites required. 41 | 42 | ## Installation 43 | 44 | Automated builds of the image are available on [Docker Hub](https://hub.docker.com/tiredofit/debian) and 45 | is the recommended method of installation. 46 | 47 | 48 | ```bash 49 | docker pull tiredofit/debian:(imagetag) 50 | ``` 51 | 52 | The following image tags are available: 53 | 54 | * `latest` - Debian Buster - 10 55 | * `buster:latest` - Debian Buster - 10 56 | * `stretch:latest` - Debian Stretch - 9 57 | * `jessie:latest` - Debian Jessie - 8 58 | 59 | 60 | ### Quick Start 61 | 62 | Utilize this image as a base for further builds. By default, it does not start the S6 Overlay system, but 63 | Bash. Please visit the [s6 overlay repository](https://github.com/just-containers/s6-overlay) for 64 | instructions on how to enable the S6 init system when using this base or look at some of my other images 65 | which use this as a base. 66 | 67 | ## Configuration 68 | 69 | ### Data-Volumes 70 | The following directories are used for configure and can be mapped for persistent storage. 71 | 72 | | Directory | Description | 73 | | ----------------------------------- | ------------------------------------ | 74 | | `/etc/zabbix/zabbix_agentd.conf.d/` | Zabbix Agent configuration directory | 75 | | `/assets/cron-custom` | Drop custom crontabs here | 76 | 77 | 78 | ### Environment Variables 79 | 80 | Below is the complete list of available options that can be used to customize your installation. 81 | 82 | | Parameter | Description | Default | 83 | | --------------------- | ---------------------------------------------------------------------- | --------- | 84 | | `COLORIZE_OUTPUT` | Enable/Disable colorized console output | `TRUE` | 85 | | `CONTAINER_LOG_LEVEL` | Control level of output of container `INFO`, `WARN`, `NOTICE`, `DEBUG` | `NOTICE` | 86 | | `DEBUG_MODE` | Enable debug mode | `FALSE` | 87 | | `DEBUG_SMTP` | Setup mail catch all on port 1025 (SMTP) and 8025 (HTTP) | `FALSE` | 88 | | `ENABLE_CRON` | Enable Cron | `TRUE` | 89 | | `ENABLE_LOGROTATE` | Enable Logrotate | `TRUE` | 90 | | `ENABLE_SMTP` | Enable SMTP services | `TRUE` | 91 | | `ENABLE_ZABBIX` | Enable Zabbix Agent | `TRUE` | 92 | | `SKIP_SANITY_CHECK` | Disable container startup routine check | `FALSE` | 93 | | `TIMEZONE` | Set Timezone | `Etc/GMT` | 94 | 95 | If you wish to have this sends mail, set `ENABLE_SMTP=TRUE` and configure the following environment variables. 96 | See the [MSMTP Configuration Options](http://msmtp.sourceforge.net/doc/msmtp.html) for further information on options to configure MSMTP. 97 | 98 | | Parameter | Description | Default | 99 | | --------------------- | ------------------------------------------------- | ------------------ | 100 | | `ENABLE_SMTP_GMAIL` | Add setting to support sending through Gmail SMTP | `FALSE` | 101 | | `SMTP_FROM` | From name to send email as | `user@example.com` | 102 | | `SMTP_HOST` | Hostname of SMTP Server | `postfix-relay` | 103 | | `SMTP_PORT` | Port of SMTP Server | `25` | 104 | | `SMTP_DOMAIN` | HELO domain | `docker` | 105 | | `SMTP_MAILDOMAIN` | Mail domain from | `local` | 106 | | `SMTP_AUTHENTICATION` | SMTP Authentication | `none` | 107 | | `SMTP_USER` | SMTP Username (optional) | | 108 | | `SMTP_PASS` | SMTP Password (optional) | | 109 | | `SMTP_TLS` | Use TLS | `off` | 110 | | `SMTP_STARTTLS` | Start TLS from within session | `off` | 111 | | `SMTP_TLSCERTCHECK` | Check remote certificate | `off` | 112 | 113 | See The [Official Zabbix Agent Documentation](https://www.zabbix.com/documentation/5.0/manual/appendix/config/zabbix_agentd) 114 | for information about the following Zabbix values. 115 | 116 | | Parameter | Description | Default | 117 | | ------------------------------ | --------------------------------------- | ----------------------------------- | 118 | | `ZABBIX_LOGFILE` | Logfile location | `/var/log/zabbix/zabbix_agentd.log` | 119 | | `ZABBIX_LOGFILESIZE` | Logfile size | `1` | 120 | | `ZABBIX_DEBUGLEVEL` | Debug level | `1` | 121 | | `ZABBIX_REMOTECOMMANDS_ALLOW` | Enable remote commands | `*` | 122 | | `ZABBIX_REMOTECOMMANDS_DENY` | Deny remote commands | `*` | 123 | | `ZABBIX_REMOTECOMMANDS_LOG` | Enable remote commands Log (`0`/`1`) | `1` | 124 | | `ZABBIX_SERVER` | Allow connections from Zabbix server IP | `0.0.0.0/0` | 125 | | `ZABBIX_LISTEN_PORT` | Zabbix Agent listening port | `10050` | 126 | | `ZABBIX_LISTEN_IP` | Zabbix Agent listening IP | `0.0.0.0` | 127 | | `ZABBIX_START_AGENTS` | How many Zabbix Agents to start | `3` | 128 | | `ZABBIX_SERVER_ACTIVE` | Server for active checks | `zabbix-proxy` | 129 | | `ZABBIX_HOSTNAME` | Container hostname to report to server | `docker` | 130 | | `ZABBIX_REFRESH_ACTIVE_CHECKS` | Seconds to refresh Active Checks | `120` | 131 | | `ZABBIX_BUFFER_SEND` | Buffer Send | `5` | 132 | | `ZABBIX_BUFFER_SIZE` | Buffer Size | `100` | 133 | | `ZABBIX_MAXLINES_SECOND` | Max Lines Per Second | `20` | 134 | | `ZABBIX_ALLOW_ROOT` | Allow running as root | `1` | 135 | | `ZABBIX_USER` | Zabbix user to start as | `zabbix` | 136 | 137 | If you enable `DEBUG_PERMISSIONS=TRUE` all the users and groups have been modified in accordance with environment 138 | variables will be displayed in output. 139 | e.g. If you add `USER_NGINX=1000` it will reset the containers `nginx` user id from `82` to `1000` - 140 | Hint, also change the Group ID to your local development users UID & GID and avoid Docker permission issues when developing. 141 | 142 | | Parameter | Description | 143 | | ---------------------- | ------------------------------------------------------------------------------------------- | 144 | | `USER_` | The user's UID in /etc/passwd will be modified with new UID - Default `N/A` | 145 | | `GROUP_` | The group's GID in /etc/group and /etc/passwd will be modified with new GID - Default `N/A` | 146 | | `GROUP_ADD_` | The username will be added in /etc/group after the group name defined - Default `N/A` | 147 | 148 | 149 | ### Networking 150 | 151 | 152 | The following ports are exposed. 153 | 154 | | Port | Description | 155 | | ------- | -------------------------------------------- | 156 | | `1025` | `DEBUG_MODE` & `DEBUG_SMTP` SMTP Catcher | 157 | | `8025` | `DEBUG_MODE` & `DEBUG_SMTP` SMTP HTTP Viewer | 158 | | `10050` | Zabbix Agent | 159 | 160 | 161 | 162 | # Debug Mode 163 | 164 | When using this as a base image, create statements in your startup scripts to check for existence of `DEBUG_MODE=TRUE` 165 | and set various parameters in your applications to output more detail, enable debugging modes, and so on. 166 | In this base image it does the following: 167 | 168 | * Sets zabbix-agent to output logs in verbosity 169 | * Enables MailHog mailcatcher, which replaces `/usr/sbin/sendmail` with it's own catchall executable. 170 | It also opens port `1025` for SMTP trapping, and you can view the messages it's trapped at port `8025` 171 | 172 | ## Maintenance 173 | ### Shell Access 174 | 175 | For debugging and maintenance purposes you may want access the containers shell. 176 | 177 | ```bash 178 | docker exec -it (whatever your container name is e.g. debian) bash 179 | ``` 180 | 181 | ## References 182 | 183 | * https://www.debian.org 184 | * https://www.zabbix.org 185 | * https://github.com/just-containers/s6-overlay 186 | -------------------------------------------------------------------------------- /freepbx-15/README.md: -------------------------------------------------------------------------------- 1 | # hub.docker.com/r/tiredofit/freepbx 2 | 3 | [![Build Status](https://img.shields.io/docker/cloud/build/tiredofit/freepbx.svg)](https://hub.docker.com/r/tiredofit/freepbx) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/freepbx.svg)](https://hub.docker.com/r/tiredofit/freepbx) 5 | [![Docker Stars](https://img.shields.io/docker/stars/tiredofit/freepbx.svg)](https://hub.docker.com/r/tiredofit/freepbx) 6 | [![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/freepbx.svg)](https://microbadger.com/images/tiredofit/freepbx) 7 | 8 | 9 | ## Introduction 10 | 11 | This will build a container for [FreePBX](https://www.freepbx.org) - A Voice over IP manager for Asterisk. 12 | Upon starting this image it will give you a turn-key PBX system for SIP calling. 13 | 14 | * Latest release FreePBX 15 15 | * Latest release Asterisk 17 16 | * Choice of running embedded database or modifies to support external MariaDB Database and only require one DB. 17 | * Supports data persistence 18 | * Fail2Ban installed to block brute force attacks 19 | * Debian Buster base w/ Apache2 20 | * NodeJS 10.x 21 | * Automatically installs User Control Panel and displays at first page 22 | * Option to Install [Flash Operator Panel 2](https://www.fop2.com/) 23 | * Customizable FOP and Admin URLs 24 | 25 | This container uses [tiredofit/debian:buster](https://hub.docker.com/r/tiredofit/debian) as a base. 26 | 27 | **If you are presently running this image when it utilized FreePBX 14 and 28 | Asterisk 14 and can no longer use your image, please see [this post](https://github.com/tiredofit/docker-freepbx/issues/51)** 29 | 30 | 31 | [Changelog](CHANGELOG.md) 32 | 33 | ## Authors 34 | 35 | - [Dave Conroy](https://github.com/tiredofit) 36 | 37 | ## Table of Contents 38 | 39 | - [Introduction](#introduction) 40 | - [Authors](#authors) 41 | - [Table of Contents](#table-of-contents) 42 | - [Prerequisites](#prerequisites) 43 | - [Installation](#installation) 44 | - [Quick Start](#quick-start) 45 | - [Configuration](#configuration) 46 | - [Data-Volumes](#data-volumes) 47 | - [Environment Variables](#environment-variables) 48 | - [Networking](#networking) 49 | - [Maintenance](#maintenance) 50 | - [Shell Access](#shell-access) 51 | - [References](#references) 52 | 53 | ## Prerequisites 54 | 55 | This image assumes that you are using a reverse proxy such as 56 | [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) and optionally the [Let's Encrypt Proxy 57 | Companion @ https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) 58 | in order to serve your pages. However, it will run just fine on it's own if you map appropriate ports. 59 | 60 | You will also need an external MySQL/MariaDB container, although it can use an internally provided service (not recommended). 61 | 62 | ## Installation 63 | 64 | Automated builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/freepbx) and is the recommended method of installation. 65 | 66 | 67 | ```bash 68 | docker pull tiredofit/freepbx:(imagetag) 69 | ``` 70 | The following image tags are available: 71 | 72 | * `15` - Asterisk 17, Freepbx 15 - Debian Buster (latest build) 73 | * `14` - Asterisk 14, Freepbx 14 - Debian Stretch (latest build) 74 | * `latest` - Asterisk 17, Freepbx 15 - Debian Buster (Same as `15`) 75 | 76 | You can also visit the image tags section on Docker hub to pull a version that follows the CHANGELOG. 77 | 78 | 79 | ### Quick Start 80 | 81 | * The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). 82 | See the example's folder for a working [docker-compose.yml](examples/docker-compose.yml) that can be modified for development or production use. 83 | 84 | * Set various [environment variables](#environment-variables) to understand the capabilities of this image. 85 | * Map [persistent storage](#data-volumes) for access to configuration and data files for backup. 86 | * Make [networking ports](#networking) available for public access if necessary 87 | 88 | *The first boot can take from 3 minutes - 30 minutes depending on your internet connection as there is a considerable amount of downloading to do!* 89 | 90 | Login to the web server's admin URL (default /admin) and enter in your admin username, admin password, and email address and start configuring the system! 91 | 92 | ## Configuration 93 | 94 | ### Data-Volumes 95 | 96 | The container supports data persistence and during Dockerfile build creates symbolic links for 97 | `/var/lib/asterisk`, `/var/spool/asterisk`, `/home/asterisk`, and `/etc/asterisk`. 98 | Upon startup configuration files are copied and generated to support portability. 99 | 100 | The following directories are used for configure and can be mapped for persistent storage. 101 | 102 | | Directory | Description | 103 | | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | 104 | | `/certs` | Drop your certificates here for TLS w/PJSIP / UCP / HTTPd/ FOP | 105 | | `/var/www/html` | FreePBX web files | 106 | | `/var/log/` | Apache, Asterisk and FreePBX Log Files | 107 | | `/data` | Data persistence for Asterisk and FreePBX and FOP | 108 | | `/assets/custom` | *OPTIONAL* - If you would like to overwrite some files in the container, | 109 | | put them here following the same folder structure for anything underneath the /var/www/html directory | 110 | 111 | ### Environment Variables 112 | 113 | 114 | Along with the environment variables from the [Base image](https://hub.docker.com/r/tiredofit/debian), 115 | below is the complete list of available options that can be used to customize your installation. 116 | 117 | | Parameter | Description | Default | 118 | | ---------------------------- | ---------------------------------------------------------------------------------- | --------------- | 119 | | `ADMIN_DIRECTORY` | What folder to access admin panel | `/admin` | 120 | | `DB_EMBEDDED` | Allows you to use an internally provided MariaDB Server e.g. `TRUE` or `FALSE` | | 121 | | `DB_HOST` | Host or container name of MySQL Server e.g. `freepbx-db` | | 122 | | `DB_PORT` | MySQL Port | `3306` | 123 | | `DB_NAME` | MySQL Database name e.g. `asterisk` | | 124 | | `DB_USER` | MySQL Username for above database e.g. `asterisk` | | 125 | | `DB_PASS` | MySQL Password for above database e.g. `password` | | 126 | | `ENABLE_FAIL2BAN` | Enable Fail2ban to block the "bad guys" | `TRUE` | 127 | | `ENABLE_FOP` | Enable Flash Operator Panel | `FALSE` | 128 | | `ENABLE_SSL` | Enable HTTPd to serve SSL requests | `FALSE` | 129 | | `ENABLE_XMPP` | Enable XMPP Module with MongoDB | `FALSE` | 130 | | `ENABLE_VM_TRANSCRIBE` | Enable Voicemail Transcription with IBM Watson | `FALSE` | 131 | | `FOP_DIRECTORY` | What folder to access FOP | `/fop` | 132 | | `HTTP_PORT` | HTTP listening port | `80` | 133 | | `HTTPS_PORT` | HTTPS listening port | `443` | 134 | | `INSTALL_ADDITIONAL_MODULES` | Comma separated list of modules to additionally install on first container startup | | 135 | | `RTP_START` | What port to start RTP transmissions | `18000` | 136 | | `RTP_FINISH` | What port to start RTP transmissions | `20000` | 137 | | `UCP_FIRST` | Load UCP as web frontpage `TRUE` or `FALSE` | `TRUE` | 138 | | `TLS_CERT` | TLS certificate to drop in /certs for HTTPS if no reverse proxy | | 139 | | `TLS_KEY` | TLS Key to drop in /certs for HTTPS if no reverse proxy | | 140 | | `WEBROOT` | If you wish to install to a subfolder use this. Example: `/var/www/html/pbx` | `/var/www/html` | 141 | | `VM_TRANSCRIBE_APIKEY` | API Key from Watson See [tutorial](http://nerdvittles.com/?page_id=25616) | | 142 | | `VM_TRANSCRIBE_MODEL` | Watson Voice Model - See [here](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models) for list | `en-GB_NarrowbandModel` 143 | 144 | *`ADMIN_DIRECTORY ` and `FOP_DIRECTORY` may not work correctly if `WEBROOT` is changed or `UCP_FIRST=FALSE`* 145 | 146 | If setting `ENABLE_VM_TRANSCRIBE=TRUE` you will need to change the `mailcmd` in Freepbx voicemail settings to `/usr/bin/watson-transcription` and set the API Key. 147 | 148 | ### Networking 149 | 150 | The following ports are exposed. 151 | 152 | | Port | Description | 153 | | ----------------- | ----------- | 154 | | `80` | HTTP | 155 | | `443` | HTTPS | 156 | | `4445` | FOP | 157 | | `4569` | IAX | 158 | | `5060` | PJSIP | 159 | | `5160` | SIP | 160 | | `8001` | UCP | 161 | | `8003` | UCP SSL | 162 | | `8008` | UCP | 163 | | `8009` | UCP SSL | 164 | | `18000-20000/udp` | RTP ports | 165 | 166 | 167 | ### Fail2Ban 168 | 169 | * For fail2ban rules to kickin, the `security` log level needs to be enable for asterisk `full` log file. This can be done from the Settings > Log File Settings > Log files. 170 | 171 | ## Maintenance 172 | 173 | * There seems to be a problem with the CDR Module when updating where it refuses to update when using an external DB Server. 174 | If that happens, simply enter the container (as shown below) and execute `upgrade-cdr`, which will download the latest CDR module, 175 | apply a tweak, install, and reload the system for you. 176 | 177 | # Known Bugs 178 | 179 | * When installing Parking Lot or Feature Codes you sometimes get `SQLSTATE[22001]: String data, right truncated: 180 | 1406 Data too long for column 'helptext' at row 1`. To resolve login to your SQL server and issue this statement: 181 | `alter table featurecodes modify column helptext varchar(500);` 182 | * If you find yourself needing to update the framework or core modules and experience issues, enter the container and 183 | run `upgrade-core` which will truncate the column and auto upgrade the core and framework modules. 184 | 185 | ### Shell Access 186 | 187 | For debugging and maintenance purposes you may want access the containers shell. 188 | 189 | ```bash 190 | docker exec -it (whatever your container name is e.g. freepbx) bash 191 | ``` 192 | 193 | ## References 194 | 195 | * https://freepbx.org/ 196 | -------------------------------------------------------------------------------- /freepbx-15/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tiredofit/nodejs:10-debian-latest 2 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 3 | 4 | ### Set defaults 5 | ENV ASTERISK_VERSION=17.6.0 \ 6 | BCG729_VERSION=1.0.4 \ 7 | DONGLE_VERSION=20200610 \ 8 | G72X_CPUHOST=penryn \ 9 | G72X_VERSION=0.1 \ 10 | MONGODB_VERSION=4.2 \ 11 | PHP_VERSION=5.6 \ 12 | SPANDSP_VERSION=20180108 \ 13 | RTP_START=18000 \ 14 | RTP_FINISH=20000 15 | 16 | ### Pin libxml2 packages to Debian repositories 17 | RUN echo "Package: libxml2*" > /etc/apt/preferences.d/libxml2 && \ 18 | echo "Pin: release o=Debian,n=buster" >> /etc/apt/preferences.d/libxml2 && \ 19 | echo "Pin-Priority: 501" >> /etc/apt/preferences.d/libxml2 && \ 20 | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=TRUE && \ 21 | \ 22 | ### Install dependencies 23 | set -x && \ 24 | curl https://packages.sury.org/php/apt.gpg | apt-key add - && \ 25 | echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/deb.sury.org.list && \ 26 | curl https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc | apt-key add - && \ 27 | echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGODB_VERSION} main" > /etc/apt/sources.list.d/mongodb-org.list && \ 28 | echo "deb http://ftp.us.debian.org/debian/ buster-backports main" > /etc/apt/sources.list.d/backports.list && \ 29 | echo "deb-src http://ftp.us.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list.d/backports.list && \ 30 | apt-get update && \ 31 | apt-get -o Dpkg::Options::="--force-confold" upgrade -y && \ 32 | \ 33 | ### Install development dependencies 34 | ASTERISK_BUILD_DEPS='\ 35 | autoconf \ 36 | automake \ 37 | bison \ 38 | binutils-dev \ 39 | build-essential \ 40 | doxygen \ 41 | flex \ 42 | graphviz \ 43 | libasound2-dev \ 44 | libbluetooth-dev \ 45 | libc-client2007e-dev \ 46 | libcfg-dev \ 47 | libcodec2-dev \ 48 | libcorosync-common-dev \ 49 | libcpg-dev \ 50 | libcurl4-openssl-dev \ 51 | libedit-dev \ 52 | libfftw3-dev \ 53 | libgmime-2.6-dev \ 54 | libgsm1-dev \ 55 | libical-dev \ 56 | libiksemel-dev \ 57 | libjansson-dev \ 58 | libldap2-dev \ 59 | liblua5.2-dev \ 60 | libmariadb-dev \ 61 | libmariadbclient-dev \ 62 | libmp3lame-dev \ 63 | libncurses5-dev \ 64 | libneon27-dev \ 65 | libnewt-dev \ 66 | libogg-dev \ 67 | libopus-dev \ 68 | libosptk-dev \ 69 | libpopt-dev \ 70 | libradcli-dev \ 71 | libresample1-dev \ 72 | libsndfile1-dev \ 73 | libsnmp-dev \ 74 | libspeex-dev \ 75 | libspeexdsp-dev \ 76 | libsqlite3-dev \ 77 | libsrtp2-dev \ 78 | libssl-dev \ 79 | libtiff-dev \ 80 | libtool-bin \ 81 | libunbound-dev \ 82 | liburiparser-dev \ 83 | libvorbis-dev \ 84 | libvpb-dev \ 85 | libxml2-dev \ 86 | libxslt1-dev \ 87 | linux-headers-amd64 \ 88 | portaudio19-dev \ 89 | python-dev \ 90 | subversion \ 91 | unixodbc-dev \ 92 | uuid-dev \ 93 | zlib1g-dev' && \ 94 | \ 95 | ### Install runtime dependencies 96 | apt-get install --no-install-recommends -y \ 97 | $ASTERISK_BUILD_DEPS \ 98 | apache2 \ 99 | composer \ 100 | fail2ban \ 101 | ffmpeg \ 102 | flite \ 103 | freetds-dev \ 104 | git \ 105 | g++ \ 106 | iptables \ 107 | lame \ 108 | libavahi-client3 \ 109 | libbluetooth3 \ 110 | libc-client2007e \ 111 | libcfg7 \ 112 | libcpg4 \ 113 | libgmime-2.6 \ 114 | libical3 \ 115 | libiodbc2 \ 116 | libiksemel3 \ 117 | libicu63 \ 118 | libicu-dev \ 119 | libneon27 \ 120 | libosptk4 \ 121 | libresample1 \ 122 | libsnmp30 \ 123 | libspeexdsp1 \ 124 | libsrtp2-1 \ 125 | libunbound8 \ 126 | liburiparser1 \ 127 | libvpb1 \ 128 | locales \ 129 | locales-all \ 130 | make \ 131 | mariadb-client \ 132 | mariadb-server \ 133 | mongodb-org \ 134 | mpg123 \ 135 | odbc-mariadb \ 136 | php${PHP_VERSION} \ 137 | php${PHP_VERSION}-curl \ 138 | php${PHP_VERSION}-cli \ 139 | php${PHP_VERSION}-mysql \ 140 | php${PHP_VERSION}-gd \ 141 | php${PHP_VERSION}-mbstring \ 142 | php${PHP_VERSION}-intl \ 143 | php${PHP_VERSION}-bcmath \ 144 | php${PHP_VERSION}-ldap \ 145 | php${PHP_VERSION}-xml \ 146 | php${PHP_VERSION}-zip \ 147 | php${PHP_VERSION}-sqlite3 \ 148 | php-pear \ 149 | pkg-config \ 150 | sipsak \ 151 | sngrep \ 152 | socat \ 153 | sox \ 154 | sqlite3 \ 155 | tcpdump \ 156 | tcpflow \ 157 | unixodbc \ 158 | uuid \ 159 | wget \ 160 | whois \ 161 | xmlstarlet && \ 162 | \ 163 | ### Add users 164 | addgroup --gid 2600 asterisk && \ 165 | adduser --uid 2600 --gid 2600 --gecos "Asterisk User" --disabled-password asterisk && \ 166 | \ 167 | ### Build SpanDSP 168 | mkdir -p /usr/src/spandsp && \ 169 | curl -kL http://sources.buildroot.net/spandsp/spandsp-${SPANDSP_VERSION}.tar.gz | tar xvfz - --strip 1 -C /usr/src/spandsp && \ 170 | cd /usr/src/spandsp && \ 171 | ./configure --prefix=/usr && \ 172 | make && \ 173 | make install && \ 174 | \ 175 | ### Build Asterisk 176 | cd /usr/src && \ 177 | mkdir -p asterisk && \ 178 | curl -sSL http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${ASTERISK_VERSION}.tar.gz | tar xvfz - --strip 1 -C /usr/src/asterisk && \ 179 | cd /usr/src/asterisk/ && \ 180 | make distclean && \ 181 | contrib/scripts/get_mp3_source.sh && \ 182 | cd /usr/src/asterisk && \ 183 | ./configure \ 184 | --with-jansson-bundled \ 185 | --with-pjproject-bundled \ 186 | --with-bluetooth \ 187 | --with-codec2 \ 188 | --with-crypto \ 189 | --with-gmime \ 190 | --with-iconv \ 191 | --with-iksemel \ 192 | --with-inotify \ 193 | --with-ldap \ 194 | --with-libxml2 \ 195 | --with-libxslt \ 196 | --with-lua \ 197 | --with-ogg \ 198 | --with-opus \ 199 | --with-resample \ 200 | --with-spandsp \ 201 | --with-speex \ 202 | --with-sqlite3 \ 203 | --with-srtp \ 204 | --with-unixodbc \ 205 | --with-uriparser \ 206 | --with-vorbis \ 207 | --with-vpb \ 208 | && \ 209 | \ 210 | make menuselect/menuselect menuselect-tree menuselect.makeopts && \ 211 | menuselect/menuselect --disable BUILD_NATIVE \ 212 | --enable-category MENUSELECT_ADDONS \ 213 | --enable-category MENUSELECT_APPS \ 214 | --enable-category MENUSELECT_CHANNELS \ 215 | --enable-category MENUSELECT_CODECS \ 216 | --enable-category MENUSELECT_FORMATS \ 217 | --enable-category MENUSELECT_FUNCS \ 218 | --enable-category MENUSELECT_RES \ 219 | --enable BETTER_BACKTRACES \ 220 | --disable MOH-OPSOUND-WAV \ 221 | --enable MOH-OPSOUND-GSM \ 222 | --disable app_voicemail_imap \ 223 | --disable app_voicemail_odbc \ 224 | --disable res_digium_phone \ 225 | --disable codec_g729a && \ 226 | make && \ 227 | make install && \ 228 | make install-headers && \ 229 | make config && \ 230 | \ 231 | #### Add G729 codecs 232 | git clone https://github.com/BelledonneCommunications/bcg729 /usr/src/bcg729 && \ 233 | cd /usr/src/bcg729 && \ 234 | git checkout tags/$BCG729_VERSION && \ 235 | ./autogen.sh && \ 236 | ./configure --prefix=/usr --libdir=/lib && \ 237 | make && \ 238 | make install && \ 239 | \ 240 | mkdir -p /usr/src/asterisk-g72x && \ 241 | curl https://bitbucket.org/arkadi/asterisk-g72x/get/master.tar.gz | tar xvfz - --strip 1 -C /usr/src/asterisk-g72x && \ 242 | cd /usr/src/asterisk-g72x && \ 243 | ./autogen.sh && \ 244 | ./configure --prefix=/usr --with-bcg729 --enable-$G72X_CPUHOST && \ 245 | make && \ 246 | make install && \ 247 | \ 248 | #### Add USB Dongle support 249 | git clone https://github.com/rusxakep/asterisk-chan-dongle /usr/src/asterisk-chan-dongle && \ 250 | cd /usr/src/asterisk-chan-dongle && \ 251 | git checkout tags/$DONGLE_VERSION && \ 252 | ./bootstrap && \ 253 | ./configure --with-astversion=$ASTERISK_VERSION && \ 254 | make && \ 255 | make install && \ 256 | \ 257 | ldconfig && \ 258 | \ 259 | ### Cleanup 260 | mkdir -p /var/run/fail2ban && \ 261 | cd / && \ 262 | rm -rf /usr/src/* /tmp/* /etc/cron* && \ 263 | apt-get purge -y $ASTERISK_BUILD_DEPS && \ 264 | apt-get -y autoremove && \ 265 | apt-get clean && \ 266 | rm -rf /var/lib/apt/lists/* && \ 267 | \ 268 | ### FreePBX hacks 269 | sed -i -e "s/memory_limit = 128M/memory_limit = 256M/g" /etc/php/${PHP_VERSION}/apache2/php.ini && \ 270 | sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/${PHP_VERSION}/apache2/php.ini && \ 271 | a2disconf other-vhosts-access-log.conf && \ 272 | a2enmod rewrite && \ 273 | a2enmod headers && \ 274 | rm -rf /var/log/* && \ 275 | mkdir -p /var/log/asterisk && \ 276 | mkdir -p /var/log/apache2 && \ 277 | mkdir -p /var/log/httpd && \ 278 | \ 279 | ### Zabbix setup 280 | echo '%zabbix ALL=(asterisk) NOPASSWD:/usr/sbin/asterisk' >> /etc/sudoers && \ 281 | \ 282 | ### Setup for data persistence 283 | mkdir -p /assets/config/var/lib/ /assets/config/home/ && \ 284 | mv /home/asterisk /assets/config/home/ && \ 285 | ln -s /data/home/asterisk /home/asterisk && \ 286 | mv /var/lib/asterisk /assets/config/var/lib/ && \ 287 | ln -s /data/var/lib/asterisk /var/lib/asterisk && \ 288 | ln -s /data/usr/local/fop2 /usr/local/fop2 && \ 289 | mkdir -p /assets/config/var/run/ && \ 290 | mv /var/run/asterisk /assets/config/var/run/ && \ 291 | mv /var/lib/mysql /assets/config/var/lib/ && \ 292 | mkdir -p /assets/config/var/spool && \ 293 | mv /var/spool/cron /assets/config/var/spool/ && \ 294 | ln -s /data/var/spool/cron /var/spool/cron && \ 295 | mkdir -p /var/run/mongodb && \ 296 | rm -rf /var/lib/mongodb && \ 297 | ln -s /data/var/lib/mongodb /var/lib/mongodb && \ 298 | ln -s /data/var/run/asterisk /var/run/asterisk && \ 299 | rm -rf /var/spool/asterisk && \ 300 | ln -s /data/var/spool/asterisk /var/spool/asterisk && \ 301 | rm -rf /etc/asterisk && \ 302 | ln -s /data/etc/asterisk /etc/asterisk 303 | 304 | ### Networking configuration 305 | EXPOSE 80 443 4445 4569 5060/udp 5160/udp 5061 5161 8001 8003 8008 8009 8025 ${RTP_START}-${RTP_FINISH}/udp 306 | 307 | ### Files add 308 | ADD install / 309 | -------------------------------------------------------------------------------- /freepbx-15/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 5.0.6 2020-08-15 2 | 3 | ### Changed 4 | - Fix for FOP2 not starting up 5 | - Add debug statements to watson-transcription script 6 | - Repair issues with watson transcription 7 | 8 | 9 | ## 5.0.5 2020-08-14 10 | 11 | ### Fixed 12 | - Changed routines to limit socat to start if SMTP_HOST=localhost 13 | 14 | 15 | ## 5.0.4 2020-08-01 16 | 17 | ### Added 18 | - Asterisk 17.6.0 19 | - Added capability of Voicemail transcription via IBM Watson (see /usr/sbin/watson-transcription) 20 | 21 | 22 | ## 5.0.3 2020-07-27 23 | 24 | ### Changed 25 | - Set +x bit on 15-socat container initialization and runtime scripts 26 | 27 | 28 | ## 5.0.2 2020-07-13 29 | 30 | ### Changed 31 | - Disable app_vooicemail_odbc and app_voicemail_imap causing problems with Voicemail working 32 | 33 | 34 | ## 5.0.1 2020-06-20 35 | 36 | ### Changed 37 | - Patch for version 5.0.0 38 | 39 | ## 5.0.0 2020-06-19 40 | 41 | ### Added 42 | - Asterisk 17.x support added 43 | - New Asterisk modules added to base image 44 | - G72x codec CPU-versioning support added 45 | - FreePBX 15.0.16.56 support added 46 | - USB dongle (huawei) module support added 47 | - MongoDB versioning support added 48 | - Sync build with latest base image features (00-container) 49 | - FreePBX keys added to avoid spam from gnupg in logs 50 | - FreePBX modules added (backup, filestore, fw_langpacks) 51 | - Fix MariaDB starting 52 | - Change external MariaDB ODBC drivers to internal (debian repository) 53 | - Some environment variables moved to \defaults to avoid rebuild image 54 | - socat as SMTP proxy added for new FreePBX modules 55 | - Support for custom RTP ports added 56 | 57 | ### Changed 58 | - Cleaned up Documentation 59 | - ENABLE_CRON, ENABLE_SMTP now TRUE by default 60 | - Fix for incorrect privileges in doctrine FreePBX cache system 61 | - Extend featurecodes column in embedded database too 62 | - Fix '--x' execute bit in all asterisk modules 63 | - Fix MongoDB starting 64 | - Fix bash scripts (fix 'sed'-scripts, fix 'chown'-scripts with symlinks and so on ...) 65 | - Fix start/stop container scripts to avoid database corruption 66 | - Create additional agi-bin, backup, fax and outgoing directories 67 | - Fix XMPP service start/stop 68 | - Change FOP2 Module to FALSE by default due to flash deprecation 69 | - RTP_START and RTP_FINISH values in embedded database 70 | - Fix issues with cron running as root 71 | 72 | 73 | ## 4.0.6 2020-06-08 74 | 75 | ### Added 76 | - Support changes to tiredofit/debian base image 77 | 78 | 79 | ## 4.0.5.1 2020-05-08 80 | 81 | ### Changed 82 | - Patchup for 4.0.5 83 | 84 | 85 | ## 4.0.4 2020-05-07 86 | 87 | ### Added 88 | - Update Console command to advise how to access admin panel upon container has finished initializing 89 | 90 | 91 | ## 4.0.3 2020-03-29 92 | 93 | ### Changed 94 | - Fix Apache for duplicate Listen statement if using `ENABLE_SSL=TRUE` 95 | 96 | 97 | ## 4.0.2 2020-03-25 98 | 99 | ### Added 100 | - Added sngrep, sipsak, tcpflow, tcpdump to image for troubleshooting SIP issues on request 101 | 102 | ## 4.0.1 2020-03-16 103 | 104 | ### Changed 105 | - Fixup for internal mailing via msmtp 106 | 107 | 108 | ## 4.0.0 2020-03-11 109 | 110 | ## Added 111 | - Option to Install Additional Modules on First Container Start 112 | 113 | ## Changed 114 | - Switch to Debian Buster 115 | - Asterisk 17.2.0 116 | - Freepbx Framework 15.0.16.45 117 | - Reworked package install in Dockerfile 118 | - Reduced errors being shown re MongoDB/XMPP Module 119 | - Changed verbosity when installing modules 120 | - Other code optimizations 121 | - MariaDB ODBC Connector 2.0.19 122 | 123 | ## 3.9.5 2020-03-03 124 | 125 | ### Changed 126 | - Fixed issues with SMTP configuration 127 | - Created temporary log directory for Flash Operator Panel installation 128 | 129 | ## 3.9.4 2020-02-10 130 | 131 | ### Added 132 | - Move more defaults into functions files 133 | - Fix error with Cron starting before it Freepbx installs causing errors with persistent storage 134 | 135 | 136 | ## 3.9.3 2020-02-01 137 | 138 | ### Changed 139 | - Spelling mistake fix for Log display 140 | - Fixed wrong function being called for checking is DB was available for External DB Container installs 141 | - Reworked CDR Hack for Single DB (external DB Container) installation (Thanks barhom@github) 142 | 143 | 144 | ## 3.9.2 2020-01-28 145 | 146 | ### Added 147 | - Freepbx Framework 15.0.16.42 148 | 149 | ### Changed 150 | - Fix to allow UCP to build properly 151 | 152 | 153 | ## 3.9.1 2020-01-27 154 | 155 | ### Changed 156 | - Fix spelling mistake in container startup script 157 | 158 | 159 | ## 3.9.0 2020-01-12 160 | 161 | ### Added 162 | - Update to support new tiredofit/debian base images 163 | - Asterisk 16.7.0 164 | - FreePBX Framework 15.0.16.39 165 | 166 | 167 | ## 3.8.3 2019-11-29 168 | 169 | ### Added 170 | - Asterisk 16.6.2 171 | - FreePBX 15.0.16.28 172 | 173 | ### Changed 174 | - Changed source location to continue building g72x codecs 175 | 176 | 177 | ## 3.8.2 2019-10-28 178 | 179 | * Asterisk 16.61 180 | * FreePBX 15.0.16.21 181 | 182 | 183 | ## 3.8.1 2019-10-28 184 | 185 | * Add php56-intl 186 | 187 | ## 3.8 2019-09-13 + 188 | 189 | * Pinned LibXML2 to older version due to an upstream change and Asterisk can no longer detect 190 | * Updated Asterisk to 16.5.1 191 | * Updated Freepbx to 15.0.16.15 192 | * Changed Download Location of SpanDSP 193 | * Downgrade Node to 10 194 | 195 | ## 3.7.2 2019-07-07 196 | 197 | * Repair broken upgrade command 198 | 199 | ## 3.7.1 2019-07-04 200 | 201 | * Freepbx 15.0.16.6 202 | 203 | ## 3.7 2019-06-07 204 | 205 | * Asterisk 16.4.0 206 | * Freepbx 15.0.16.2 207 | * Hack to solve issue #83 re /data/home/asterisk not being created 208 | 209 | ## 3.6 2019-05-10 210 | 211 | * Reintroduce Fax Capabilities and SpanDSP 212 | * New way of importing GPG Keys 213 | * Force Specific FreePBX Version to be installed (Presently 15.0.15.3) 214 | * Rework hack for seperate DB Host upon install 215 | * Add /var/spool/cron to the persistent data (Issue #56) 216 | 217 | ## 3.5.1 2019-05-06 218 | 219 | * NodeJS 12 220 | 221 | ## 3.5 2019-05-06 222 | 223 | * Asterisk 16.3.0 224 | * Remove unneccessary ADD command 225 | 226 | ## 3.4 2019-05-02 227 | 228 | * Fix for UCP failing 229 | * Added more Languages 230 | * Change Module Load Order 231 | 232 | ## 3.3.1 2019-02-27 233 | 234 | * Downgrade MariaDB Connector to fix CDR Issues 235 | 236 | ## 3.3 2019-02-21 237 | 238 | * Embarassing fix for breaking first install 239 | * Asterisk 16.2.0 240 | 241 | ## 3.2.1 2019-02-20 242 | 243 | * Fixup for restarting the container after first install 244 | * Minor DB Fixes 245 | * Removal of SpanDSP temporarily and app_fax due to problems with source site (soft-switch.org) 246 | 247 | ## 3.2 2019-02-06 248 | 249 | * Added MongoDB to support `ENABLE_XMPP` environment variable/installing XMPP module from inside FreePBX. 250 | * A few more sanity checks to ensure installation completes 251 | 252 | ## 3.1 2019-02-06 253 | 254 | * Added Fax Support 255 | 256 | ## 3.0 2019-02-06 257 | 258 | This is a breaking release due to major version changes. 259 | If attempting to run from a previous release and system detects Asterisk 14 and FreePBX instructions will be given on how to let container operate. New installations only in the 3.x series. 260 | 261 | * Asterisk 16 262 | * Freepbx 15 263 | * NodeJS 11 264 | * Multilanguage Support 265 | * Many bugfixes 266 | * Better Debug verbosity when `DEBUG_MODE=TRUE` 267 | 268 | ## 2.13 - 2019-01-31 269 | 270 | * Add Asterisk Version in startup step to prepare for upcoming image shift to Asterisk 16 and FreePBX 15 271 | 272 | ## 2.12 - 2018-12-27 273 | 274 | * Sort Defaults in Startup Script (cosmetic) 275 | * Add cache dir upon first startup 276 | * Fix internal ports exposure 277 | * Change GPG Keyserver 278 | * Change PHP Packages Source Location 279 | * Update MariaDB Connector 280 | * Fix Database Sanity Tests 281 | * Reorder Module Download 282 | * Add Warning for Self Signed Certificate 283 | * Stop using edge versions on initial bootup, problems have been resolved which caused this on upstream 284 | 285 | ## 2.11 - 2018-11-20 286 | 287 | * Refinements to environment variables being TRUE/true or FALSE/false 288 | * Fixup PHP Memory Limit issue due to poor regex 289 | 290 | ## 2.10 - 2018-09-26 291 | 292 | * Refix for internal database being deleted on 2nd startup 293 | 294 | ## 2.9 2018-10-18 295 | 296 | * Remove /etc/cron.* folders to avoid calling anacron even if isnt installed 297 | * Repair Logrotate for Apache Log files 298 | 299 | ## 2.8 - 2018-10-16 300 | 301 | * Fix for changed Asterisk Download link 302 | 303 | ## 2.7 - 2018-08-15 304 | 305 | * Update for changed MSMTP in Base Image 306 | 307 | ## 2.6 - 2018-07-02 308 | 309 | * Fix logrotate for Apache 310 | 311 | ## 2.5 - 2018-07-02 312 | 313 | * MSMTP Cleanup courtesy of @joeyberkovitz 314 | 315 | ## 2.41 - 2018-06-06 316 | 317 | Still fixing 2.4 release 318 | 319 | ## 2.4 - 2018-06-06 320 | 321 | * Update for HTTP_PORT/HTTPS_PORT Variable 322 | 323 | ## 2.3 - 2018-06-06 324 | 325 | * Custom Files Modification to support adding custom files outside of webroot - Follow general linux filesystem 326 | 327 | ## 2.22 - 2018-06-01 328 | 329 | * Final Fop2 Fix to change fop2.cfg to look to 127.0.0.1 instead of localhost 330 | 331 | ## 2.21 - 2018-06-01 332 | 333 | * Add logrotate and output FOP log to /var/log/fop/ 334 | 335 | ## 2.2 - 2018-06-01 336 | 337 | * Fix for FOP Installation 338 | 339 | ## 2.1 - 2018-06-01 340 | 341 | * Added `HTTP_PORT` Variable 342 | * Added `HTTPS_PORT` Variable 343 | 344 | ## 2.0 - 2018-05-31 345 | 346 | * Flash Operator Panel 2 integrated (no need to re-install, will detect if you are upgrading) 347 | * Customizable admin URL 348 | * Customizable FOP URL 349 | 350 | ## 1.11 - 2018-05-31 351 | 352 | * Fail2ban Logrotate Fixup 353 | 354 | ## 1.10 - 2018-05-30 355 | 356 | * Additional Tweaks for CDR and CEL to be recorded without issues. 357 | 358 | ## 1.9 - 2018-05-30 359 | 360 | * Add UCP_FIRST env var to display the UCP first instead of the FreePBX Admin screen 361 | 362 | ## 1.8 - 2018-05-07 363 | 364 | * Tweak to ODBC Driver to allow for CDR to be recorded. 365 | 366 | ## 1.7 - 2018-05-07 367 | 368 | * Compile Jansson 369 | * Compile BCG729 370 | * Compile G729 Codecs instead of relying on prebuilt binary 371 | 372 | ## 1.6 - 2018-04-17 373 | 374 | * Add custom file support - Drop your files in /assets/custom following the /var/www/html directory structure and they will get overwritten (Use with care, modules may not work after this after upgrading) 375 | 376 | ## 1.53 - 2018-04-14 377 | 378 | * Tweak for Asterisk Logging 379 | 380 | ## 1.52 - 2018-04-14 381 | 382 | * Update PHP to support SMTP sending 383 | 384 | ## 1.51 - 2018-04-10 385 | 386 | * Add php5.6-ldap for LDAP Lookups 387 | 388 | ## 1.5 - 2018-04-08 389 | 390 | * Add libsrtp for TLS RTP 391 | 392 | ## 1.42 - 2018-04-08 393 | 394 | * Apache Cleanup 395 | 396 | ## 1.41 - 2018-04-08 397 | 398 | * Apache2 Fixup for Extended Status 399 | 400 | ## 1.4 - 2018-04-08 401 | 402 | * Add Zabbix Monitoring for Asterisk and Apache 403 | * Shuffle Log Locations around a bit (just map /var/log as a directory now for seperated service folders) 404 | * Tweak Fail2ban Scripts to properly block PJSIP 405 | * Add Fail2ban script to block FreePBX authentication failures (Admin and UCP) 406 | * Add ability to disable Fail2ban on Startup 407 | 408 | ## 1.32 - 2018-04-06 409 | 410 | * Set X-Real-IP in Apache2 logs, fix log location 411 | 412 | ## 1.31 - 2018-04-06 413 | 414 | * Sanity test for Apache logdir if following example/docker-compose.yml 415 | 416 | ## 1.3 - 2018-04-06 417 | 418 | * SSL Support for Apache Included - Map /certs volume somewhere, drop your keys in and set ENV Var `TLS_CERT` and `TLS_KEY` and set `ENABLE_SSL=TRUE` 419 | * Add logrotate for fail2ban and apache 420 | * Added some error checking to exit when bad stuff happens 421 | 422 | ## 1.22 2018-04-05 423 | 424 | * Fix /etc/amportal.conf permissions after initial install courtesy of github.com/flaviut 425 | 426 | ## 1.21 2018-04-01 427 | 428 | * Be more verbose when Webroot environment variable is being changed 429 | * Disable Indexing if custom webroot enabled 430 | 431 | ## 1.2 2018-04-01 432 | 433 | * Updated Asterisk Compilation options courtesy of github.com/flaviut 434 | 435 | ## 1.1 2018-03-31 436 | 437 | * Cleanup some of the Embedded DB Routines 438 | * Expose more ports 439 | * Fix RTP Port Range Modification in Database 440 | * Update docker-compose.yml example 441 | * Added WEBROOT variable for adding subfolder based install 442 | 443 | ## 1.0 2018-03-15 444 | 445 | * Production Ready 446 | * Fixes Previous Download and installation steps as reported by Github users 447 | * Installs all latest applications from --edge to avoid any signature failures 448 | * Compiles and installs app_confbridge 449 | 450 | ## 0.82 2018-01-09 451 | 452 | * Added DB_PORT verification to SQL strings 453 | 454 | ## 0.81 2017-12-14 455 | 456 | * Tweak for DB_EMBEDDED acting strange 457 | 458 | ## 0.8 2017-12-14 459 | 460 | * Support both embedded and external MariaDB servers via DB_EMBEDDED environment variable 461 | 462 | ## 0.7 2017-12-14 463 | 464 | * Debian Stretch 465 | * Asterisk 14 466 | * NodeJS 8.x 467 | * Apache2 (Potentially will revert to Nginx again later) 468 | * Seperate MariaDB database support as per original 0.2 build 469 | * FreePBX 14 470 | * UCP installed as part of freepbx initial install 471 | 472 | 473 | ## 0.7test 2017-12-12 474 | 475 | * Test Single Container Mode proving that UCP works with Apache (Didn't work with Nginx) 476 | * Next release will decide which way forward (Split DB or Not) 477 | 478 | ## 0.6 2017-11-18 479 | 480 | * Fix Fail2ban to properly load Asterisk Jails 481 | 482 | ## 0.51 2017-11-17 483 | 484 | * Fix Logrotate 485 | 486 | ## 0.5 2017-10-30 487 | 488 | * Remove BUILDNATIVE compiler flag for compatibility 489 | 490 | ## 0.4 2017-10-17 491 | 492 | * Composer - UCP Currently Broken 493 | 494 | ## 0.3 2017-10-17 495 | 496 | * Added NodeJS for UCP 497 | * Added SpanDSP and Libtiff for Fax 498 | * Fixed some install routines 499 | 500 | ## 0.2 2017-10-01 501 | 502 | * Ability to utilize same FreePBX Configuration Database for CDR Records 503 | * Ability to dynamically set the RTP Ports upon startup 504 | * Overall cleanup and size optimizations 505 | 506 | ## 0.1 2017-10-01 507 | 508 | * Initial Relase 509 | * Asterisk 14 510 | * FreePBX 14 511 | * Nginx 512 | * Fail2ban 513 | * PHP-FPM 5.6 514 | * Debian Stretch 515 | * Requires External DB Server 516 | 517 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ###https://github.com/tiredofit/docker-debian/tree/buster 2 | FROM debian:buster AS epandi-debian-buster 3 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 4 | 5 | ### Set defaults 6 | ENV ZABBIX_VERSION=5.2 \ 7 | S6_OVERLAY_VERSION=v2.1.0.2 \ 8 | DEBUG_MODE=FALSE \ 9 | TIMEZONE=Etc/GMT \ 10 | DEBIAN_FRONTEND=noninteractive \ 11 | ENABLE_CRON=TRUE \ 12 | ENABLE_SMTP=TRUE \ 13 | ENABLE_ZABBIX=TRUE \ 14 | ZABBIX_HOSTNAME=debian.buster 15 | 16 | ### Dependencies addon 17 | RUN set -x && \ 18 | apt-get update && \ 19 | apt-get upgrade -y && \ 20 | apt-get install -y --no-install-recommends \ 21 | apt-transport-https \ 22 | aptitude \ 23 | bash \ 24 | ca-certificates \ 25 | curl \ 26 | dirmngr \ 27 | dos2unix \ 28 | gnupg \ 29 | less \ 30 | logrotate \ 31 | msmtp \ 32 | nano \ 33 | net-tools \ 34 | netcat-openbsd \ 35 | procps \ 36 | sudo \ 37 | tzdata \ 38 | vim-tiny \ 39 | wget \ 40 | && \ 41 | ### curl https://repo.zabbix.com/zabbix-official-repo.key | apt-key add - && \ 42 | ### echo "deb http://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian buster main" >>/etc/apt/sources.list && \ 43 | ### echo "deb-src http://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian buster main" >>/etc/apt/sources.list && \ 44 | wget https://repo.zabbix.com/zabbix/5.2/raspbian/pool/main/z/zabbix-release/zabbix-release_5.2-1+debian$(cut -d"." -f1 /etc/debian_version)_all.deb && \ 45 | dpkg -i zabbix-release_5.2-1+debian$(cut -d"." -f1 /etc/debian_version)_all.deb && \ 46 | apt-get update && \ 47 | apt-get install -y --no-install-recommends \ 48 | zabbix-agent && \ 49 | rm -rf /etc/zabbix/zabbix-agentd.conf.d/* && \ 50 | curl -ksSLo /usr/local/bin/MailHog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_arm && \ 51 | curl -ksSLo /usr/local/bin/mhsendmail https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_arm && \ 52 | chmod +x /usr/local/bin/MailHog && \ 53 | chmod +x /usr/local/bin/mhsendmail && \ 54 | useradd -r -s /bin/false -d /nonexistent mailhog && \ 55 | apt-get autoremove -y && \ 56 | apt-get clean -y && \ 57 | rm -rf /var/lib/apt/lists/* /root/.gnupg /var/log/* /etc/logrotate.d && \ 58 | mkdir -p /assets/cron && \ 59 | rm -rf /etc/timezone && \ 60 | ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \ 61 | echo "${TIMEZONE}" > /etc/timezone && \ 62 | dpkg-reconfigure -f noninteractive tzdata && \ 63 | echo '%zabbix ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 64 | \ 65 | ### S6 installation 66 | curl -ksSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-arm.tar.gz | tar xfz - --strip 0 -C / 67 | 68 | ### Networking configuration 69 | EXPOSE 1025 8025 10050/TCP 70 | 71 | ### Add folders 72 | ADD debian-buster/install / 73 | 74 | ### Entrypoint configuration 75 | ENTRYPOINT ["/init"] 76 | 77 | 78 | 79 | ###https://github.com/tiredofit/docker-nodejs/tree/10/debian 80 | FROM epandi-debian-buster AS epandi-nodejs-10-debian-latest 81 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 82 | 83 | ### Environment variables 84 | ENV ENABLE_CRON=FALSE \ 85 | ENABLE_SMTP=FALSE 86 | 87 | ### Add users 88 | RUN adduser --home /app --gecos "Node User" --disabled-password nodejs && \ 89 | \ 90 | ### Install NodeJS 91 | wget --no-check-certificate -qO - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ 92 | echo 'deb https://deb.nodesource.com/node_10.x buster main' > /etc/apt/sources.list.d/nodesource.list && \ 93 | echo 'deb-src https://deb.nodesource.com/node_10.x buster main' >> /etc/apt/sources.list.d/nodesource.list && \ 94 | apt-get update && \ 95 | apt-get install -y \ 96 | nodejs \ 97 | yarn \ 98 | && \ 99 | \ 100 | apt-get clean && \ 101 | apt-get autoremove -y && \ 102 | rm -rf /var/lib/apt/lists/* 103 | 104 | 105 | 106 | ###https://github.com/tiredofit/docker-freepbx 107 | FROM epandi-nodejs-10-debian-latest 108 | LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" 109 | 110 | ### Set defaults 111 | ENV ASTERISK_VERSION=17.9.3 \ 112 | BCG729_VERSION=1.0.4 \ 113 | DONGLE_VERSION=20200610 \ 114 | G72X_CPUHOST=penryn \ 115 | G72X_VERSION=0.1 \ 116 | MONGODB_VERSION=4.2 \ 117 | PHP_VERSION=5.6 \ 118 | SPANDSP_VERSION=20180108 \ 119 | RTP_START=18000 \ 120 | RTP_FINISH=20000 121 | 122 | ### Pin libxml2 packages to Debian repositories 123 | RUN c_rehash && \ 124 | echo "Package: libxml2*" > /etc/apt/preferences.d/libxml2 && \ 125 | echo "Pin: release o=Debian,n=buster" >> /etc/apt/preferences.d/libxml2 && \ 126 | echo "Pin-Priority: 501" >> /etc/apt/preferences.d/libxml2 && \ 127 | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=TRUE && \ 128 | \ 129 | ### Install dependencies 130 | set -x && \ 131 | curl https://packages.sury.org/php/apt.gpg | apt-key add - && \ 132 | echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/deb.sury.org.list && \ 133 | # curl https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc | apt-key add - && \ 134 | # echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGODB_VERSION} main" > /etc/apt/sources.list.d/mongodb-org.list && \ 135 | echo "deb http://ftp.us.debian.org/debian/ buster-backports main" > /etc/apt/sources.list.d/backports.list && \ 136 | echo "deb-src http://ftp.us.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list.d/backports.list && \ 137 | wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add - && \ 138 | echo "deb http://archive.raspbian.org/raspbian buster main contrib non-free" >>/etc/apt/sources.list && \ 139 | echo "deb-src http://archive.raspbian.org/raspbian buster main contrib non-free" >>/etc/apt/sources.list && \ 140 | apt-get update && \ 141 | apt-get -o Dpkg::Options::="--force-confold" upgrade -y && \ 142 | \ 143 | ### Install development dependencies 144 | ASTERISK_BUILD_DEPS='\ 145 | autoconf \ 146 | automake \ 147 | bison \ 148 | binutils-dev \ 149 | build-essential \ 150 | doxygen \ 151 | flex \ 152 | graphviz \ 153 | libasound2-dev \ 154 | libbluetooth-dev \ 155 | libc-client2007e-dev \ 156 | libcfg-dev \ 157 | libcodec2-dev \ 158 | libcorosync-common-dev \ 159 | libcpg-dev \ 160 | libcurl4-openssl-dev \ 161 | libedit-dev \ 162 | libfftw3-dev \ 163 | libgmime-2.6-dev \ 164 | libgsm1-dev \ 165 | libical-dev \ 166 | libiksemel-dev \ 167 | libjansson-dev \ 168 | libldap2-dev \ 169 | liblua5.2-dev \ 170 | libmariadb-dev \ 171 | libmariadbclient-dev \ 172 | libmp3lame-dev \ 173 | libncurses5-dev \ 174 | libneon27-dev \ 175 | libnewt-dev \ 176 | libogg-dev \ 177 | libopus-dev \ 178 | libosptk-dev \ 179 | libpopt-dev \ 180 | libradcli-dev \ 181 | libresample1-dev \ 182 | libsndfile1-dev \ 183 | libsnmp-dev \ 184 | libspeex-dev \ 185 | libspeexdsp-dev \ 186 | libsqlite3-dev \ 187 | libsrtp2-dev \ 188 | libssl-dev \ 189 | libtiff-dev \ 190 | libtool-bin \ 191 | libunbound-dev \ 192 | liburiparser-dev \ 193 | libvorbis-dev \ 194 | libvpb-dev \ 195 | libxml2-dev \ 196 | libxslt1-dev \ 197 | linux-headers-armmp \ 198 | portaudio19-dev \ 199 | python-dev \ 200 | subversion \ 201 | unixodbc-dev \ 202 | uuid-dev \ 203 | zlib1g-dev' && \ 204 | \ 205 | ### Install runtime dependencies 206 | apt-get install --no-install-recommends -y \ 207 | $ASTERISK_BUILD_DEPS \ 208 | apache2 \ 209 | composer \ 210 | fail2ban \ 211 | ffmpeg \ 212 | flite \ 213 | freetds-dev \ 214 | git \ 215 | g++ \ 216 | iptables \ 217 | lame \ 218 | libavahi-client3 \ 219 | libbluetooth3 \ 220 | libc-client2007e \ 221 | libcfg7 \ 222 | libcpg4 \ 223 | libgmime-2.6 \ 224 | libical3 \ 225 | libiodbc2 \ 226 | libiksemel3 \ 227 | libicu63 \ 228 | libicu-dev \ 229 | libneon27 \ 230 | libosptk4 \ 231 | libresample1 \ 232 | libsnmp30 \ 233 | libspeexdsp1 \ 234 | libsrtp2-1 \ 235 | libunbound8 \ 236 | liburiparser1 \ 237 | libvpb1 \ 238 | locales \ 239 | locales-all \ 240 | make \ 241 | mariadb-client \ 242 | mariadb-server \ 243 | mongodb \ 244 | mpg123 \ 245 | php${PHP_VERSION} \ 246 | php${PHP_VERSION}-curl \ 247 | php${PHP_VERSION}-cli \ 248 | php${PHP_VERSION}-mysql \ 249 | php${PHP_VERSION}-gd \ 250 | php${PHP_VERSION}-mbstring \ 251 | php${PHP_VERSION}-intl \ 252 | php${PHP_VERSION}-bcmath \ 253 | php${PHP_VERSION}-ldap \ 254 | php${PHP_VERSION}-xml \ 255 | php${PHP_VERSION}-zip \ 256 | php${PHP_VERSION}-sqlite3 \ 257 | php-pear \ 258 | pkg-config \ 259 | sipsak \ 260 | sngrep \ 261 | socat \ 262 | sox \ 263 | sqlite3 \ 264 | tcpdump \ 265 | tcpflow \ 266 | unixodbc \ 267 | uuid \ 268 | wget \ 269 | whois \ 270 | xmlstarlet && \ 271 | \ 272 | ### Usbutils addon 273 | apt-get install usbutils unzip autoconf automake -y && \ 274 | \ 275 | ### Add users 276 | addgroup --gid 2600 asterisk && \ 277 | adduser --uid 2600 --gid 2600 --gecos "Asterisk User" --disabled-password asterisk && \ 278 | \ 279 | ### Build MardiaDB connector 280 | apt-get install -y cmake gcc && \ 281 | cd /usr/src && \ 282 | git clone https://github.com/MariaDB/mariadb-connector-odbc.git && \ 283 | cd mariadb-connector-odbc && \ 284 | git checkout tags/3.1.1-ga && \ 285 | mkdir build && \ 286 | cd build && \ 287 | cmake ../ -LH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_SSL=OPENSSL\ 288 | -DDM_DIR=/usr/lib/arm-linux-gnueabihf -DCMAKE_C_FLAGS_RELEASE:STRING="-w" && \ 289 | cmake --build . --config Release && \ 290 | make install && \ 291 | \ 292 | ### Build SpanDSP 293 | mkdir -p /usr/src/spandsp && \ 294 | curl -kL http://sources.buildroot.net/spandsp/spandsp-${SPANDSP_VERSION}.tar.gz | tar xvfz - --strip 1 -C /usr/src/spandsp && \ 295 | cd /usr/src/spandsp && \ 296 | ./configure --prefix=/usr && \ 297 | make && \ 298 | make install && \ 299 | \ 300 | ### Build Asterisk 301 | cd /usr/src && \ 302 | mkdir -p asterisk && \ 303 | curl -sSL http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${ASTERISK_VERSION}.tar.gz | tar xvfz - --strip 1 -C /usr/src/asterisk && \ 304 | cd /usr/src/asterisk/ && \ 305 | make distclean && \ 306 | contrib/scripts/get_mp3_source.sh && \ 307 | cd /usr/src/asterisk && \ 308 | ./configure \ 309 | --with-jansson-bundled \ 310 | --with-pjproject-bundled \ 311 | --with-bluetooth \ 312 | --with-codec2 \ 313 | --with-crypto \ 314 | --with-gmime \ 315 | --with-iconv \ 316 | --with-iksemel \ 317 | --with-inotify \ 318 | --with-ldap \ 319 | --with-libxml2 \ 320 | --with-libxslt \ 321 | --with-lua \ 322 | --with-ogg \ 323 | --with-opus \ 324 | --with-resample \ 325 | --with-spandsp \ 326 | --with-speex \ 327 | --with-sqlite3 \ 328 | --with-srtp \ 329 | --with-unixodbc \ 330 | --with-uriparser \ 331 | --with-vorbis \ 332 | --with-vpb \ 333 | && \ 334 | \ 335 | make menuselect/menuselect menuselect-tree menuselect.makeopts && \ 336 | menuselect/menuselect --disable BUILD_NATIVE \ 337 | --enable-category MENUSELECT_ADDONS \ 338 | --enable-category MENUSELECT_APPS \ 339 | --enable-category MENUSELECT_CHANNELS \ 340 | --enable-category MENUSELECT_CODECS \ 341 | --enable-category MENUSELECT_FORMATS \ 342 | --enable-category MENUSELECT_FUNCS \ 343 | --enable-category MENUSELECT_RES \ 344 | --enable BETTER_BACKTRACES \ 345 | --disable MOH-OPSOUND-WAV \ 346 | --enable MOH-OPSOUND-GSM \ 347 | --disable app_voicemail_imap \ 348 | --disable app_voicemail_odbc \ 349 | --disable res_digium_phone \ 350 | --disable codec_g729a && \ 351 | make && \ 352 | make install && \ 353 | make install-headers && \ 354 | make config && \ 355 | \ 356 | #### Add G729 codecs 357 | git clone https://github.com/BelledonneCommunications/bcg729 /usr/src/bcg729 && \ 358 | cd /usr/src/bcg729 && \ 359 | git checkout tags/$BCG729_VERSION && \ 360 | ./autogen.sh && \ 361 | ./configure --prefix=/usr --libdir=/lib && \ 362 | make && \ 363 | make install && \ 364 | \ 365 | mkdir -p /usr/src/asterisk-g72x && \ 366 | curl https://bitbucket.org/arkadi/asterisk-g72x/get/master.tar.gz | tar xvfz - --strip 1 -C /usr/src/asterisk-g72x && \ 367 | cd /usr/src/asterisk-g72x && \ 368 | ./autogen.sh && \ 369 | ./configure CFLAGS='-march=armv7' --prefix=/usr --with-bcg729 --enable-$G72X_CPUHOST && \ 370 | make && \ 371 | make install && \ 372 | \ 373 | #### Add USB Dongle support 374 | git clone https://github.com/rusxakep/asterisk-chan-dongle /usr/src/asterisk-chan-dongle && \ 375 | cd /usr/src/asterisk-chan-dongle && \ 376 | git checkout tags/$DONGLE_VERSION && \ 377 | ./bootstrap && \ 378 | ./configure --with-astversion=$ASTERISK_VERSION && \ 379 | make && \ 380 | make install && \ 381 | \ 382 | ldconfig && \ 383 | \ 384 | ### Cleanup 385 | mkdir -p /var/run/fail2ban && \ 386 | cd / && \ 387 | rm -rf /usr/src/* /tmp/* /etc/cron* && \ 388 | apt-get purge -y $ASTERISK_BUILD_DEPS && \ 389 | apt-get -y autoremove && \ 390 | apt-get clean && \ 391 | rm -rf /var/lib/apt/lists/* && \ 392 | \ 393 | ### FreePBX hacks 394 | sed -i -e "s/memory_limit = 128M/memory_limit = 256M/g" /etc/php/${PHP_VERSION}/apache2/php.ini && \ 395 | sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/${PHP_VERSION}/apache2/php.ini && \ 396 | a2disconf other-vhosts-access-log.conf && \ 397 | a2enmod rewrite && \ 398 | a2enmod headers && \ 399 | rm -rf /var/log/* && \ 400 | mkdir -p /var/log/asterisk && \ 401 | mkdir -p /var/log/apache2 && \ 402 | mkdir -p /var/log/httpd && \ 403 | \ 404 | ### Zabbix setup 405 | echo '%zabbix ALL=(asterisk) NOPASSWD:/usr/sbin/asterisk' >> /etc/sudoers && \ 406 | \ 407 | ### Setup for data persistence 408 | mkdir -p /assets/config/var/lib/ /assets/config/home/ && \ 409 | mv /home/asterisk /assets/config/home/ && \ 410 | ln -s /data/home/asterisk /home/asterisk && \ 411 | mv /var/lib/asterisk /assets/config/var/lib/ && \ 412 | ln -s /data/var/lib/asterisk /var/lib/asterisk && \ 413 | ln -s /data/usr/local/fop2 /usr/local/fop2 && \ 414 | mkdir -p /assets/config/var/run/ && \ 415 | mv /var/run/asterisk /assets/config/var/run/ && \ 416 | mv /var/lib/mysql /assets/config/var/lib/ && \ 417 | mkdir -p /assets/config/var/spool && \ 418 | mv /var/spool/cron /assets/config/var/spool/ && \ 419 | ln -s /data/var/spool/cron /var/spool/cron && \ 420 | mkdir -p /var/run/mongodb && \ 421 | rm -rf /var/lib/mongodb && \ 422 | ln -s /data/var/lib/mongodb /var/lib/mongodb && \ 423 | ln -s /data/var/run/asterisk /var/run/asterisk && \ 424 | rm -rf /var/spool/asterisk && \ 425 | ln -s /data/var/spool/asterisk /var/spool/asterisk && \ 426 | rm -rf /etc/asterisk && \ 427 | ln -s /data/etc/asterisk /etc/asterisk 428 | 429 | ### Networking configuration 430 | EXPOSE 80 443 4445 4569 5060/udp 5160/udp 5061 5161 8001 8003 8008 8009 8025 ${RTP_START}-${RTP_FINISH}/udp 431 | 432 | ### Files add 433 | ADD freepbx-15/install / -------------------------------------------------------------------------------- /debian-buster/zabbix_templates/zabbix_agent_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3.4 4 | 2018-02-02T19:04:27Z 5 | 6 | 7 | Discovered Containers 8 | 9 | 10 | Templates 11 | 12 | 13 | 14 | 161 | 396 | 397 | 398 | 399 | {Service - ICMP:icmpping.max(3m)}=3 400 | 0 401 | 402 | Cannot be pinged 403 | 0 404 | 405 | 406 | 0 407 | 5 408 | 409 | 0 410 | 0 411 | 412 | 413 | 414 | 415 | {Service - ICMP:icmppingloss.min(10m)}>50 416 | 0 417 | 418 | Ping loss is too high 419 | 0 420 | 421 | 422 | 0 423 | 4 424 | 425 | 0 426 | 0 427 | 428 | 429 | Cannot be pinged 430 | {Service - ICMP:icmpping.max(3m)}=3 431 | 432 | 433 | 434 | 435 | 436 | 437 | {Service - ICMP:icmppingsec.avg(2m)}>100 438 | 0 439 | 440 | Ping Response time is too high 441 | 0 442 | 443 | 444 | 0 445 | 4 446 | 447 | 1 448 | 0 449 | 450 | 451 | Cannot be pinged 452 | {Service - ICMP:icmpping.max(3m)}=3 453 | 454 | 455 | 456 | 457 | 458 | 459 | {Zabbix - Container Agent:packages.upgradable.last()}>0 460 | 0 461 | 462 | Upgraded Packages in Container Available 463 | 0 464 | 465 | 466 | 0 467 | 1 468 | 469 | 0 470 | 0 471 | 472 | 473 | 474 | 475 | {Zabbix - Container Agent:agent.ping.nodata(3m)}=1 476 | 0 477 | 478 | Zabbix agent is unreachable 479 | 0 480 | 481 | 482 | 0 483 | 5 484 | 485 | 0 486 | 0 487 | 488 | 489 | 490 | 491 | 492 | 493 | Service state 494 | 495 | 496 | 0 497 | Down 498 | 499 | 500 | 1 501 | Up 502 | 503 | 504 | 505 | 506 | Zabbix agent ping status 507 | 508 | 509 | 1 510 | Up 511 | 512 | 513 | 514 | 515 | 516 | -------------------------------------------------------------------------------- /freepbx-15/install/etc/cont-init.d/10-freepbx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | source /assets/functions/00-container 4 | prepare_service single 5 | # shellcheck disable=SC2034 6 | PROCESS_NAME="freepbx" 7 | 8 | if var_false "$DB_EMBEDDED" ; then 9 | sanity_db 10 | db_ready mariadb 11 | fi 12 | 13 | ### Startup 14 | if [ ! -f /data/.installed ]; then 15 | print_notice "Creating default configuration files" 16 | mkdir -p /data/db 17 | cp -R /assets/config/* /data/ 18 | fi 19 | 20 | ### Container version sanity check 21 | if [ -f /data/etc/asterisk/.asterisk_version ]; then 22 | ASTERISK_VERSION_TMP=$(cat /data/etc/asterisk/.asterisk_version) 23 | ASTERISK_VERSION_TMP=${ASTERISK_VERSION_TMP:0:2} 24 | 25 | if [[ ${ASTERISK_VERSION_TMP//./} -lt "16" ]]; then 26 | print_error "****" 27 | print_error "***** This container has been detected to have FreePBX 14 installed" 28 | print_error "***** You cannot perform an inplace upgrade to FreePBX 15 and Asterisk 16+" 29 | print_error "***** To continue using this image switch to using tiredofit/freepbx:14-latest" 30 | print_error "***** See https://github.com/tiredofit/docker-freepbx/issues/51 for more details" 31 | print_error "***** This container will now cease to function" 32 | print_error "****" 33 | exit 1 34 | fi 35 | fi 36 | 37 | print_notice "Setting file permissions" 38 | mkdir -p /data/etc/asterisk 39 | mkdir -p /data/var/lib/asterisk/{bin,playback} 40 | mkdir -p /data/var/spool/asterisk/{backup,cache,dictate,fax,meetme,monitor,outgoing,recording,system,tmp,voicemail} 41 | mkdir -p /data/var/run/asterisk 42 | mkdir -p /data/home/asterisk 43 | mkdir -p /home/asterisk 44 | ln -sf /data/home/asterisk /home/asterisk 45 | chown -R asterisk. /data 46 | chmod +x /usr/lib/asterisk/modules/* 47 | 48 | ### Check if FreePBX installed 49 | if [ ! -f "$WEBROOT"/admin/index.php ]; then 50 | print_info "New install detected - please wait while we fetch FreePBX - will take up to 30 minutes!" 51 | 52 | if [ "$WEBROOT" != "/var/www/html" ]; then 53 | print_notice "Custom installation webroot defined: '${WEBROOT}'" 54 | fi 55 | 56 | if var_false "$DB_EMBEDDED" ; then 57 | cat < /etc/odbc.ini 58 | [MySQL-asteriskcdrdb] 59 | Description = MySQL connection to 'asteriskcdrdb' database 60 | driver = MySQL 61 | server = $DB_HOST 62 | User = $DB_USER 63 | Password = $DB_PASS 64 | database = $DB_NAME 65 | Port = $DB_PORT 66 | option = 3 67 | 68 | [asteriskcdrdb] 69 | Description = MySQL connection to 'asteriskcdrdb' database 70 | driver = MySQL 71 | server = $DB_HOST 72 | User = $DB_USER 73 | Password = $DB_PASS 74 | database = $DB_NAME 75 | Port = $DB_PORT 76 | option = 3 77 | EOF 78 | fi 79 | 80 | mkdir -p /usr/src/freepbx 81 | cd /usr/src || exit 82 | curl -ssL https://github.com/FreePBX/framework/archive/release/"${FREEPBX_VERSION}".tar.gz| tar xfz - --strip 1 -C /usr/src/freepbx 83 | 84 | silent sudo -u asterisk gpg --refresh-keys --keyserver hkp://keyserver.ubuntu.com:80 85 | silent sudo -u asterisk gpg --import /usr/src/freepbx/amp_conf/htdocs/admin/libraries/BMO/1588A7366BD35B34.key 86 | silent sudo -u asterisk gpg --import /usr/src/freepbx/amp_conf/htdocs/admin/libraries/BMO/3DDB2122FE6D84F7.key 87 | silent sudo -u asterisk gpg --import /usr/src/freepbx/amp_conf/htdocs/admin/libraries/BMO/86CE877469D2EAD9.key 88 | silent sudo -u asterisk gpg --import /usr/src/freepbx/amp_conf/htdocs/admin/libraries/BMO/9F9169F4B33B4659.key 89 | silent sudo -u asterisk gpg --import /usr/src/freepbx/amp_conf/htdocs/admin/libraries/BMO/B53D215A755231A3.key 90 | 91 | cd /usr/src/freepbx || exit 92 | cp -R /etc/odbc.ini /usr/src/freepbx/installlib/files/odbc.ini 93 | 94 | touch /etc/asterisk/{acl,agents,amd,app_skel,ari,calendar,cdr,cdr_odbc,cel,cel_odbc,cel_tds,codecs,console,dundi,dongle,hep,modules,motif,ooh323,pjsip_wizard,pjproject,prometheus,res_parking,res_snmp.conf,res_stun_monitor,smdi,statsd,unistim,xmpp}.conf 95 | if [ ! -f /etc/asterisk/extensions.lua ]; then 96 | cat < /etc/asterisk/extensions.lua 97 | extensions = { 98 | ["internal"] = { 99 | ["_1XX"] = function (context, extension) 100 | app.dial('SIP/'..extension); 101 | 102 | local dialstatus = channel["DIALSTATUS"]:get(); 103 | if dialstatus == 'BUSY' then 104 | -- do something....... 105 | elseif dialstatus == 'CHANUNAVAIL' then 106 | -- do another thing 107 | end; 108 | end; 109 | } 110 | } 111 | EOF 112 | fi 113 | 114 | if [ ! -f /etc/asterisk/dongle.conf ]; then 115 | mkdir -p /var/lib/asterisk/smsdb 116 | chown -RH asterisk. /var/lib/asterisk/smsdb 117 | 118 | cat < /etc/asterisk/dongle.conf 119 | [general] 120 | interval = 15 121 | smsdb = /var/lib/asterisk/smsdb 122 | csmsttl = 600 123 | 124 | [defaults] 125 | context = default 126 | group = 0 127 | rxgain = 0 128 | txgain = 0 129 | autodeletesms = yes 130 | resetdongle = yes 131 | u2diag = -1 132 | usecallingpres = yes 133 | callingpres = allowed_passed_screen 134 | disablesms = no 135 | language = en 136 | mindtmfgap = 45 137 | mindtmfduration = 80 138 | mindtmfinterval = 200 139 | callwaiting = auto 140 | disable = no 141 | initstate = start 142 | exten = +00000000000 143 | dtmf = relax 144 | 145 | ;[dongle0] 146 | ;audio = /dev/ttyUSB1 147 | ;data = /dev/ttyUSB2 148 | ;imei = 000000000000000 149 | ;imsi = 000000000000000 150 | EOF 151 | fi 152 | 153 | print_notice "Starting Asterisk ${ASTERISK_VERSION} for the first time" 154 | silent ./start_asterisk start 155 | 156 | if [ ! -f "/var/run/asterisk/asterisk.pid" ]; then 157 | print_error "Can't seem to start Asterisk.. exiting" 158 | exit 1 159 | fi 160 | 161 | if var_false "$DB_EMBEDDED" ; then 162 | print_notice "Installing FreePBX $FREEPBX_VERSION source code" 163 | sed -i "s/'default' => 'localhost',/'default' => '$DB_HOST',/g" /usr/src/freepbx/installlib/installcommand.class.php 164 | sed -i "s/'default' => 'asteriskcdrdb',/'default' => '$DB_NAME',/g" /usr/src/freepbx/installlib/installcommand.class.php 165 | sed -i "s/\$amp_conf\['CDRDBNAME'\] = \$answers\['cdrdbname'\];/\$amp_conf\['CDRDBNAME'\] = '$DB_NAME';/g" /usr/src/freepbx/installlib/installcommand.class.php 166 | silent ./install -n --dbuser="$DB_USER" --dbpass="$DB_PASS" --dbname="$DB_NAME" --cdrdbname="$DB_NAME" --webroot="$WEBROOT" 167 | 168 | cat < /etc/freepbx.conf 169 | 185 | EOF 186 | else 187 | print_notice "Installing FreePBX $FREEPBX_VERSION source code (db embedded)" 188 | silent ./install -n --webroot="$WEBROOT" 189 | fi 190 | 191 | sed -i '/^preload = chan_local.so$/d' /etc/asterisk/modules.conf 192 | 193 | if [ ! -f "/usr/sbin/fwconsole" ]; then 194 | print_error "Can't seem to locate /usr/sbin/fwconsole.. exiting" 195 | exit 1 196 | fi 197 | 198 | print_notice "Enabling default modules:" 199 | print_notice "- framework, core" 200 | check_process 201 | silent fwconsole ma downloadinstall framework core 202 | silent fwconsole ma download cdr 203 | 204 | if var_false "$DB_EMBEDDED" ; then 205 | ### CDR Hack 206 | mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" -P"$DB_PORT" "$DB_NAME" < /usr/src/freepbx/installlib/SQL/cdr.sql 207 | # shellcheck disable=SC2016 208 | mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" -P"$DB_PORT" -e 'USE '"$DB_NAME"'; UPDATE freepbx_settings SET `value` = "'"$DB_HOST"'" WHERE keyword = "CDRDBHOST"; UPDATE freepbx_settings SET `value` = "'"$DB_NAME"'" WHERE keyword = "CDRDBNAME"; UPDATE freepbx_settings SET `value` = "'"$DB_PASS"'" WHERE keyword = "CDRDBPASS"; UPDATE freepbx_settings SET `value` = "'"$DB_USER"'" WHERE keyword = "CDRDBUSER"; UPDATE freepbx_settings SET `value` = "mysql" WHERE keyword = "CDRDBTYPE"; UPDATE freepbx_settings SET `value` = "'"$DB_PORT"'" WHERE keyword = "CDRDBPORT"; UPDATE freepbx_settings SET `value` = "cdr" WHERE keyword = "CDRDBTABLENAME";' 209 | cp -R "$WEBROOT"/admin/modules/cdr/install.php "$WEBROOT"/admin/modules/cdr/.install.php 210 | # shellcheck disable=SC2016 211 | sed -i 's/\$db_host = !empty(\$db_host) ? \$db_host : "localhost";/\$db_host = !empty(\$db_host) ? \$db_host : "'"$DB_HOST"'";/g' "$WEBROOT"/admin/modules/cdr/install.php 212 | # shellcheck disable=SC2016 213 | sed -i 's/\$db_name = !empty(\$db_name) ? \$db_name : "asteriskcdrdb";/\$db_name = !empty(\$db_name) ? \$db_name : "'"$DB_NAME"'";/g' "$WEBROOT"/admin/modules/cdr/install.php 214 | print_notice '** [freepbx] - cdr' 215 | check_process 216 | silent fwconsole ma install cdr 217 | cp -R "$WEBROOT"/admin/modules/cdr/.install.php "$WEBROOT"/admin/modules/cdr/install.php 218 | else 219 | print_notice "- cdr (embedded db)" 220 | check_process 221 | silent fwconsole ma install cdr 222 | fi 223 | 224 | print_notice "- backup, callrecording, conferences, dashboard, featurecodeadmin, filestore, fw_langpacks, infoservices, languages, logfiles, music, recordings, sipsettings, soundlang, voicemail" 225 | check_process 226 | silent fwconsole ma downloadinstall backup callrecording conferences dashboard featurecodeadmin filestore fw_langpacks infoservices languages logfiles music recordings sipsettings soundlang voicemail 227 | print_notice "- certman, userman, pm2" 228 | check_process 229 | silent fwconsole ma downloadinstall certman userman pm2 230 | silent fwconsole setting SHOWLANGUAGE 1 231 | silent fwconsole chown 232 | silent fwconsole reload 233 | chown -RH asterisk. /home/asterisk/.npm 234 | print_notice "- ucp" 235 | ### UCP fix https://community.freepbx.org/t/ucp-upgrade-error/58273 236 | touch /usr/bin/icu-config 237 | echo "icuinfo 2>/dev/null|grep \"version\"|sed 's/.*>\(.*\)<.*/\1/g'" > /usr/bin/icu-config 238 | chmod +x /usr/bin/icu-config 239 | check_process 240 | silent fwconsole ma downloadinstall ucp 241 | 242 | if var_true "$ENABLE_XMPP" ; then 243 | print_notice "- xmpp" 244 | silent mongod --unixSocketPrefix=/var/run/mongodb run & 245 | check_process 246 | silent fwconsole ma downloadinstall xmpp 247 | sed -i 's/uri: mongodb:\/\/localhost\/letschat/uri: mongodb:\/\/localhost:27017\/letschat?useNewUrlParser=true/g' "$WEBROOT"/admin/modules/xmpp/node/node_modules/lets-chat/settings.yml 248 | fi 249 | 250 | if [[ -v INSTALL_ADDITIONAL_MODULES ]] ; then 251 | print_notice "Attempting to install additional FreePBX modules '${INSTALL_ADDITIONAL_MODULES}'" 252 | modules=$(echo "${INSTALL_ADDITIONAL_MODULES}" | tr "," "\n") 253 | for module in $modules 254 | do 255 | print_notice "- ${module}" 256 | check_process 257 | silent fwconsole ma downloadinstall "$module" 258 | done 259 | fi 260 | silent fwconsole chown 261 | silent fwconsole reload 262 | silent fwconsole stop --immediate 263 | print_info "Finished installation of FreePBX modules - proceeding with next phase of install" 264 | cd / 265 | rm -rf /usr/src/freepbx 266 | 267 | touch /data/.installed 268 | echo "$ASTERISK_VERSION" > /etc/asterisk/.asterisk-version 269 | fi 270 | 271 | ### Data persistence workaround 272 | if [ ! -f /usr/sbin/fwconsole ]; then 273 | ln -s /var/lib/asterisk/bin/fwconsole /usr/sbin/fwconsole 274 | fi 275 | 276 | if [ ! -f /usr/sbin/amportal ]; then 277 | ln -s /var/lib/asterisk/bin/amportal /usr/sbin/amportal 278 | fi 279 | 280 | if [ ! -f /data/etc/amportal.conf ]; then 281 | mkdir -p /data/etc 282 | cp -R /etc/amportal.conf /data/etc/ 283 | rm -f /etc/amportal.conf 284 | touch /data/etc/amportal.conf 285 | chown asterisk. /data/etc/amportal.conf 286 | ln -s /data/etc/amportal.conf /etc/amportal.conf 287 | else 288 | ln -sf /data/etc/amportal.conf /etc/amportal.conf 289 | touch /data/etc/amportal.conf 290 | fi 291 | 292 | if var_true "$DB_EMBEDDED" ; then 293 | if [ ! -f /data/etc/freepbx.conf ]; then 294 | mkdir -p /data/etc 295 | cp -R /etc/freepbx.conf /data/etc/ 296 | rm -f /etc/freepbx.conf 297 | touch /data/etc/freepbx.conf 298 | chown asterisk. /data/etc/freepbx.conf 299 | ln -s /data/etc/freepbx.conf /etc/freepbx.conf 300 | else 301 | ln -sf /data/etc/freepbx.conf /etc/freepbx.conf 302 | touch /data/etc/freepbx.conf 303 | fi 304 | 305 | ### Set RTP ports and fix a FreePBX bug with upgrades 306 | print_notice "Setting RTP ports - start: '${RTP_START}' finish: '${RTP_FINISH}'" 307 | mysql -e 'USE asterisk; ALTER TABLE featurecodes CHANGE column helptext helptext VARCHAR(10000); INSERT INTO sipsettings (keyword, data, seq, type) VALUES ("rtpstart","'"$RTP_START"'",1,0) ON DUPLICATE KEY UPDATE data="'"$RTP_START"'";INSERT INTO sipsettings (keyword, data, seq, type) VALUES ("rtpend","'"$RTP_FINISH"'",1,0) ON DUPLICATE KEY UPDATE data="'"$RTP_FINISH"'";' 308 | else 309 | ### Setup dynamic configuration 310 | print_notice "Setting configuration" 311 | cat < /etc/freepbx.conf 312 | 326 | EOF 327 | cat < /etc/odbc.ini 328 | [MySQL-asteriskcdrdb] 329 | Description = MySQL connection to 'asteriskcdrdb' database 330 | driver = MySQL 331 | server = $DB_HOST 332 | User = $DB_USER 333 | Password = $DB_PASS 334 | database = $DB_NAME 335 | Port = $DB_PORT 336 | option = 3 337 | 338 | [asteriskcdrdb] 339 | Description = MySQL connection to 'asteriskcdrdb' database 340 | driver = MySQL 341 | server = $DB_HOST 342 | User = $DB_USER 343 | Password = $DB_PASS 344 | database = $DB_NAME 345 | Port = $DB_PORT 346 | option = 3 347 | EOF 348 | ### Set RTP ports and fix a FreePBX bug with upgrades 349 | print_notice "Setting RTP ports - start: '${RTP_START}' finish: '${RTP_FINISH}'" 350 | mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" -P"$DB_PORT" -e 'USE '"$DB_NAME"'; ALTER TABLE featurecodes CHANGE column helptext helptext VARCHAR(10000); INSERT INTO sipsettings (keyword, data, seq, type) VALUES ("rtpstart","'"$RTP_START"'",1,0) ON DUPLICATE KEY UPDATE data="'"$RTP_START"'";INSERT INTO sipsettings (keyword, data, seq, type) VALUES ("rtpend","'"$RTP_FINISH"'",1,0) ON DUPLICATE KEY UPDATE data="'"$RTP_FINISH"'";' 351 | fi 352 | 353 | if [ ! -f /etc/asterisk/cdr_adaptive_odbc.conf ]; then 354 | cat < /etc/asterisk/cdr_adaptive_odbc.conf 355 | [asteriskcdrdb] 356 | connection=asteriskcdrdb 357 | table=cdr 358 | alias start => calldate 359 | loguniqueid=yes 360 | EOF 361 | fi 362 | 363 | chown asterisk. /etc/freepbx.conf 364 | 365 | print_info "Starting Asterisk ${ASTERISK_VERSION}" 366 | 367 | if [ ! -f "/usr/sbin/fwconsole" ]; then 368 | print_error "Can't seem to locate /usr/sbin/fwconsole.. Exiting. This is likely because the initial installation of FreePBX failed, and usually an upstream error. Try again by deleting all volumes and databases and starting from scratch before submitting an issue." 369 | exit 1 370 | fi 371 | 372 | chown -RH asterisk. /etc/asterisk 373 | chown asterisk. /etc/amportal.conf 374 | 375 | ### Custom file support 376 | if [ -d /assets/custom ] ; then 377 | print_warn "Custom files found, copying over top of original.." 378 | cp -R /assets/custom/* / 379 | chown -R asterisk. /var/www/html 380 | chown -RH asterisk. /var/lib/asterisk 381 | chown -RH asterisk. /var/spool/asterisk 382 | fi 383 | 384 | ## Execute Custom Scripts 385 | if [ -d /assets/custom-scripts/ ] ; then 386 | print_warn "Found Custom Scripts to Execute" 387 | for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do 388 | print_warn "Running Script ${f}" 389 | ${f} 390 | done 391 | fi 392 | 393 | chown -RH asterisk. /var/spool/asterisk 394 | rm -f /tmp/cron.error 395 | 396 | check_process 397 | silent fwconsole start 398 | 399 | ### Apache setup 400 | cat >> /etc/apache2/conf-available/allowoverride.conf << EOF 401 | 402 | AllowOverride All 403 | 404 | EOF 405 | 406 | cat > /etc/apache2/sites-enabled/000-default.conf << EOF 407 | Listen 73 408 | 409 | ExtendedStatus On 410 | 411 | 412 | CustomLog /dev/null common 413 | ErrorLog /dev/null 414 | 415 | 416 | SetHandler server-status 417 | Order deny,allow 418 | Deny from all 419 | Allow from localhost 420 | 421 | 422 | 423 | 424 | EOF 425 | 426 | if var_true "$UCP_FIRST" ; then 427 | # shellcheck disable=SC2129 428 | echo ' DocumentRoot "'"$WEBROOT"'/ucp"' >> /etc/apache2/sites-enabled/000-default.conf 429 | echo ' Alias "'"$ADMIN_DIRECTORY"'" "'"$WEBROOT"'/admin"' >> /etc/apache2/sites-enabled/000-default.conf 430 | echo ' Alias "/ucp" "'"$WEBROOT"'/ucp"' >> /etc/apache2/sites-enabled/000-default.conf 431 | else 432 | echo " DocumentRoot ""$WEBROOT" >> /etc/apache2/sites-enabled/000-default.conf 433 | fi 434 | 435 | if var_true "$ENABLE_FOP" ; then 436 | echo ' Alias "'"$FOP_DIRECTORY"'" "/var/www/html/fop2"' >> /etc/apache2/sites-enabled/000-default.conf 437 | 438 | ### Check to see if FOP enabled and exists (upgrade catcher) 439 | if [ ! -f /usr/local/fop2/fop2_server ] ; then 440 | print_info "Starting installation of Flash Operator Panel 2" 441 | 442 | ### FOP2 installation 443 | mkdir -p /data/usr/local/fop2 444 | mkdir -p /var/log/apache2 445 | cd /usr/src || exit 446 | silent wget http://download.fop2.com/install_fop2.sh 447 | chmod +x install_fop2.sh 448 | silent ./install_fop2.sh 449 | chown -RH asterisk. /usr/local/fop2 450 | rm -rf /usr/src/* 451 | fi 452 | fi 453 | 454 | cat >> /etc/apache2/sites-enabled/000-default.conf << EOF 455 | 456 | ErrorLog /var/log/apache2/error.log 457 | CustomLog /var/log/apache2/access.log common 458 | 459 | SetHandler server-status 460 | Order deny,allow 461 | Deny from all 462 | 463 | 464 | EOF 465 | 466 | if [ "$VIRTUAL_PROTO" = "https" ] || var_true "$ENABLE_SSL" ; then 467 | print_notice "Enabling SSL" 468 | mkdir -p /certs 469 | 470 | if [ ! -f /certs/"${TLS_CERT}" ] && [ ! -f /certs/"${TLS_KEY}" ]; then 471 | print_warn "No SSL certs found, autogenerating self-signed - WebRTC will not work with a self-signed certificate!" 472 | cat < /tmp/openssl.cnf 473 | [ req ] 474 | default_bits = 2048 475 | encrypt_key = yes 476 | distinguished_name = req_dn 477 | x509_extensions = cert_type 478 | prompt = no 479 | 480 | [ req_dn ] 481 | C=XX 482 | ST=XX 483 | L=Self Signed 484 | O=Freepbx 485 | OU=Freepbx 486 | CN=* 487 | emailAddress=hostmaster@local 488 | 489 | [ cert_type ] 490 | nsCertType = server 491 | EOF 492 | 493 | silent openssl req -new -x509 -nodes -days 365 -config /tmp/openssl.cnf -out /certs/cert.pem -keyout /certs/key.pem 494 | chmod 0600 /certs/key.pem 495 | rm -f /tmp/openssl.cnf 496 | TLS_CERT="cert.pem" 497 | TLS_KEY="key.pem" 498 | fi 499 | 500 | silent a2enmod ssl 501 | cat >> /etc/apache2/sites-enabled/000-default.conf << EOF 502 | 503 | SSLEngine on 504 | SSLCertificateFile "/certs/$TLS_CERT" 505 | SSLCertificateKeyFile "/certs/$TLS_KEY" 506 | ErrorLog /var/log/apache2/error.log 507 | CustomLog /var/log/apache2/access.log common 508 | EOF 509 | 510 | if var_true "$UCP_FIRST" ; then 511 | # shellcheck disable=SC2129 512 | echo ' DocumentRoot "'"$WEBROOT"'/ucp"' >> /etc/apache2/sites-enabled/000-default.conf 513 | echo ' Alias "'"$ADMIN_DIRECTORY"'" "'"$WEBROOT"'/admin"' >> /etc/apache2/sites-enabled/000-default.conf 514 | echo ' Alias "/ucp" "'"$WEBROOT"'/ucp"' >> /etc/apache2/sites-enabled/000-default.conf 515 | else 516 | echo " DocumentRoot $WEBROOT" >> /etc/apache2/sites-enabled/000-default.conf 517 | fi 518 | 519 | if var_true "$ENABLE_FOP" ; then 520 | echo ' Alias "'"$FOP_DIRECTORY"'" "'"$WEBROOT"'/fop2"' >>/etc/apache2/sites-enabled/000-default.conf 521 | sed -i 's/ssl_certificate_file=.*/ssl_certificate_file=\/certs\/'$TLS_CERT'/g' /usr/local/fop2/fop2.cfg 522 | sed -i 's/ssl_certificate_key_file=.*/ssl_certificate_key_file=\/certs\/'$TLS_KEY'/g' /usr/local/fop2/fop2.cfg 523 | fi 524 | 525 | cat >> /etc/apache2/sites-enabled/000-default.conf << EOF 526 | 527 | SetHandler server-status 528 | Order deny,allow 529 | Deny from all 530 | 531 | 532 | 533 | EOF 534 | fi 535 | 536 | ### Write ports.conf 537 | cat > /etc/apache2/ports.conf < 541 | Listen $HTTPS_PORT 542 | 543 | 544 | 545 | Listen $HTTPS_PORT 546 | 547 | EOF 548 | 549 | silent a2enmod remoteip 550 | 551 | cat >> /etc/apache2/conf-available/remoteip.conf << EOF 552 | RemoteIPHeader X-Real-IP 553 | RemoteIPTrustedProxy 10.0.0.0/8 554 | RemoteIPTrustedProxy 172.16.0.0/12 555 | RemoteIPTrustedProxy 192.168.0.0/16 556 | EOF 557 | 558 | silent a2enconf allowoverride 559 | silent a2enconf remoteip.conf 560 | 561 | sed -iE 's/\(APACHE_RUN_USER=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars 562 | sed -iE 's/\(APACHE_RUN_GROUP=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars 563 | mkdir -p /var/log/apache2 564 | chown -R root:adm /var/log/apache2 565 | chown asterisk. /run/lock/apache2 566 | 567 | ### Disable indexes if outside of regular webroot 568 | if [ "$WEBROOT" != "/var/www/html" ]; then 569 | silent a2dismod autoindex -f 570 | fi 571 | 572 | sed -i 's/DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm/DirectoryIndex index.php index.html index.htm/g' /etc/apache2/mods-enabled/dir.conf 573 | 574 | ### SMTP config 575 | if var_true "$ENABLE_SMTP" ; then 576 | echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' > /etc/php/"${PHP_VERSION}"/apache2/conf.d/smtp.ini 577 | echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' > /etc/php/"${PHP_VERSION}"/cli/conf.d/smtp.ini 578 | chown asterisk. /etc/msmtprc 579 | chmod 0600 /etc/msmtprc 580 | fi 581 | 582 | ### FOP2 setup 583 | if var_true "$ENABLE_FOP" ; then 584 | print_info "Starting operator panel" 585 | chown -RH asterisk. /usr/local/fop2 586 | rm -rf /var/run/fop2.* 587 | mkdir -p /var/log/fop 588 | chown -R asterisk. /var/log/fop 589 | sed -i "s/manager_host=.*/manager_host=127.0.0.1/g" /usr/local/fop2/fop2.cfg 590 | /usr/local/fop2/fop2_server -D 591 | fi 592 | 593 | chown asterisk:asterisk /usr/sbin/watson-transcription 594 | 595 | silent service apache2 restart 596 | 597 | if var_true "$ENABLE_XMPP" ; then 598 | silent mongod --unixSocketPrefix=/var/run/mongodb --shutdown 599 | fi 600 | 601 | if var_true "$UCP_FIRST" ; then 602 | print_info "Web server started - container initialization completed - visit your http(s)://...${ADMIN_DIRECTORY} to administer" 603 | else 604 | print_info "Web server started - container initialization completed - visit your http(s)://.../ to administer" 605 | fi 606 | 607 | liftoff --------------------------------------------------------------------------------