Skip to content

Restructure the repository and document the system - #1

Merged
FARADTechnologies merged 6 commits into
mainfrom
repo-restructure
Aug 15, 2026
Merged

FARADTechnologies merged 6 commits into
mainfrom
repo-restructure

Conversation

@FARADTechnologies

Copy link
Copy Markdown
Owner

What this changes

The repository was eight files in the root with a three-line README. This groups the sources by role, adds the documentation the project never had, and sets up a build and CI.

  • Sources moved into src/ (gui, reader, tools), deployment material into deploy/, configuration into config/. All moves are git mv, so file history is preserved.
  • Six documents under docs/: architecture, payment flow, hardware, deployment, security notes and roadmap.
  • README rewritten: what the terminal does, the closed-loop system it replaces, the hardware, how to build and deploy, and what is not finished.
  • CMake build for both C++ targets, pinned PyQt5 requirement, .gitignore.
  • Apache 2.0 licence, security policy, contribution guide, changelog.
  • CI: C++ build, Python syntax and ruff, shellcheck.
  • Issue and pull request templates.

idtech-expect is renamed to deploy/sudoers.d/busvalidator-reader.example and gains a dated security note explaining that a NOPASSWD rule pointing at an expect script is effectively root, how to harden it, and how a udev rule removes the need for it. The rule itself is unchanged.

No behaviour changes. Every source file is byte-identical to what was on main.

How it was tested

  • Built locally (cmake -B build && cmake --build build)
  • Documentation only, nothing to test

CI steps were run locally before pushing: CMake build, python -m compileall, ruff check, and shellcheck --severity=error. All pass.

Checklist

  • No card number, key, token or production endpoint added to the repository
  • Documentation under docs/ updated
  • CHANGELOG.md updated

Files were sitting flat in the repository root. Group them by role so the
layout reflects how the system actually runs: the reader pipeline and the
kiosk UI are separate processes that talk over a FIFO.

  card_gui.py         -> src/gui/
  parse_card_data.cpp -> src/reader/
  run_ctls_read.exp   -> src/reader/
  fifo_writer.cpp     -> src/tools/
  start_all.sh        -> deploy/scripts/
  bus-kiosk.service   -> deploy/systemd/
  idtech-expect       -> deploy/sudoers.d/busvalidator-reader.example

The sudoers fragment kept a name that said nothing about what it was.
Nothing described how to build the two C++ targets or which PyQt5 version the
interface expects, so both had to be rediscovered on every fresh device.

validator.env.example lists every path, account and endpoint the system
depends on. The prototype still has these compiled in; the file documents them
now and becomes the source of them later.

The ignore rules cover validator.env itself, which names the production
endpoint and must never be committed.
Six documents covering what was previously only in the author's head:

  ARCHITECTURE     why three processes and a FIFO rather than one program
  PAYMENT_FLOW     EMV tag parsing, the offline queue, the FIFO protocol
  HARDWARE         the bill of materials, and why each sensor was chosen
                   over the alternatives that were evaluated
  DEPLOYMENT       a fresh Pi to a running unit, with a troubleshooting table
  SECURITY_NOTES   the gaps in this build, stated with their fixes
  ROADMAP          what is next, in dependency order

SECURITY_NOTES is deliberate. The build logs an unmasked pan, shells out to
curl with card-derived data, and runs the reader under a sudo rule that is
root in practice. Undocumented, those are traps for whoever deploys this
next.
CI builds both C++ targets, syntax-checks the Python and runs shellcheck.

PyQt5 is not installed on the runner: the interface needs a display and the
packaged Qt build, so importing it there would only produce a failure that
says nothing about the change under test.

Shellcheck runs at error severity. The startup script carries one known
warning, SC2024, where a redirect on a sudo line is performed by the calling
user; that is tracked rather than silenced.

The issue templates ask for the reader and display model, since those are
where behaviour that does not reproduce usually comes from, and both warn
against pasting a real card number.
The README was a title and two screenshots. It now describes what the terminal
does, the closed-loop system it replaces, the hardware it runs on, how to build
and deploy it, and what is not finished.

The capability table marks each feature as implemented, in development,
planned or research, with a note that several subsystems are not yet published.
Claiming the unbuilt parts would not survive the first person who looked.

Apache 2.0 for the licence: it grants patent rights explicitly, terminates them
for anyone who sues over them, protects the project name, and requires anyone
who forks to say what they changed.

The sudoers fragment gains a security note explaining that a NOPASSWD rule
pointing at an expect script is effectively root, how to harden it, and how to
remove the need for it with a udev rule. The rule itself is unchanged; the note
is dated so it is clear it was written after the fact.
The LinkedIn link already carries it, and the README does not need to state it
twice.
@FARADTechnologies
FARADTechnologies merged commit cab6ceb into main Aug 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant