Share your "hooks" to apply custom configurations- Partagez vos "hooks" pour appliquer des configurations personnelles

Il y a apparemment une incompatibilité pour pouvoir utiliser l’application keeweb sur Nextcloud. Ce problème se résout en supprimant le carré de Yunohost qui permet de revenir sur le portail SSO :

Pour supprimer le carré Yunohost uniquement pour Nextcloud, voici le hook qu’il faut utiliser:
AVERTISSEMENT: Comme il n’y a pas de conf_regen à l’installation d’une application, il faut obligatoirement relancer la commande yunohost tools regen-conf nginx --force. Du coup il y a quand même très peu d’intérêt dans ce cas-ci.

/etc/yunohost/hooks.d/conf_regen/17-nginx_nextcloud

#!/bin/bash
action=$1
pending_dir=$4
nginx_dir=$pending_dir/../nginx/etc/nginx
nginx_nextcloud_conf=$(find /etc/nginx -name nextcloud.conf)
[[ $action == "pre" ]] || exit 0
[[ -d $nginx_dir ]] || exit 0
[[ -e $nginx_nextcloud_conf ]] || exit 0
sed -e "/^  #/! {/yunohost_panel/ s/^  /  #/}" \
    -i $nginx_nextcloud_conf

Ceux qui veulent supprimer ce carré sur toutes les applications doivent utiliser le hook suivant. Celui-ci reste intéressant car automatisé avec les mises à jour de Yunohost:

AVERTISSEMENT: il existe maintenant un paramètre de yunohost qui permet de faire la même chose avec la commande:

yunohost settings set ssowat.panel_overlay.enabled -v False

Il faut remplacer False par True pour rétablir le carré.

Je laisse le hook simplement pour exemple, son utilisation n’est donc plus recommandée avec ce nouveau paramètre.

/etc/yunohost/hooks.d/conf_regen/17-nginx_yunopanel

#!/bin/bash
action=$1
pending_dir=$4
nginx_dir=$pending_dir/../nginx/etc/nginx
yunohost_panel_conf=$nginx_dir/conf.d/yunohost_panel.conf.inc
[[ $action == "pre" ]] || exit 0
[[ -d $nginx_dir ]] || exit 0
[[ -e $yunohost_panel_conf ]] || exit 0
sed -e "/#/! s/^/#/g" \
    -i $yunohost_panel_conf
2 Likes