5.2 Security and serving other machines
Gateway binds 127.0.0.1 by default, because two things are wide open to whoever can reach the port:
- the UI signs the local admin in without asking,
- and
/v1relays with the API keys stored here.
Both are exactly what you want from a local tool, and neither should be offered to a network.
Serving other machines anyway
Set httpaddr = 0.0.0.0 in conf/app.conf, and then do both of these:
- Change the admin password from My Account. The automatic sign-in stops at the first request that is not from this machine, so from then on the password is the only thing in the way.
- Send the relay token with every request to
/v1. Gateway generates one on first start and shows it under Settings → Security.
The environment snippets on the Providers and Agents pages already carry the token, and it is what Gateway writes into the configuration of an agent it switches. Requests from this machine never need it.
Keys at rest
apiKeyEncryptionKey, under Settings → Security, encrypts provider API keys in the database with AES-256-GCM. Set it before adding the providers whose keys you care about.
What never reaches storage in the first place:
- Request headers, which is where an inbound API key would be — they are not recorded at all.
- Anything credential-shaped in a recorded body, which is replaced before the record is written (4.2).
Network settings
Settings → Network:
| Field | What it is for |
|---|---|
| Outbound SOCKS5 proxy | Reach vendor endpoints through a proxy |
| Allowed hosts | Which Host headers Gateway answers to |
| Allowed origins | Which browser origins may call the API |
The last two matter once httpaddr is not loopback: a Gateway on a network should answer to the names you meant it to answer to.
Sign-in
Out of the box, sign-in is Gateway's own user table with the local admin auto-signed-in. Setting casdoorEndpoint switches the whole thing over to Casdoor, which brings SSO and OAuth logins with it (5.1).
What an agent gets, and what it does not
An agent routed through Gateway holds Gateway's relay token, never a vendor key. Revoking one agent's access is a Gateway-side change, not eight configuration file edits — and the Permissions page can narrow what that token is good for without touching the agent at all.
Next: 5.3 Backups and cloud sync.
5.1 Settings and configuration
Editing the file after that first start does nothing — except for the keys read before the database is open:
5.3 Backups and cloud sync
A backup is a snapshot of the configuration, written beside the database rather than inside it, so it survives the database it was taken from.