Skip to content

Phase 0 : stabilisation de l'existant - #112

Merged
alex-dembele merged 20 commits into
mainfrom
fix/phase0-stabilization
Oct 29, 2026
Merged

alex-dembele merged 20 commits into
mainfrom
fix/phase0-stabilization

Conversation

@alex-dembele

Copy link
Copy Markdown
Member

Phase 0 : stabilisation de l'existant

Cette PR est au sommet de la pile #63 → #72 (base : fix/immediate-domain-check). Chaque commit est atomique et traite une seule issue.

Commit Issue Changement
ci: restore GitHub Actions validation #18 Annule 1891ea5. La CI avait été coupée à cause du blocage de facturation du compte personnel ; le dépôt appartient maintenant à l'organisation. Python 3.12 et Node 22.
fix(checker): negotiate TLS without StreamWriter.start_tls #97 start_tls n'existe qu'à partir de Python 3.11, et l'image était en 3.10 : tout le cron plantait. Une erreur inattendue ne bloque plus le lot.
security: remove internal domain inventory — backend/domains copy.txt était encore suivi sur cette lignée de branches.
ci: pin backend test dependencies… #18 requirements-dev.txt ; les tests tournent depuis la racine (import backend.*).
fix(api): allow PUT in CORS preflight #101
fix(alerts): include the occurrence in idempotency keys #100
fix(alerts): apply global notification settings… #99 La portée Organisation pilote les alertes planifiées.
feat(scheduler): run checks at the configured interval #98 Remplace sleep 86400.
fix(compose): stop mounting volumes over the application code #16 Le volume api_data:/app gardait l'ancien code à chaque rebuild.
fix(frontend): resolve the backend URL at runtime #102 Un route handler remplace les rewrites, figées au build.
security: stop shipping a seed domain list — Plus de domains.json / domains.txt embarqués dans l'image.
chore: license OpenCert under AGPL-3.0… #105
chore: rename the product to OpenCert #106
docs: align documentation with actual runtime behaviour #16 Reprend les critères de #104.

Vérifications

  • pytest : 24 tests passent sous Python 3.10 et 3.12. Les nouveaux tests couvrent l'échec TLS, le timeout TLS, l'erreur inattendue, le preflight CORS, les rappels successifs, les paramètres globaux, le chemin réel du cron et l'ordonnanceur. Le test des rappels échoue sans le correctif.
  • Frontend : lint, typecheck et build passent. Proxy testé à l'exécution : URL et jeton injectés, 502 si le backend est injoignable.
  • Stack docker-compose complète, sous un nom de projet isolé : le cron tourne chaque minute, github.com/google.com sont OK, expired.badssl.com donne certificat_invalide et wrong.host.badssl.com donne hostname_invalide. Le canal webhook des paramètres globaux est appliqué (dead_letter faute d'URL).

À savoir au déploiement

  • Le service cron doit lancer python scheduler.py, plus cron_job.py.
  • Avec docker-compose, les anciens volumes api_data / status_data ne servent plus et peuvent être supprimés. Les données sont dans postgres_data.
  • Les identifiants techniques ne changent pas : base ssl_monitor, en-têtes X-SSL-Monitor-*, noms des services Render/Railway.

Closes #97, closes #98, closes #99, closes #100, closes #101, closes #102, closes #105, closes #106, closes #16, closes #18

The workflow was removed because the personal account was locked for
billing. The repository now belongs to the OpenDefender organization.

Align CI and images on Python 3.12 (3.10 reaches end of life in
October 2026) and Node 22.

Refs #18

ci: restore GitHub Actions validation

The workflow had been removed because Actions could not run on the
personal account (billing lock). The repository now belongs to the
OpenDefender organization.

Also align CI and images on Python 3.12 (3.10 reaches end of life in
October 2026) and Node 22.

Refs #18
StreamWriter.start_tls only exists since Python 3.11; the backend image
ran 3.10, so every check crashed the cron with an AttributeError and
/api/status stayed empty.

Connect the socket first, then hand it to open_connection(ssl=...),
which keeps separate TCP and TLS timeouts on every supported Python.
Any unexpected exception now becomes an erreur_inattendue result
instead of aborting the whole batch.

Closes #97
The list of internal domains was still tracked on this branch line
although it had been removed from main (#37).
Tests import the backend package, which only resolves from the
repository root. httpx is pinned below 0.28, which the TestClient of
starlette 0.27 does not support.

Refs #18
Settings and alert policy updates use PUT, which the CORS middleware
rejected for cross-origin browsers.

Closes #101
Keys were derived from the certificate only, so successive reminders
for the same certificate shared a key and overwrote each other in the
notification log. Events now carry the time they were raised.

Closes #100
The settings screen saved threshold, channel, recipients and the
enabled switch, but only the test endpoint used them. Scheduled runs
now use the organization settings: they disable alerts globally,
provide the defaults for domains without their own policy and supply
the email recipients.

Closes #99
The cron container looped on a hard-coded 24 h sleep and ignored
check_interval_minutes. A scheduler now reads the interval from the
organization settings (then CHECK_INTERVAL_MINUTES, then 60), rereads
it every minute while waiting so a shorter interval applies at once,
and survives a failed run.

Closes #98
The api_data volume was mounted on /app in the API and cron containers.
Docker fills a named volume only on first creation, so every later
rebuild kept running the original code. Domains and statuses live in
PostgreSQL; the JSON status volumes are leftovers of the file store.

Refs #16
Next.js rewrites are compiled at build time, so BACKEND_API_URL set on
the deployed container was ignored and the app could call the wrong
API. A catch-all route handler now proxies /api/* to the URL read on
each request, adds the bearer token server side and answers 502 when
the backend is unreachable.

BACKEND_API_URL is the only frontend variable; .env.example drops the
unused API_URL and NEXT_PUBLIC_API_URL.

Closes #102
The image seeded every new installation with domains.json, which
included an internal domain; domains.txt was unused. New installations
now start empty. LEGACY_DOMAINS_FILE still imports a JSON list once
when it is set explicitly.
Align with OpenRisk and the OpenDefender suite: the Community Edition
is AGPL-3.0-only and OpenDefender can dual-license it. The repository
was public without any license. No file is Enterprise yet.

Closes #105
The repository moved to opendefender/OpenCert. Update the product name
in the UI, notification emails and documentation, and point repository
links to the new location.

Technical identifiers keep their names so existing installations keep
working: the ssl_monitor database, the theme storage key, the
X-SSL-Monitor-* webhook headers and the deployed Render/Railway service
names.

Closes #106
Document every environment variable per service, the scheduler and
how organization settings drive scheduled alerts, the production
requirements (APP_ENV, BACKEND_API_TOKEN, private API), the test
commands used by CI and the settings endpoints. Deployment guides now
start the scheduler instead of a one-shot cron_job.py, use Python 3.12
and pass DATABASE_URL to the worker.

Closes #16
Resolve conflicts with #63–#67 and #69:
- alerts: keep the scoped alert rules and add the occurrence and the
  global settings to them
- AddDomainModal: keep the bulk result panel and the keyboard dialog
- DashboardDisplay: keep the supervision console from #70
- docker-compose: no volume over /app; the scheduler gets its SMTP and
  webhook settings without an .env file
- frontend: no build-time BACKEND_API_URL, the URL is read at runtime
The import was lost while resolving a merge on main, so every
POST /api/domains/bulk failed with a NameError. Add an API test for
the endpoint.
@alex-dembele
alex-dembele changed the base branch from fix/immediate-domain-check to main October 29, 2026 17:54
@alex-dembele alex-dembele reopened this Oct 29, 2026
@alex-dembele
alex-dembele merged commit 047dc19 into main Oct 29, 2026
2 checks passed
@alex-dembele
alex-dembele deleted the fix/phase0-stabilization branch October 29, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment