diff --git a/TODO.md b/TODO.md index 4715789..e3c02ef 100644 --- a/TODO.md +++ b/TODO.md @@ -52,6 +52,8 @@ - [x] Fix import modal missing FilePond styling: bundling refactor dropped filepond CSS + file-upload-filepond.js wrapper from admin list page (pre-existing regression) - [x] Move 'download empty CSV template' button onto the same line as the Fichier CSV heading (button on the right, styled as btn) +- [x] Rework `parameters.php` admin page: new `Identifiants` section (shared SMTP/PeerTube/Nextcloud username+password) before `Emails`, Emails section without username/password, test-send button moved outside its fieldset, PeerTube merged into one `Paramètres Peertube` fieldset with activation checkbox on top and test button aligned with Enregistrer + ## Enquête: PeerTube auth failed (400) invalid_grant - [x] [Diagnosed & reproduced] Single LDAP credential (`xamxam@erg.be`). **Both** mail and PeerTube are now on `portail.erg.school` (LemonLDAP OIDC) SSO — verified: mail.erg.school advertises SMTP `XOAUTH2`/`OAUTHBEARER` after STARTTLS. The difference: mail kept `PLAIN`/`LOGIN` (additive migration) so the app's `PLAIN` auth still works; PeerTube *removed* the `password` grant (hard cutover) so `grant_type=password` → `invalid_grant`. Not fixable with any credential; needs admin to restore password grant, register OIDC client, or (best) set up `authorization_code`+`refresh_token`. Full report in docs/peertube-sso-incident.md. - [x] Built `scripts/creds-test.sh` (gum UI) + `scripts/creds-probe.php` (PHP probe) + `just creds-test`, + public `PeerTubeService::probeAuth()` to isolate auth-vs-channel. Probes SMTP AUTH and PeerTube password grant with the stored creds; logs results (never the password). Added `probeAuth` to PeerTubeService. diff --git a/app/public/assets/css/admin.css b/app/public/assets/css/admin.css index a392bff..f55eab0 100644 --- a/app/public/assets/css/admin.css +++ b/app/public/assets/css/admin.css @@ -1353,6 +1353,22 @@ th.admin-ap-col { gap: var(--space-m); } +.param-form > .param-form-actions { + display: flex; + align-items: center; + gap: var(--space-s); +} + +/* Spacing between the two fieldsets in the Identifiants section */ +.param-account-fieldset { + margin-top: var(--space-l); +} + +/* Remove the top border on the confirm-password row (it follows the new-password row) */ +.param-form > .param-form-row--flush { + border-top: none; +} + .param-form fieldset { display: flex; flex-direction: column; @@ -1430,11 +1446,16 @@ th.admin-ap-col { gap: var(--space-3xs); border-top: 1px solid var(--border-primary); padding: var(--space-xs) 0; + display: grid; + grid-template-columns: 1fr; + gap: var(--space-3xs); + border-top: 1px solid var(--border-primary); } .param-form > div:first-of-type { border-top: none; padding-top: 0; + border-top: none; } .param-form input[type="password"] { @@ -1526,6 +1547,10 @@ th.admin-ap-col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-s); } +.param-grid > .param-checkbox, +.param-grid > .param-note { + grid-column: 1 / -1; +} .param-grid label { display: flex; flex-direction: column; diff --git a/app/templates/admin/parametres.php b/app/templates/admin/parametres.php index c9c7ca2..c5fad0c 100644 --- a/app/templates/admin/parametres.php +++ b/app/templates/admin/parametres.php @@ -77,6 +77,146 @@ + + when this field is the culprit. + // Shared by the Identifiants and Emails (SMTP) sections below. + $smtpFieldErr = function(string $id) use ($smtpErrorField): string { + return $smtpErrorField === $id ? ' aria-invalid="true"' : ''; + }; + $smtpFieldMsg = function(string $id, string $msg) use ($smtpErrorField): string { + return $smtpErrorField === $id + ? '' . htmlspecialchars($msg) . '' + : ''; + }; + // Human-readable hints per field (brief — the full message is in the toast) + $smtpHints = [ + 'smtp_host' => 'Vérifiez l’adresse du serveur SMTP.', + 'smtp_port' => 'Vérifiez le numéro de port.', + 'smtp_encryption' => 'Vérifiez le mode de chiffrement.', + 'smtp_username' => 'Vérifiez le nom d’utilisateur.', + 'smtp_password' => 'Mot de passe incorrect.', + ]; + ?> +
+

Identifiants

+

+ Identifiants communs partagés par le relay SMTP, la connexion + PeerTube et l'instance Nextcloud utilisés par le script de sauvegarde. +

+
> + + + +
+ Identifiants communs +
+ + + > + Utilisée pour l'authentification SMTP, PeerTube et Nextcloud. + +
+ +
+ + + > + +
+
+ + +
+ +
+ Compte administrateur + + + + +

+ Aucun mot de passe PHP configuré. Le formulaire ci-dessous stockera + un hash bcrypt dans la base de données. +

+ + +
+ + + + +
+ + +
+ + +
+ + + Minimum 12 caractères. +
+ +
+ + +
+
+ + + +
+ Supprimer la configuration du mot de passe +

+ Supprime le hash de la base de données. L'accès admin + ne sera plus protégé (mode développement). +

+ modal like the other confirmations */ ?> +
+ + + + + +
+
+ + +
+ + +
+ @@ -95,25 +235,6 @@ - when this field is the culprit - $smtpFieldErr = function(string $id) use ($smtpErrorField): string { - return $smtpErrorField === $id ? ' aria-invalid="true"' : ''; - }; - $smtpFieldMsg = function(string $id, string $msg) use ($smtpErrorField): string { - return $smtpErrorField === $id - ? '' . htmlspecialchars($msg) . '' - : ''; - }; - // Human-readable hints per field (brief — the full message is in the toast) - $smtpHints = [ - 'smtp_host' => 'Vérifiez l’adresse du serveur SMTP.', - 'smtp_port' => 'Vérifiez le numéro de port.', - 'smtp_encryption' => 'Vérifiez le mode de chiffrement.', - 'smtp_username' => 'Vérifiez le nom d’utilisateur.', - 'smtp_password' => 'Mot de passe incorrect.', - ]; - ?>
> @@ -154,28 +275,6 @@ -
- - - > - Adresse utilisée pour l'authentification SMTP et comme expéditeur. - -
- -
- - - > - -
-
-
- Tester l'envoi d'un e-mail -

Envoie un e-mail de test via le relay SMTP configuré ci-dessus.

- -

⚠ Configurez le relay SMTP avant de pouvoir tester l'envoi.

- - - + + +
+ Tester l'envoi d'un e-mail +

Envoie un e-mail de test via le relay SMTP configuré ci-dessus.

+ +

⚠ Configurez le relay SMTP avant de pouvoir tester l'envoi.

+
-
- + +
+ + -
+ -
-

Compte administrateur

- - - - -

- Aucun mot de passe PHP configuré. Le formulaire ci-dessous stockera - un hash bcrypt dans la base de données. -

- - -
- - - - -
- - -
- - -
- - - Minimum 12 caractères. -
- -
- - -
- - -
- - - -
- Supprimer la configuration du mot de passe -

- Supprime le hash de la base de données. L'accès admin - ne sera plus protégé (mode développement). -

- modal like the other confirmations */ ?> -
- - - - - -
-
- -
-