fix(ha): orchestration Keepalived root, support unicast VRRP, preservation identite backup et synchro HTTPS
This commit is contained in:
1 parent
93f842a363
commit
da0805fd5f
7 files changed
+302
-82
No files matched your search
+10
-4
@@ -171,8 +171,12 @@ mkdir -p /var/lib/asterisk/sounds/custom
|
||||
mkdir -p /var/spool/asterisk/voicemail/default
|
||||
mkdir -p /var/log/asterisk /var/log/asterisk/cdr-csv
|
||||
mkdir -p /var/log/nexus-pbx
|
||||
mkdir -p /etc/keepalived
|
||||
mkdir -p /etc/keepalived/scripts
|
||||
mkdir -p "$TARGET_DIR/scripts/cluster"
|
||||
touch /var/log/nexus_cluster.log
|
||||
chmod 666 /var/log/nexus_cluster.log
|
||||
sysctl -w net.ipv4.ip_nonlocal_bind=1 >/dev/null 2>&1 || true
|
||||
echo "net.ipv4.ip_nonlocal_bind=1" > /etc/sysctl.d/99-nexus-ha.conf 2>/dev/null || true
|
||||
|
||||
touch /var/log/asterisk/messages /var/log/asterisk/security.log /var/log/asterisk/cdr-csv/Master.csv
|
||||
chown -R asterisk:asterisk /var/log/asterisk 2>/dev/null || true
|
||||
@@ -201,7 +205,7 @@ setfacl -R -d -m u:www-data:rwx,g:asterisk:rwx /etc/asterisk /var/lib/asterisk/s
|
||||
# Droits sudoers pour l'interface web (www-data)
|
||||
cat << 'EOF' > /etc/sudoers.d/nexus-pbx
|
||||
# Privilèges spécifiques NexusPBX pour l'utilisateur Web www-data
|
||||
www-data ALL=(ALL) NOPASSWD: /usr/sbin/asterisk, /usr/sbin/nginx, /usr/bin/systemctl, /usr/bin/fail2ban-client, /bin/fail2ban-client, /var/www/nexus-pbx/scripts/nexus-firewall, /usr/bin/certbot, /usr/sbin/nft, /usr/sbin/iptables, /var/www/nexus-pbx/scripts/update.sh, /usr/local/bin/nexus-update
|
||||
www-data ALL=(ALL) NOPASSWD: /usr/sbin/asterisk, /usr/sbin/nginx, /usr/bin/systemctl, /usr/bin/fail2ban-client, /bin/fail2ban-client, /var/www/nexus-pbx/scripts/nexus-firewall, /usr/bin/certbot, /usr/sbin/nft, /usr/sbin/iptables, /var/www/nexus-pbx/scripts/update.sh, /usr/local/bin/nexus-update, /var/www/nexus-pbx/scripts/nexus-cluster
|
||||
EOF
|
||||
chmod 0440 /etc/sudoers.d/nexus-pbx
|
||||
|
||||
@@ -213,7 +217,7 @@ for fpm_svc in /lib/systemd/system/php*-fpm.service /usr/lib/systemd/system/php*
|
||||
cat << 'EOF_OVERRIDE' > "/etc/systemd/system/${svc_name}.d/override.conf"
|
||||
[Service]
|
||||
ProtectSystem=false
|
||||
ReadWritePaths=/etc/asterisk /etc/fail2ban /etc/nginx /var/log /var/lib/asterisk /var/spool/asterisk /var/www /usr/local/bin /etc/sudoers.d /etc/letsencrypt /var/lib/letsencrypt
|
||||
ReadWritePaths=/etc/asterisk /etc/fail2ban /etc/nginx /var/log /var/lib/asterisk /var/spool/asterisk /var/www /usr/local/bin /etc/sudoers.d /etc/letsencrypt /var/lib/letsencrypt /etc/keepalived
|
||||
EOF_OVERRIDE
|
||||
fi
|
||||
done
|
||||
@@ -483,10 +487,12 @@ chmod 0644 /etc/cron.d/nexus-backup
|
||||
touch /var/log/nexus_backup.log && chown www-data:asterisk /var/log/nexus_backup.log && chmod 664 /var/log/nexus_backup.log
|
||||
|
||||
# CLI symlinks
|
||||
chmod +x "$TARGET_DIR/scripts/nexus-firewall" "$TARGET_DIR/scripts/nexus-banner.sh" "$TARGET_DIR/scripts/update.sh"
|
||||
chmod +x "$TARGET_DIR/scripts/nexus-firewall" "$TARGET_DIR/scripts/nexus-banner.sh" "$TARGET_DIR/scripts/update.sh" "$TARGET_DIR/scripts/nexus-cluster"
|
||||
chmod +x "$TARGET_DIR"/scripts/cluster/*.sh 2>/dev/null || true
|
||||
ln -sf "$TARGET_DIR/scripts/nexus-firewall" /usr/local/bin/nexus-firewall
|
||||
ln -sf "$TARGET_DIR/scripts/nexus-banner.sh" /usr/local/bin/nexus-banner
|
||||
ln -sf "$TARGET_DIR/scripts/update.sh" /usr/local/bin/nexus-update
|
||||
ln -sf "$TARGET_DIR/scripts/nexus-cluster" /usr/local/bin/nexus-cluster
|
||||
|
||||
# Bannière interactive lors de chaque connexion terminal (SSH / Console)
|
||||
cat << 'EOF' > /etc/profile.d/nexus-motd.sh
|
||||
|
||||
Reference in new issue
Block a user