Configuration
Snipraw's snippets directory, title, description, base URL, attribution, and log level are set via a YAML config file. Host and port are CLI-only, see Command Line.
Config file
Snipraw does not assume a default config path. Point it at a file with --config (or -c):
bash
snipraw -c ~/.config/snipraw/config.yamlThe file must exist; snipraw will not create one for you.
yaml
snippets-dir: ~/snippets
title: Snipraw
desc: My personal code snippets
base-url: ""
attribution: true
log-level: infoReference
| Key | Default | Description |
|---|---|---|
snippets-dir | — | Directory to serve snippets from. Required. |
title | Snipraw | Site title shown in the UI |
desc | — | Site description, used in meta tags |
base-url | — | Canonical base URL, used in meta tags |
attribution | true | Show "Hosted with Snipraw" in the footer |
log-level | info | Log level: trace, debug, info, warn, error, fatal, panic, disabled |
Binding to all interfaces
Host/port are CLI flags, not config fields. To make snipraw accessible on your local network:
bash
snipraw --host 0.0.0.0 --port 8245 -c ~/.config/snipraw/config.yamlWARNING
Snipraw has no built-in authentication. Binding to 0.0.0.0 exposes it to anyone on your network. Put it behind a reverse proxy with its own auth layer if you need to restrict access.
Using a different port
bash
snipraw --port 8080 -c ~/.config/snipraw/config.yamlConfig file location
You can put the config file anywhere:
bash
snipraw -c /etc/snipraw/config.yamlThis is useful when running snipraw as a system service.