# Configuring a host

> zaun-host.toml explained, section by section; relays, community creation, attachments, voice and bots.

The configuration is one TOML file: `<data dir>/zaun-host.toml`, or `--config F`, or
`$ZAUN_HOST_CONFIG`, or `/etc/zaun-host/zaun-host.toml`. **It holds no secrets and refuses
unknown keys**, so a secret pasted into it stops the host instead of being used. Restart the host
after editing it. Every key is listed in the [configuration reference](/docs/reference/configuration/).

## The basics

```toml
data_dir = "/var/lib/zaun-host"
smp_servers = []            # empty: the official SimpleX servers
xftp_servers = []           # file servers; see below
max_connections = 1000      # connected or connecting, before new requests are refused
community_creation = "closed"
log_level = "info"
```

The store passphrase comes from `simplex.key`, `$ZAUN_HOST_PASSPHRASE`, or a file named by
`passphrase_file` (for example a systemd credential), never from this file.

## Attachments

```toml
[attachments]
enabled = true
max_file_mb = 25           # largest file
community_quota_mb = 2048  # what one community may store
transfers = 8              # uploads and downloads at once, host-wide
```

Files travel through XFTP servers: the official ones when `smp_servers` is empty, otherwise list
your own in `xftp_servers`, or attachments are off. The host keeps every file under its data
directory and re-sends it for each download, so keep limits modest on shared machines.

## Voice

```toml
[voice]
enabled = true
mesh_max = 8              # participants per voice channel, up to 10
ice_servers = ["turn:turn.example.net:3478"]
ice_policy = "relay"      # media only through TURN, hiding participants' IP addresses
ice_credentials_file = "/run/credentials/zaun-host.service/turn.toml"
```

Audio never passes through the host: participants send it to each other, end-to-end encrypted.
The host only relays signalling and keys. List a TURN server and keep `ice_policy = "relay"` so
participants don't learn each other's addresses. TURN credentials live in their own file (mode
0600), never here.

## Bots

```toml
[bots]
enabled = true
allow_remote_install = true # community owners may install bots from their app
allow_unsigned = false      # development only
max_bots = 20               # per community
allow_network = false       # may any bot be granted internet access?
network_allow_list = []     # if set, granted hosts must be among these
max_memory_mb = 64
cpu_ms_per_call = 500
max_storage_mb = 64
allow_update_checks = false
allow_voice = true          # bots may be granted voice: join voice channels and play audio
allow_dms = true            # bots may be granted direct messages with members
# http_proxy = "socks5h://127.0.0.1:9050"   # send bots' requests through Tor
```

Every value is a **ceiling**: a community owner can grant a bot less, never more. A bot's internet
requests leave from the host, so they reveal the host's IP address to the server it contacts; keep
`allow_network = false` unless you need it, or route requests through a proxy. A bot in voice
streams through the host's own media relay; set `allow_voice = false` to keep bots out of voice
channels, and `allow_dms = false` to stop any bot from messaging members privately. See
[Installing bots on a host](/docs/guide/bots/installing/).
