Skip to content

Commit

Permalink
fix(freepbx_init.sh): install modules as asterisk user (#339)
Browse files Browse the repository at this point in the history
* fix(freepbx_init.sh): fix permissions at startup

- Launch fwconsole chown to let FreePBX change all permissions

* fix(freepbx_init.sh): fix permissions at startup 2

- create freepbx chown configuration file to exclude wizard

NethServer/dev#7191
  • Loading branch information
Stell0 authored Dec 16, 2024
1 parent ea1e745 commit e1a0777
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions freepbx/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ CheckInterval: 20
EOF
fi

# create freepbx chown configuration if it doesn't exist
if [[ ! -f /etc/asterisk/freepbx_chown.conf ]]; then
cat > /etc/asterisk/freepbx_chown.conf <<EOF
[blacklist]
directory = /var/www/html/freepbx/rest
directory = /var/www/html/freepbx/visualplan
directory = /var/www/html/freepbx/wizard
EOF
fi

# configure recallonbusy
sed -i 's/^Port: .*/Port: '${ASTMANAGERPORT}'/' /etc/asterisk/recallonbusy.cfg
sed -i 's/^Username: .*/Username: proxycti/' /etc/asterisk/recallonbusy.cfg
Expand Down
4 changes: 4 additions & 0 deletions freepbx/etc/asterisk/freepbx_chown.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[blacklist]
directory = /var/www/html/freepbx/rest
directory = /var/www/html/freepbx/visualplan
directory = /var/www/html/freepbx/wizard
3 changes: 3 additions & 0 deletions freepbx/freepbx_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ do
fi
done

# Fix permissions
fwconsole chown

# Disable signature check
php -r 'include_once "/etc/freepbx_db.conf"; $db->query("UPDATE freepbx_settings SET value = 0 WHERE keyword = \"SIGNATURECHECK\"");'

Expand Down

0 comments on commit e1a0777

Please sign in to comment.