Commit Graph
26 Commits
Author SHA1 Message Date
rickyandClaude Opus 5.5 afaa1ca191 Records package: README explains viewing the data locally, links the source; includes viewer/docker-compose.yml
The viewer compose uses the published image (from docker-compose.image.yml)
and a throwaway secret key, plain HTTP on localhost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 07:05:43 -05:00
rickyandClaude Opus 5.5 2fe2f464c1 Docker examples use the published Docker Hub image
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:52:17 -05:00
rickyandClaude Opus 5.5 a6e5c4343f Docker: complete .env.example, image-based and Traefik compose examples, health checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:49:37 -05:00
rickyandClaude Opus 5.5 1412470cd5 Maintenance commands: doctor, records check, restore, sign out all, more
- sam:doctor: health report (secret key, address, HTTPS, SMTP and SSO
  reachable, Google Drive, migrations, disk, jobs, backup/check/off-site/
  procedures/audit recency); exits 1 on a failure
- records:check: backup now + history and signature check; exits 1 on a problem
- backups:list / backups:restore[file]: checks the copy (nightly or Drive
  .gz), refuses while the server runs, moves the current DB aside, asks
  (CONFIRM=yes to skip)
- users:sign_out_all, sam:records_package[tail], email:test[address],
  offsite:backup, offsite:restore_test
- Admin guide: maintenance commands table, restore steps use backups:restore

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:42:52 -05:00
rickyandClaude Opus 5.5 20fe485f10 Account recovery from the command line (bin/rails users:*)
list, reset_password (generated, shown once; unlocks and signs out),
sign_in_link (one-time, 15 min), unlock, reset_two_factor, enable,
disable, make_admin, create_admin. Logged; documented in the admin
guide and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:36:58 -05:00
rickyandClaude Opus 5.5 76643de2e7 Procedures: suggested text from the installation's settings; blanks block adoption
- Insert suggested text for Hosting and network (HTTPS, sign-in mode,
  password/lockout rules, Docker) and Additional procedures (common
  Part 91 procedures; electronic-records date filled in), with
  [bracketed] blanks for what only the owner knows
- A revision can't be adopted while a [blank] is left (Markdown links ok)
- Generated sections state HTTPS and the sign-in mode from the config

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:35:41 -05:00
rickyandClaude Opus 5.5 f2e4fd0beb Authentik reference: SSO, forward auth and the unauthenticated URL list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:22:44 -05:00
rickyandClaude Opus 5.5 14316bb60f Sign-in hardening: lockout, stronger passwords, authenticator codes
- 10 failed sign-ins in a row (password, authenticator code, or password
  at signing) lock an account for 15 minutes from any address; the user
  is emailed; admins can unlock. Same message as a wrong password.
- Passwords: at least 12 characters (max 72), refused if found in Have I
  Been Pwned (k-anonymity range API; fails open; PWNED_PASSWORDS_CHECK=false)
- Optional TOTP (authenticator app) with 10 recovery codes for password
  and emailed-link sign-in, and at signing (auth method password_totp);
  codes accepted once; admins can reset; SSO sign-in unaffected
- Demo/test passwords updated; guide, README and procedures document

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:17:56 -05:00
rickyandClaude Opus 5.5 a6bfe922be README: bring up to date (SSO is ported, stack, env vars, roles, features)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:53:58 -05:00
rickyandClaude Opus 5.5 7694719582 Off-site backup to Google Drive
- Admin → Off-site Backup: connect a Google account with your own OAuth
  client (drive.file scope; refresh token and secret encrypted)
- Nightly after the verified database backup: upload the gzipped snapshot
  (newest N kept, Settings) and every uploaded file not yet copied
- Restore test downloads the newest copy, opens and checks it, and checks
  sampled files against their checksums; failures emailed to admins
- About, procedures document, policy completeness and audits use it
- offsite:restore_files rake task; restore steps in the admin guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:51:45 -05:00
rickyandClaude Opus 5.5 fe3fba1736 User guide in docs/guide, shown in the app under Help
- 16 Markdown pages covering every area for pilots, owners, mechanics
  and admins, readable on GitHub
- /help renders them with a page list; links between pages work in both
  places; only listed pages can be opened
- The electronic records instructions (AC 120-78B user instructions) are
  now the guide's records page, also used as the procedures appendix
- Help link in the main menu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:40:09 -05:00
rickyandClaude Opus 5.5 761f381679 Recordkeeping procedures, QC audits and user instructions (AC 120-78B)
- Admin → Recordkeeping Procedures: generated procedures document
  (2.2.11 / 3.2.8) from the system setup plus owner-entered details;
  adopted as numbered, immutable revisions; included in the records package
- Admin → Records Audits: periodic QC checklist (3.2.8.5) combining app
  checks with a restore test, sampled entries vs. source documents and a
  user review; next due date on About and in admins' weekly reminder
- User instructions at /help/records, linked from the logbook and signing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:30:46 -05:00
rickyandClaude Opus 5.5 68a1719db2 Records integrity: history, nightly backup and check, records package
AC 120-78B chapter 3:
- Every change to logbook entries, sub-components, signatures, inspection
  records, AD compliance, major records, W&B, components, squawks and
  documents is kept as a RecordVersion (who, IP, when, field changes),
  hash-chained per aircraft; versions can't be edited or deleted. Shown on
  each logbook entry and in Activity -> Record history
- Nightly job: SQLite online-backup copy to storage/backups, verified
  (integrity_check + record counts), pruned to the configured number; then
  an integrity check of the history chains and every signature's seal and
  fingerprint. Results on Admin -> About ("Back up and check now"); admins
  are emailed on failure
- Software versions recorded (first/last seen) on Admin -> About
- Records package (Access & Sharing): logbook entries PDF with signatures,
  signatures.csv, record-history.csv, self-contained status report HTML,
  the .sam.zip, and a README, for the FAA/NTSB or a buyer
- Legacy (paper) records: documents can be marked as legacy records;
  aircraft have an "electronic records since" date (status report, package)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:21:26 -05:00
rickyandClaude Opus 5.5 d719f663bc Electronic signatures on logbook entries (AC 120-78B chapter 2)
- Sign an entry: review exactly what's certified, choose a current
  certificate (eligibility checked: pilot only for preventive maintenance,
  inspections need their result and time), re-enter the password or sign
  in again with SSO (prompt=login, within 5 minutes), and confirm the
  "Certified by" statement (43.9 return to service, 43.11(a)(5) for
  inspections, preventive maintenance for pilots)
- The signature stores signer, certificate, statement, UTC time, how they
  authenticated, IP/browser, a SHA-256 fingerprint of the entry's content
  and a readable snapshot; an HMAC seal covers the signature record. Status
  shows Valid / Superseded / Altered since signing. The signer is emailed
- Signed entries (and their sub-components) can't be edited or deleted;
  a correction entry, once signed, supersedes the original (kept)
- Owners invite an outside mechanic by email to sign one entry: one-time,
  14-day link; they create or use their own account and certificate and
  see only that entry
- Admins can disable accounts (signed out, can't sign in or sign; past
  signatures kept); users with signatures can't be deleted
- Printouts show the electronic signature and fingerprint; archives carry
  signatures (marked imported, with their origin) and corrections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:12:04 -05:00
rickyandClaude Opus 5.5 7caa213e7a Sub-components on logbook entries (e.g. the oil filter on the engine)
- Once a component is chosen, its sub-components are offered on the entry
  form (and the squawk Resolve page); ticked ones are saved with their
  total time and time since service, worked out from the airframe total
  time like the component's (editable; blank before it was installed)
- Entry page and printed PDFs list each sub-component with its serial
  number and times; parts without an overhaul type read "Since service"
- Archives carry them: the original format's list of components per entry
  (first = the entry's component, the rest = sub-components)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:54:49 -05:00
rickyandClaude Opus 5.5 72e1d7760f Editable logbook templates; component times follow the airframe time
- Templates move to the database (Admin -> Logbook templates: add, edit,
  delete, restore the built-in ones). The built-in preventive maintenance
  set is added once on first use; deletions stick. A template can set the
  entry type, logbook (picking the matching component) and certificate
- Template list shows "Name — Part 43 App. A (c)(6), (c)(23)" instead of
  the doubled parentheses
- Component total time and time since overhaul are worked out from the
  entry's airframe total time (current times shifted by the difference);
  blank when the entry predates the overhaul; typing them stops the
  automatic updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:40:23 -05:00
rickyandClaude Opus 5.5 a51f78ebf3 Logbook entries link a component and its times; boxed page printouts
- An entry can link a component (engine, propeller…) and records its total
  time and time since overhaul at the entry; picking the engine or prop log
  selects that component and fills its current times (editable). Squawk
  fixes carry the squawk's component
- Components have an overhaul type (major, factory overhaul, factory new),
  shown as SMOH / SFOH / SNEW
- Printouts: engine and propeller entries add the serial number, total
  time and SMOH/SFOH (blanks when no component is linked); airframe total
  time is labelled as such; full-page layouts draw a box around each entry
- Archives carry the entry's component and times (the original format's
  components / component_hours), no longer dropped on import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:19:44 -05:00
rickyandClaude Opus 5.5 5584ad59c5 Printable logbook entries (PDF) for the paper logbook
- Print one entry or several (tick them on the logbook list) as a PDF:
  Avery 5164/8164 or 5163/8163 adhesive labels (start at any label on a
  partly used sheet), or half-letter / letter pages
- Each entry has the aircraft and serial, log, date, total time in
  service, the work, the signer's name and certificate, and a blank line
  to sign by hand; inspection entries with a recorded result get the
  43.11(a)(5) statement unless the text already certifies
- Labels: long entries shrink to fit, then continue on the next label.
  Pages: entries follow one another with their signature lines, numbered
- Generated with Prawn (built-in fonts; unsupported characters become ?)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:59:58 -05:00
rickyandClaude Opus 5.5 6cab81332e Unverified transcriptions, PM templates, ICA inspections, W&B, AD watch
- Entries transcribed by Claude are unverified (with Claude's confidence)
  until an owner checks them against the scan: badge, filter, "mark
  verified" stepping through the rest
- Preventive maintenance templates on new logbook entries, keyed to Part 43
  Appendix A(c), setting the entry type and pilot certificate (43.3(g))
- An STC's ICA can become a tracked recurring inspection, linked from its
  major record
- Weight & balance: history of empty weight/CG (linked to the 337 that
  changed them), loading stations and CG envelope from the POH, and a live
  calculator for takeoff and landing weight/CG; shown on the status report
- New ADs: weekly Federal Register search per aircraft (aircraft, engine
  and propeller models, or custom terms); track or dismiss each; included
  in the weekly reminder
- Archives carry the new records; brakeman: explicit params, reviewed
  About-page links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:49:29 -05:00
rickyandClaude Opus 5.5 61c3749793 Deferrals, expirations, standard inspections, reminders, squawk fixes
- Squawks: defer an inoperative item under 91.213(d) once each condition
  is confirmed (pilots may too); deferred items stop grounding and are
  listed for awareness. Resolving can record the fix as a logbook entry
  (43.9 fields) or link an existing one
- Expiration dates on components (ELT battery, 91.207(c)) and documents;
  new document types (registration, airworthiness certificate, insurance,
  radio license). Expired replacement-critical parts and an expired
  registration (91.203) ground; others warn; registration warns 90 days out
- Standard inspections: one click adds annual, 100-hour, 91.411, 91.413,
  ELT (91.207(d)) and VOR (91.171) checks with the right rules, skipping
  ones already tracked and linking annual to 100-hour
- Weekly Monday reminder email to owners when something needs attention;
  profile opt-out; admin "send me this week's reminder"
- README feature table updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:24:33 -05:00
rickyandClaude Opus 5.5 4f548f3874 Email test button and sign-in by emailed link
- Admin -> About: Email card (delivery, server, encryption, login name,
  From; never the password) and a "Send test email" button that sends
  immediately and shows the SMTP error if it fails
- SMTP: implicit TLS on port 465 (or SMTP_TLS=true), auth only with a
  username, 10-15 s timeouts
- "Email me a sign-in link": single-use (spent by any later sign-in via a
  monotonic users.last_signed_in_at), 15-minute expiry, confirm step so
  mail scanners can't use it up, same answer for unknown addresses, rate
  limited, off when PASSWORD_LOGIN=false
- Admin -> Users shows last sign-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 09:27:57 -05:00
rickyandClaude Opus 5.5 ac4da93aaf Security hardening and OpenID Connect single sign-on
- SSO via OmniAuth OpenID Connect (Authentik, Keycloak, …): link by stable
  subject, by verified email, or from the profile; optional auto-create,
  admin-group sync, and turning password sign-in off
- Current password required to change email or password; password changes
  and resets sign out other sessions; idle sessions expire after 30 days;
  "sign out everywhere else"; session reset on sign-in
- Rate-limit password resets; scope squawk components to the aircraft
- Strict Content Security Policy with nonces (inline handlers removed),
  Permissions-Policy and COOP headers; file links expire after an hour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 08:38:25 -05:00
rickyandClaude Opus 5.5 1c6c2f88c0 Blackstone oil analysis, .sam.zip export/import, AI logbook transcription
- Oil analysis: Blackstone PDF import (20 elements, oil properties, universal
  averages), results stored per element, oil type, "leave out of trends",
  the original app's statuses; AvLab fixes (multi-line comments, unrelated
  labels no longer steal values). Existing records migrate.
- Aircraft archives in the original app's .sam.zip format (schema v2): export
  from Access & Sharing, background import from the Fleet page, rake tasks.
  Archives move both ways between this app and the original.
- Scanned logbook pages (images or PDFs) upload as a document; with
  ANTHROPIC_API_KEY set, Claude transcribes them into logbook entries.
- Fix: deleting a component or aircraft failed when AD compliances or
  inspection records pointed at a component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 21:05:19 -05:00
rickyandClaude Opus 5.5 b75fd7cf62 Import ADs from FAA DRS exports; N/A determinations and DRS links
AD import (owners, ADs tab → Import from FAA DRS):
- Upload a DRS export (.xlsx recommended, .csv works), preview, confirm.
- Per AD: track, not applicable, or skip, with suggestions and flags for
  superseded/non-current ADs, model mismatches, appliance and STC-only
  ADs, repetitive actions, and older ADs this one supersedes.
- ADs are matched by number; re-importing updates existing ADs from the
  FAA data (preview lists what will change) without touching compliance
  records, recurrence or applicability. Superseded tracked ADs are
  updated and flagged rather than skipped.
- DRS's Excel export hyperlinks each AD number to its DRS page; those
  links are kept (http(s) only). DRS ids aren't derivable from the AD
  number, so no links are guessed.

Also:
- Per-aircraft "not applicable" AD determinations (N/A badge, quick
  action, excluded from airworthiness).
- AD numbers link to their DRS document in the AD list, compliance
  history (now with description, logbook/inspection links) and share page.
- Saved DRS search link per aircraft with an "Open in DRS" button.
- Upload storage extracted to a StoredUpload concern shared with the
  flight import.
- document_url / drs_search_url added in their own guarded migration
  (they were briefly in an already-applied migration).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 18:35:38 -05:00
rickyandClaude Opus 5.5 4d3dc7150a Add spreadsheet flight import; fix oil/fuel consumption charts
Flight import (owners, Flights tab → Import from spreadsheet):
- Upload .xlsx or .csv, preview, then confirm. Columns are matched by
  header name (Date, From, To, Tach, Hobbs, Oil, Fuel, Flight Time).
- Each flight's time is derived from the previous row's meter reading;
  rows are kept in file order so typos (tach going backwards) are
  flagged and skipped while the next good row absorbs the time.
- Unchanged tach imports as a 0.0 hr entry so fuel/oil isn't lost;
  "Full" fuel is warned about; re-imports skip existing rows.
- History only: component hours are untouched unless the owner opts in
  to advancing the aircraft's meters to the last reading.
- Upload redirects to a GET preview (Turbo ignores 200 renders after a
  form POST, which made the button appear to do nothing).

Consumption charts:
- Replace per-fill math (qty ÷ hours since last add), which spiked to
  80 gal/hr on partial fills and top-offs, with a rolling rate (total
  added ÷ hours over a trailing 10 h fuel / 25 h oil window).
- Headline shows recent (last ~50/100 hrs) and lifetime rates; straight
  chart lines instead of splines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:23:47 -05:00
rickyandClaude Opus 5.5 38df19c331 Initial commit: Rails port of Simple Aircraft Manager
Rails 8.1 + SQLite rewrite of marbindrakon/simple-aircraft-manager,
designed to self-host as a single container (Solid Queue/Cache/Cable,
Active Storage on disk, Hotwire + importmap, Tailwind).

- Airworthiness engine ported from health/services.py (ADs, grounding
  squawks, inspection recurrency, component replacement)
- Hours updates and flight logs cascading to in-service components,
  optional airworthiness enforcement
- Components, squawks, ADs, inspections, logbook, documents, major
  records, oil/fuel consumption stats and charts, activity log
- Admin/owner/pilot RBAC and public share links (status/maintenance)
- Docker Compose and Kamal deployment, env-driven production config
- Service and integration tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 17:59:08 -05:00