Docs · Reference

Files and environment.

osewa keeps its state in a few plain files under your home directory, the same layout on your machine and on the host. Nothing is system-wide, and nothing needs root.

Config: ~/.config/osewa

Private: the directory must be mode 0700 and the files 0600, or osewa refuses to use them and says which chmod fixes it.

FileWhereWhat
client.keyyour machineThis device's Ed25519 private key.
hosts.jsonyour machineThe hosts you have logged in to, with their pinned keys.
server.keyhostThe host's Ed25519 private key.
deviceshostEnrolled devices, one JSON line each. Delete a line to revoke.
*.lockbothLock files for safe concurrent writes.

hosts.json

[
  {
    "name": "devbox",
    "addr": "devbox.example.com:7322",
    "server_key": "Qm9l…",
    "ssh": "me@devbox",
    "quic_port": 7322
  }
]

quic_port is filled in the first time the server tells the client it speaks QUIC, so the very first connection after login is WebSocket only. Editing addr by hand is fine; logging in again does the same.

On the host

PathWhat
~/.local/bin/osewaThe binary login and update install.
~/.local/state/osewa/server.logThe server's log, for a daemon or a macOS service.
~/.local/state/osewa/update.jsonWhen osewa last checked for a release, and what it found.
~/.config/osewa/settings.jsonSettings from osewa set.
$XDG_RUNTIME_DIR/osewa/Session sockets and server.pid. Without XDG_RUNTIME_DIR (macOS): ~/.local/state/osewa/run/.
~/.config/systemd/user/osewa.serviceThe Linux service.
~/Library/LaunchAgents/dev.osewa.server.plistThe macOS service.

Environment variables

VariableWhat it does
OSEWA_CONFIG_DIRUse this directory instead of ~/.config/osewa.
XDG_CONFIG_HOMEWhen set, config lives in $XDG_CONFIG_HOME/osewa, and the systemd unit under it.
OSEWA_RUN_DIRWhere session sockets and server.pid go.
XDG_STATE_HOMEWhen set, the log is $XDG_STATE_HOME/osewa/server.log.
OSEWA_CARRIERquic or ws to use only that carrier, instead of racing both. Handy for testing a firewall.
OSEWA_QUIC_CCQUIC congestion control: cubic (default), bbr or newreno.
OSEWA_DISTA directory of osewa-<os>-<arch> builds for login and update to send to hosts. A released osewa downloads its own release's build when there's none.
OSEWA_AUTO_UPDATEauto, ask or off, over osewa set auto-update.
OSEWA_RELEASESWhere releases are, instead of https://github.com/rjyo/osewa/releases: a mirror with the same layout.
OSEWA_TRACEA directory to write JSON-lines traces to, for debugging.
OSEWA_HOMEOn the host: an absolute path to use as sessions' home instead of the account's. For sandboxes and tests.

Sessions don't inherit the server's environment. They get HOME, USER, LOGNAME, SHELL and PATH from the account, the locale (LANG, LC_*) and TZ, and TERM=xterm-256color. Variables starting with OSEWA_ are never passed in.