1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/netdata_ynh.git synced 2024-09-03 19:46:33 +02:00

Merge pull request #70 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-08-10 22:58:35 +02:00 committed by GitHub
commit fc9009ba90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 69 deletions

View file

@ -13,7 +13,7 @@ _netdata is **fast** and **efficient**, designed to permanently run on all syste
(**physical** & **virtual** servers, **containers**, **IoT** devices), without
disrupting their core function._
**Shipped version:** 1.30.0
**Shipped version:** 1.31.0
**Customization brought by the package:**

View file

@ -1,3 +1,3 @@
SOURCE_URL=https://github.com/netdata/netdata/releases/download/v1.30.0/netdata-v1.30.0.tar.gz
SOURCE_SUM=711c9ce7a5b34c4e05dee8b2b034896f995cf5360eedca8b1d7375e0d33d9f59
SOURCE_URL=https://github.com/netdata/netdata/releases/download/v1.31.0/netdata-v1.31.0.tar.gz
SOURCE_SUM=ca68f725224e8bbec041b493891376fbf41aedb47c4ac06161c2eda990089c9f
SOURCE_FORMAT=tar.gz

View file

@ -3,10 +3,10 @@
"id": "netdata",
"packaging_format": 1,
"description": {
"en": "real-time performance and health monitoring",
"en": "Real-time performance and health monitoring",
"fr": "Monitoring serveur en temps reel"
},
"version": "1.30.0~ynh1",
"version": "1.31.0~ynh1",
"url": "http://my-netdata.io/",
"license": "GPL-3.0",
"maintainer": {
@ -15,7 +15,7 @@
"url": ""
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.2.0"
},
"multi_instance": false,
"services": [
@ -26,38 +26,22 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for NetData",
"fr": "Choisissez un nom de domaine pour NetData"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for NetData",
"fr": "Choisissez un chemin pour NetData"
},
"example": "/netdata",
"default": "/netdata"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": false
},
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose the only user initially allowed (others can be added later)",
"fr": "Choisissez l'unique utilisateur autorisé initialement (d'autres peuvent être ajoutés ultérieurement)"
},
"example": "johndoe"
}
]

View file

@ -24,14 +24,14 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
ynh_script_progression --message="Loading installation settings..." --weight=1
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --time --weight=1
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
ynh_backup_before_upgrade
@ -118,7 +118,7 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="$final_pat
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -51,7 +51,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
# STANDARD MODIFICATIONS
@ -81,9 +80,7 @@ ynh_setup_source --dest_dir="$NETDATA_TMPDIR"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=2
### `ynh_add_nginx_config` will use the file conf/nginx.conf
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
@ -112,8 +109,6 @@ configure_netdata
#=================================================
# GENERIC FINALIZATION
#=================================================
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
@ -131,7 +126,7 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="$final_pat
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]; then
@ -146,7 +141,7 @@ ynh_permission_update --permission "main" --add "$admin"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -71,19 +71,11 @@ ynh_mysql_execute_as_root "drop user 'netdata'@'localhost'; flush privileges;"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing nginx web server configuration..." --weight=1
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
#=================================================
# GENERIC FINALIZATION
#=================================================
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -101,7 +101,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -19,7 +19,6 @@ 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)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
@ -33,15 +32,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
# If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/opt/$app
@ -55,6 +45,13 @@ if [[ $final_path == /var/www* ]]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -71,8 +68,6 @@ ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -118,7 +113,7 @@ configure_netdata
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config
@ -140,18 +135,6 @@ ynh_install_app_dependencies $pkg_dependencies
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"
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
# Make app public if necessary
if [[ $is_public -eq 1 ]]; then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission "main" --add "visitors"
fi
#=================================================
# START SYSTEMD SERVICE
#=================================================
@ -162,7 +145,7 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="$final_pat
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload