Commit graph

8 commits

Author SHA1 Message Date
197d19d61e [ADD] vpn : cinq pilotes, secrets en coffre, diagnostic étagé
Le dépôt n'avait aucun moyen de monter un tunnel VPN ni de dire pourquoi il
refuse de monter. Cinq technologies libres, un pilote chacune, derrière un
`vpn.py` qui monte, démonte et diagnostique.

Ce qui n'est pas secret — hôte, utilisateur, routes, MTU — vit dans une
configuration JSON lisible ; clés pré-partagées et mots de passe vivent dans
un coffre KeePassXC. Un profil se montre et se partage sans donner de quoi
monter le tunnel. Les secrets s'écrivent en tmpfs sous 0700, jamais sur un
disque persistant. Le diagnostic part du noyau et remonte, pour que la
première ligne fausse soit la cause et non une conséquence.
Vérifié : 138 tests, dont le rendu de chaque fichier généré.

--- EN ---

The repository had no way to raise a VPN tunnel, nor to say why one refuses
to come up. Five free technologies, one driver each, behind a `vpn.py` that
raises, tears down and diagnoses.

What is not secret — host, user, routes, MTU — lives in readable JSON
configuration; pre-shared keys and passwords live in a KeePassXC vault. A
profile can be shown and shared without handing over the means to raise the
tunnel. Secrets are written to tmpfs at 0700, never to a persistent disk.
Diagnosis starts at the kernel and climbs, so the first false line is the
cause and not a consequence.
Checked: 138 tests, including the rendering of every generated file.

Assisted-by: Claude Opus 5
2026-09-04 03:42:49 +00:00
ae9463ebcb [FIX] kdbx : nommer le coffre avant que getpass ne pose sa question
L'invite de `getpass` part vers le terminal, la ligne qui nomme le coffre
vers la sortie standard — un TUBE dès qu'un menu nous lance. Sans vidage, les
deux ressortaient dans le désordre : « Mot de passe du coffre : Coffre
KeePass : <chemin> », la question avant ce dont elle parle.

Le bouchon de `print` des tests accepte désormais la signature complète de
`print` : sans `**k`, ajouter un `flush` au code testé faisait échouer six
tests sur une différence étrangère à ce qu'ils vérifient.

--- EN ---

The `getpass` prompt goes to the terminal, the line naming the vault to
standard output — a PIPE as soon as a menu launches us. Without a flush the
two came out in the wrong order: "Vault password: KeePass vault: <path>", the
question before what it is about.

The tests' `print` stub now accepts the full signature of `print`: without
`**k`, adding a `flush` to the code under test failed six tests over a
difference foreign to what they check.

Assisted-by: Claude Opus 5
2026-09-04 03:42:18 +00:00
cedf702226 [FIX] kdbx : ouvrir le coffre sans tkinter, donc sur un serveur
Sur une machine sans tkinter — tout serveur — `get_kdbx()` rendait None en
journalisant « pykeepass is not installed », alors que pykeepass était là.
Les deux imports partageaient un seul `try` : l'absence de tkinter mettait
aussi `PyKeePass` à None, et le coffre restait inouvrable même avec chemin et
mot de passe configurés.

tkinter ne sert qu'au sélecteur de fichier, quand aucun chemin n'est
configuré ; deux blocs séparés le rendent à ce seul rôle.

--- EN ---

On a machine without tkinter — every server — `get_kdbx()` returned None
while logging "pykeepass is not installed", though pykeepass was present.
Both imports shared one `try`: a missing tkinter set `PyKeePass` to None as
well, and the vault stayed unopenable even with path and password configured.

tkinter serves only the file picker, when no path is configured; two separate
blocks give it back that single role.

Assisted-by: Claude Opus 5
2026-09-04 03:42:00 +00:00
3f97b0a49c [FIX] security: the KeePass password leaves the command line too
Same exposure as the master password, same fix. kdbx_manager put the Odoo
password straight into the web_login command; /proc/<pid>/cmdline is
readable by every user on the machine, and no downstream filter reaches
that.

The command now carries the NAME of an environment variable, never the
value. One name per entry, because several credentials go out in a single
"parallel" call and a single variable could not tell them apart.
get_extra_command_user therefore returns (fragments, variables), and the
two call sites hand the variables to exec_command_live, which already
merged an environment.

Two things found on the way. web_login re-sent config.default_password_auth
when it retried after dismissing a modal, ignoring whatever the caller had
passed -- the retry silently fell back to "admin". And install_forgejo
printed the admin password back to the terminal, hence into the install log
and any CI capture; its own header already documents the default.

A test pins the guarantee: the fragment must not contain the password.

--- FR ---

Même exposition que pour le mot de passe maître, même correctif.
kdbx_manager mettait le mot de passe Odoo directement dans la commande
web_login ; /proc/<pid>/cmdline est lisible par tout utilisateur de la
machine, et aucun filtre en aval ne l'atteint.

La commande porte désormais le NOM d'une variable d'environnement, jamais
la valeur. Un nom par entrée, car plusieurs identifiants partent dans un
seul appel « parallel » et une variable unique ne saurait les distinguer.
get_extra_command_user rend donc (fragments, variables), et les deux
appelants confient les variables à exec_command_live, qui fusionnait déjà
un environnement.

Deux trouvailles en chemin. web_login renvoyait config.default_password_auth
à la reprise après une modale, ignorant ce que l'appelant avait fourni — la
reprise retombait en silence sur « admin ». Et install_forgejo réaffichait
le mot de passe administrateur, donc dans le journal d'installation et
toute capture de CI ; son propre en-tête documente déjà le défaut.

Un test verrouille la garantie : le fragment ne doit pas porter le secret.

Assisted-by: Claude Opus 5
2026-08-23 02:11:50 -04:00
fd2e2ca7ef [FIX] todo: test menu, file browser and KeePass refusals
Four papercuts met while using the CLI: the test menu returned a verdict
nobody could find at the end of the output, the file browser never closed
once a file was picked, a wrong KeePass password killed the whole CLI, and
a configuration key had drifted from the code that reads it.

--- FR ---

Quatre irritants rencontrés à l'usage : le menu Test rendait un verdict
introuvable en fin de sortie, le navigateur de fichiers ne se fermait
jamais une fois le fichier choisi, un mauvais mot de passe KeePass tuait
tout le CLI, et une clé de configuration avait dérivé du code qui la lit.

Assisted-by: Claude Opus 5
2026-08-16 03:56:34 -04:00
1e731114f5 [IMP] script: update copyright year to 2026
Reflect the current year in all TechnoLibre
license headers across script/, test/, and docker/.

Generated by Claude Code 2.1.74 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 23:16:05 -04:00
2dde5467db [REF] script: add type hints and remove duplicate methods
Complete the manager extraction by removing methods from todo.py
that were already moved to database_manager.py (select_database,
restore_from_database, create_backup_from_database, open_file_image_db,
download_database_backup_cli). Add type annotations to manager
classes for better code clarity. Update tests to target the
manager instances directly.

Generated by Claude Code 2.1.72 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 03:25:43 -04:00
ec134d9299 [REF] script: extract managers from todo into modules
Reduce complexity of todo.py by extracting database,
kdbx, and version logic into dedicated manager classes.
Update tests to reference new module paths.

Generated by Claude Code 2.1.72 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 03:25:43 -04:00