1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Turn off pbx_use_apache or pbx_use_nginx + instant iptables

This commit is contained in:
root 2021-08-17 20:09:07 -04:00
parent 66489c9fbd
commit 42d4d70367
14 changed files with 169 additions and 111 deletions

View file

@ -7,6 +7,11 @@ INVENTORY="ansible_hosts"
# the other) due to Ansible. So we emulate Ansible's behavior, when reading from # the other) due to Ansible. So we emulate Ansible's behavior, when reading from
# (and later writing to) disk, removing outer cruft as explained on Lines 31-33: # (and later writing to) disk, removing outer cruft as explained on Lines 31-33:
handle1=$(grep "^openvpn_handle:" /etc/iiab/local_vars.yml | sed -e "s/^openvpn_handle://; s/^\s*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/") handle1=$(grep "^openvpn_handle:" /etc/iiab/local_vars.yml | sed -e "s/^openvpn_handle://; s/^\s*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/")
# 2021-08-17: bash scripts using default_vars.yml &/or local_vars.yml
# https://github.com/iiab/iiab/blob/master/roles/firmware/templates/iiab-check-firmware#L11
# https://github.com/iiab/iiab/blob/master/roles/network/templates/gateway/iiab-gen-iptables#L53-L54
# https://github.com/iiab/maps/blob/master/osm-source/pages/viewer/scripts/iiab-install-map-region#L25-L34
# https://github.com/iiab/iiab/blob/master/iiab-support READS AND WRITES, INCL NON-BOOLEAN (openvpn_handle)
echo -e "\n/etc/iiab/local_vars.yml source/master copy: $handle1" echo -e "\n/etc/iiab/local_vars.yml source/master copy: $handle1"
if [ -f /etc/iiab/openvpn_handle ]; then if [ -f /etc/iiab/openvpn_handle ]; then
handle2=$(cat /etc/iiab/openvpn_handle) handle2=$(cat /etc/iiab/openvpn_handle)

View file

@ -3,7 +3,12 @@
WARN=0 WARN=0
DATE=$(date +%F-%T) DATE=$(date +%F-%T)
if grep -q '^wifi_hotspot_capacity_rpi_fix: False' /etc/iiab/local_vars.yml ; then # 2021-08-17: bash scripts using default_vars.yml &/or local_vars.yml
# https://github.com/iiab/iiab/blob/master/roles/firmware/templates/iiab-check-firmware#L11
# https://github.com/iiab/iiab/blob/master/roles/network/templates/gateway/iiab-gen-iptables#L53-L54
# https://github.com/iiab/maps/blob/master/osm-source/pages/viewer/scripts/iiab-install-map-region#L25-L34
# https://github.com/iiab/iiab/blob/master/iiab-support READS AND WRITES, INCL NON-BOOLEAN (openvpn_handle)
if grep -q '^wifi_hotspot_capacity_rpi_fix:\s\+[fF]alse\b' /etc/iiab/local_vars.yml ; then
echo "'wifi_hotspot_capacity_rpi_fix: False' found in /etc/iiab/local_vars.yml" echo "'wifi_hotspot_capacity_rpi_fix: False' found in /etc/iiab/local_vars.yml"
echo "...so WiFi firmware will NOT be checked or replaced." echo "...so WiFi firmware will NOT be checked or replaced."

View file

@ -45,11 +45,18 @@ echo -e "WAN: $wan\n"
# "Good thing we replace this file; should be treated like Squid below" ? # "Good thing we replace this file; should be treated like Squid below" ?
ports_externally_visible={{ ports_externally_visible }} ports_externally_visible={{ ports_externally_visible }}
gw_block_https={{ gw_block_https }} # 2021-08-17: bash scripts using default_vars.yml &/or local_vars.yml
# https://github.com/iiab/iiab/blob/master/roles/firmware/templates/iiab-check-firmware#L11
# https://github.com/iiab/iiab/blob/master/roles/network/templates/gateway/iiab-gen-iptables#L53-L54
# https://github.com/iiab/maps/blob/master/osm-source/pages/viewer/scripts/iiab-install-map-region#L25-L34
# https://github.com/iiab/iiab/blob/master/iiab-support READS AND WRITES, INCL NON-BOOLEAN (openvpn_handle)
grep -q '^gw_block_https:\s\+[tT]rue\b' /opt/iiab/iiab/vars/default_vars.yml && gw_block_https=True || gw_block_https=False
grep -q '^gw_block_https:\s\+[tT]rue\b' /etc/iiab/local_vars.yml && gw_block_https=True
sshd_port={{ sshd_port }} sshd_port={{ sshd_port }}
#gui_wan= [no longer needed] #gui_wan= [no longer needed]
gui_port={{ gui_port }} gui_port={{ gui_port }}
block_DNS={{ block_DNS }} grep -q '^block_DNS:\s\+[tT]rue\b' /opt/iiab/iiab/vars/default_vars.yml && block_DNS=True || block_DNS=False
grep -q '^block_DNS:\s\+[tT]rue\b' /etc/iiab/local_vars.yml && block_DNS=True
azuracast_ports="{{ azuracast_port_range_prefix }}000:{{ azuracast_port_range_prefix }}100" azuracast_ports="{{ azuracast_port_range_prefix }}000:{{ azuracast_port_range_prefix }}100"
azuracast_https_port={{ azuracast_https_port }} azuracast_https_port={{ azuracast_https_port }}
@ -64,7 +71,8 @@ kolibri_http_port={{ kolibri_http_port }}
minetest_port={{ minetest_port }} minetest_port={{ minetest_port }}
mosquitto_port={{ mosquitto_port }} mosquitto_port={{ mosquitto_port }}
nodered_port={{ nodered_port }} nodered_port={{ nodered_port }}
pbx_enabled={{ pbx_enabled }} grep -q '^pbx_enabled:\s\+[tT]rue\b' /opt/iiab/iiab/vars/default_vars.yml && pbx_enabled=True || pbx_enabled=False
grep -q '^pbx_enabled:\s\+[tT]rue\b' /etc/iiab/local_vars.yml && pbx_enabled=True
pbx_http_port={{ pbx_http_port }} pbx_http_port={{ pbx_http_port }}
pbx_signaling_ports_chan_sip={{ pbx_signaling_ports_chan_sip }} pbx_signaling_ports_chan_sip={{ pbx_signaling_ports_chan_sip }}
pbx_signaling_ports_chan_pjsip={{ pbx_signaling_ports_chan_pjsip }} pbx_signaling_ports_chan_pjsip={{ pbx_signaling_ports_chan_pjsip }}

View file

@ -27,10 +27,16 @@ pbx_install: True
pbx_enabled: True pbx_enabled: True
---- ----
+ +
You have the option of using Apache on port 83 (default) or NGINX on port 80, as the web server for FreePBX. To use NGINX, include this line in your http://wiki.laptop.org/go/IIAB/FAQ#What_is_local_vars.yml_and_how_do_I_customize_it.3F[/etc/iiab/local_vars.yml] file: FreePBX can be used with either or both web servers, Apache on port 83 (as is traditional) and/or NGINX on port 80 (as is new). If you don't want Apache installed on your IIAB, set this line in your http://wiki.laptop.org/go/IIAB/FAQ#What_is_local_vars.yml_and_how_do_I_customize_it.3F[/etc/iiab/local_vars.yml] prior to installing IIAB:
+ +
---- ----
pbx_try_nginx: True pbx_use_apache: False
----
+
Or, if you want to use Apache alone with FreePBX, set this line in your /etc/iiab/local_vars.yml:
+
----
pbx_use_nginx: False
---- ----
+ +
If using PBX intensively, please adjust `/etc/php/X.Y/apache2/php.ini`, `/etc/php/X.Y/cli/php.ini` and/or `/etc/php/X.Y/nginx/php.ini` (where `X.Y` is typically 7.4) as outlined within https://github.com/iiab/iiab/blob/master/roles/www_options/tasks/main.yml#L88-L131[/opt/iiab/iiab/roles/www_options/tasks/main.yml] — some of which happens automatically if you also set: If using PBX intensively, please adjust `/etc/php/X.Y/apache2/php.ini`, `/etc/php/X.Y/cli/php.ini` and/or `/etc/php/X.Y/nginx/php.ini` (where `X.Y` is typically 7.4) as outlined within https://github.com/iiab/iiab/blob/master/roles/www_options/tasks/main.yml#L88-L131[/opt/iiab/iiab/roles/www_options/tasks/main.yml] — some of which happens automatically if you also set:
@ -240,7 +246,7 @@ _If there's a bug or serious problem with IIAB, please do https://internet-in-a-
. Apache's `/var/lib/php/asterisk_sessions/` directory might also be needed for NGINX? . Apache's `/var/lib/php/asterisk_sessions/` directory might also be needed for NGINX?
+ +
If not, the https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/freepbx.yml#L152-L164[configuration of /var/lib/php/asterisk_sessions/] might be made conditional upon `when: not pbx_try_nginx` If not, the https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/freepbx.yml#L151-L163[configuration of /var/lib/php/asterisk_sessions/] might be made conditional upon `when: not pbx_use_apache`
. The https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/freepbx.yml#L208-L211[installation of /etc/odbc.ini] for CDR (Call Detail Records) database `asteriskcdrdb` might benefit from compiling the ODBC driver for aarch64, per http://mghadam.blogspot.com/2021/03/install-asterisk-18-freepbx-15-on.html ? . The https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/freepbx.yml#L208-L211[installation of /etc/odbc.ini] for CDR (Call Detail Records) database `asteriskcdrdb` might benefit from compiling the ODBC driver for aarch64, per http://mghadam.blogspot.com/2021/03/install-asterisk-18-freepbx-15-on.html ?
+ +

View file

@ -4,11 +4,9 @@
# pbx_install: False # pbx_install: False
# pbx_enabled: False # pbx_enabled: False
pbx_use_apache: True
pbx_use_nginx: True
# pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, # pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# # AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! # pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
# asterisk_chan_dongle: False # asterisk_chan_dongle: False

View file

@ -136,13 +136,14 @@
system: yes # 2021-08-08: No evidence this is needed. Hopefully it doesn't cause harm? (FYI Ansible doesn't change pre-existing users) system: yes # 2021-08-08: No evidence this is needed. Hopefully it doesn't cause harm? (FYI Ansible doesn't change pre-existing users)
append: yes # 2021-08-08: Not essential. So Ansible adds groups w/o deleting existing group memberships. append: yes # 2021-08-08: Not essential. So Ansible adds groups w/o deleting existing group memberships.
- name: Asterisk - Add user 'www-data' to group 'asterisk' - if pbx_try_nginx # 2021-08-17: Moved to enable-or-disable.yml
user: # - name: Asterisk - Add user 'www-data' to group 'asterisk' - if pbx_use_nginx
name: www-data # user:
groups: asterisk # name: www-data
# system: yes # 2021-08-06: Ansible doesn't change pre-existing users # groups: asterisk
append: yes # # system: yes # 2021-08-06: Ansible doesn't change pre-existing users
when: pbx_try_nginx # append: yes
# when: pbx_use_nginx
- name: Asterisk - Set ownership for 6 directories (asterisk:asterisk, recurse) - name: Asterisk - Set ownership for 6 directories (asterisk:asterisk, recurse)
file: file:

View file

@ -1,86 +1,120 @@
- name: Enable & (Re)start 'freepbx' systemd service, if pbx_enabled - name: JUST 1 SETTING TO TURN ON/OFF FOR APACHE - whereas NGINX below has 4...
meta: noop
- name: EITHER - Create symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to enable Apache's http://box:{{ pbx_http_port }}/freepbx - if pbx_use_apache and pbx_enabled # http://box:83/freepbx
command: a2ensite freepbx.conf
when: pbx_use_apache and pbx_enabled
- name: OR ELSE - Delete symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to disable Apache's http://box:{{ pbx_http_port }}/freepbx - if not (pbx_use_apache and pbx_enabled)
file: # As 'a2dissite freepbx.conf' might not be installed
path: /etc/{{ apache_service }}/sites-enabled/freepbx.conf # apache2
state: absent
when: not (pbx_use_apache and pbx_enabled)
- name: "ENACT ABOVE SETTING FOR APACHE - 'pbx_use_apache: False' might arise later, so best ALWAYS run..."
meta: noop
- name: EITHER - Restart & Enable '{{ apache_service }}' systemd service - if pbx_use_apache and pbx_enabled
systemd: systemd:
daemon_reload: yes daemon_reload: yes
name: "{{ apache_service }}" # apache2
state: restarted
enabled: yes
when: pbx_use_apache and pbx_enabled
ignore_errors: yes # In case Apache not installed
- name: OR ELSE - Stop & Disable '{{ apache_service }}' systemd service - if not (pbx_use_apache and pbx_enabled)
systemd:
daemon_reload: yes
name: "{{ apache_service }}"
state: stopped
enabled: no
when: not (pbx_use_apache and pbx_enabled)
ignore_errors: yes # In case Apache not installed
- name: Open-or-Close Asterix ports (including Apache port {{ pbx_http_port }}) in iptables firewall, depending on pbx_enabled [{{ pbx_enabled }}] in local_vars.yml - in support of './runrole pbx'
command: /usr/bin/iiab-gen-iptables
ignore_errors: yes # iptables installed in 2-common, but iiab-gen-tables may not be set up until roles/network runs later
- name: EITHER - TURN ON 4 SETTINGS FOR NGINX - if pbx_use_nginx and pbx_enabled
meta: noop
- block:
- name: "Add user 'www-data' to group 'asterisk' BEFORE restarting Asterisk (via FreePBX, below) -- Ansible doesn't support removing a single non-primary group, so if you later change to 'pbx_use_nginx: False' please manually edit /etc/group to revert this"
user:
name: www-data
groups: asterisk
append: yes
- name: Run 'fwconsole set CHECKREFERER 0' (0 means false) so 'Submit' button definitively works with NGINX at http://box/freepbx >> Settings >> Advanced Settings -- FYI you can run 'fwconsole set -l' or 'fwconsole set CHECKREFERER' to view FreePBX settings -- FYI /etc/freepbx.conf can completely override FreePBX's stored settings if nec
command: fwconsole set CHECKREFERER 0 # Or/later try to run 'fwconsole set CHECKREFERER 1' (1 means true) to restore FreePBX's default strict checking!
- name: Install /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf converted from www.conf for user 'asterisk'
copy:
src: roles/pbx/templates/asterisk.conf
dest: /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf
- name: Enable http://box/freepbx via NGINX, by installing {{ nginx_conf_dir }}/freepbx-nginx.conf from template
template:
src: freepbx-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/freepbx-nginx.conf" # /etc/nginx/conf.d
when: pbx_use_nginx and pbx_enabled
- name: OR ELSE - TURN OFF 3 SETTINGS FOR NGINX (1st of 4 above settings too hard!) - if not (pbx_use_nginx and pbx_enabled)
meta: noop
- block:
- name: Restore FreePBX default by running 'fwconsole set CHECKREFERER 1' (1 means true) as works with Apache -- FYI you can run 'fwconsole set -l' or 'fwconsole set CHECKREFERER' to view FreePBX settings -- FYI /etc/freepbx.conf can completely override FreePBX's stored settings if nec
command: fwconsole set CHECKREFERER 1
- name: Remove /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf
file:
path: /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf
state: absent
- name: Disable http://box/freepbx via NGINX, by removing {{ nginx_conf_dir }}/freepbx-nginx.conf
file:
path: "{{ nginx_conf_dir }}/freepbx-nginx.conf"
state: absent
when: not (pbx_use_nginx and pbx_enabled)
- name: "ENACT ABOVE 3-4 SETTINGS FOR NGINX - 'pbx_use_nginx: False' might arise later, so best ALWAYS run these 2..."
meta: noop
- name: Enable & Restart 'php{{ php_version }}-fpm' systemd service
systemd:
name: php{{ php_version }}-fpm
state: restarted
enabled: yes
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
- name: WRAP UP - Asterisk VIA FreePBX systemd service...
meta: noop
- name: EITHER - Enable & (Re)start 'freepbx' systemd service, if pbx_enabled
systemd:
name: freepbx name: freepbx
enabled: yes enabled: yes
state: restarted state: restarted
when: pbx_enabled when: pbx_enabled
- name: Disable & Stop 'freepbx' systemd service, if not pbx_enabled - name: OR ELSE - Disable & Stop 'freepbx' systemd service, if not pbx_enabled
systemd: systemd:
daemon_reload: yes
name: freepbx name: freepbx
enabled: no enabled: no
state: stopped state: stopped
when: not pbx_enabled when: not pbx_enabled
- block:
- name: Enable http://box:{{ pbx_http_port }}/freepbx via Apache, if pbx_enabled # http://box:83/freepbx
command: a2ensite freepbx.conf
when: pbx_enabled
- name: Disable http://box:{{ pbx_http_port }}/freepbx via Apache, if not pbx_enabled
command: a2dissite freepbx.conf
when: not pbx_enabled
- name: Restart & Enable '{{ apache_service }}' systemd service, if pbx_enabled
systemd:
name: "{{ apache_service }}" # apache2
state: restarted
enabled: yes
when: pbx_enabled
- name: Stop & Disable '{{ apache_service }}' systemd service, if not pbx_enabled
systemd:
name: "{{ apache_service }}"
state: stopped
enabled: no
when: not pbx_enabled
when: pbx_use_apache
- block:
- name: Install /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf converted from www.conf for user 'asterisk', if pbx_enabled
copy:
src: roles/pbx/templates/asterisk.conf
dest: /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf
when: pbx_enabled
- name: Remove /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf, if not pbx_enabled
file:
path: /etc/php/{{ php_version }}/fpm/pool.d/asterisk.conf
state: absent
when: not pbx_enabled
- name: Enable & Restart 'php{{ php_version }}-fpm' systemd service
systemd:
name: php{{ php_version }}-fpm
state: restarted
enabled: yes
- name: Enable http://box/freepbx via NGINX, by installing {{ nginx_conf_dir }}/freepbx-nginx.conf from template, if pbx_enabled
template:
src: freepbx-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/freepbx-nginx.conf" # /etc/nginx/conf.d
when: pbx_enabled
- name: Disable http://box/freepbx via NGINX, by removing {{ nginx_conf_dir }}/freepbx-nginx.conf, if not pbx_enabled
file:
path: "{{ nginx_conf_dir }}/freepbx-nginx.conf"
state: absent
when: not pbx_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
when: pbx_use_nginx
- name: FreePBX - Run 'fwconsole set CHECKREFERER 0' (0 means false) - if pbx_try_nginx - so 'Submit' button definitively works at http://box/freepbx >> Settings >> Advanced Settings -- FYI you can run 'fwconsole set -l' or 'fwconsole set CHECKREFERER' to view FreePBX settings -- FYI /etc/freepbx.conf can completely override FreePBX's stored settings if nec
command: fwconsole set CHECKREFERER 0 # Or/later run 'fwconsole set CHECKREFERER 1' (1 means true) to restore FreePBX's default strict checking.
when: pbx_use_nginx and not pbx_use_apache

View file

@ -62,7 +62,7 @@
# state: present # state: present
# when: php_version is version('8.0', '<') # when: php_version is version('8.0', '<')
- name: FreePBX - Install and configure Apache - if not pbx_try_nginx - name: FreePBX - Install and configure Apache - if pbx_use_apache
include_tasks: apache.yml include_tasks: apache.yml
when: pbx_use_apache when: pbx_use_apache
@ -148,7 +148,7 @@
state: present state: present
# 2021-08-16: DOES NGINX NEED THE NEXT 2 STANZAS? (If not, should 'when: not pbx_try_nginx' be added?) # 2021-08-16: DOES NGINX NEED THE NEXT 2 STANZAS? (If not, should 'when: pbx_use_apache' be added?)
- name: FreePBX - Create new php sessions dir /var/lib/php/asterisk_sessions/ - SEE 'php_value session.save_path /var/lib/php/asterisk_sessions/' IN pbx/templates/freepbx.conf.j2 - name: FreePBX - Create new php sessions dir /var/lib/php/asterisk_sessions/ - SEE 'php_value session.save_path /var/lib/php/asterisk_sessions/' IN pbx/templates/freepbx.conf.j2
file: file:
@ -252,12 +252,12 @@
- name: FreePBX - Run 'fwconsole ma upgradeall' on installed FreePBX modules, e.g. 16 default modules (of about 70 total) - CAN TAKE 1 MIN OR LONGER! - name: FreePBX - Run 'fwconsole ma upgradeall' on installed FreePBX modules, e.g. 16 default modules (of about 70 total) - CAN TAKE 1 MIN OR LONGER!
command: fwconsole ma upgradeall command: fwconsole ma upgradeall
# - name: FreePBX - Add "$amp_conf['CHECKREFERER'] = false;" to /etc/freepbx.conf #2931 - if pbx_try_nginx" # - name: FreePBX - Add "$amp_conf['CHECKREFERER'] = false;" to /etc/freepbx.conf #2931 - if pbx_use_nginx"
# lineinfile: # lineinfile:
# path: /etc/freepbx.conf # path: /etc/freepbx.conf
# insertbefore: '^\?>$' # Match exact line '?>' -- BOTTOM OF FILE NEC! # insertbefore: '^\?>$' # Match exact line '?>' -- BOTTOM OF FILE NEC!
# line: "$amp_conf['CHECKREFERER'] = false;" # line: "$amp_conf['CHECKREFERER'] = false;"
# when: pbx_try_nginx # when: pbx_use_nginx
# - name: 'FreePBX - fix file permissions for NGINX: /etc/freepbx.conf (0644), /var/log/asterisk/freepbx.log (0666)' # - name: 'FreePBX - fix file permissions for NGINX: /etc/freepbx.conf (0644), /var/log/asterisk/freepbx.log (0666)'
# file: # file:
@ -267,7 +267,7 @@
# with_items: # with_items:
# - { path: '/etc/freepbx.conf', mode: u=rw,g=r,o=r } # 2021-08-04: LATER ENDS UP AS 0660 # - { path: '/etc/freepbx.conf', mode: u=rw,g=r,o=r } # 2021-08-04: LATER ENDS UP AS 0660
# - { path: '/var/log/asterisk/freepbx.log', mode: u=rw,g=rw,o=rw } # 2021-08-04: LATER ENDS UP AS 0664 # - { path: '/var/log/asterisk/freepbx.log', mode: u=rw,g=rw,o=rw } # 2021-08-04: LATER ENDS UP AS 0664
# when: pbx_try_nginx # when: pbx_use_nginx
# - name: 'FreePBX - fix dir permissions for NGINX: /var/spool/asterisk/cache (0777)' # - name: 'FreePBX - fix dir permissions for NGINX: /var/spool/asterisk/cache (0777)'
# file: # file:
@ -278,9 +278,9 @@
# with_items: # with_items:
# # - /var/www/html/freepbx/admin/assets/less/cache # # - /var/www/html/freepbx/admin/assets/less/cache
# - /var/spool/asterisk/cache # - /var/spool/asterisk/cache
# when: pbx_try_nginx # when: pbx_use_nginx
# For 'pbx_try_nginx: True' -- FreePBX's initial page (Admin user registration) # For 'pbx_use_nginx: True' -- FreePBX's initial page (Admin user registration)
# tries to set up a cron job but fails: # tries to set up a cron job but fails:
# "Exception: Trying to edit user asterisk, when I'm running as www-data" # "Exception: Trying to edit user asterisk, when I'm running as www-data"
# 2021-08-10: Hacking /etc/freepbx.conf WAS NOT TESTED PROPERLY -- some vars MAY # 2021-08-10: Hacking /etc/freepbx.conf WAS NOT TESTED PROPERLY -- some vars MAY
@ -291,4 +291,4 @@
# #insertafter: '^<\?php$' # Match exact line '<?php' -- BUT TOP OF FILE FAILS :( # #insertafter: '^<\?php$' # Match exact line '<?php' -- BUT TOP OF FILE FAILS :(
# insertbefore: '^\?>$' # Match exact line '?>' -- BOTTOM OF FILE NECESSARY :) # insertbefore: '^\?>$' # Match exact line '?>' -- BOTTOM OF FILE NECESSARY :)
# line: "$amp_conf['AMPASTERISKWEBUSER'] = 'www-data';" # line: "$amp_conf['AMPASTERISKWEBUSER'] = 'www-data';"
# when: pbx_try_nginx # when: pbx_use_nginx

View file

@ -23,12 +23,13 @@
include_tasks: install.yml include_tasks: install.yml
when: pbx_installed is undefined when: pbx_installed is undefined
- name: Install chan_dongle for Huawei USB modems - if asterisk_chan_dongle - name: Install & Enable chan_dongle for Huawei USB modems - if asterisk_chan_dongle
include: chan_dongle.yml include: chan_dongle.yml
when: asterisk_chan_dongle when: asterisk_chan_dongle
- include_tasks: enable-or-disable.yml - include_tasks: enable-or-disable.yml
- name: Add 'pbx' variable values to {{ iiab_ini_file }} - name: Add 'pbx' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini

View file

@ -629,8 +629,8 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above. # If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False pbx_install: False
pbx_enabled: False pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
asterisk_chan_dongle: False asterisk_chan_dongle: False
pbx_signaling_ports_chan_sip: 5160:5161 pbx_signaling_ports_chan_sip: 5160:5161
pbx_signaling_ports_chan_pjsip: 5060 pbx_signaling_ports_chan_pjsip: 5060

View file

@ -378,6 +378,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above. # If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False pbx_install: False
pbx_enabled: False pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
asterisk_chan_dongle: False asterisk_chan_dongle: False

View file

@ -378,6 +378,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above. # If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False pbx_install: False
pbx_enabled: False pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
asterisk_chan_dongle: False asterisk_chan_dongle: False

View file

@ -378,6 +378,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above. # If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False pbx_install: False
pbx_enabled: False pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
asterisk_chan_dongle: False asterisk_chan_dongle: False

View file

@ -378,6 +378,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above. # If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False pbx_install: False
pbx_enabled: False pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE, pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX ! pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
asterisk_chan_dongle: False asterisk_chan_dongle: False