# Settings keys

Runtime settings live in the `system_settings` table as JSON values, one row per key, and are edited in the admin area (not through environment variables, see [Configuration](configuration.md)). 36 keys are read or written by the code. Found by scanning `settings::get` / `settings::set` calls (consts resolved to their value), raw SQL on `system_settings`, and `*_KEY` consts of files that query the table directly.

| Key | Const | Description | Used in |
|---|---|---|---|
| `addon.mixins_disabled` | `KILL_KEY` |  | `crates/pelty-api/src/addon_events.rs` |
| `addons.registry` | `REGISTRY_KEY` |  | `crates/pelty-api/src/addons.rs` |
| `billing.add_funds` | `KEY` |  | `crates/pelty-database/src/add_funds.rs` |
| `billing.autopay` | `KEY` |  | `crates/pelty-database/src/autopay.rs` |
| `billing.bank_transfer` | `BANK_TRANSFER_KEY` |  | `crates/pelty-database/src/settings.rs` `crates/pelty-api/src/routes/settings.rs` |
| `billing.due_reminders` | `DUE_KEY` |  | `crates/pelty-database/src/invoice_tools.rs` |
| `billing.invoice_branding` | `KEY` |  | `crates/pelty-database/src/branding.rs` |
| `billing.on_demand_renewals` | `KEY` |  | `crates/pelty-api/src/routes/renewals.rs` |
| `billing.overdue` | `KEY` |  | `crates/pelty-database/src/overdue.rs` |
| `billing.proforma` | `PROFORMA_KEY` |  | `crates/pelty-database/src/invoices.rs` `crates/pelty-api/src/routes/admin_ops.rs` |
| `billing.reversal` | `REVERSAL_KEY` |  | `crates/pelty-api/src/routes/refunds.rs` |
| `billing.tax` | `TAX_KEY` |  | `crates/pelty-database/src/report_library.rs` `crates/pelty-database/src/tax.rs` |
| `custom_code` | `CODE_KEY` |  | `crates/pelty-database/src/general_settings.rs` |
| `domains.defaults` | `KEY` |  | `crates/pelty-database/src/domain_defaults.rs` |
| `domains.premium` | `PREMIUM_KEY` |  | `crates/pelty-database/src/domain_pricing.rs` |
| `domains.rdap_base` |  |  | `crates/pelty-api/src/routes/domains.rs` |
| `duo` | `KEY` |  | `crates/pelty-api/src/duo.rs` |
| `einvoice` | `KEY` |  | `crates/pelty-api/src/routes/einvoice.rs` |
| `email_templates_disabled` | `DISABLED_KEY` |  | `crates/pelty-api/src/mail.rs` |
| `fraud` | `KEY` |  | `crates/pelty-database/src/fraud.rs` |
| `general_settings` | `KEY` |  | `crates/pelty-database/src/general_settings.rs` |
| `kyc` | `SETTINGS_KEY` |  | `crates/pelty-database/src/kyc.rs` |
| `mail.smtp` | `KEY` |  | `crates/pelty-database/src/setup_wizard.rs` `crates/pelty-api/src/routes/smtp.rs` |
| `orders.approval` | `KEY` |  | `crates/pelty-database/src/order_approval.rs` |
| `registrant_verification_enabled` | `ENABLED_KEY` |  | `crates/pelty-api/src/registrant_verify.rs` |
| `security.captcha` | `SETTING_KEY` |  | `crates/pelty-api/src/captcha.rs` |
| `security.policy` | `SETTING_KEY` |  | `crates/pelty-auth/src/policy.rs` `crates/pelty-api/src/security.rs` |
| `security.staff_require_2fa` | `REQUIRE_2FA_KEY` |  | `crates/pelty-database/src/staff.rs` `crates/pelty-api/src/routes/staff.rs` |
| `security.trusted_proxies` | `KEY` |  | `crates/pelty-api/src/trusted_proxy.rs` |
| `setup.wizard` | `KEY` |  | `crates/pelty-database/src/setup_wizard.rs` |
| `site.config` | `CONFIG_KEY` |  | `crates/pelty-api/src/routes/site.rs` |
| `system.housekeeping` | `KEY` |  | `crates/pelty-database/src/housekeeping.rs` |
| `system.inactive_client_erasure` | `KEY` |  | `crates/pelty-database/src/inactive_clients.rs` |
| `theme.active` | `ACTIVE_THEME_KEY` |  | `crates/pelty-api/src/routes/extensions.rs` |
| `update_check` | `CFG` |  | `crates/pelty-api/src/updates.rs` |
| `update_status` | `STATUS` |  | `crates/pelty-api/src/updates.rs` |

## General settings

Admin → System & settings → General settings stores one JSON document under `general_settings` (custom head/body code under `custom_code`). Its sections:

### General

| Field | Type | Required | Description |
|---|---|---|---|
| `company_name` | `String` | yes |  |
| `email` | `String` | yes |  |
| `domain` | `String` | yes |  |
| `logo_url` | `String` | yes |  |
| `pay_to_text` | `String` | yes |  |
| `records_per_page` | `u32` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`General`).

### SystemUrls

| Field | Type | Required | Description |
|---|---|---|---|
| `system_url` | `String` | yes |  |
| `terms_url` | `String` | yes |  |
| `privacy_url` | `String` | yes |  |
| `support_url` | `String` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`SystemUrls`).

### Maintenance

| Field | Type | Required | Description |
|---|---|---|---|
| `enabled` | `bool` | yes |  |
| `message` | `String` | yes |  |
| `redirect_url` | `String` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`Maintenance`).

### Localisation

| Field | Type | Required | Description |
|---|---|---|---|
| `default_language` | `String` | yes |  |
| `allow_language_choice` | `bool` | yes |  |
| `date_format` | `String` | yes |  |
| `client_date_format` | `String` | yes |  |
| `timezone` | `String` | yes |  |
| `default_country` | `String` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`Localisation`).

### Ordering

| Field | Type | Required | Description |
|---|---|---|---|
| `default_order_form` | `String` | yes |  |
| `tos_required` | `bool` | yes |  |
| `allow_domain_only` | `bool` | yes |  |
| `show_cart_after_add` | `bool` | yes |  |
| `grace_days` | `u32` | yes |  |
| `enable_promo_field` | `bool` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`Ordering`).

### Support

| Field | Type | Required | Description |
|---|---|---|---|
| `attachment_max_mb` | `u32` | yes | Max size per ticket attachment, in MiB (1..=50). |
| `attachments_per_message` | `u32` | yes | Max files per ticket message (1..=20). |
| `live_chat` | `bool` | yes | Show the public live-chat widget. |

Source: `crates/pelty-database/src/general_settings.rs` (`Support`).

### CustomCode

| Field | Type | Required | Description |
|---|---|---|---|
| `css` | `String` | yes |  |
| `head_js` | `String` | yes |  |
| `footer_js` | `String` | yes |  |

Source: `crates/pelty-database/src/general_settings.rs` (`CustomCode`).

