Przeglądaj źródła

Merge branch 'testing' into 6.4

yalh76 11 miesięcy temu
rodzic
commit
d561e20cd0

+ 0 - 1
README_fr.md

@@ -20,7 +20,6 @@ Il NE doit PAS être modifié à la main.
 
 
 Un outil de surveillance pour divers composants informatiques, notamment les réseaux, les serveurs, les machines virtuelles et les services en nuage.
 Un outil de surveillance pour divers composants informatiques, notamment les réseaux, les serveurs, les machines virtuelles et les services en nuage.
 
 
-
 **Version incluse :** 6.4~ynh1
 **Version incluse :** 6.4~ynh1
 
 
 ## Captures d’écran
 ## Captures d’écran

+ 7 - 0
conf/etc_apt_preferences.d_zabbix

@@ -0,0 +1,7 @@
+Package: zabbix-*
+Pin: origin repo.zabbix.com
+Pin-Priority: 900
+
+Package: zabbix-*
+Pin: origin security.debian.org
+Pin-Priority: -1

+ 1 - 1
conf/etc_zabbix_web_init.zabbix.conf.php.sh

@@ -18,7 +18,7 @@ global \$DB;
 \$DB['PORT']     = '0';
 \$DB['PORT']     = '0';
 \$DB['DATABASE'] = '"$(yunohost app setting zabbix db_name)"';
 \$DB['DATABASE'] = '"$(yunohost app setting zabbix db_name)"';
 \$DB['USER']     = '"$(yunohost app setting zabbix db_user)"';
 \$DB['USER']     = '"$(yunohost app setting zabbix db_user)"';
-\$DB['PASSWORD'] = '"$(yunohost app setting zabbix mysqlpwd)"';
+\$DB['PASSWORD'] = '"$(yunohost app setting zabbix db_pwd)"';
 
 
 // Schema name. Used for IBM DB2 and PostgreSQL.
 // Schema name. Used for IBM DB2 and PostgreSQL.
 \$DB['SCHEMA'] = '';
 \$DB['SCHEMA'] = '';

+ 3 - 0
scripts/backup

@@ -42,6 +42,9 @@ ynh_backup --src_path="/etc/sudoers.d/zabbix"
 # Backup zabbix-cli
 # Backup zabbix-cli
 ynh_backup --src_path="/usr/share/zabbix-cli"
 ynh_backup --src_path="/usr/share/zabbix-cli"
 
 
+# Backup pinning preferences repo
+ynh_backup --src_path="/etc/apt/preferences.d/zabbix_repo"
+
 #=================================================
 #=================================================
 # BACKUP THE MYSQL DATABASE
 # BACKUP THE MYSQL DATABASE
 #=================================================
 #=================================================

+ 7 - 4
scripts/install

@@ -44,19 +44,22 @@ ynh_script_progression --message="Adding $app's configuration files..."
 
 
 ynh_add_config --template="../conf/etc_zabbix_web_zabbix.conf.php" --destination="/etc/zabbix/web/zabbix.conf.php"
 ynh_add_config --template="../conf/etc_zabbix_web_zabbix.conf.php" --destination="/etc/zabbix/web/zabbix.conf.php"
 
 
+ynh_add_config --template="../conf/etc_apt_preferences.d_zabbix" --destination="/etc/apt/preferences.d/zabbix_repo"
+
+chmod 644 "/etc/apt/preferences.d/zabbix_repo"
 chmod 400 "/etc/zabbix/web/zabbix.conf.php"
 chmod 400 "/etc/zabbix/web/zabbix.conf.php"
 chown "$app:www-data" "/etc/zabbix/web/zabbix.conf.php"
 chown "$app:www-data" "/etc/zabbix/web/zabbix.conf.php"
 
 
-ynh_replace_string --match_string="DBName=zabbix" --replace_string="DBName=$db_name" --target_file=/etc/zabbix/zabbix_server.conf
-ynh_replace_string --match_string="DBUser=zabbix" --replace_string="DBUser=$db_user" --target_file=/etc/zabbix/zabbix_server.conf
-ynh_replace_string --match_string="# DBPassword=" --replace_string="# DBPassword=\nDBPassword=$db_pwd" --target_file=/etc/zabbix/zabbix_server.conf
+ynh_replace_string --match_string="DBName=zabbix" --replace_string="DBName=$db_name" --target_file="/etc/zabbix/zabbix_server.conf"
+ynh_replace_string --match_string="DBUser=zabbix" --replace_string="DBUser=$db_user" --target_file="/etc/zabbix/zabbix_server.conf"
+ynh_replace_string --match_string="# DBPassword=" --replace_string="# DBPassword=\nDBPassword=$db_pwd" --target_file="/etc/zabbix/zabbix_server.conf"
 
 
 #=================================================
 #=================================================
 # SYSTEM CONFIGURATION
 # SYSTEM CONFIGURATION
 #=================================================
 #=================================================
 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
 
 
-ynh_replace_string --match_string="# $language.UTF-8 UTF-8" --replace_string="$language.UTF-8 UTF-8" --target_file=/etc/locale.gen
+ynh_replace_string --match_string="# ${language}\.UTF-8 UTF-8" --replace_string="${language}\.UTF-8 UTF-8" --target_file="/etc/locale.gen"
 locale-gen
 locale-gen
 
 
 # Create a PHP-FPM config (with conf/extra_php-fpm.conf being appended to it)
 # Create a PHP-FPM config (with conf/extra_php-fpm.conf being appended to it)

+ 6 - 1
scripts/remove

@@ -12,7 +12,10 @@ source /usr/share/yunohost/helpers
 #=================================================
 #=================================================
 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
 
 
-ynh_exec_warn_less yunohost user delete $zabbix_username --purge
+# need remove pinning
+if [ -f "/etc/apt/preferences.d/zabbix_repo" ]; then
+ynh_secure_remove --file="/etc/apt/preferences.d/zabbix_repo"
+fi
 
 
 # Remove the dedicated systemd config
 # Remove the dedicated systemd config
 ynh_systemd_action --service_name="$app-server" --action="stop" --log_path="/var/log/$app/${app}_server.log"
 ynh_systemd_action --service_name="$app-server" --action="stop" --log_path="/var/log/$app/${app}_server.log"
@@ -41,6 +44,8 @@ ynh_secure_remove --file="/etc/sudoers.d/$app"
 
 
 ynh_secure_remove --file="/usr/share/zabbix-cli"
 ynh_secure_remove --file="/usr/share/zabbix-cli"
 
 
+ynh_exec_warn_less yunohost user delete $zabbix_username --purge
+
 #=================================================
 #=================================================
 # END OF SCRIPT
 # END OF SCRIPT
 #=================================================
 #=================================================

+ 2 - 0
scripts/restore

@@ -66,6 +66,8 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
 
 
 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 
 
+ynh_restore_file --origin_path="/etc/apt/preferences.d/zabbix_repo"
+
 change_timeoutAgent
 change_timeoutAgent
 
 
 systemctl enable zabbix-agent --quiet
 systemctl enable zabbix-agent --quiet