From bb810c35ad8f2c38eb0719f7720ad7b1d989fc3b Mon Sep 17 00:00:00 2001 From: JimboJoe Date: Mon, 4 May 2020 21:58:29 +0200 Subject: [PATCH] Buster support and misc package updates (fixes #43) (#44) (#45) --- CHANGELOG.md | 23 +++++++++++++++++++++++ README.md | 3 +-- check_process | 12 +----------- manifest.json | 4 ++-- scripts/_common.sh | 21 ++++++++------------- scripts/backup | 7 +------ scripts/install | 9 +++++---- scripts/remove | 5 ----- scripts/restore | 7 +------ scripts/upgrade | 8 +++++--- 10 files changed, 47 insertions(+), 52 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b4da394 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +Changelog +========= + +## Unreleased +- Nothing for now... + +## [1.21.1~ynh2](https://github.com/YunoHost-Apps/netdata_ynh/pull/TBD) - 2020-04-27 + +#### Added +* [Add changelog]() + +#### Fixed +- [fix buster support]() + +#### Changed +* [Remove now official helpers]() +* [Use new permission system]() + +## [1.21.1~ynh1](https://github.com/YunoHost-Apps/netdata_ynh/pull/41) - 2020-04-15 + +#### Changed +* [Update to 1.21.1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/41) + diff --git a/README.md b/README.md index 2763ec0..09005ef 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ NetData for YunoHost --------------------- +[![Integration level](https://dash.yunohost.org/integration/netdata.svg)](https://ci-apps.yunohost.org/jenkins/job/netdata%20%28Community%29/lastBuild/consoleFull) ![](https://ci-apps.yunohost.org/ci/badges/netdata.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/netdata.maintain.svg) [![Install NetData with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=netdata) -[![Integration level](https://dash.yunohost.org/integration/netdata.svg)](https://ci-apps.yunohost.org/jenkins/job/netdata%20%28Community%29/lastBuild/consoleFull) - [NetData](http://my-netdata.io/) is a system for **distributed real-time performance and health monitoring**. It provides **unparalleled insights, in real-time**, of everything happening on the diff --git a/check_process b/check_process index 29d86be..5245d0d 100644 --- a/check_process +++ b/check_process @@ -19,18 +19,8 @@ wrong_path=1 change_url=1 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - Level 4=na -# https://github.com/YunoHost-Apps/netdata_ynh/issues/3 - Level 5=1 + Level 5=auto # https://github.com/YunoHost-Apps/netdata_ynh/issues/4 - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Options Email= Notification=none diff --git a/manifest.json b/manifest.json index 9267d04..facde28 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "real-time performance and health monitoring", "fr": "Monitoring serveur en temps reel" }, - "version": "1.21.1~ynh1", + "version": "1.21.1~ynh2", "url": "http://my-netdata.io/", "license": "GPL-3.0", "maintainer": { @@ -15,7 +15,7 @@ "url": "" }, "requirements": { - "yunohost": ">= 2.7.2" + "yunohost": ">= 3.7.0" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index e4bb685..6fc2136 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -35,7 +35,14 @@ touch /opt/netdata/etc/netdata/.opt-out-from-anonymous-statistics if type "setfacl" > /dev/null ; then # Give dovecot privileges to netdata user to monitor Dovecot # Need dovecot 2.2.16+ - setfacl -m u:netdata:rw /var/run/dovecot/stats + if [ -f /var/run/dovecot/stats ] ; then + # Until Debian Strech + setfacl -m u:netdata:rw /var/run/dovecot/stats + fi + if [ -f /var/run/dovecot/old-stats ] ; then + # From Debian Buster + setfacl -m u:netdata:rw /var/run/dovecot/old-stats + fi fi # Add netdata to the adm group to access web logs @@ -88,15 +95,3 @@ EOF fi chgrp netdata $postgres_file } - -# ============= FUTURE YUNOHOST HELPER ============= -# Delete a file checksum from the app settings -# -# $app should be defined when calling this helper -# -# usage: ynh_remove_file_checksum file -# | arg: file - The file for which the checksum will be deleted -ynh_delete_file_checksum () { - local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' - ynh_app_setting_delete $app $checksum_setting_name -} diff --git a/scripts/backup b/scripts/backup index 503a5b3..4674860 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,12 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get the _common.sh file if it's not in the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi -source _common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index 7be2ea3..9003a7e 100644 --- a/scripts/install +++ b/scripts/install @@ -109,14 +109,15 @@ cp ../conf/app.src /opt/netdata/etc/netdata # SETUP SSOWAT #================================================= -# If app is public, add url to SSOWat conf as skipped_uris +# Make app public if necessary if [ $is_public -eq 1 ]; then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set "$app" unprotected_uris "/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi # Add direct access in the portal to admin only -yunohost app addaccess --users=$admin $app +ynh_permission_update --permission "main" --add "$admin" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index 833a995..48648e9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -6,11 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get file fonction if not been to the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi # Source app helpers source _common.sh source /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index 2424b61..4b6ec37 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,12 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get the _common.sh file if it's not in the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi -source _common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bf18c94..bfcd2e2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,10 +115,12 @@ cp ../conf/app.src /opt/netdata/etc/netdata #================================================= # SETUP SSOWAT #================================================= -# If app is public, add url to SSOWat conf as skipped_uris + +# Make app public if necessary if [[ $is_public -eq 1 ]]; then - # See install script - ynh_app_setting_set "$app" unprotected_uris "/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #=================================================