diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 86edae8..3aed2ac 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,3 +1,7 @@ * Port assigned to the app can be read in `/etc/yunohost/apps/prometheus/settings.yml` or within CLI with `yunohost app info prometheus --full` * The app is configurable within the file `/opt/yunohost/prometheus/prometheus.yml`, then reboot the app service. +* Permissions : + * `graph` enables access to Prometheus' graphical interface (address `/graph`) ; + * `api` protects the API (address `/api`, will not be shown on a tile in YunoHost's user interface) ; + * `main` protects all other *endpoints* (address `/`, will not be shown on a tile in YunoHost's user interface). diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 75f5653..41ce362 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -2,3 +2,7 @@ ou avec la commande `yunohost app info prometheus --full` * L'app est configurable dans le fichier `/opt/yunohost/prometheus/prometheus.yml`, ensuite redémarrez le service de l'app. +* Permissions : + * `graph` permet d'accéder à l'interface graphique de Prometheus (adresse `/graph`) ; + * `api` protège l'API (adresse `/api`, ne sera pas affichée sur une tuile dans l'interface utilisateur de YunoHost) ; + * `main` protège tous les autres *endpoints* (adresse `/`, ne sera pas affichée sur une tuile dans l'interface utilisateur de YunoHost). diff --git a/manifest.json b/manifest.json index 0e496e0..de22872 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Monitoring system and time series database", "fr": "Supervision chronologique de systèmes et services" }, - "version": "2.28.0~ynh1", + "version": "2.28.0~ynh2", "url": "https://prometheus.io", "upstream": { "license": "Apache-2.0", diff --git a/scripts/install b/scripts/install index 94ad0e8..13c461f 100755 --- a/scripts/install +++ b/scripts/install @@ -144,9 +144,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 -ynh_permission_update --permission="main" --add="$admin" --remove="all_users" +ynh_permission_update --permission="main" --add="$admin" --remove="all_users" --show_tile="false" -ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" +ynh_permission_create --permission="graph" --url="/graph" --allowed="$admin" --show_tile="true" +ynh_permission_create --permission="api" --url="/api" --allowed="$admin" --show_tile="false" #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index c6d0d1d..937078f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,9 +62,17 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Create a permission if needed +# Hide non-browsable main / endpoint +ynh_permission_update --permission="main" --show_tile="false" + +# Create a permission for browsable /graph endpoint, if needed +if ! ynh_permission_exists --permission="graph"; then + ynh_permission_create --permission="graph" --url="/graph" --show_tile="true" +fi + +# Create a permission for /api endpoint, if needed if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" + ynh_permission_create --permission="api" --url="/api" --show_tile="false" fi #=================================================