1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prometheus_ynh.git synced 2024-09-03 20:16:01 +02:00

Refine permissions

This commit is contained in:
tituspijean 2021-06-25 21:29:11 +02:00
parent cb0a076673
commit c63f291f1a
5 changed files with 22 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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

View file

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