From 473bf459647d8688b44c3245e29884358b73c6d9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 22:33:52 +0100 Subject: [PATCH] Fix linter warning --- README.md | 8 +++----- check_process | 4 ---- issue_template.md | 4 ++-- scripts/backup | 23 ----------------------- scripts/install | 10 ++++------ scripts/remove | 4 ---- scripts/restore | 4 ++-- scripts/upgrade | 17 +++++------------ 8 files changed, 16 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 267f015..29bf163 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Grafana app for YunoHost +# Grafana for YunoHost [![Integration level](https://dash.yunohost.org/integration/grafana.svg)](https://dash.yunohost.org/appci/app/grafana) ![](https://ci-apps.yunohost.org/ci/badges/grafana.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grafana.maintain.svg) [![Install grafana with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=grafana) @@ -56,7 +56,7 @@ LDAP and HTTP auth are supported. #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grafana/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grafana/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grafana/) ## Limitations @@ -79,10 +79,8 @@ None. --- -Developers info ----------------- +## Developers info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/grafana_ynh/tree/testing). To try the testing branch, please proceed like that. diff --git a/check_process b/check_process index b86d33e..35d5307 100644 --- a/check_process +++ b/check_process @@ -17,11 +17,8 @@ upgrade=1 from_commit=a6403c448199ec31430a3fd88c8318965e9583c4 backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=1 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none @@ -29,4 +26,3 @@ Notification=none ; commit=a6403c448199ec31430a3fd88c8318965e9583c4 name=Fix backup/restore manifest_arg=domain=DOMAIN&path=PATH&admin=USER&admin_password=secret&language=en&is_public=1& - diff --git a/issue_template.md b/issue_template.md index c9a0368..378db3c 100644 --- a/issue_template.md +++ b/issue_template.md @@ -7,7 +7,7 @@ about: Create a report to help us debug, it would be nice to fill the template a **How to post a meaningful bug report** 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - *Otherwise, the issue may be due to Grafana or InfluxDB themselves. Refer to its documentation or repository for help.* - *If you have a doubt, post here, we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* @@ -20,7 +20,7 @@ about: Create a report to help us debug, it would be nice to fill the template a - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* diff --git a/scripts/backup b/scripts/backup index 93fdb82..8fda6ca 100644 --- a/scripts/backup +++ b/scripts/backup @@ -34,25 +34,11 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= # STANDARD BACKUP STEPS #================================================= - ynh_print_info --message="Declaring files to be backed up..." -# N.B.: the following 'ynh_backup' calls are only a *declaration* of what needs -# to be backuped and not an actual copy of any file. The actual backup that -# creates and fill the archive with the files happens in the core after this -# script is called. Hence ynh_backups calls takes basically 0 seconds to run. - -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_print_info --message="Stopping a systemd service..." - -ynh_systemd_action --service_name="grafana-server" --action="stop" --log_path="/var/log/grafana/grafana.log" - #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info --message="Backing up configuration directories..." ynh_backup --src_path="/etc/influxdb" ynh_backup --src_path="/etc/grafana" @@ -61,7 +47,6 @@ ynh_backup --src_path="/var/lib/grafana/plugins" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -77,7 +62,6 @@ ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= # SPECIFIC BACKUP #================================================= - ynh_print_info --message="Backing up the InfluxDB database..." # Backup InfluxDB data # Source: http://stackoverflow.com/questions/39501416/how-to-restore-data-base-using-influxd @@ -101,13 +85,6 @@ if [ -d "/var/lib/influxdb/data/opentsdb" ]; then fi fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_print_info --message="Starting a systemd service..." - -ynh_systemd_action --service_name="grafana-server" --action="start" --log_path="/var/log/grafana/grafana.log" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index e8fb2b1..c553c53 100644 --- a/scripts/install +++ b/scripts/install @@ -205,19 +205,17 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard_version (id, dashboard_id, parent_version, restored_from, version, created, created_by, message, data) VALUES (99999, 99999, 0, 0, 1, '2020-05-16 14:36:50', 1, 'YunoHost installer', \"$escaped_dashboard\");" # Enable the systemd service so that InfluxDB and Grafana start at boot -systemctl enable influxdb.service -systemctl enable grafana-server.service +systemctl enable influxdb.service --quiet +systemctl enable grafana-server.service --quiet #================================================= # GENERIC FINALIZATION -#================================================= - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -yunohost service add influxdb --description "open source time series database" --log "/var/log/grafana/grafana.log" -yunohost service add grafana-server --description "open source analytics and monitoring solution" --log "/var/log/grafana/grafana.log" +yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log" +yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index 12c2398..a5bed51 100644 --- a/scripts/remove +++ b/scripts/remove @@ -76,10 +76,6 @@ fi ynh_secure_remove --file="/etc/grafana/grafana.ini" -#================================================= -# GENERIC FINALIZATION -#================================================= - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index be96d42..fb4bfed 100644 --- a/scripts/restore +++ b/scripts/restore @@ -97,8 +97,8 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ # INTEGRATE SERVICE IN YUNOHOST #================================================= -yunohost service add influxdb --description "open source time series database" --log "/var/log/grafana/grafana.log" -yunohost service add grafana-server --description "open source analytics and monitoring solution" --log "/var/log/grafana/grafana.log" --timeout=600 +yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log" +yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 679217b..d283cd4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,17 +65,8 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS -#================================================= - #================================================= # NGINX CONFIGURATION #================================================= @@ -150,8 +141,6 @@ EOF ynh_systemd_action --service_name=netdata --action="restart" fi - - # Update default dashboard for NetData (source: https://grafana.com/grafana/dashboards/2701) # Remove new lines tr -d '\n' < ../conf/netdata_dashboard.json > dashboard.json @@ -168,6 +157,11 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< #================================================= # GENERIC FINALIZATION #================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= + +yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log" +yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log" #================================================= # SETUP SSOWAT @@ -188,7 +182,6 @@ ynh_script_progression --message="Restarting a systemd service..." --weight=2 ynh_systemd_action --service_name=grafana-server --action="restart" --log_path="/var/log/grafana/grafana.log" --line_match="HTTP Server Listen" --timeout=600 - #================================================= # RELOAD NGINX #=================================================