Explorar o código

Merge pull request #84 from YunoHost-Apps/testing

Pinning
yalh76 hai 11 meses
pai
achega
2ee2da0e3e

+ 1 - 1
README.md

@@ -20,7 +20,7 @@ It shall NOT be edited by hand.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Shipped version:** 6.0~ynh1
+**Shipped version:** 6.0~ynh2
 
 
 ## Screenshots
 ## Screenshots
 
 

+ 1 - 1
README_es.md

@@ -20,7 +20,7 @@ No se debe editar a mano.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Versión actual:** 6.0~ynh1
+**Versión actual:** 6.0~ynh2
 
 
 ## Capturas
 ## Capturas
 
 

+ 1 - 1
README_eu.md

@@ -20,7 +20,7 @@ EZ editatu eskuz.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Paketatutako bertsioa:** 6.0~ynh1
+**Paketatutako bertsioa:** 6.0~ynh2
 
 
 ## Pantaila-argazkiak
 ## Pantaila-argazkiak
 
 

+ 1 - 1
README_fr.md

@@ -21,7 +21,7 @@ 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.0~ynh1
+**Version incluse :** 6.0~ynh2
 
 
 ## Captures d’écran
 ## Captures d’écran
 
 

+ 1 - 1
README_gl.md

@@ -20,7 +20,7 @@ NON debe editarse manualmente.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Versión proporcionada:** 6.0~ynh1
+**Versión proporcionada:** 6.0~ynh2
 
 
 ## Capturas de pantalla
 ## Capturas de pantalla
 
 

+ 1 - 1
README_id.md

@@ -20,7 +20,7 @@ Ini TIDAK boleh diedit dengan tangan.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Versi terkirim:** 6.0~ynh1
+**Versi terkirim:** 6.0~ynh2
 
 
 ## Tangkapan Layar
 ## Tangkapan Layar
 
 

+ 1 - 1
README_nl.md

@@ -20,7 +20,7 @@ Hij mag NIET handmatig aangepast worden.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Geleverde versie:** 6.0~ynh1
+**Geleverde versie:** 6.0~ynh2
 
 
 ## Schermafdrukken
 ## Schermafdrukken
 
 

+ 1 - 1
README_pl.md

@@ -20,7 +20,7 @@ Nie powinno być ono edytowane ręcznie.
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Dostarczona wersja:** 6.0~ynh1
+**Dostarczona wersja:** 6.0~ynh2
 
 
 ## Zrzuty ekranu
 ## Zrzuty ekranu
 
 

+ 1 - 1
README_ru.md

@@ -20,7 +20,7 @@
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**Поставляемая версия:** 6.0~ynh1
+**Поставляемая версия:** 6.0~ynh2
 
 
 ## Снимки экрана
 ## Снимки экрана
 
 

+ 1 - 1
README_zh_Hans.md

@@ -20,7 +20,7 @@
 
 
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.
 
 
-**分发版本:** 6.0~ynh1
+**分发版本:** 6.0~ynh2
 
 
 ## 截图
 ## 截图
 
 

+ 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'] = '';

+ 1 - 1
manifest.toml

@@ -7,7 +7,7 @@ name = "Zabbix"
 description.en = "Monitoring tool for diverse IT components, including networks, servers, VMs and cloud services"
 description.en = "Monitoring tool for diverse IT components, including networks, servers, VMs and cloud services"
 description.fr = "Outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne"
 description.fr = "Outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne"
 
 
-version = "6.0~ynh1"
+version = "6.0~ynh2"
 
 
 maintainers = []
 maintainers = []
 
 

+ 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