diff --git a/.gitea/scripts/release.py b/.gitea/scripts/release.py index 03a7320..24ebbc6 100644 --- a/.gitea/scripts/release.py +++ b/.gitea/scripts/release.py @@ -230,7 +230,7 @@ def notes(tag, sha, files): ) head = f"Changes since {prev}:" if prev else "Commits in this first release:" held = ( - f"`{WEB}` holds the server `bin/visa`; cnx01 installs it as lannadesk.com only with " + f"`{WEB}` holds the server `bin/visa`; cnx01 installs it as app.lannadesk.com only with " "its signature beside it (`release/allowed-signers`)." ) return ( diff --git a/.gitea/scripts/test_release.py b/.gitea/scripts/test_release.py index 15eacf8..e1e8d8a 100644 --- a/.gitea/scripts/test_release.py +++ b/.gitea/scripts/test_release.py @@ -221,7 +221,7 @@ class ReleaseTest(unittest.TestCase): self.assertIn("Commits in this first release:", rel["body"]) self.assertIn("- first commit (", rel["body"]) self.assertIn(release.hashlib.sha256(b"web").hexdigest(), rel["body"]) - self.assertIn("cnx01 installs it as lannadesk.com only with its signature", rel["body"]) + self.assertIn("cnx01 installs it as app.lannadesk.com only with its signature", rel["body"]) self.assertIn("| `visa-linux-x86_64.tar.gz.sig` | the server's signature", rel["body"]) self.assertIn("November 16, 2026", rel["body"]) self.assertNotIn("ci-run", rel["body"]) diff --git a/README.md b/README.md index e829227..dcb4d70 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,10 @@ an agency whose staff see all records, so it can grow into the internal tool of the visa agency planned in `grabowski/julia`. [docs/PLAN.md](docs/PLAN.md) holds the decisions, the deadline rules, the data model and the phases. -`/` is lannadesk.com's public page: what Lanna Desk does, how a client -starts, and the contact address `contact@lannadesk.com`. The back office -starts at `/desk`, behind the sign-in. Signing out ends the session at +The app runs at https://app.lannadesk.com, the back office of Lanna Desk, +the legal side of buildfor.life. Lanna Desk's public website, lannadesk.com, +is a static site of its own (B4L/lannadesk-web). The back office starts at +`/desk`, behind the sign-in, and `/` leads there. Signing out ends the session at id.cnx.network as well (Kanidm's `/ui/logout`), so the next sign-in asks for the password again. The logo and its variants are in `static/brand/`, made by `scripts/gen_logo.py` from Sarabun (SIL Open Font License, in @@ -145,7 +146,7 @@ files or systemd credentials and never from a variable's value. | Variable | Meaning | | -------------------------------- | --------------------------------------------------------------- | | `VISA_LISTEN` | address to listen on, default `127.0.0.1:8040` | -| `VISA_PUBLIC_URL` | `https://lannadesk.com`, for the login's redirect | +| `VISA_PUBLIC_URL` | `https://app.lannadesk.com`, for the login's redirect | | `VISA_DATABASE_URL` | `postgres://visa@host/visa` | | `VISA_DATABASE_PASSWORD_FILE` | the role's password; else the credential `db-password` | | `VISA_OIDC_ISSUER` | `https://id.cnx.network/oauth2/openid/visa-web` | @@ -182,8 +183,8 @@ from that directory. Since November 17, 2026 the app runs on cnx01 in the office, like proplan and lampbench-web: the database `visa` on cnx01's PostgreSQL, the documents in the bucket `visa-documents` of cnx01's Garage, backups by borg, and bkk01 -publishing https://lannadesk.com (its first name, visa.buildfor.life, -redirects there with the path). Passport data stays on B4L's own +publishing https://app.lannadesk.com (its first name, visa.buildfor.life, +and its paths on lannadesk.com redirect there with the path). Passport data stays on B4L's own servers. The fleet's module is `modules/visa` in cnx-network-clan, with its runbook in `docs/src/visa.md` there. Only members of the Kanidm group `visa` get in; members are set in the fleet's `identity/people.nix`. @@ -202,8 +203,8 @@ fake provider, adds a person and checks the audit log on the real PostgreSQL module. Which commit runs: every page's footer names it, with a link to it, and -https://lannadesk.com/version answers with the full hash, without a -login, so `curl https://lannadesk.com/version` tells whether a release +https://app.lannadesk.com/version answers with the full hash, without a +login, so `curl https://app.lannadesk.com/version` tells whether a release is live, and `visa --version` prints the release and the commit. A Nix build takes the commit from the flake's source, CI from `VISA_COMMIT`, a build in a checkout from git. diff --git a/docs/PLAN.md b/docs/PLAN.md index bb2bea7..ba22045 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -14,7 +14,9 @@ > work and artists' contracts; visa.buildfor.life redirects there with the > path. The same day `/` became the public page with the logo, the back > office moved to `/desk`, and signing out ends the id.cnx.network session -> too. **Resume here: phase 8, reminders.** +> too. Later that day lannadesk.com became Lanna Desk's own static website +> (B4L/lannadesk-web, Astro), and the app moved to https://app.lannadesk.com; +> its `/` now leads to the back office. **Resume here: phase 8, reminders.** Lanna Desk keeps the immigration records of the foreigners that B4L looks after: their passports, addresses in Thailand, arrivals with the Thailand @@ -38,7 +40,7 @@ The first round of questions was answered on November 17, 2026. | Where it runs | cnx01, installed on the host like proplan and lampbench: database `visa` on cnx01's PostgreSQL, documents in its Garage, encrypted by the app, borg backups to juliet | | Releases (Nov 20) | as thukthuk and lampbench-web: every push to main that passes CI becomes a signed release (CalVer), which cnx01 fetches and restarts on within 15 minutes; no fleet PR per release | | Documents in Garage | bucket `visa-documents` on cnx01's Garage, 10 GB (Nov 19, 2026); the app encrypts each file before it leaves the app, so Garage holds no key; Garage's SSE-C is off | -| How it is published | bkk01 publishes `lannadesk.com` through a `modules/web-sites` app entry; `visa.buildfor.life` redirects there | +| How it is published | bkk01 publishes `app.lannadesk.com` through a `modules/web-sites` app entry; `visa.buildfor.life` and the app's paths on `lannadesk.com` redirect there | | Login | Kanidm at id.cnx.network, OAuth2 client `visa-web`, group `visa` with grabowski and oltmanns | | Who sees what | every member of `visa` sees and edits every record, as agency staff would; a view for clients comes later | | First extension pack | Non-B with a work permit, employer B4L, at Chiang Mai Immigration | diff --git a/src/agreements/pdf.rs b/src/agreements/pdf.rs index f9496cf..caabbee 100644 --- a/src/agreements/pdf.rs +++ b/src/agreements/pdf.rs @@ -42,7 +42,7 @@ pub struct Signed<'a> { pub record: &'a str, /// "Nov 20, 2026, 14:05 (Chiang Mai time)" pub at: &'a str, - /// "client link 12 at https://lannadesk.com" + /// "client link 12 at https://app.lannadesk.com" pub through: &'a str, pub ip: &'a str, pub user_agent: &'a str, diff --git a/src/config.rs b/src/config.rs index 8818771..9d5e2e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,7 +4,7 @@ //! | Variable | Meaning | //! | -------------------------------- | ------------------------------------------------ | //! | `VISA_LISTEN` | address to listen on, default 127.0.0.1:8040 | -//! | `VISA_PUBLIC_URL` | https://lannadesk.com (login redirects) | +//! | `VISA_PUBLIC_URL` | https://app.lannadesk.com (login redirects) | //! | `VISA_DATABASE_URL` | postgres://user@host/db | //! | `VISA_DATABASE_PASSWORD_FILE` | the role's password (else credential `db-password`) | //! | `VISA_OIDC_ISSUER` | https://id.cnx.network/oauth2/openid/visa-web | diff --git a/src/web/mod.rs b/src/web/mod.rs index d1525d6..a3c48d8 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -390,8 +390,9 @@ pub fn router(st: Arc) -> Router { .with_state(st) } -/// Paths open without a session: the public page at `/`, and the client's -/// pages (`/c/`, which check their link themselves) among them. +/// Paths open without a session: `/`, which leads to the back office, and the +/// client's pages (`/c/`, which check their link themselves) among +/// them. fn is_public(path: &str) -> bool { matches!( path, @@ -705,18 +706,10 @@ pub fn message( /// The back office's first page, the deadlines; `/` is the public page. pub const HOME: &str = "/desk"; -/// The address on the public page that people write to. -pub const CONTACT: &str = "contact@lannadesk.com"; - -/// lannadesk.com's public page: what Lanna Desk does and how to reach it, -/// with the way into the back office. Open without a session. -async fn landing(State(st): State>) -> Response { - render( - &st, - "landing.html", - context! { v => embedded::STATIC_HASH, home => HOME, contact => CONTACT }, - StatusCode::OK, - ) +/// `/` leads to the back office. Lanna Desk's public website is +/// lannadesk.com (B4L/lannadesk-web); this app is app.lannadesk.com. +async fn landing() -> Response { + Redirect::to(HOME).into_response() } pub fn not_found_page(st: &AppState) -> Response { diff --git a/static/landing.css b/static/landing.css deleted file mode 100644 index 60088e6..0000000 --- a/static/landing.css +++ /dev/null @@ -1,259 +0,0 @@ -/* lannadesk.com's public page: light, with the navy and gold of the app. - Only the landing page loads this file; the back office keeps app.css. */ -:root { - --navy: #071323; - --navy2: #0d2240; - --gold: #f5c000; - --gold-ink: #8a6700; - --ink: #1b2533; - --mute: #566273; - --line: #e3e7ee; - --paper: #f7f8fb; -} -* { - box-sizing: border-box; -} -html { - scroll-behavior: smooth; -} -body { - margin: 0; - color: var(--ink); - background: #ffffff; - font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif; -} -a { - color: var(--navy2); -} -.wrap { - max-width: 1080px; - margin: 0 auto; - padding-right: 24px; - padding-left: 24px; -} -.bar { - display: flex; - align-items: center; - gap: 18px; -} - -/* the navy header with the logo, the links and the first lines */ -.top { - background: radial-gradient(1200px 500px at 85% -10%, #163566 0%, var(--navy) 60%); - color: #e8edf5; -} -.top .bar { - justify-content: space-between; - padding-top: 22px; - padding-bottom: 22px; -} -.logo img { - display: block; - height: 44px; - width: auto; -} -.links { - display: flex; - align-items: center; - gap: 22px; - font-size: 15px; -} -.links a { - color: #c9d3e2; - text-decoration: none; -} -.links a:hover { - color: #ffffff; -} -.links .staff { - padding: 7px 14px; - border: 1px solid rgba(245, 192, 0, 0.55); - border-radius: 8px; - color: var(--gold); -} -.links .staff:hover { - background: rgba(245, 192, 0, 0.1); - color: var(--gold); -} -.hero { - padding-top: 64px; - padding-bottom: 88px; -} -.kicker { - margin: 0 0 14px; - color: var(--gold); - font-size: 13px; - font-weight: 700; - letter-spacing: 0.14em; - text-transform: uppercase; -} -h1 { - max-width: 760px; - text-wrap: balance; - margin: 0; - color: #ffffff; - font-size: clamp(32px, 5vw, 52px); - line-height: 1.12; - letter-spacing: -0.01em; -} -.lead { - max-width: 700px; - margin: 22px 0 0; - color: #c9d3e2; - font-size: 19px; -} -.cta { - margin: 34px 0 0; -} -.btn { - display: inline-block; - padding: 13px 22px; - border-radius: 10px; - background: var(--gold); - color: var(--navy); - font-weight: 700; - text-decoration: none; -} -.btn:hover { - background: #ffd23d; -} - -/* the sections */ -main section { - padding-top: 72px; - padding-bottom: 72px; -} -h2 { - margin: 0 0 28px; - color: var(--navy); - font-size: 30px; - line-height: 1.2; -} -h3 { - margin: 0 0 8px; - color: var(--navy); - font-size: 19px; -} -.grid { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 18px; -} -.card { - padding: 24px; - border: 1px solid var(--line); - border-top: 3px solid var(--gold); - border-radius: 12px; - background: #ffffff; -} -.card p { - margin: 0; - color: var(--mute); - font-size: 16px; -} -.band { - background: var(--paper); - border-top: 1px solid var(--line); - border-bottom: 1px solid var(--line); -} -.steps { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 28px; - margin: 0; - padding: 0; - list-style: none; - counter-reset: step; -} -.steps li { - position: relative; - padding-top: 52px; - color: var(--mute); - font-size: 16px; - counter-increment: step; -} -.steps li::before { - content: counter(step); - position: absolute; - top: 0; - left: 0; - width: 38px; - height: 38px; - border-radius: 50%; - background: var(--navy); - color: var(--gold); - font-weight: 800; - line-height: 38px; - text-align: center; -} -.steps b { - display: block; - margin-bottom: 4px; - color: var(--navy); - font-size: 18px; -} -.split { - display: grid; - grid-template-columns: 1.3fr 1fr; - gap: 56px; -} -.split p { - margin: 0 0 12px; -} -.muted { - color: var(--mute); - font-size: 15px; -} -.foot { - background: var(--navy); - color: #9ba8ba; - font-size: 14px; -} -.foot .bar { - padding-top: 22px; - padding-bottom: 22px; -} -.foot a { - margin-left: auto; - color: var(--gold); -} - -@media (max-width: 860px) { - .grid, - .steps { - grid-template-columns: 1fr 1fr; - } - .split { - grid-template-columns: 1fr; - gap: 8px; - } -} -@media (max-width: 620px) { - body { - font-size: 16px; - } - .links a:not(.staff) { - display: none; - } - .logo img { - height: 36px; - } - .hero { - padding-top: 36px; - padding-bottom: 56px; - } - .lead { - font-size: 17px; - } - .grid, - .steps { - grid-template-columns: 1fr; - } - main section { - padding-top: 48px; - padding-bottom: 48px; - } - h2 { - font-size: 25px; - } -} diff --git a/templates/landing.html b/templates/landing.html deleted file mode 100644 index d8ba34f..0000000 --- a/templates/landing.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - -Lanna Desk ยท Visas, work permits and contracts in Chiang Mai - - - - - -
- -
-

Chiang Mai, Northern Thailand

-

Visas, work permits and contracts for foreigners in Northern Thailand

-

Lanna Desk prepares and files the papers for people who live, work or perform here. We keep each client's passport, visa and deadlines in one record, fill in the Immigration Bureau's forms from it, and put together the pack you hand in at Chiang Mai Immigration.

-

Write to {{ contact }}

-
-
- -
-
-

What we take care of

-
-
-

Visas and extensions of stay

-

Non-immigrant visas for work, business, family and retirement, and the yearly extension of stay with every form, copy and photo the officer asks for, in the officer's order.

-
-
-

90-day reports and TM.30

-

We count the days from each entry and extension, file the report inside its window, and register your address with the landlord's TM.30 receipt.

-
-
-

Work permits

-

New permits, renewals and changes of employer, with the employer's certificates and tax returns that each application needs.

-
-
-

Artists and events

-

Work permits and visas for musicians and crews who come to play a show or a festival, and the contracts that go with a booking, from the offer to the signed copy.

-
-
-

Employers

-

Companies that hire foreigners get one place for their staff's papers: who needs what before which date, and the company documents each application uses.

-
-
-

Contracts and legal work

-

Agreements are signed online and kept as signed PDFs. We are adding legal advice and consultations with our lawyers; write to us if you need them now.

-
-
-
- -
-
-

How it works

-
    -
  1. Write to us. Tell us who you are, your visa now and what you need. We answer with what it takes, the documents and the cost.
  2. -
  3. Open your link. You get a personal link. You read and sign our agreement first, then enter your passport with your phone's camera, your address and your documents.
  4. -
  5. We keep the dates. From your record we work out each deadline, prepare the forms and copies for the next one, and tell you when to come.
  6. -
-
-
- -
-
-

Your data

-

Passports and records stay on B4L's own servers. Documents are encrypted before they are stored, and every view and change of a record is logged with the name of the person who made it. Only our staff sign in.

-
-
-

Contact

-

Email {{ contact }}, and tell us what you need and by when.

-

Lanna Desk is a service of B4L (buildfor.life) in Chiang Mai.

-
-
-
- - - - diff --git a/tests/auth.rs b/tests/auth.rs index 424e196..075c970 100644 --- a/tests/auth.rs +++ b/tests/auth.rs @@ -47,20 +47,10 @@ async fn the_gate_sends_people_to_the_login(pool: PgPool) { "{t}" ); assert!(t.contains("Sign out of id.cnx.network"), "{t}"); - // the public page is open; the back office behind it is not + // `/` leads to the back office, which asks for the sign-in; the public + // website is lannadesk.com, a site of its own let r = app.get("/").await; - assert_eq!(r.status, StatusCode::OK); - let t = r.text(); - assert!( - t.contains("Lanna Desk") && t.contains("mailto:contact@lannadesk.com"), - "{t}" - ); - assert!( - t.contains("href=\"/desk\" id=\"staff\">Staff sign-in"), - "{t}" - ); - assert!(!t.contains("Deadlines") && !t.contains("MUSTERMANN"), "{t}"); - assert_eq!(app.get("/static/landing.css").await.status, StatusCode::OK); + assert_eq!(r.location(), "/desk"); assert_eq!( app.get("/static/brand/lannadesk-logo-dark.svg") .await diff --git a/tests/pages.rs b/tests/pages.rs index 14fea32..d3eacdc 100644 --- a/tests/pages.rs +++ b/tests/pages.rs @@ -266,10 +266,8 @@ async fn open_paths_headers_and_not_found(pool: PgPool) { let r = app.get("/desk").await; assert_eq!(r.status, StatusCode::OK); assert!(r.text().contains("No people yet")); - // `/` is the public page, the same signed in or not - let r = app.get("/").await; - assert_eq!(r.status, StatusCode::OK); - assert!(r.text().contains("Visas, work permits and contracts")); + // `/` leads to the back office + assert_eq!(app.get("/").await.location(), "/desk"); let r = app.get("/people/999999").await; assert_eq!(r.status, StatusCode::NOT_FOUND);