Files
openbot/remote
NBandClaude Opus 5 ed5964a526 feat: add app language setting with a Japanese catalog (#457)
* feat: add app language setting with a Japanese catalog

Add the i18n foundation the whole app can translate through, and the
Settings row that selects a language.

`packages/i18n` is a plain-TS catalog runtime shared by main and the
renderer. It has no external dependency: the main process has no Solid,
so a Solid-specific library cannot serve it, and the one that matches
`solid-js@2.0.0-rc.0` is itself a prerelease. Placeholder names are read
off the message literal by a template-literal type, so a call that
forgets an interpolation argument does not compile. Plural forms select
through `Intl.PluralRules`. English is both a catalog and the fallback,
so a key a catalog has not translated yet reads English rather than
disappearing.

The main process owns the setting, because it is the only part of the
app that survives a window being closed and a notification can fire
while no renderer exists to translate it. A change rebuilds the native
menu, which Electron cannot relabel in place, and is sent to every
window, so the Dynamic Island follows a choice made in the main window
although it has no Settings of its own. No restart.

The preference is a versioned JSON file in `userData`, written
atomically. A file that is missing, unreadable, or names a language this
build no longer ships reads as the system default: unlike the analytics
preference there is no safe direction to fall back to, and an unreadable
file must not leave the app with no language at all.

The picker offers only the languages a catalog exists for - system,
English and Japanese. Listing more would be a promise the build cannot
keep, because choosing one would leave the interface in English with no
way to tell why.

Translated so far: the two custom application-menu labels and the three
agent notification bodies. The rest of the main-process strings and the
renderer follow surface by surface.

The Japanese catalog is a first draft and needs a native-speaker review
before release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: address review findings on the app language setting

- Read the language preference back as the system default on every read
  error, not only a missing file. Startup awaits this read and has no
  recovery, so a rethrown EACCES would show the error box and quit.
- Serialize LanguageService.set, so two quick choices cannot persist or
  broadcast the older one.
- Choose plural forms by the language of the rendered text. A key that
  falls back to the English source no longer picks Japanese rules.
- Give the renderer i18n context a value outside its provider, so a
  component rendered alone in a test or a story still draws.
- Copy packages/i18n/package.json in the Signal API image, which installs
  with a frozen lockfile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: bundle the i18n package into main and settle language changes in order

Adding @openbot/i18n to the dependencies made externalizeDepsPlugin leave
it external, so Electron loaded the package source at runtime and the app
did not start. Exclude it, as the other workspace sources already are.

Also keep the renderer on the last confirmed language when a write fails,
rather than on an earlier optimistic choice, and ignore a value from main
while a newer choice is still in flight.

Verified in the isolated dev app: choosing 日本語 turns the Settings row at
once, writes {"version":1,"language":"ja"} with mode 0600, survives a
restart, and switches back to English.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: translate the Settings window and the provider list

The language row turned Japanese while everything beside it stayed
English. These are the first screens to follow the setting: the Settings
shell, its General tab, and the provider rows shared with onboarding.

Separate a provider action from its label: the click handler branched on
the word on the button, which is only "Cancel" in English. It now branches
on an identifier and translates where it draws.

Add AppTextKey for a key whose message takes no placeholders, so a list
that holds keys - a tab, an action - can be translated where it is drawn.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: declare the document language and reach the language row through its tab

A screen reader takes the voice for a control from the nearest lang, and
index.html declares English for good. The document now follows the chosen
locale, so Japanese text is read with a Japanese voice.

The settings test opened the language selector while the Updates tab was
in front. The General panel is hidden by CSS, which jsdom does not apply,
so the test reached a control a reader cannot see. It returns to General
first, as a user does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:44:28 +02:00
..

OpenBot Remote

This directory holds our own control plane for WebRTC connections. The Remote API relays SDP and ICE only. Files, chats, commands and video never pass through the Remote API or Cloudflare.

Flow

  1. The app signs the user in through the Cloudflare API.
  2. Cloudflare D1 checks membership and creates a logical session.
  3. Cloudflare signs a short ES256 ticket. The ticket names the host, the user, the role, the protocol version and authEpoch.
  4. The client and the host open WSS /v1/signal. Signal validates the ticket locally through JWKS.
  5. Signal relays SDP and ICE and issues a resume token along with time-limited coturn credentials.
  6. Chromium sets up WebRTC. The Team API uses the rpc, events and files channels.
  7. ICE picks either a direct p2p path or relay through this coturn. Cloudflare is never on the data path.

Signal has no database. It stores no tokens, SDP, ICE, file names or message contents. Room and presence data exist only in process memory.

A resume token is valid for 10 minutes. Signal keeps the issued token in a bounded in-memory cache. A normal reconnect validates that token locally. After a Signal restart the cache is empty, so the first reconnect for a given token makes one signed request to the control plane. The same request is needed once the token has expired. The control plane checks the session, the membership and authEpoch. Signal then issues a new token. Subsequent reconnects are local again. There are no heartbeats and no periodic refresh through Cloudflare.

Ending a session and changing access both write a revocation event to a durable D1 outbox. The Worker tries to deliver it to Signal immediately. If Signal is unreachable, the Worker retries the delivery from cron. An ordinary reconnect still does not ask Cloudflare. Ended and expired sessions are removed after the 10-minute validation window.

Production requirements

  • Linux with Docker Engine and Docker Compose.
  • A static public IPv4 address.
  • signal.openbot.run and turn.openbot.run records in DNS only mode.
  • Open ports TCP 443, TCP/UDP 3478, TCP 5349 and UDP 49152-65535.
  • A Cloudflare token scoped to DNS edit for the openbot.run zone.

The signal.openbot.run and turn.openbot.run records must be in DNS only mode. Do not enable the Cloudflare proxy for them. api.openbot.run stays a Cloudflare Worker.

If you already run a reverse proxy on port 443, set REMOTE_SIGNAL_BIND_ADDRESS=127.0.0.1, REMOTE_SIGNAL_PUBLIC_PORT=8081, REMOTE_SIGNAL_PORT=8081 and REMOTE_TLS_DISABLED=true. The reverse proxy must terminate TLS and forward the WebSocket to http://127.0.0.1:8081. Also set REMOTE_TRUST_PROXY=true so the IP limits use the client address from X-Forwarded-For.

The configuration in nginx/signal.openbot.run.conf uses the certificate from the ACME volume. Install openbot-remote-nginx-reload.path and openbot-remote-nginx-reload.service into /etc/systemd/system/ as well. The unit reloads Nginx after the certificate is renewed:

sudo cp remote/nginx/openbot-remote-nginx-reload.* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now openbot-remote-nginx-reload.path

Production secrets are stored in the tracked .env.production file as encrypted Dotenvx values. The private decryption key lives only in the ignored remote/.env.keys file. Do not pass the encrypted file straight to docker compose --env-file, because Compose will not decrypt the values. The remote:* scripts run Compose through Dotenvx and decrypt the values only in process memory. The --overload option keeps empty host environment variables from overriding the decrypted values. The scripts use remote/bin/dotenvx. The wrapper picks the pinned Node from the application runtime if the system Node is too old.

Validate the environment and start the services:

bun run remote:env:validate
bun run remote:up
bun run remote:check

Updating Signal may close the WebSocket. An active WebRTC connection stays up. remote:update puts coturn into drain and waits for the allocations to finish. A single coturn instance is no protection against machine failure. Forcing a coturn restart ends active relay sessions. The client performs an ICE restart and resumes a file transfer from the last acknowledged offset once the service is back.

Current hosts advertise multiplex: true and support independent device sessions at the same time. Reconnecting one session replaces only that session's Signal socket. Disconnecting or revoking one device must not end another device's session. Legacy hosts that omit multiplex keep the one-client limit: a second session receives host_busy without interrupting the first.

See the issue #325 deployment procedure for the production evidence, a Signal-only update, rollback commands, and the required desktop/mobile checks.