cmd/api: handles Google OAuth and notifies the gateway over a local Unix socket.cmd/ssh-gateway: accepts user SSH sessions, waits for OAuth, lists owned VMs, and relays to the selected VM throughcmd/ns-proxy.cmd/ns-proxy: SOCKS5 transport inside the OpenStack tenant namespace.
Run rcp-server, ssh-gateway, and ns-proxy with the shared return group. Both Unix sockets are 0660, so group membership is required:
/run/rcp/ssh-gateway-notify.sock: API -> ssh-gateway/run/rcp/ns-proxy.sock: ssh-gateway -> ns-proxy
FRONTEND_URLorRCP_FRONTEND_BASE_URLRCP_VM_KNOWN_HOSTS_PATHorRCP_SSH_GW_KNOWN_HOSTS_PATHRCP_SSH_GW_NOTIFY_SOCKRCP_SSH_GW_NOTIFY_SECRET
If the notify envs are absent, normal web auth still works but SSH OAuth callback notification is disabled.
RCP_SSH_GW_NOTIFY_SECRETRCP_SSH_GW_AUTH_URL_BASERCP_SSH_GW_API_URL_BASERCP_SSH_GW_DB_PATHfor the API-owned SQLite database. UseDB_DSNonly for a manual gateway-specific database override.- OpenStack auth envs used by the existing provider client
RCP_SSH_GW_FIXED_NETWORKwhen VMs can have fixed IPs on more than one OpenStack networkRCP_SSH_GW_VM_USERSto change the default SSH login fallback order (ubuntu,rocky)
The gateway opens Ent without running schema migration. Schema ownership stays with the API process, so the API must start and complete migration before the gateway is exposed.
The gateway verifies inner VM SSH host keys with RCP_SSH_GW_KNOWN_HOSTS_PATH, defaulting to /etc/rcp/ssh-gateway/known_hosts. Missing or mismatched keys fail closed.
Register fixed-IP host keys before users connect:
ssh-keyscan 10.0.0.7 | sudo tee -a /etc/rcp/ssh-gateway/known_hosts
sudo chown return:return /etc/rcp/ssh-gateway/known_hosts
sudo chmod 0640 /etc/rcp/ssh-gateway/known_hosts- Install/update
server,ssh-gateway, andns-proxybinaries. - Install systemd units from
deploy/systemd/. - Populate
/etc/rcp/ssh-gateway.env. - Populate
/etc/cloudflared/config.yml. - Register VM host keys in the gateway known_hosts file.
- Restart in order:
ns-proxy,rcp-server,ssh-gateway,cloudflared.
Keep ssh-gateway and cloudflared behind the API restart on first deploys or schema-affecting deploys, because rcp-server owns Ent migrations and ssh-gateway opens the database without migration.
deploy-ssh-gateway.yml builds and installs the gateway binary and systemd unit. Cloudflared tunnel credentials and DNS routing remain a one-time host setup using deploy/cloudflared/config.yml.example.