The app sends mail by SMTP submission (src/mail.rs, lettre over rustls
with the system's CA bundle, ring as reqwest): VISA_SMTP_HOST, _PORT
(465), _SECURITY (tls, starttls, or none for a server on this machine),
_USER and the password from VISA_SMTP_PASSWORD_FILE or the credential
smtp-password; VISA_MAIL_FROM defaults to "Lanna Desk <user>",
VISA_MAIL_REPLY_TO is optional. Without VISA_SMTP_HOST mail is off. The
settings are checked at start; the password stays out of Debug.
The Notifications page (Office) shows the sender, server and connection,
sends a test mail to the address given (offered again next time) and
shows the mail server's answer; every message sent or failed is logged
(notifications, migration 0011). Text messages say "not yet".
Tests: a fake SMTP server checks the envelope, Subject and Reply-To, a
refused recipient logged as failed, a bad address and mail switched off.
121 unit, 65 integration.
lannadesk.com is Lanna Desk's own static website (B4L/lannadesk-web,
cnx-network-clan PR #163, deployed), and this app is app.lannadesk.com.
The landing page the app served at `/` goes (templates/landing.html,
static/landing.css): `/` now redirects to the back office, /desk. The
logo files in static/brand/ stay, the website copies them.
The public URL in README, PLAN, config.rs, the agreement PDF's comment and
the release notes is app.lannadesk.com.
Checks: fmt, clippy, 109 unit and 57 integration tests (`/` leads to
/desk, signed in or not).
The header (staff pages, messages and the client link), page titles,
footer, messages, the pack's cover line and the PDFs' creator now say
Lanna Desk (lannadesk.com) instead of visa.buildfor.life. The company
named in the client's texts and agreements stays B4L. Nothing depends on
the name the app is reached under: VISA_PUBLIC_URL comes from the fleet,
which moves it to https://lannadesk.com and redirects visa.buildfor.life
there with the path, so links already sent keep working.
README, AGENTS, PLAN and the release notes name the new address.
Checks: fmt, clippy, 108 unit and 57 integration tests; the header at
360 and 390 px and on a desktop.
Asked for on November 19, 2026: the uploaded files land in an S3 bucket of
the fleet's Garage instead of a directory on cnx01, as the fleet's other
apps keep theirs. The app encrypts each file exactly as before (AES-256-GCM
under a key from HKDF, the document's id authenticated), so the bucket holds
the same VISADOC1 files and Garage never sees a key or a document in the
clear. Garage's SSE-C stays off: its key would come from the same secret.
src/s3.rs is a small S3 client on reqwest and ring, as in proplan: SigV4
(checked against AWS's two published examples), path-style PUT, GET, HEAD,
DELETE and ListObjectsV2 page by page, three attempts when the server is
away or busy. It asks before it writes, so no object is replaced; it sends
If-None-Match: * as well, which Garage 2.5 ignores (seen in tests/garage.rs).
The store (src/files.rs) keeps the files as documents/<id>.vdoc in the
bucket, or as <id>.vdoc in a directory for development and the tests. Its
calls are async now. VISA_S3_BUCKET, _ENDPOINT, _REGION and _ACCESS_KEY_ID
name the bucket, the secret comes from VISA_S3_SECRET_ACCESS_KEY_FILE or the
credential s3-secret; the bucket and a directory together are refused. At
the start the app checks the bucket in the background and only warns.
New commands: `visa files-migrate --from DIR` copies the files of a
directory into the store, each opened and compared with its upload before
and after, and may run again; `visa files-mirror --to DIR` makes a
directory hold exactly the bucket's files, still encrypted, for the
backups, and a restore is files-migrate from it.
Tests: an S3 server inside the test process that checks every request's
signature and pages its listings (tests/common/fake_s3.rs); uploads, views,
downloads and deletions through it, the check finding swapped, missing and
stray objects, the move from a directory (again, missing, other bytes,
damaged), the mirror and a restore from it, a busy server and a wrong key.
tests/garage.rs runs the store against Garage 2.5.0, the version cnx01 runs,
which scripts/dev-garage.sh starts in Docker; VISA_DEV_S3=1 scripts/dev.sh
runs the dev server on it. The 14 demo documents moved into it with
files-migrate and a browser upload landed there.
Scans and photos of a person's papers, and a company's documents for the
extension packs, uploaded on a dashed strip that takes dropped files: up to
10 files of 20 MB each, 64 MB in all; PDF, JPEG, PNG and WebP, told by their
first bytes.
- src/files.rs: one file per document as <id>.vdoc, AES-256-GCM under a key
per file (HKDF-SHA256 from the file key and a random salt in the header);
the document's id is authenticated with it. The key comes from
VISA_FILES_KEY_FILE or the credential files-key; with the login on, the
app does not start without it and VISA_FILES_DIR.
- migrations/0003: documents (a person's or a company's, the record it
belongs to, kind, date on it, note, file name, type, size, SHA-256);
audit_log gets company_id and the action download.
- A Documents tab per person, the documents on the company's page, and each
record's documents next to its Edit link with "+ Document".
- An upload's form token is its first field and is checked before any file
is read; the guard lets multipart through only to the two upload addresses.
- Files open under their own CSP and are never cached; a download is named
after the person or company, the kind and the date. Every upload, view,
download, change and deletion is in the audit log.
- visa files-check; demo documents in seed-demo; scripts/dev.sh keeps the
local documents and their key in .dev/; /favicon.ico for image and PDF
pages.
Tests: 57 unit and 33 integration (8 new for documents). Edge check of the
strip (choose, drop, too large), an upload, the PDF and image viewers under
the file policy: no problems, no console errors.
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.