Commit Graph

20 Commits

Author SHA1 Message Date
Vlad Doloman
f0db11597a fix: populate cert form email from index.txt emailAddress field on reissue
_parse_index_line now extracts the emailAddress segment from the DN
alongside CN, returning a (cn, expiry, email) triple. CertInfo gains an
email field populated by both load functions.

In _main(), RENEW_SELECTED falls back to cert.email when the metadata
store has no entry for the CN — so certs created outside this tool (or
before the metadata store existed) pre-fill the email field correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 12:33:25 +03:00
Vlad Doloman
eb47e1262f fix: address 7 consistency findings from code review
- Counter overflow: drop len==2 guard in build_ovpn so suffixes grow
  naturally beyond _99 instead of silently resetting to _00
- TOGGLE_ALL: preserve checked set and cursor across A-key view switches
  by threading saved_checked/saved_cursor through ScreenResult and back
  into show_main_screen on the next call
- CLI Cryptgeon fallback: skip email/eml when Cryptgeon fails instead of
  embedding the raw plaintext password in the email body
- --show-eml silent skip: warn explicitly when --show-eml is requested
  but no email address is available
- URL truncation: show full one-time URL in TUI confirmation dialog
- _fatal(): remove misleading alias; inline self._error() + return at the
  sole call site so termination is explicit
- argparse: replace store_true/store_false with store_const for the
  three-state --send-email / --no-send-email / neither pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 11:40:11 +03:00
Vlad Doloman
6e4be8965d feat: add two-digit counter suffix to vpn-configs dir (CN_YYYY-MM-DD_NN) 2026-06-24 03:25:42 +03:00
Vlad Doloman
006cedebbe feat: --show-eml outputs base64-encoded .eml; implies --no-send-email by default 2026-06-24 03:02:38 +03:00
Vlad Doloman
996000c5ae feat: --send-email / --no-send-email flag for CLI mode 2026-06-24 02:54:48 +03:00
Vlad Doloman
ceaf24414a feat: CLI mode (--create, --reissue, --revoke, --gen-crl) 2026-06-24 02:53:47 +03:00
Vlad Doloman
1222fb46a4 feat: toggle all-certs view with A key (load_all_certs, Action.TOGGLE_ALL) 2026-06-24 02:36:32 +03:00
Vlad Doloman
629095e0d8 fix: show explicit half-done warning when build-client-full fails after revoke
Split revoke_issued and build_client_full into separate try/except blocks.
When renewal is in progress and build-client-full fails after a successful
revoke, display an explicit warning that the old certificate has been revoked
but no new one was built, and advise re-running the renewal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:33:23 +03:00
Vlad Doloman
896ad2d19b fix: use form.confirmed (not .cancelled) in _process_cert 2026-06-24 00:25:15 +03:00
Vlad Doloman
1b2f4d2bdc feat: app orchestrator, entry point, CLAUDE.md — implementation complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:24:30 +03:00
Vlad Doloman
ca6fe9f525 feat: TUI main selection screen with checkboxes, menu items, revoke hotkey 2026-06-24 00:20:10 +03:00
Vlad Doloman
565a152243 fix: spec compliance for TUI DIALOGS section
- Rename CertFormResult.cancelled → confirmed (True=submit, False=cancel/Esc)
- Change _FORM_FIELDS from list to tuple
- Update _FORM_LABELS to exact values: CN, Email, Password
- Update _FORM_FIELD_Y to {cn:3, email:5, password:7}
- Add password param to show_cert_form (uses generate_password() if empty)
- Add mask=True to password InputField (both init and F5-regen sites)
- Add ord("Q") to show_confirm false-return condition
- Add KEY_UP/KEY_DOWN navigation in show_cert_form
- Add Ctrl-S (0x13) as immediate submit key in show_cert_form
- Update tests/test_dialogs.py: confirmed=True on submit, confirmed=False on cancel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:13:46 +03:00
Vlad Doloman
fefec14929 feat: TUI modal dialogs (confirm Y/N, cert detail form)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:07:38 +03:00
Vlad Doloman
3a6d6aa125 feat: TUI widget primitives (colors, InputField, draw helpers)
Implement COLOR_* constants, initialization, box/centered drawing,
clamp utility, and InputField with handle_key/value logic for pure
text editing without live curses. All tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:00:52 +03:00
Vlad Doloman
a2593b644e feat: MIME email composer with .ovpn attachment via msmtp/sendmail
Add send_email() function that composes multipart MIME messages with
template-based body and .ovpn file attachment, piped to mail binary via
subprocess.Popen. Supports Cryptgeon URL insertion and sender metadata.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 23:58:00 +03:00
Vlad Doloman
5b9ee8d448 feat: Cryptgeon client with AES-GCM client-side encryption
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 23:55:32 +03:00
Vlad Doloman
8a93a1a727 feat: metadata store (CN→email) and .ovpn config builder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 23:52:55 +03:00
Vlad Doloman
c93a7b0c00 feat: EasyRSA subprocess wrappers (revoke, build, gen-crl, copy-crl)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 23:50:59 +03:00
Vlad Doloman
941b3d3f5b feat: password generator with 28-char charset rules
Implements generate_password() function that produces 28-character passwords
following charset rules: position 1 uppercase, position 2 and last lowercase
with restricted characters, middle positions alphanumeric. Uses secrets module
for cryptographic randomness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 23:49:14 +03:00
Vlad Doloman
3618d3a73b feat: project skeleton + settings + PKI index.txt reader 2026-06-23 23:46:44 +03:00