From 3633e2d0efc537164661343f9cdd3019dd328d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:31:32 +0100 Subject: [PATCH 01/20] v2 --- conf/app.src | 6 ---- conf/uninstaller.src | 7 ----- manifest.toml | 67 ++++++++++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 24 ++++++++-------- scripts/backup | 14 ++++----- scripts/change_url | 62 ++++++++++++++++++++-------------------- scripts/install | 50 ++++++++++++++++----------------- scripts/remove | 14 ++++----- scripts/restore | 26 ++++++++--------- scripts/upgrade | 54 +++++++++++++++++------------------ 10 files changed, 190 insertions(+), 134 deletions(-) delete mode 100644 conf/app.src delete mode 100644 conf/uninstaller.src create mode 100644 manifest.toml diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 33c1264..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/netdata/netdata/releases/download/v1.44.1/netdata-v1.44.1.tar.gz -SOURCE_SUM=77e94acf7085c23ab20b2d0d2d4d2bc5a289f121fc7aac5d0daffb960041fd95 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/uninstaller.src b/conf/uninstaller.src deleted file mode 100644 index 5617ba0..0000000 --- a/conf/uninstaller.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://raw.githubusercontent.com/netdata/netdata/v1.15.0/packaging/installer/netdata-uninstaller.sh -SOURCE_SUM=a4727069b47138cea5c466bc902934545841c88dc5f641728ef0feb921efd218 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=sh -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=netdata-uninstaller.sh -SOURCE_EXTRACT=false diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..fd9e733 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,67 @@ +packaging_format = 2 + +id = "netdata" +name = "NetData" +description.en = "Real-time performance and health monitoring" +description.fr = "Monitoring serveur en temps reel" + +version = "1.44.1~ynh1" + +maintainers = ["JimboJoe"] + +[upstream] +license = "GPL-3.0" +website = "http://my-netdata.io" +demo = "https://learn.netdata.cloud/docs/agent/demo-sites/" +admindoc = "https://learn.netdata.cloud/docs" +code = "https://github.com/netdata/netdata" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.2" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/netdata" + + [install.init_main_permission] + type = "group" + default = false + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + +[resources] + [resources.sources] + [resources.sources.main] + url = "https://github.com/netdata/netdata/releases/download/v1.44.1/netdata-v1.44.1.tar.gz" + sha256 = "77e94acf7085c23ab20b2d0d2d4d2bc5a289f121fc7aac5d0daffb960041fd95" + + [resources.sources.uninstaller] + url = "https://raw.githubusercontent.com/netdata/netdata/v1.15.0/packaging/installer/netdata-uninstaller.sh" + sha256 = "a4727069b47138cea5c466bc902934545841c88dc5f641728ef0feb921efd218" + format = "sh" + rename = "netdata-uninstaller.sh" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index d5fee85..6b373b7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs python3-mysqldb libipmimonitoring-dev acl python3-pymongo libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake" +#REMOVEME? pkg_dependencies="zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs python3-mysqldb libipmimonitoring-dev acl python3-pymongo libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake" #================================================= # PERSONAL HELPERS @@ -17,12 +17,12 @@ configure_netdata() { # Set server as registry serveur sed -i "/^\[registry\]$/,/^\[/ { s/# enabled = no/enabled = yes/ - s@# registry to announce = https://registry.my-netdata.io@registry to announce = https://$domain$path_url@ - }" $final_path/etc/netdata/netdata.conf + s@# registry to announce = https://registry.my-netdata.io@registry to announce = https://$domain$path@ + }" $install_dir/etc/netdata/netdata.conf # Opt-out from sending anonymous statistics # (see https://docs.netdata.cloud/docs/anonymous-statistics/#opt-out) - touch $final_path/etc/netdata/.opt-out-from-anonymous-statistics + touch $install_dir/etc/netdata/.opt-out-from-anonymous-statistics # Add a web_log entry for every YunoHost domain netdata_add_yunohost_web_logs @@ -57,9 +57,9 @@ configure_netdata() { # Add a web_log entry for every YunoHost domain netdata_add_yunohost_web_logs () { - local web_log_file="$final_path/etc/netdata/go.d/web_log.conf" + local web_log_file="$install_dir/etc/netdata/go.d/web_log.conf" if [ ! -f $web_log_file ] ; then - cp $final_path/etc/netdata/orig/go.d/web_log.conf $web_log_file + cp $install_dir/etc/netdata/orig/go.d/web_log.conf $web_log_file fi if [ -z "$(grep "YUNOHOST" $web_log_file)" ] ; then echo "# ------------YUNOHOST DOMAINS---------------" >> $web_log_file @@ -77,16 +77,16 @@ EOF fi chgrp netdata $web_log_file # Manage upgrade case from python to go plugin - if [ -f "$final_path/etc/netdata/python.d/web_log.conf" ] ; then - ynh_secure_remove --file="$final_path/etc/netdata/python.d/web_log.conf" + if [ -f "$install_dir/etc/netdata/python.d/web_log.conf" ] ; then +#REMOVEME? ynh_secure_remove --file="$install_dir/etc/netdata/python.d/web_log.conf" fi } # If PostgreSQL is installed, add a PostgreSQL entry using instance password netdata_add_yunohost_postgres_configuration () { - local postgres_file="$final_path/etc/netdata/go.d/postgres.conf" + local postgres_file="$install_dir/etc/netdata/go.d/postgres.conf" if [ ! -f $postgres_file ] ; then - cp $final_path/etc/netdata/orig/go.d/postgres.conf $postgres_file + cp $install_dir/etc/netdata/orig/go.d/postgres.conf $postgres_file fi if [ -f /etc/yunohost/psql ] && [ -z "$(grep "YUNOHOST" $postgres_file)" ] ; then cat >> $postgres_file <${tmp} # Execute the uninstall script - ./${UNINSTALL_SCRIPT} --yes --force --env $final_path/etc/netdata/.environment >&3 2>&3 + ./${UNINSTALL_SCRIPT} --yes --force --env $install_dir/etc/netdata/.environment >&3 2>&3 # close fd 3 exec 3<&- diff --git a/scripts/restore b/scripts/restore index 5b4de05..219b217 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,27 +14,27 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 #================================================= # STANDARD RESTORATION STEPS @@ -43,17 +43,17 @@ ynh_script_progression --message="Validating restoration parameters..." --weight #================================================= ynh_script_progression --message="Restoring Netdata configuration directory..." --weight=1 -ynh_restore_file --origin_path="$final_path/etc/netdata" +ynh_restore_file --origin_path="$install_dir/etc/netdata" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=7 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE NGINX CONFIGURATION @@ -91,14 +91,14 @@ configure_netdata #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$final_path/var/log/netdata/error.log" "$final_path/var/log/netdata/access.log" "$final_path/var/log/netdata/debug.log" +yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/var/log/$app/error.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/var/log/$app/error.log" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 9af2636..bfe3c02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,14 +12,14 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK VERSION @@ -30,16 +30,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -48,22 +48,22 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/opt/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/opt/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi -# If final_path wrongly refers to /var/www +# If install_dir wrongly refers to /var/www # see http://tldp.org/LDP/abs/html/comparison-ops.html for syntax reference -if [[ $final_path == /var/www* ]]; then - final_path=/opt/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +if [[ $install_dir == /var/www* ]]; then +#REMOVEME? install_dir=/opt/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -121,9 +121,9 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=7 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=7 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # GENERIC FINALIZATION @@ -132,21 +132,21 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$final_path/var/log/netdata/error.log" "$final_path/var/log/netdata/access.log" "$final_path/var/log/netdata/debug.log" +yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="restart" --log_path="$final_path/var/log/$app/error.log" +ynh_systemd_action --service_name=$app --action="restart" --log_path="$install_dir/var/log/$app/error.log" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 81c86f0bbd91c6661404bacf90d5341d2aac3ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:40:22 +0100 Subject: [PATCH 02/20] v2 --- check_process | 24 ---------- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/DESCRIPTION.md | 2 +- manifest.json | 55 --------------------- manifest.toml | 28 ++++++----- scripts/_common.sh | 3 -- scripts/backup | 20 -------- scripts/change_url | 85 --------------------------------- scripts/install | 75 ----------------------------- scripts/remove | 23 --------- scripts/restore | 43 ----------------- scripts/upgrade | 67 -------------------------- tests.toml | 7 +++ 13 files changed, 23 insertions(+), 409 deletions(-) delete mode 100644 check_process rename doc/{DISCLAIMER.md => ADMIN.md} (100%) delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 091de06..0000000 --- a/check_process +++ /dev/null @@ -1,24 +0,0 @@ -;; Complete test - auto_remove=1 - ; Manifest - domain="domain.tld" - path="/path" - admin="john" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=0 - wrong_user=0 - wrong_path=1 - change_url=1 -# https://github.com/YunoHost-Apps/netdata_ynh/issues/4 -;;; Options -Email= -Notification=none diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index dd0daf6..877e689 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,4 +1,4 @@ -[NetData](http://my-netdata.io/) is a system for **distributed real-time performance and health monitoring**. +NetData is a system for **distributed real-time performance and health monitoring**. It provides **unparalleled insights, in real-time**, of everything happening on the system it runs (including applications such as web and database servers), using **modern interactive web dashboards**. diff --git a/manifest.json b/manifest.json deleted file mode 100644 index a343fa8..0000000 --- a/manifest.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "NetData", - "id": "netdata", - "packaging_format": 1, - "description": { - "en": "Real-time performance and health monitoring", - "fr": "Monitoring serveur en temps reel" - }, - "version": "1.44.1~ynh1", - "url": "http://my-netdata.io/", - "upstream": { - "license": "GPL-3.0", - "website": "http://my-netdata.io", - "demo": "https://learn.netdata.cloud/docs/agent/demo-sites/", - "admindoc": "https://learn.netdata.cloud/docs", - "code": "https://github.com/netdata/netdata", - "cpe": "cpe:2.3:a:netdata:netdata" - }, - "license": "GPL-3.0", - "maintainer": { - "name": "JimboJoe", - "email": "jimmy@monin.net", - "url": "" - }, - "requirements": { - "yunohost": ">= 11.2" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/netdata", - "default": "/netdata" - }, - { - "name": "is_public", - "type": "boolean", - "default": false - }, - { - "name": "admin", - "type": "user" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index fd9e733..1b5567b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,26 +15,25 @@ website = "http://my-netdata.io" demo = "https://learn.netdata.cloud/docs/agent/demo-sites/" admindoc = "https://learn.netdata.cloud/docs" code = "https://github.com/netdata/netdata" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.2" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +ldap = false + +sso = false + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/netdata" @@ -43,25 +42,28 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = false [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [resources] + [resources.sources] [resources.sources.main] url = "https://github.com/netdata/netdata/releases/download/v1.44.1/netdata-v1.44.1.tar.gz" sha256 = "77e94acf7085c23ab20b2d0d2d4d2bc5a289f121fc7aac5d0daffb960041fd95" + autoupdate.strategy = "latest_github_tag" [resources.sources.uninstaller] url = "https://raw.githubusercontent.com/netdata/netdata/v1.15.0/packaging/installer/netdata-uninstaller.sh" sha256 = "a4727069b47138cea5c466bc902934545841c88dc5f641728ef0feb921efd218" - format = "sh" + format = "whatever" rename = "netdata-uninstaller.sh" - [resources.system_user] [resources.install_dir] [resources.permissions] main.url = "/" + + [resources.apt] + packages = "zlib1g-dev, uuid-dev, libmnl-dev, gcc, make, git, autoconf, autoconf-archive, autogen, automake, pkg-config, curl, jq, nodejs, python3-mysqldb, libipmimonitoring-dev, acl, python3-pymongo, libuv1-dev, liblz4-dev, libjudy-dev, libssl-dev, cmake" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6b373b7..450c27c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs python3-mysqldb libipmimonitoring-dev acl python3-pymongo libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index d9accaf..d00af66 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index 702b44c..340c1c8 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,58 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -77,35 +25,9 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... -#================================================= # Change registry link ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/opt/netdata/etc/netdata/netdata.conf" @@ -119,13 +41,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="restart" --log_path="$install_dir/var/log/$app/error.log" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index ab556ff..0a2e974 100644 --- a/scripts/install +++ b/scripts/install @@ -9,63 +9,11 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? admin=$YNH_APP_ARG_ADMIN - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/opt/$app - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin - -#================================================= -# STANDARD MODIFICATIONS -#================================================= - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=32 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=11 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src NETDATA_TMPDIR=$(mktemp -d) ynh_setup_source --dest_dir="$NETDATA_TMPDIR" @@ -118,29 +66,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name=$app --action="restart" --log_path="$install_dir/var/log/$app/error.log" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -# Add direct access in the portal to admin only -#REMOVEME? ynh_permission_update --permission="main" --remove="all_users" --add="$admin" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index e45683c..25701bc 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,16 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -32,22 +22,9 @@ then yunohost service remove $app fi -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=8 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - #================================================= # UNINSTALLING NETDATA #================================================= diff --git a/scripts/restore b/scripts/restore index 219b217..a49ea07 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,32 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -45,16 +19,6 @@ ynh_script_progression --message="Restoring Netdata configuration directory..." ynh_restore_file --origin_path="$install_dir/etc/netdata" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -100,13 +64,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/var/log/$app/error.log" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bfe3c02..a09c169 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,65 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/opt/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - -# If install_dir wrongly refers to /var/www -# see http://tldp.org/LDP/abs/html/comparison-ops.html for syntax reference -if [[ $install_dir == /var/www* ]]; then -#REMOVEME? install_dir=/opt/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -118,13 +65,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=7 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # GENERIC FINALIZATION #================================================= @@ -141,13 +81,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="restart" --log_path="$install_dir/var/log/$app/error.log" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From 3527d719ac80b44cf67f5ae152cf90b83b3c29a8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 28 Dec 2023 08:40:26 +0000 Subject: [PATCH 03/20] Auto-update README --- README.md | 181 +-------------------------------------------------- README_fr.md | 181 +-------------------------------------------------- 2 files changed, 2 insertions(+), 360 deletions(-) diff --git a/README.md b/README.md index 79b6af0..4b239b3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -[NetData](http://my-netdata.io/) is a system for **distributed real-time performance and health monitoring**. +NetData is a system for **distributed real-time performance and health monitoring**. It provides **unparalleled insights, in real-time**, of everything happening on the system it runs (including applications such as web and database servers), using **modern interactive web dashboards**. @@ -29,185 +29,6 @@ disrupting their core function._ **Shipped version:** 1.44.1~ynh1 **Demo:** https://learn.netdata.cloud/docs/agent/demo-sites/ -## Disclaimers / important information - -**Customization brought by the package:** - -* Netdata Cloud functionality disabled -* grant MySQL statistics access via a `netdata` user -* nginx root log statistics via putting `netdata` user in the `adm` group -* Dovecot statistics via giving access to Dovecot stats stocket to `netdata` user (works only with Dovecot 2.2.16+) - -**Further recommendations:** -We don't allow YunoHost packages to make changes to sensitive system files. So here are further customizations you can make to allow more monitoring: - -* Nginx: - * requests/connections: follow [these recommandations](https://github.com/netdata/netdata/tree/master/collectors/python.d.plugin/nginx) to enable `/stab_status`; for example by creating the file `/etc/nginx/conf.d/default.d/netdat_stub.conf` with the following content: -``` -# For Netdata -location /stub_status { - stub_status on; - # Security: Only allow access from the IP below. - allow 127.0.0.1; - # Deny anyone else - deny all; - } -``` -* weblogs: you can monitor all your nginx weblogs for errors; follow [these recommendations](https://github.com/firehol/netdata/tree/master/python.d#nginx_log) -* phpfpm: follow [these recommandations](https://github.com/firehol/netdata/tree/master/python.d#phpfpm) -* NetData registry: set the instance as its own NetData registry server to avoid leaking any information by default - -It has been tested on x86_64 and ARM. - -## How it works - -Netdata is a highly efficient, highly modular, metrics management engine. Its lockless design makes it ideal for -concurrent operations on the metrics. - -![image](https://user-images.githubusercontent.com/2662304/48323827-b4c17580-e636-11e8-842c-0ee72fcb4115.png) - -This is how it works: - -| Function | Description | Documentation | -| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- | -| **Collect** | Multiple independent data collection workers are collecting metrics from their sources using the optimal protocol for each application and push the metrics to the database. Each data collection worker has lockless write access to the metrics it collects. | [`collectors`](/collectors/README.md) | -| **Store** | Metrics are first stored in RAM in a custom database engine that then "spills" historical metrics to disk for efficient long-term metrics storage. | [`database`](/database/README.md) | -| **Check** | A lockless independent watchdog is evaluating **health checks** on the collected metrics, triggers alarms, maintains a health transaction log and dispatches alarm notifications. | [`health`](/health/README.md) | -| **Stream** | A lockless independent worker is streaming metrics, in full detail and in real-time, to remote Netdata servers, as soon as they are collected. | [`streaming`](/streaming/README.md) | -| **Archive** | A lockless independent worker is down-sampling the metrics and pushes them to **backend** time-series databases. | [`backends`](/backends/README.md) | -| **Query** | Multiple independent workers are attached to the [internal web server](/web/server/README.md), servicing API requests, including [data queries](/web/api/queries/README.md). | [`web/api`](/web/api/README.md) | - -The result is a highly efficient, low-latency system, supporting multiple readers and one writer on each metric. - -## Infographic - -This is a high level overview of Netdata feature set and architecture. Click it to to interact with it (it has direct -links to our documentation). - -[![image](https://user-images.githubusercontent.com/43294513/60951037-8ba5d180-a2f8-11e9-906e-e27356f168bc.png)](https://my-netdata.io/infographic.html) - -## Features - -![finger-video](https://user-images.githubusercontent.com/2662304/48346998-96cf3180-e685-11e8-9f4e-059d23aa3aa5.gif) - -This is what you should expect from Netdata: - -### General - -- **1s granularity** - The highest possible resolution for all metrics. -- **Unlimited metrics** - Netdata collects all the available metrics—the more, the better. -- **1% CPU utilization of a single core** - It's unbelievably optimized. -- **A few MB of RAM** - The highly-efficient database engine stores per-second metrics in RAM and then "spills" - historical metrics to disk long-term storage. -- **Minimal disk I/O** - While running, Netdata only writes historical metrics and reads `error` and `access` logs. -- **Zero configuration** - Netdata auto-detects everything, and can collect up to 10,000 metrics per server out of the - box. -- **Zero maintenance** - You just run it. Netdata does the rest. -- **Zero dependencies** - Netdata runs a custom web server for its static web files and its web API (though its - plugins may require additional libraries, depending on the applications monitored). -- **Scales to infinity** - You can install it on all your servers, containers, VMs, and IoT devices. Metrics are not - centralized by default, so there is no limit. -- **Several operating modes** - Autonomous host monitoring (the default), headless data collector, forwarding proxy, - store and forward proxy, central multi-host monitoring, in all possible configurations. Each node may have different - metrics retention policies and run with or without health monitoring. - -### Health Monitoring & Alarms - -- **Sophisticated alerting** - Netdata comes with hundreds of alarms **out of the box**! It supports dynamic - thresholds, hysteresis, alarm templates, multiple role-based notification methods, and more. -- **Notifications**: [alerta.io](/health/notifications/alerta/), [amazon sns](/health/notifications/awssns/), - [discordapp.com](/health/notifications/discord/), [email](/health/notifications/email/), - [flock.com](/health/notifications/flock/), [hangouts](/health/notifications/hangouts/), - [irc](/health/notifications/irc/), [kavenegar.com](/health/notifications/kavenegar/), - [messagebird.com](/health/notifications/messagebird/), [pagerduty.com](/health/notifications/pagerduty/), - [prowl](health/notifications/prowl/), [pushbullet.com](/health/notifications/pushbullet/), - [pushover.net](health/notifications/pushover/), [rocket.chat](/health/notifications/rocketchat/), - [slack.com](/health/notifications/slack/), [smstools3](/health/notifications/smstools3/), - [syslog](/health/notifications/syslog/), [telegram.org](/health/notifications/telegram/), - [twilio.com](/health/notifications/twilio/), [web](/health/notifications/web/) and [custom - notifications](/health/notifications/custom/). - -### Integrations - -- **Time-series databases** - Netdata can archive its metrics to **Graphite**, **OpenTSDB**, **Prometheus**, **AWS - Kinesis**, **MongoDB**, **JSON document DBs**, in the same or lower resolution (lower: to prevent it from congesting - these servers due to the amount of data collected). Netdata also supports **Prometheus remote write API**, which - allows storing metrics to **Elasticsearch**, **Gnocchi**, **InfluxDB**, **Kafka**, **PostgreSQL/TimescaleDB**, - **Splunk**, **VictoriaMetrics** and a lot of other [storage - providers](https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage). - -## Visualization - -- **Stunning interactive dashboards** - Our dashboard is mouse-, touchpad-, and touch-screen friendly in 2 themes: - `slate` (dark) and `white`. -- **Amazingly fast visualization** - Even on low-end hardware, the dashboard responds to all queries in less than 1 ms - per metric. -- **Visual anomaly detection** - Our UI/UX emphasizes the relationships between charts so you can better detect - anomalies visually. -- **Embeddable** - Charts can be embedded on your web pages, wikis and blogs. You can even use [Atlassian's Confluence - as a monitoring dashboard](/web/gui/confluence/README.md). -- **Customizable** - You can build custom dashboards using simple HTML. No JavaScript needed! - -### Positive and negative values - -To improve clarity on charts, Netdata dashboards present **positive** values for metrics representing `read`, `input`, -`inbound`, `received` and **negative** values for metrics representing `write`, `output`, `outbound`, `sent`. - -![positive-and-negative-values](https://user-images.githubusercontent.com/2662304/48309090-7c5c6180-e57a-11e8-8e03-3a7538c14223.gif) - -_Netdata charts showing the bandwidth and packets of a network interface. `received` is positive and `sent` is -negative._ - -### Autoscaled y-axis - -Netdata charts automatically zoom vertically, to visualize the variation of each metric within the visible time-frame. - -![non-zero-based](https://user-images.githubusercontent.com/2662304/48309139-3d2f1000-e57c-11e8-9a44-b91758134b00.gif) - -_A zero-based `stacked` chart, automatically switches to an auto-scaled `area` chart when a single dimension is -selected._ - -### Charts are synchronized - -Charts on Netdata dashboards are synchronized to each other. There is no master chart. Any chart can be panned or zoomed -at any time, and all other charts will follow. - -![charts-are-synchronized](https://user-images.githubusercontent.com/2662304/48309003-b4fb3b80-e578-11e8-86f6-f505c7059c15.gif) - -_Charts are panned by dragging them with the mouse. Charts can be zoomed in/out with`SHIFT` + `mouse wheel` while the -mouse pointer is over a chart._ - -> The visible time-frame (pan and zoom) is propagated from Netdata server to Netdata server when navigating via the -> [My nodes menu](/registry/README.md). - -### Highlighted time-frame - -To improve visual anomaly detection across charts, the user can highlight a time-frame (by pressing `Alt` + `mouse -selection`) on all charts. - -![highlighted-timeframe](https://user-images.githubusercontent.com/2662304/48311876-f9093300-e5ae-11e8-9c74-e3e291741990.gif) - -_A highlighted time-frame can be given by pressing `Alt` + `mouse selection` on any chart. Netdata will highlight the -same range on all charts._ - -> Highlighted ranges are propagated from Netdata server to Netdata server, when navigating via the [My nodes -> menu](/registry/README.md). - -## What Netdata monitors - -Netdata can collect metrics from 200+ popular services and applications, on top of dozens of system-related metrics -jocs, such as CPU, memory, disks, filesystems, networking, and more. We call these **collectors**, and they're managed -by [**plugins**](/collectors/plugins.d/README.md), which support a variety of programming languages, including Go and -Python. - -Popular collectors include **Nginx**, **Apache**, **MySQL**, **statsd**, **cgroups** (containers, Docker, Kubernetes, -LXC, and more), **Traefik**, **web server `access.log` files**, and much more. - -See the **full list of [supported collectors](/collectors/COLLECTORS.md)**. - -Netdata's data collection is **extensible**, which means you can monitor anything you can get a metric for. You can even -write a collector for your custom application using our [plugin API](/collectors/plugins.d/README.md). - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 2f1d497..fb28a0c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -[NetData](http://my-netdata.io/) is a system for **distributed real-time performance and health monitoring**. +NetData is a system for **distributed real-time performance and health monitoring**. It provides **unparalleled insights, in real-time**, of everything happening on the system it runs (including applications such as web and database servers), using **modern interactive web dashboards**. @@ -29,185 +29,6 @@ disrupting their core function._ **Version incluse :** 1.44.1~ynh1 **Démo :** https://learn.netdata.cloud/docs/agent/demo-sites/ -## Avertissements / informations importantes - -**Customization brought by the package:** - -* Netdata Cloud functionality disabled -* grant MySQL statistics access via a `netdata` user -* nginx root log statistics via putting `netdata` user in the `adm` group -* Dovecot statistics via giving access to Dovecot stats stocket to `netdata` user (works only with Dovecot 2.2.16+) - -**Further recommendations:** -We don't allow YunoHost packages to make changes to sensitive system files. So here are further customizations you can make to allow more monitoring: - -* Nginx: - * requests/connections: follow [these recommandations](https://github.com/netdata/netdata/tree/master/collectors/python.d.plugin/nginx) to enable `/stab_status`; for example by creating the file `/etc/nginx/conf.d/default.d/netdat_stub.conf` with the following content: -``` -# For Netdata -location /stub_status { - stub_status on; - # Security: Only allow access from the IP below. - allow 127.0.0.1; - # Deny anyone else - deny all; - } -``` -* weblogs: you can monitor all your nginx weblogs for errors; follow [these recommendations](https://github.com/firehol/netdata/tree/master/python.d#nginx_log) -* phpfpm: follow [these recommandations](https://github.com/firehol/netdata/tree/master/python.d#phpfpm) -* NetData registry: set the instance as its own NetData registry server to avoid leaking any information by default - -It has been tested on x86_64 and ARM. - -## How it works - -Netdata is a highly efficient, highly modular, metrics management engine. Its lockless design makes it ideal for -concurrent operations on the metrics. - -![image](https://user-images.githubusercontent.com/2662304/48323827-b4c17580-e636-11e8-842c-0ee72fcb4115.png) - -This is how it works: - -| Function | Description | Documentation | -| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- | -| **Collect** | Multiple independent data collection workers are collecting metrics from their sources using the optimal protocol for each application and push the metrics to the database. Each data collection worker has lockless write access to the metrics it collects. | [`collectors`](/collectors/README.md) | -| **Store** | Metrics are first stored in RAM in a custom database engine that then "spills" historical metrics to disk for efficient long-term metrics storage. | [`database`](/database/README.md) | -| **Check** | A lockless independent watchdog is evaluating **health checks** on the collected metrics, triggers alarms, maintains a health transaction log and dispatches alarm notifications. | [`health`](/health/README.md) | -| **Stream** | A lockless independent worker is streaming metrics, in full detail and in real-time, to remote Netdata servers, as soon as they are collected. | [`streaming`](/streaming/README.md) | -| **Archive** | A lockless independent worker is down-sampling the metrics and pushes them to **backend** time-series databases. | [`backends`](/backends/README.md) | -| **Query** | Multiple independent workers are attached to the [internal web server](/web/server/README.md), servicing API requests, including [data queries](/web/api/queries/README.md). | [`web/api`](/web/api/README.md) | - -The result is a highly efficient, low-latency system, supporting multiple readers and one writer on each metric. - -## Infographic - -This is a high level overview of Netdata feature set and architecture. Click it to to interact with it (it has direct -links to our documentation). - -[![image](https://user-images.githubusercontent.com/43294513/60951037-8ba5d180-a2f8-11e9-906e-e27356f168bc.png)](https://my-netdata.io/infographic.html) - -## Features - -![finger-video](https://user-images.githubusercontent.com/2662304/48346998-96cf3180-e685-11e8-9f4e-059d23aa3aa5.gif) - -This is what you should expect from Netdata: - -### General - -- **1s granularity** - The highest possible resolution for all metrics. -- **Unlimited metrics** - Netdata collects all the available metrics—the more, the better. -- **1% CPU utilization of a single core** - It's unbelievably optimized. -- **A few MB of RAM** - The highly-efficient database engine stores per-second metrics in RAM and then "spills" - historical metrics to disk long-term storage. -- **Minimal disk I/O** - While running, Netdata only writes historical metrics and reads `error` and `access` logs. -- **Zero configuration** - Netdata auto-detects everything, and can collect up to 10,000 metrics per server out of the - box. -- **Zero maintenance** - You just run it. Netdata does the rest. -- **Zero dependencies** - Netdata runs a custom web server for its static web files and its web API (though its - plugins may require additional libraries, depending on the applications monitored). -- **Scales to infinity** - You can install it on all your servers, containers, VMs, and IoT devices. Metrics are not - centralized by default, so there is no limit. -- **Several operating modes** - Autonomous host monitoring (the default), headless data collector, forwarding proxy, - store and forward proxy, central multi-host monitoring, in all possible configurations. Each node may have different - metrics retention policies and run with or without health monitoring. - -### Health Monitoring & Alarms - -- **Sophisticated alerting** - Netdata comes with hundreds of alarms **out of the box**! It supports dynamic - thresholds, hysteresis, alarm templates, multiple role-based notification methods, and more. -- **Notifications**: [alerta.io](/health/notifications/alerta/), [amazon sns](/health/notifications/awssns/), - [discordapp.com](/health/notifications/discord/), [email](/health/notifications/email/), - [flock.com](/health/notifications/flock/), [hangouts](/health/notifications/hangouts/), - [irc](/health/notifications/irc/), [kavenegar.com](/health/notifications/kavenegar/), - [messagebird.com](/health/notifications/messagebird/), [pagerduty.com](/health/notifications/pagerduty/), - [prowl](health/notifications/prowl/), [pushbullet.com](/health/notifications/pushbullet/), - [pushover.net](health/notifications/pushover/), [rocket.chat](/health/notifications/rocketchat/), - [slack.com](/health/notifications/slack/), [smstools3](/health/notifications/smstools3/), - [syslog](/health/notifications/syslog/), [telegram.org](/health/notifications/telegram/), - [twilio.com](/health/notifications/twilio/), [web](/health/notifications/web/) and [custom - notifications](/health/notifications/custom/). - -### Integrations - -- **Time-series databases** - Netdata can archive its metrics to **Graphite**, **OpenTSDB**, **Prometheus**, **AWS - Kinesis**, **MongoDB**, **JSON document DBs**, in the same or lower resolution (lower: to prevent it from congesting - these servers due to the amount of data collected). Netdata also supports **Prometheus remote write API**, which - allows storing metrics to **Elasticsearch**, **Gnocchi**, **InfluxDB**, **Kafka**, **PostgreSQL/TimescaleDB**, - **Splunk**, **VictoriaMetrics** and a lot of other [storage - providers](https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage). - -## Visualization - -- **Stunning interactive dashboards** - Our dashboard is mouse-, touchpad-, and touch-screen friendly in 2 themes: - `slate` (dark) and `white`. -- **Amazingly fast visualization** - Even on low-end hardware, the dashboard responds to all queries in less than 1 ms - per metric. -- **Visual anomaly detection** - Our UI/UX emphasizes the relationships between charts so you can better detect - anomalies visually. -- **Embeddable** - Charts can be embedded on your web pages, wikis and blogs. You can even use [Atlassian's Confluence - as a monitoring dashboard](/web/gui/confluence/README.md). -- **Customizable** - You can build custom dashboards using simple HTML. No JavaScript needed! - -### Positive and negative values - -To improve clarity on charts, Netdata dashboards present **positive** values for metrics representing `read`, `input`, -`inbound`, `received` and **negative** values for metrics representing `write`, `output`, `outbound`, `sent`. - -![positive-and-negative-values](https://user-images.githubusercontent.com/2662304/48309090-7c5c6180-e57a-11e8-8e03-3a7538c14223.gif) - -_Netdata charts showing the bandwidth and packets of a network interface. `received` is positive and `sent` is -negative._ - -### Autoscaled y-axis - -Netdata charts automatically zoom vertically, to visualize the variation of each metric within the visible time-frame. - -![non-zero-based](https://user-images.githubusercontent.com/2662304/48309139-3d2f1000-e57c-11e8-9a44-b91758134b00.gif) - -_A zero-based `stacked` chart, automatically switches to an auto-scaled `area` chart when a single dimension is -selected._ - -### Charts are synchronized - -Charts on Netdata dashboards are synchronized to each other. There is no master chart. Any chart can be panned or zoomed -at any time, and all other charts will follow. - -![charts-are-synchronized](https://user-images.githubusercontent.com/2662304/48309003-b4fb3b80-e578-11e8-86f6-f505c7059c15.gif) - -_Charts are panned by dragging them with the mouse. Charts can be zoomed in/out with`SHIFT` + `mouse wheel` while the -mouse pointer is over a chart._ - -> The visible time-frame (pan and zoom) is propagated from Netdata server to Netdata server when navigating via the -> [My nodes menu](/registry/README.md). - -### Highlighted time-frame - -To improve visual anomaly detection across charts, the user can highlight a time-frame (by pressing `Alt` + `mouse -selection`) on all charts. - -![highlighted-timeframe](https://user-images.githubusercontent.com/2662304/48311876-f9093300-e5ae-11e8-9c74-e3e291741990.gif) - -_A highlighted time-frame can be given by pressing `Alt` + `mouse selection` on any chart. Netdata will highlight the -same range on all charts._ - -> Highlighted ranges are propagated from Netdata server to Netdata server, when navigating via the [My nodes -> menu](/registry/README.md). - -## What Netdata monitors - -Netdata can collect metrics from 200+ popular services and applications, on top of dozens of system-related metrics -jocs, such as CPU, memory, disks, filesystems, networking, and more. We call these **collectors**, and they're managed -by [**plugins**](/collectors/plugins.d/README.md), which support a variety of programming languages, including Go and -Python. - -Popular collectors include **Nginx**, **Apache**, **MySQL**, **statsd**, **cgroups** (containers, Docker, Kubernetes, -LXC, and more), **Traefik**, **web server `access.log` files**, and much more. - -See the **full list of [supported collectors](/collectors/COLLECTORS.md)**. - -Netdata's data collection is **extensible**, which means you can monitor anything you can get a metric for. You can even -write a collector for your custom application using our [plugin API](/collectors/plugins.d/README.md). - ## Documentations et ressources * Site officiel de l’app : From c6f32af568596ec1768c50ff0000a4b537ab389d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:41:14 +0100 Subject: [PATCH 04/20] cleaning --- .github/workflows/updater.sh | 106 ---------------------------------- .github/workflows/updater.yml | 50 ---------------- 2 files changed, 156 deletions(-) delete mode 100644 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100644 index aff3037..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets="https://github.com/netdata/netdata/releases/download/$version/netdata-$version.tar.gz" - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Let's download source tarball -asset_url=$assets - -echo "Handling asset at $asset_url" - -src="app" - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi - -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -EOT -echo "... conf/$src.src updated" - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index 08ec1b3..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - draft: false - From df6b735fa10b4e1a38b0cff07e555a27a510ad0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:41:53 +0100 Subject: [PATCH 05/20] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 1b5567b..145a9a7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - + dir = [resources.permissions] main.url = "/" From 0190fc9c02f3c5eeecd1fc417fd3250db8db6541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:42:37 +0100 Subject: [PATCH 06/20] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 145a9a7..b8b0922 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - dir = + dir = "/opt/__APP__" [resources.permissions] main.url = "/" From 4372d54246a43e37c8e43765493bd478383a4dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:13:17 +0100 Subject: [PATCH 07/20] Update _common.sh --- scripts/_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 450c27c..0e25271 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -75,7 +75,7 @@ EOF chgrp netdata $web_log_file # Manage upgrade case from python to go plugin if [ -f "$install_dir/etc/netdata/python.d/web_log.conf" ] ; then -#REMOVEME? ynh_secure_remove --file="$install_dir/etc/netdata/python.d/web_log.conf" + ynh_secure_remove --file="$install_dir/etc/netdata/python.d/web_log.conf" fi } @@ -95,6 +95,6 @@ EOF chgrp netdata $postgres_file # Manage upgrade case from python to go plugin if [ -f "$install_dir/etc/netdata/python.d/postgres.conf" ] ; then -#REMOVEME? ynh_secure_remove --file="$install_dir/etc/netdata/python.d/postgres.conf" + ynh_secure_remove --file="$install_dir/etc/netdata/python.d/postgres.conf" fi } From 7a3d426eb175319542c557deee5211ebf9e88a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:25:05 +0100 Subject: [PATCH 08/20] Update manifest.toml --- manifest.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index b8b0922..6a02fa2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,10 +58,9 @@ ram.runtime = "50M" format = "whatever" rename = "netdata-uninstaller.sh" - [resources.system_user] - [resources.install_dir] dir = "/opt/__APP__" + [resources.permissions] main.url = "/" From 1eec4f2e0776ef28e05ccf12497aeaca172306f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:31:16 +0100 Subject: [PATCH 09/20] Update manifest.toml --- manifest.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifest.toml b/manifest.toml index 6a02fa2..e6204ab 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,6 +58,8 @@ ram.runtime = "50M" format = "whatever" rename = "netdata-uninstaller.sh" + [resources.system_user] + [resources.install_dir] dir = "/opt/__APP__" From c46f0df04505f870b685dd0b8a06dce9c353c285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:33:22 +0100 Subject: [PATCH 10/20] cleaning --- scripts/install | 15 ++++----------- scripts/upgrade | 9 +-------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index 0a2e974..2ac5f56 100644 --- a/scripts/install +++ b/scripts/install @@ -21,17 +21,19 @@ ynh_setup_source --dest_dir="$NETDATA_TMPDIR" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" + #================================================= # SPECIFIC SETUP #================================================= # EXECUTE NETDATA INSTALLER #================================================= -ynh_script_progression --message="Executing Netdata installer..." --weight=30 +ynh_script_progression --message="Executing Netdata installer..." --weight=10 # create a temporary file for the log tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) @@ -49,15 +51,6 @@ exec 3<&- # Specific configuration configure_netdata -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a09c169..39a8dac 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,18 +60,11 @@ configure_netdata #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= From 7570394fa6ba7e02a30b4066c015cac2c25d9159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:35:16 +0100 Subject: [PATCH 11/20] cleaning --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 2ac5f56..f692241 100644 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ ynh_script_progression --message="Adding system configurations related to $app.. # Create a dedicated NGINX config ynh_add_nginx_config -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" +yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= # SPECIFIC SETUP diff --git a/scripts/restore b/scripts/restore index a49ea07..0107139 100644 --- a/scripts/restore +++ b/scripts/restore @@ -55,7 +55,7 @@ configure_netdata #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" +yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 39a8dac..2f68212 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,7 +65,7 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config ynh_add_nginx_config -yunohost service add $app --description "Real-time performance and health monitoring for systems and applications" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" +yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" #================================================= # START SYSTEMD SERVICE From 8e74925341a68a01822e5c6dd401f127e4c66d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:42:08 +0100 Subject: [PATCH 12/20] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e6204ab..8ee05d7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,7 +26,7 @@ ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "1500M" ram.runtime = "50M" [install] From 53438bf0163b0ce7f4eb3851c01f8cf931d56d64 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 28 Dec 2023 18:41:40 +0000 Subject: [PATCH 13/20] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19bed6b..4b239b3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ _netdata is **fast** and **efficient**, designed to permanently run on all syste disrupting their core function._ -**Shipped version:** 1.44.1~ynh2 +**Shipped version:** 1.44.1~ynh1 **Demo:** https://learn.netdata.cloud/docs/agent/demo-sites/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 981cb84..fb28a0c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ _netdata is **fast** and **efficient**, designed to permanently run on all syste disrupting their core function._ -**Version incluse :** 1.44.1~ynh2 +**Version incluse :** 1.44.1~ynh1 **Démo :** https://learn.netdata.cloud/docs/agent/demo-sites/ ## Documentations et ressources From 470c5c61fc98a3b4d26b66391b2964d539a872d9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 20:17:47 +0100 Subject: [PATCH 14/20] Update install: simplify unecessary file descriptor magic... --- scripts/install | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index f692241..f53a148 100644 --- a/scripts/install +++ b/scripts/install @@ -36,18 +36,13 @@ yunohost service add $app --description "Real-time performance and health monito ynh_script_progression --message="Executing Netdata installer..." --weight=10 # create a temporary file for the log -tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) -# open fd 3 and send it to tmp -exec 3>${tmp} +tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) # Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR - ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" + ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" popd -# close fd 3 -exec 3<&- - # Specific configuration configure_netdata From e3fd4e5447581935f928ba68e3b441e889733df2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 20:18:42 +0100 Subject: [PATCH 15/20] Update remove: simplify unecessary file descriptor magic... --- scripts/remove | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/remove b/scripts/remove index 25701bc..c0fd58f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -39,16 +39,11 @@ chmod +x $tmpdir/$UNINSTALL_SCRIPT # Move outside the directory (which will be removed) pushd $tmpdir - # create a temporary file for the log - tmp=$(mktemp /tmp/netdata-uninstaller-log-XXXXXX.log) - # open fd 3 and send it to tmp - exec 3>${tmp} + # create a temporary file for the log + tmplog=$(mktemp /tmp/netdata-uninstaller-log-XXXXXX.log) - # Execute the uninstall script - ./${UNINSTALL_SCRIPT} --yes --force --env $install_dir/etc/netdata/.environment >&3 2>&3 - - # close fd 3 - exec 3<&- + # Execute the uninstall script + ./${UNINSTALL_SCRIPT} --yes --force --env $install_dir/etc/netdata/.environment >$tmplog 2>$tmplog popd # Remove MySQL netdata user From d4485f13128cc2c816a9bcf0cb3c58f8293c3859 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 20:19:38 +0100 Subject: [PATCH 16/20] Update upgrade: simplify unecessary file descriptor magic... --- scripts/upgrade | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2f68212..7166d6a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,17 +41,12 @@ then [ ! -z "${pids}" ] && kill -USR1 ${pids} # create a temporary file for the log - tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) - # open fd 3 and send it to tmp - exec 3>${tmp} + tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) # Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR - ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" + ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" popd - - # close fd 3 - exec 3<&- fi # Specific configuration From 0d9de5c6a6d1fe7634c3c8997d6414afc616645a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 20:43:38 +0100 Subject: [PATCH 17/20] Update remove script: don't use the official script which is essentially blowing hot air (and removes the system user which then makes yunohost unhappy) --- manifest.toml | 6 ------ scripts/remove | 35 ++++++++++++++++++----------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8ee05d7..2370d06 100644 --- a/manifest.toml +++ b/manifest.toml @@ -52,12 +52,6 @@ ram.runtime = "50M" sha256 = "77e94acf7085c23ab20b2d0d2d4d2bc5a289f121fc7aac5d0daffb960041fd95" autoupdate.strategy = "latest_github_tag" - [resources.sources.uninstaller] - url = "https://raw.githubusercontent.com/netdata/netdata/v1.15.0/packaging/installer/netdata-uninstaller.sh" - sha256 = "a4727069b47138cea5c466bc902934545841c88dc5f641728ef0feb921efd218" - format = "whatever" - rename = "netdata-uninstaller.sh" - [resources.system_user] [resources.install_dir] diff --git a/scripts/remove b/scripts/remove index c0fd58f..7f18d7c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,24 +30,25 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Uninstalling Netdata..." --weight=6 -# Prepare to execute uninstaller(generated by NetData install script) -UNINSTALL_SCRIPT="netdata-uninstaller.sh" -tmpdir=$(mktemp -d) +# Kill all netdata processes (essentially what the official uninstaller does) +pkill netdata +pkill -U netdata -ynh_setup_source --dest_dir="$tmpdir" --source_id="uninstaller" -chmod +x $tmpdir/$UNINSTALL_SCRIPT - -# Move outside the directory (which will be removed) -pushd $tmpdir - # create a temporary file for the log - tmplog=$(mktemp /tmp/netdata-uninstaller-log-XXXXXX.log) - - # Execute the uninstall script - ./${UNINSTALL_SCRIPT} --yes --force --env $install_dir/etc/netdata/.environment >$tmplog 2>$tmplog -popd - -# Remove MySQL netdata user -ynh_mysql_execute_as_root "drop user 'netdata'@'localhost'; flush privileges;" +# Rm all files that netdata may have installed (this is copypasta of the official uninstaller script) +ynh_secure_remove /etc/logrotate.d/netdata +ynh_secure_remove /etc/systemd/system/netdata.service +ynh_secure_remove /lib/systemd/system/netdata.service +ynh_secure_remove /usr/lib/systemd/system/netdata.service +ynh_secure_remove /etc/init.d/netdata +ynh_secure_remove /etc/periodic/daily/netdata-updater +ynh_secure_remove /etc/cron.daily/netdata-updater +ynh_secure_remove "/usr/sbin/netdata" +ynh_secure_remove "/usr/share/netdata" +ynh_secure_remove "/usr/libexec/netdata" +ynh_secure_remove "/var/lib/netdata" +ynh_secure_remove "/var/cache/netdata" +ynh_secure_remove "/var/log/netdata" +ynh_secure_remove "/etc/netdata" #================================================= # END OF SCRIPT From f65fcc1bedb7a61daa578f58f89bca73ef73e452 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 20:50:12 +0100 Subject: [PATCH 18/20] Install in /var/www/$app like any other app .. --- manifest.toml | 1 - scripts/install | 34 ++++++++++++++++------------------ scripts/restore | 28 ++++++++++++---------------- scripts/upgrade | 4 ++-- 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/manifest.toml b/manifest.toml index 2370d06..907f1e2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -55,7 +55,6 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - dir = "/opt/__APP__" [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index f53a148..e828f10 100644 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,22 @@ ynh_script_progression --message="Setting up source files..." --weight=11 NETDATA_TMPDIR=$(mktemp -d) ynh_setup_source --dest_dir="$NETDATA_TMPDIR" +#================================================= +# BUILD +#================================================= +ynh_script_progression --message="Executing Netdata installer..." --weight=10 + +# create a temporary file for the log +tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) + +pushd $NETDATA_TMPDIR + # the installer.sh script will append "netdata" after the --install-prefix arg + ./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" +popd + +# Specific configuration +configure_netdata + #================================================= # NGINX CONFIGURATION #================================================= @@ -28,24 +44,6 @@ ynh_add_nginx_config yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" -#================================================= -# SPECIFIC SETUP -#================================================= -# EXECUTE NETDATA INSTALLER -#================================================= -ynh_script_progression --message="Executing Netdata installer..." --weight=10 - -# create a temporary file for the log -tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) - -# Launch netdata installation in /opt directory -pushd $NETDATA_TMPDIR - ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" -popd - -# Specific configuration -configure_netdata - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/restore b/scripts/restore index 0107139..041ebc6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,13 +19,6 @@ ynh_script_progression --message="Restoring Netdata configuration directory..." ynh_restore_file --origin_path="$install_dir/etc/netdata" -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # INSTALL AND RESTORE THE APP CONFIGURATION #================================================= @@ -36,20 +29,23 @@ NETDATA_TMPDIR=$(mktemp -d) ynh_setup_source --dest_dir="$NETDATA_TMPDIR" # create a temporary file for the log -tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) -# open fd 3 and send it to tmp -exec 3>${tmp} +tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) -# Launch netdata installation in /opt directory -cd $NETDATA_TMPDIR -./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" - -# close fd 3 -exec 3<&- +pushd $NETDATA_TMPDIR + # the installer.sh script will append "netdata" after the --install-prefix arg + ./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" +popd # Specific configuration configure_netdata +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7166d6a..743ccef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,9 +43,9 @@ then # create a temporary file for the log tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) - # Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR - ./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" + # the installer.sh script will append "netdata" after the --install-prefix arg + ./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" popd fi From 20391a1f7f5ed9cfbdfa158e9851b7165a938ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 6 Jan 2024 22:16:51 +0100 Subject: [PATCH 19/20] Update change_url --- scripts/change_url | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 340c1c8..b2a695b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,7 +30,8 @@ ynh_change_url_nginx_config #================================================= # Change registry link -ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/opt/netdata/etc/netdata/netdata.conf" +#ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/opt/netdata/etc/netdata/netdata.conf" +ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/etc/netdata/netdata.conf" #================================================= # GENERIC FINALISATION From 9abf429eca7a1bbd29122a8a3473ee203668e534 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 7 Jan 2024 04:03:32 +0100 Subject: [PATCH 20/20] Update change_url --- scripts/change_url | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index b2a695b..76a6575 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,8 +30,7 @@ ynh_change_url_nginx_config #================================================= # Change registry link -#ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/opt/netdata/etc/netdata/netdata.conf" -ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="/etc/netdata/netdata.conf" +ynh_replace_string --match_string="registry to announce = https://$old_domain$old_path" --replace_string="registry to announce = https://$new_domain$new_path" --target_file="$install_dir/etc/netdata/netdata.conf" #================================================= # GENERIC FINALISATION