Configuration¶
router-hosts uses TOML configuration files for both server and client.
Server Configuration¶
Create server.toml:
[server]
listen_addr = "0.0.0.0:50051"
[tls]
cert_file = "/path/to/server.crt"
key_file = "/path/to/server.key"
ca_file = "/path/to/ca.crt"
[storage]
# SQLite (default)
database_url = "sqlite:///var/lib/router-hosts/hosts.db"
# PostgreSQL alternative
# database_url = "postgres://user:pass@localhost/router_hosts"
Start the server:
Client Configuration¶
The client looks for configuration in these locations (in order):
$XDG_CONFIG_HOME/router-hosts/client.toml~/.config/router-hosts/client.toml./client.toml
Create client.toml:
[client]
server_addr = "https://router-hosts.example.com:50051"
[tls]
cert_file = "/path/to/client.crt"
key_file = "/path/to/client.key"
ca_file = "/path/to/ca.crt"
See Configuration Reference for all options.