> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gocopper.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Reference

Every configurable Copper package reads its own TOML table from your config files. All keys are optional; sensible defaults apply when a key, or the whole table, is missing. To learn how config files are loaded and layered, see [Configuration](/the-basics/configuration).

### Command-Line Flags

Every Copper binary accepts two flags:

| Flag      | Default             | Description                                                                                                                                           |
| --------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-config` | `./config/dev.toml` | Path to the config file                                                                                                                               |
| `-set`    | —                   | Inline overrides, e.g. `-set "chttp.port=5902"`. Values are parsed as TOML, so quote strings: `-set 'csql.dialect="pgx"'`. Separate multiple with `;` |

### \[chttp]

| Key                                      | Type   | Default | Description                                                                                           |
| ---------------------------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| `port`                                   | uint   | `7501`  | HTTP server port (`copper create` sets `5901` in generated config)                                    |
| `read_timeout_seconds`                   | uint   | `10`    | `http.Server` read timeout                                                                            |
| `use_local_html`                         | bool   | `false` | Read templates and static files from `./web` on disk instead of the embedded copies — for development |
| `render_html_error`                      | bool   | `false` | Render a detailed error page in the browser — for development                                         |
| `enable_single_page_routing`             | bool   | `false` | Serve `index.html` for all unmatched GET routes (SPA mode)                                            |
| `redirect_url_for_unauthorized_requests` | string | —       | Where `HTMLReaderWriter.Unauthorized` redirects; plain `401` if unset                                 |
| `base_path`                              | string | —       | Mount the app under a path prefix                                                                     |

### \[clogger]

| Key             | Type      | Default | Description                                           |
| --------------- | --------- | ------- | ----------------------------------------------------- |
| `out`           | string    | stdout  | File path for debug/info logs                         |
| `err`           | string    | stderr  | File path for warn/error logs                         |
| `format`        | string    | `plain` | `plain` or `json`                                     |
| `level_filter`  | \[]string | all     | Allow-list of levels to log, e.g. `["info", "error"]` |
| `redact_fields` | \[]string | —       | Tag field names to redact — JSON format only          |

### \[csql]

| Key                      | Type   | Default | Description                                         |
| ------------------------ | ------ | ------- | --------------------------------------------------- |
| `dialect`                | string | —       | `postgres`, `pgx`, `sqlite3`, or `mysql`            |
| `dsn`                    | string | —       | Database connection string                          |
| `max_open_connections`   | int    | `25`    | Connection pool: max open connections               |
| `max_idle_connections`   | int    | `25`    | Connection pool: max idle connections               |
| `conn_max_lifetime_mins` | int    | `5`     | Connection pool: max connection lifetime in minutes |

### \[csql.migrations]

| Key         | Type   | Default | Description                                                                    |
| ----------- | ------ | ------- | ------------------------------------------------------------------------------ |
| `direction` | string | `up`    | `up` applies all pending migrations; `down` rolls back one                     |
| `source`    | string | `embed` | `embed` reads migrations from the binary; `dir` reads `./migrations` from disk |

### \[aws]

Used by `cmailer`'s AWS SES backend. See [Sending Email](/digging-deeper/sending-email).

| Key                 | Type   | Default | Description           |
| ------------------- | ------ | ------- | --------------------- |
| `region`            | string | —       | AWS region            |
| `access_key_id`     | string | —       | AWS access key ID     |
| `secret_access_key` | string | —       | AWS secret access key |

### \[inertia]

| Key          | Type   | Default                  | Description                            |
| ------------ | ------ | ------------------------ | -------------------------------------- |
| `ssr`        | bool   | `false`                  | Render pages via an Inertia SSR server |
| `ssr_server` | string | `http://localhost:13714` | SSR server URL                         |

### \[vitejs]

| Key        | Type   | Default                 | Description                                   |
| ---------- | ------ | ----------------------- | --------------------------------------------- |
| `dev_mode` | bool   | `false`                 | Load assets from the Vite dev server with HMR |
| `host`     | string | `http://localhost:3000` | Vite dev server URL                           |

### \[cprometheus]

| Key            | Type   | Default             | Description                           |
| -------------- | ------ | ------------------- | ------------------------------------- |
| `http_enabled` | bool   | `false`             | Serve the Prometheus metrics endpoint |
| `http_path`    | string | `/internal/metrics` | Path for the metrics endpoint         |
