oliver-zehentleitner / maity
deploy: one verify-backup script for the stop check and signature check both restore blocks repeat
tsk-akxh7zkf5xrx Open
Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication.
What is wrong: the database restore block in docs/install/README.md:465-485 and the attachments restore block in deploy/k3s-single/restore-attachments.yaml:21-41 (commented) share about 21 identical shell lines: the hub-stopped check, the MAITY_BACKUP_SIGNER fingerprint check, the NEWSIG count, VALIDSIG, revoked or expired key, notation name, and the MAITY_RESTORE_UNSIGNED switch. A fix to one has to be copied to the other by hand; the tests extract both blocks separately.
Proposal: one checked-in script (e.g. deploy/k3s-single/verify-backup.sh <ctx> <file>) that both blocks call, tested once. Keep "one block, stops at the first failure" for operators, and move the test extractors with it.
Effort / risk: M. Medium risk (operators copy and run these blocks).