Limits and improvements
What the project does not do yet, and how to improve it. Sorted by importance.
Security
| Limit | Risk | Improvement |
|---|---|---|
| The API has no authentication | anyone can create or delete products through api.trinity.jostud.com | DRF permissions (IsAuthenticated) + accounts, planned for the web part (702) |
| No secret scanning in the pipeline (gitleaks was planned) | a secret committed by mistake goes unnoticed | add a gitleaks job to the lint stage |
| No image scanning | a known flaw in a base image goes unnoticed | add Trivy after *:build |
| Django 4.2: support ended in April 2026 | no more security fixes | move to Django 5.2 (LTS) |
| Unpinned Python dependencies | two builds may install different versions | pin requirements.txt (pip freeze or pip-tools) |
Ansible connects with the personal eliashounnou account | depends on one person | a shared admin user, one key per person |
| SSH not hardened, no fail2ban (planned at first) | brute-force attacks on port 22 | Ansible role: key-only login, root forbidden, fail2ban |
Reliability
| Limit | Risk | Improvement |
|---|---|---|
| No database backup | data lost if the volume or the VM is lost | scheduled pg_dump, copied off the VM |
| A single machine per environment | if the VM goes down, the site goes down, even with two replicas | a second Swarm node |
| Dev does not use the prod images | an error specific to Dockerfile.prod is only seen in prod | also deploy api:<sha> and web:<sha> in dev |
removeProduct (web) does not catch errors | Next.js error page if the API refuses | return an error state, like addProduct |
| Delete without confirmation | accidental deletion | confirmation dialog |
| The web calls the API at its public address | needless round trip through the Internet and Traefik | API_URL=http://trinity_api:8000 on the trinity network |
Operations (the brief's bonuses)
| Bonus | Status | Improvement |
|---|---|---|
| Logs persisted across restarts | not done: logs live in the containers | log driver to a volume, or Loki |
| Load balancer | done: two replicas of api and web, spread by Traefik and Swarm's virtual address | more replicas, or a second node |
| Pipeline monitoring | not done: Datadog removed | Datadog CI Visibility, or GitLab's pipeline metrics |
| Failure notifications | not done | GitLab's Slack or e-mail integration |
Small debts
| Limit | Improvement |
|---|---|
| The Django admin has no styling in prod | WhiteNoise to serve staticfiles/ |
| Traefik routes are not deployed by the pipeline | a job re-running the Ansible role when infra/traefik/ changes |
| No automatic system updates | unattended-upgrades in the Ansible role |