A Forms tab on each person fills in TM.7, STM.2, STM.9, STM.11 and STM.1
for an extension of stay, TM.47 for a 90-day report and TM.8 for a re-entry
permit. The Bureau's blank pages (forms/, with their sources and checksums)
go unchanged into a new PDF, and the values are written on the dotted lines
in Sarabun; boxes are ticked and the title circled where a form asks.
scripts/gen_layout.py measures the blanks into src/papers/layout.rs.
The tab says what would stay blank and links to where it is added. What only
the application says (the date, the office, the reason, the days, a trip) is
carried in the links and never stored. The extension's five forms also come
in one PDF. Opening or downloading a form is audited as entity "form" with
the forms' codes, never their values.
Migration 0005 adds what STM.1 and STM.11 ask of the company (capital,
revenue, equity, staff, a coordinator), a work permit's salary and contract
dates, and where an arrival came from. The Nix package now takes forms/.
The fleet (cnx-network-clan, modules/visa) takes the server from this
flake: crane builds one binary with its templates, static files and
migrations compiled in. The tests need PostgreSQL, so the build runs
none; CI and the fleet's VM test cover them. Built against the
fleet's nixpkgs (Rust 1.95): 9.8 MB, closure 58 MB.
visa.buildfor.life keeps the immigration records of the foreigners B4L
looks after. This first phase is the base the deadlines and extension
packs build on (docs/PLAN.md, phases 2 to 7).
- One Rust binary (axum 0.8, minijinja, sqlx on PostgreSQL) with its
templates, static files and migrations compiled in.
- Login through Kanidm (OpenID Connect with PKCE and a nonce, ES256),
client visa-web, group visa; sessions in PostgreSQL keyed by the
SHA-256 of the cookie. VISA_INSECURE_NO_LOGIN=1 for loopback
development only.
- Same-site check and form token on every POST; a CSP without inline
script or style; security headers.
- People: list with filter, page, create, edit, archive, restore.
- Passports from the machine-readable zone with check digits (ICAO
9303 TD3); expiry warnings at 12 and 6 months.
- Addresses in Thailand in the order Thai forms use, with the house
master and the TM.30 receipt.
- Append-only audit log of every view and change, with the names of the
changed fields but never their values (PDPA); the Activity page.
- Invented demo people (visa seed-demo, refused when login is on).
- 40 tests: unit tests, pages with demo data, the forms, the audit log
and the whole login against a fake OpenID provider.
- CI: gitleaks over the history, fmt, clippy and the tests against
PostgreSQL 18; the pre-commit secret scan.