5.1 Settings and configuration
Everything is optional. Settings are changed on the Settings page and stored in the database, so nothing has to be edited by hand and nothing has to be restarted.
The file and the page
conf/app.conf, next to the executable, seeds the settings on the very first start and explains each one. The one-step install has no file beside it and seeds from the copy baked into the binary instead.
Editing the file after that first start does nothing — except for the keys read before the database is open:
httpport, driverName, dataSourceName, dbName, redisEndpoint.
The settings people actually change
| Setting | Default | What it does |
|---|---|---|
httpport | 17000 | Port of the web UI and the REST API |
httpaddr | 127.0.0.1 | Interface the web UI binds to — 5.2 |
driverName / dataSourceName | sqlite / ./data/casbin-gateway.db | Where data is stored |
llmRecordMode | full | How much of each relayed request is kept — 4.2 |
providerProbeMode | auto | Whether providers are probed on their own, only when asked (manual), or never (off) — 3.4 |
apiKeyEncryptionKey | empty | Encrypts provider API keys at rest (AES-256-GCM) |
casdoorEndpoint | empty | Switches sign-in over to Casdoor SSO |
The Settings page, section by section
| Section | Holds |
|---|---|
| Startup | Whether Gateway starts when you log in. The tray menu's Start at Login is the same switch |
| LLM records | The recording mode and the limits around it — 4.2 |
| Channel probes | Probe mode and how long before a report goes stale — 3.4 |
| Agents | Agent state directory, how many agent records to keep, how often to poll a monitored agent |
| Sign-in | The five Casdoor fields; empty means Gateway's own user table |
| Security | apiKeyEncryptionKey and the relay token — 5.2 |
| Network | Outbound SOCKS5 proxy, allowed hosts, allowed origins |
| Backups | Snapshots of the configuration — 5.3 |
| Cloud sync | A copy of every backup, somewhere that is not this machine — 5.3 |
| Import and export | The configuration as one file, to move to another machine and read back |
Using MySQL instead of SQLite
XORM is used, so every database it supports works. Point Gateway at your server and it creates dbName on first start if it does not exist:
driverName = mysql
dataSourceName = root:123@tcp(localhost:3306)/
dbName = casbin_gatewayConnecting Casdoor
Casdoor is optional and takes over member management. Create an organization and an application for Gateway in a Casdoor instance, then fill in the five fields of Settings → Sign-in.
Sign-in redirects to Casdoor as soon as casdoorEndpoint is set, which also enables OAuth logins.
Checking the result instead of the file
The startup summary reports what Gateway is actually doing — which port, which database, which settings source, whether the relay needs a token (1.2).
4.3 Usage and model pricing
An agent on its own subscription relays nothing through Gateway, and a request that goes straight to the vendor leaves no record here — but the agent writes a transcript of it on disk anyway.
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: