Skip to main content

In development

Architecture

This page shows where oSUHA's sites and services run and how they connect. It covers the way in for visitors, the sites, sign-in, how a change goes live, and backups and monitoring.

For security, this page leaves out server addresses, ports, locations on the server, software versions, account names and exact times. Some private services are left out too.

Checked against the server and the source of its settings on 18 October 2026. How the public pages are served, and the App, were updated on 30 October.

From the entrance to each site

  1. Visitors

    Browsers and iPhones

  2. HTTPS

    Cloudflare

    Name lookup (DNS), delivery network (CDN), HTTPS

  3. HTTPS

    AWS EC2

    One server in the Tokyo region, running containers (Docker) and services on the host itself

    1. Caddy

      This server's way in for the web: certificates, security headers, compression, and routing by host name and path

      • osuha.com

        The live site

        • Public pages

          Home, Services, Projects, About, Members, Contact and this page. The generator draws them as static files, and the server returns them as they are

        • Static pages

          Personal space and works, Status, Financial Terminal, SNS, Account

        • Sign-in

          Kratos (sign-in and sessions) and userapi (each user's documents and AI, and the sign-in gate)

        • Drupal for editing

          A Drupal holding the project entries, for editing. Behind the sign-in, and not yet connected to the public pages

        • Interview Rehearsal

          Behind the sign-in

      • Trials and practice

        Set to stay out of search engines

        • stg.osuha.com

          Drupal practice (a shopping street's site)

        • 12.osuha.com

          Trying a CMS

        • t3.osuha.com

          Trying TYPO3

        • proto.osuha.com

          The first prototype (kept as an archive)

      • ctl.osuha.net

        Site control and visitor stats. A sign-in is needed

      • Redirects

        www.osuha.com goes to osuha.com. status.osuha.net goes to osuha.com's Status page (only its old status.json is still served there)

Figure 1A visitor's request flows from top to bottom. Below Caddy, each branch is where a host name (or a group of them) goes.
Public pages
The text lives in the settings repository (git). A generator prepares the words, and Astro with shadcn/ui draws the pages of all seven displays as static files. The server returns those files to visitors. Changes made to the text in Drupal do not appear on the public pages.
Static pages
Caddy serves, as it is, the HTML that build scripts in the repository make. Every page limits which scripts may run with a CSP.
Sign-in
Ory Kratos holds identities and sessions. userapi looks after each user's documents and AI jobs, and it is the gate in front of pages that need a sign-in. Neither is a container; both run on the host.
Drupal for editing
Visitors who have not signed in cannot reach it. After the gate, there is a second sign-in: Drupal's own.
What runs on the host
Sign-in (Kratos and userapi), site control, visitor stats, collecting status and market data on a schedule, and the daily backup.
Outside EC2
CanIRun.ai (canirun.osuha.net) runs on Vercel.

How a change goes live

  1. Mac

    SU HAO makes a change, signs it with SU HAO's own key and pushes it

  2. push

    GitHub

    The main branch of a private repository

    • GitHub Actions

      Seven checks. No key or secret for the live server is kept on GitHub

      • Project check

        The built pages match their source, and more

      • Secret scan

        The whole history

      • ShellCheck

        Shell scripts

      • actionlint

        How the workflows are written

      • zizmor

        The workflows' security

      • Trivy

        Known flaws in the public images the settings files name

      • axe

        Accessibility of chosen static pages (a report only)

  3. fetched by the server

    CD on the server

    Started on the server by SU HAO, for a version that SU HAO names

    1. Fetches main with a read-only key
    2. In a sandbox with no network, checks SU HAO's signature, and that it only moves forward
    3. Swaps the static pages it looks after in one step
    4. Checks set pages and headers, and goes back to the last version if a check fails
Figure 2A change to the static pages that the CD on the server looks after moves from top to bottom. GitHub only checks it and never touches the live site. The server fetches the change itself.
Where trust starts
On this path from GitHub, the server trusts only SU HAO's public key, which is kept on the server. Even if someone takes over the GitHub account, nothing without SU HAO's signature goes live this way.
Everything else
For now, the server fetches only the static pages itself. Drupal, Caddy's settings, sign-in and the Status page are deployed from the Mac over SSH. Caddy's settings are put back if they fail its check. Drupal and sign-in have steps for going back when something fails, but those do not put the databases back.

Backups and monitoring

  1. AWS EC2

    Every day, the databases, code and settings are packed. A database copy is checked before it is kept. Up to seven copies

  2. fetched by the Mac

    Mac

    Every day. Hashes, archives and databases are checked before a copy is kept. It keeps the latest seven, those from the last 30 days, and the last one of each of the 12 most recent months that have one

  3. the time it worked

    Status

    Shows a fault when the record of the last fetch that worked is too old or missing

Figure 3Backups are made on the server and fetched by the Mac. Nothing was built for the server to write to the Mac.
Status
Every minute, set endpoints and signs of each service are checked and the result is written down. The Status page, the status card on the home page and the Financial Terminal all read that one result.
The Financial Terminal's data
Public market data is collected, each kind at its own interval.
Visitor stats
Caddy's access log is counted. Before a line is written, the end of the IP address is hidden and the query string is removed. There are no tracking scripts or tracking cookies (only the cookies things need to work, such as the language chosen or a sign-in). The dashboard needs a sign-in.

What comes next

Headless Drupal (planned)
The plan: manage the osuha.com and osuha.net sites together with a headless Drupal. The public pages moved to static files on 30 October 2026. What is still to come: saving in Drupal and pressing Publish to build the pages and swap them in.
More of CD
After watching it for a while, SU HAO decides what starts it, and whether it covers more than the static pages.