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

**URL:** https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235
**Category:** Tutorials
**Tags:** french, english
**Created:** [September 20, 2021, 9:36pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235 "2021-09-20T21:36:03Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)
#### Post date: [November 6, 2021, 9:40pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/3 "2021-11-06T21:40:27Z")

</div>

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 :

> <https://github.com/YunoHost-Apps/nextcloud_ynh/issues/317#issuecomment-702596438>
>
> I've installed nextcloud-keeweb on my nextcloud, but the app doesn't work at all….
> 
> Here is a screenshot of how it renders: 
> 
> !\[\](https://user-images.githubusercontent.com/477243/84126195-e3374a80-aa3d-11ea-8eea-e7638512ca77.png)
> 
> I've talked about this issue on https://github.com/jhass/nextcloud-keeweb/issues/143#issuecomment-641130673
> 
> Several yunohost users are getting a similar problem. I've installed nextcloud on my computer just to try, then nextcloud-keeweb, and it works as expected.
> 
> I've seen this issue: https://github.com/YunoHost-Apps/nextcloud\_ynh/issues/161 and I've tried the commands, but it's not better.
> 
> Do you have any clue?

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

```auto
#!/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** :

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

```auto
#!/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

```

---

_[View the full topic](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235)._
