Commit bfdfe5b
committed
feat(updates): implement production-ready update system with security and reliability features
Upgrade the software update subsystem from prototype to production-ready with
comprehensive integrity verification, automatic retry, and resume capabilities.
Security Enhancements:
- SHA256 checksum verification for all downloaded files
- File format validation (PE headers for Windows .exe)
- Source URL validation (GitHub-only)
- File permission hardening (chmod 0o600)
- Document security trade-offs (DOS header vs full PE validation)
Reliability Features:
- Resume interrupted downloads using HTTP Range headers
- Exponential backoff with jitter (3 retries, configurable)
- Automatic retry on network/filesystem errors
- Proper error classification and logging
New Capabilities:
- Direct wheel installation from GitHub release assets
- Automatic checksum discovery from multiple asset formats (SHA256SUMS, *.sha256, checksums.txt)
- Fallback to release notes for checksums
- Corporate proxy support via environment variables
Code Quality:
- Extract magic values to named constants (DOWNLOAD_BLOCK_SIZE, PE_MAGIC_BYTES)
- Replace generic exceptions with specific types
- Use contextlib.suppress() for optional operations
- Document non-cryptographic use of random.uniform() for timing jitter
Testing:
- Add checksum parsing tests for various release asset formats
- Update download tests to use allow_resume parameter
- All existing tests remain passing (70+ tests)
Documentation:
- Update ARCHITECTURE_1_software_update.md marking features as implemented
- Change 14 items from ❌ TODO to ✅ IMPLEMENTED
- Add Known Limitations section documenting security trade-offs
Closes: Security requirements for production deployment
Ref: ARCHITECTURE_1_software_update.md1 parent 57684c1 commit bfdfe5b
File tree
11 files changed
+2152
-248
lines changed- ardupilot_methodic_configurator
- tests
11 files changed
+2152
-248
lines changedLarge diffs are not rendered by default.
Large diffs are not rendered by default.
Lines changed: 27 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | | - | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
91 | 107 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
0 commit comments