1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00

Merge pull request #25 from YunoHost-Apps/testing

This commit is contained in:
JimboJoe 2021-04-30 22:52:16 +02:00 committed by GitHub
commit b7192c7ca5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 65 deletions

View file

@ -4,6 +4,11 @@ Changelog
## Unreleased
- Nothing for now...
## [7.4.0~ynh1](https://github.com/YunoHost-Apps/grafana_ynh/pull/23) - 2021-02-05
#### Changed
* Upgrade to upstream version 7.4.0
## [7.3.3~ynh1](https://github.com/YunoHost-Apps/grafana_ynh/pull/22) - 2020-11-15
#### Changed

View file

@ -1,7 +1,7 @@
# 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)
[![Install grafana with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grafana)
> *This package allows you to install grafana quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
@ -13,7 +13,7 @@ NetData only collects, displays and sets alarms based on data from the last hour
Note: You can use it without NetData, but you'll have to install a collection application (e.g. collectd) to gather data.
**Shipped version:** 7.3.3
**Shipped version:** 7.5.5
## Screenshots
@ -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.

View file

@ -14,19 +14,15 @@
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=a6403c448199ec31430a3fd88c8318965e9583c4
upgrade=1 from_commit=893b873f00c2f9793369b7cd5d034b06605aaa8a
backup_restore=1
multi_instance=0
incorrect_path=1
port_already_use=1
change_url=1
;;; Levels
Level 5=auto
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=a6403c448199ec31430a3fd88c8318965e9583c4
name=Fix backup/restore
; commit=893b873f00c2f9793369b7cd5d034b06605aaa8a
name=Upgrade to upstream version 7.0.0
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&admin_password=secret&language=en&is_public=1&

View file

@ -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`*

View file

@ -6,7 +6,7 @@
"en": "Beautiful metric & analytic dashboards for monitoring",
"fr": "Tableaux de bords de supervision"
},
"version": "7.3.3~ynh1",
"version": "7.5.5~ynh1",
"license": "Apache-2.0",
"url": "http://grafana.org/",
"maintainer": {

View file

@ -5,7 +5,7 @@
#=================================================
# Debian package version for Grafana
GRAFANA_VERSION="7.3.3"
GRAFANA_VERSION="7.5.5"
# dependencies used by the app
pkg_dependencies="influxdb"

View file

@ -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
#=================================================

View file

@ -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

View file

@ -76,10 +76,6 @@ fi
ynh_secure_remove --file="/etc/grafana/grafana.ini"
#=================================================
# GENERIC FINALIZATION
#=================================================
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -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

View file

@ -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
#=================================================