# Files in the prefs directory

| File | Mode | Purpose |
|---|---|---|
| `prefs.XML` | 0600 for new files | The configuration |
| `backup/prefs-<yyyyMMdd-HHmmss-SSS>[-invalid].XML` | 0600 (directory 0700) | The newest 50 versions that loaded, plus raw `-invalid` copies made before a forced overwrite or a safe-mode restore (newest 10 kept) |
| `prefs.XML.v1-<yyyyMMdd-HHmmss>.bak` | 0600 (best effort) | An old or foreign `prefs.XML`, moved aside unread |
| `crushbalance.key` | 0600; Windows: owner, SYSTEM and Administrators only | Master key: encrypted passwords, generated keystore passwords, the pin-file key |
| `crushbalance.lock` | 0644 | Instance lock (holds the pid and start time) |
| `admin-selfsigned.p12` | 0600 | Generated admin certificate |
| `listener-selfsigned.p12` | 0600 | Generated certificate for TLS listeners without a keystore |
| `setup-token.txt` | 0600 | One-time setup token; deleted after setup |
| `geoip-cache.json` | 0600 | GeoIP cache and the monthly lookup count |
| `sticky-pins.dat` | 0600 | Sticky pins as hashed keys |
| `*.tmp-<random>` | 0600 | Temporary files of atomic saves; stale ones are deleted at startup |

The log file lives where `log_file` points (relative paths resolve against the working directory) and gets mode 0640 when created. The prefs directory itself is created with mode 0700. The modes are POSIX modes (Linux, macOS). On Windows CrushBalance gives only `crushbalance.key` and `setup-token.txt` an access list of their own; every other file gets the folder's access list ([Hardening: What is sensitive](Hardening.md#what-is-sensitive)). Browser-only preferences (theme, dashboard range, dismissed notices) stay in the browser.
