Skip to content

feat(notifier): canal Nextcloud Talk pour les alertes - #101

Merged
laurentvv merged 2 commits into
mainfrom
feat/notifier-nextcloud-talk
Sep 29, 2026
Merged

laurentvv merged 2 commits into
mainfrom
feat/notifier-nextcloud-talk

Conversation

@laurentvv

Copy link
Copy Markdown
Owner

Contenu

Nouveau canal d'alerte Nextcloud Talk pour le watchdog (POST /ocs/v2.php/apps/spreed/api/v1/chat/<jeton>), en plus de ntfy et Telegram. Variables : NEXTCLOUD_URL, NEXTCLOUD_USER, NEXTCLOUD_PASSWORD (mot de passe d'application), NEXTCLOUD_TALK_TOKEN (jeton lu dans l'URL de la conversation). Gabarit dans .env.example, secrets jamais dans le code ni dans les logs (test dédié).

Vérification

4 tests ajoutés (canal exigeant les 4 variables, endpoint et authentification, aucune fuite d'identifiants, erreur HTTP ≠ livraison). ruff propre.

🤖 Generated with Claude Code

Compte dédié + mot de passe d'application + jeton de conversation, lus dans .env
(NEXTCLOUD_URL/USER/PASSWORD/TALK_TOKEN, gabarit dans .env.example). Aucun secret dans
le code ni dans les logs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread src/notifier.py
logger.warning(f"telegram: envoi impossible ({type(e).__name__})")

if all(os.getenv(v) for v in _NEXTCLOUD_VARS):
base = os.environ["NEXTCLOUD_URL"].rstrip("/")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: No HTTPS guard before sending Basic auth

base comes straight from NEXTCLOUD_URL and is used as the target of the auth=(user, password) POST. If the URL is ever configured as http://... (self-hosted behind a reverse proxy, a typo, a LAN address), the app password travels base64-encoded in cleartext on every watchdog alert. The other channels hardcode https:// hosts, so nothing else in the file constrains the scheme here. A cheap guard is to log/skip (or at least warn loudly) when the parsed scheme is not https, which also turns a silent misconfiguration into a visible one.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of d774d9be..1989017e (2 files, 15 lines). The previous SUGGESTION (src/notifier.py:89, missing HTTPS guard) is fixed: the non-https:// case now logs and skips the send, and test_nextcloud_refuses_plain_http covers it. No new issues in the changed code.

Files Reviewed (2 files)
  • src/notifier.py
  • tests/test_watchdog.py
Previous Review Summary (commit d774d9b)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit d774d9b)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
src/notifier.py 89 No HTTPS guard before sending the Nextcloud app password via Basic auth
Files Reviewed (4 files)
  • .env.example - 0 issues
  • src/notifier.py - 1 issue
  • tests/test_watchdog.py - 0 issues
  • watchdog.py - 0 issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 0 · Output: 0 · Cached: 0

…air)

Review Kilo #101.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@laurentvv
laurentvv merged commit fc3b891 into main Sep 29, 2026
2 checks passed
@laurentvv
laurentvv deleted the feat/notifier-nextcloud-talk branch September 29, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant