Hi all,
I started a phplist package for Yunohost. phpList is a newsletter/mailing list app which is on the Yunohost whishlist. It’s nearly usable but some help would be welcome to resolve the remaining issues detailed below (sorry, it’s long).
By using the template app and the guidelines, it was more or less straightforward to get the app to install and run without SSO (more on SSO below), although the appearance of the site is broken for non-logged-in users (visitors) which is not ideal. This is presumably due to some filtering operated by yunohost, since the web console reports a buch of errors of the type
The resource from “https://mydomain.tld/yunohost/sso/?r=XXXX[...]XXXXXX==” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
for these non-logged-in connections. I’m not proficient enough in web servers to figure how to fix this, and some help on this would be welcome.
For this packaging, I nevertheless found that the guideline sorely lacked even basic information on how to adequately setup the SSO and other details such as Fail2ban or php-fpm. I could gather some scarce information here in the forum, but it took me very long to find, and I’m not sure the present setup is fully correct.
For my use case of phplist, I want that only a subset of my users have the right to manage phplist (defining lists, sending mails, etc.). Visitors and non-admin users should only have the possibility to sign in (or opt out) for receiving newsletters. I got SSO working based on HTTP auth (that is, when the php dictionary string $_SERVER['REMOTE_USER']
is non-empty), but that does not distinguish users that have phplist admin permissions and those that do not and, as a result, all users that are identified in Yunohost SSO end up logged in as phplist superusers (although Yunohost correctly prevents “normal users” from accessing the admin page). Clearly that’s not what I want. In order to avoid this I can give phplist access only to the visitors group and my phplist admins but not to the all_users group. That achieves more or less what I want, although non-admin users may not understand why they cannot access the subscription page while logged in yunohost.
Now, if I want to improve on that last point, is there a way to setup SSO or nginx.conf such that the $_SERVER dictionary in php carries some info about the user actual user permission on the app being accessed? If not, I understand that I can I recourse to LDAP to get the actual user permissions, but can someone point me to a php ynh app that does a simple ldap authentication, so that I can borrow the code there?
The other issue I face is setting up Fail2ban, for which help would also be welcome.
Bonjour,
J’ai commencé un package phplist pour Yunohost. phpList est une application de newsletter/liste de diffusion qui figure sur la “Yunohost whishlist”. C’est quasiment utilisable mais un peu d’aide serait bienvenue pour résoudre quelques soucis détaillés ci-dessous (désolé c’est long).
En utilisant le modèle d’application et les instructions pour le packaging, il a été relativement direct d’arriver à ce que l’application s’installe et fonctionne sans SSO (plus d’informations sur le SSO ci-dessous), bien que l’apparence du site soit cassée pour les utilisateurs non connectés (visiteurs), ce qui n’est pas idéal. Cela est probablement dû à un certain filtrage opéré par yunohost, puisque la console web signale plein d’erreurs du type
The resource from “https://mydomain.tld/yunohost/sso/?r=XXXX[...]XXXXXX==” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
pour ces connexions hors login yunohost. Je ne suis pas assez compétent en matière de serveurs web pour savoir comment résoudre ce problème, et de l’aide à ce sujet serait la bienvenue.
Pour ce package, j’ai néanmoins trouvé que les instructions manquaient cruellement d’informations de base sur la façon de configurer correctement le SSO et d’autres détails tels que Fail2ban ou php-fpm. J’ai pu rassembler quelques rares informations ici dans le forum, mais il m’a fallu beaucoup de temps pour les trouver, et je ne suis pas sûr que la configuration actuelle soit entièrement correcte.
Pour mon utilisation de phplist, je veux que seul un sous-ensemble de mes utilisateurs ait le droit de gérer phplist (définition des listes, envoi de mails, etc.). Les visiteurs et les utilisateurs non administrateurs devraient seulement avoir la possibilité de s’inscrire (ou de se désinscrire) pour recevoir des bulletins d’information. Le SSO que j’ai implémenté utilise l’authentification HTTP (c’est-à-dire lorsque l’entrée de dictionnaire php $_SERVER['REMOTE_USER']
est non vide), mais cela ne distingue pas les utilisateurs qui ont les droits d’administration de phplist de ceux qui ne les ont pas et, par conséquent, tous les utilisateurs qui sont identifiés dans le SSO de Yunohost se retrouvent super-utilisateurs de phplist (même si Yunohost empêche bien l’accès des “utilisateurs normaux” à la page d’administration). Clairement, ce n’est pas ce que je veux. Pour éviter cela, je peux donner l’accès à phplist uniquement au groupe de visiteurs et à mes administrateurs phplist mais pas au groupe all_users. Cela permet d’obtenir plus ou moins ce que je veux, bien que les utilisateurs non-administrateurs puissent ne pas comprendre pourquoi ils ne peuvent pas accéder à la page des abonnements pendant qu’ils sont connectés à yunohost.
Maintenant, si je veux améliorer ce dernier point, y a-t-il un moyen de configurer SSO ou nginx.conf de telle sorte que dans php, le dictionnaire $_SERVER contienne des informations sur les droits d’accès de l’utilisateur pour l’application à laquelle il accède ? Sinon, on peut recourir à LDAP pour obtenir les droits d’accès réels, mais quelqu’un peut-il m’indiquer une application php ynh qui fait une authentification ldap toute simple, afin que je puisse y emprunter le code ?
L’autre problème auquel je suis confronté est la mise en place de Fail2ban, pour laquelle de l’aide serait également la bienvenue.