Documentation

Configuration

Bangs

Privian comes with a default set of bangs (from DuckDuckGo), but you can customize them using the bangs configuration option.

  • add - (object) Custom bangs, see object example below
  • blacklist - (string[]) Bangs that should not be available
  • enable - (boolean) whether to enable bangs
  • whitelist - (string[]) Bangs that should be available (use either blacklist or whitelist, not both)

Adding a custom bang:

{
	"bangs": {
		"add": {
			"!custom": {
				"label": "Custom bang",
				"priority": 0,
				"url": "https://example.com/search?q=%s"
			}
		}
	}
}

Providers

Configures search and preview providers.

Supported search and suggestions providers:

Supported preview providers:

  • Imdb
  • Mdn
  • StackOverflow
  • Wikipedia

Puppeteer

The Google provider can be configured to handle 429 status codes (captchas) with puppeteer. If you enable this features by providing the executablePath, it will open a browser window when Google requests captcha.

  • executablePath (string) - The path to the broswer executable (you can find yours using chrome://version/)

Redis

Privian caches various data such as suggestions, search results, and previews. By default, the data is stored in-memory using LRU cache. You can enable redis instead by providing the redis connection URL.

  • cache:
    • brotli (boolean) - whether to compress data using Brotli
    • hashKey (boolean) - whether to hash key using SHA1
  • url (string) - connection string as redis://127.0.0.1:6379

Default config.json

{
	"bangs": {
		"add": null,
		"blacklist": null,
		"enable": true,
		"whitelist": null
	},
	"providers": {
		"load": [
			"BingApi",
			"Brave",
			"Google",
			"Calculator",
			"Currency"
		],
		"preview": [
			"Imdb",
			"Mdn",
			"StackOverflow",
			"Wikipedia"
		],
		"search": [
			"Google",
			"Calculator",
			"Currency"
		],
		"suggestions": [
			"Google"
		]
	},
	"puppeteer": {
		"executablePath": ""
	},
	"redis": {
		"cache": {
			"brotli": true,
			"hashKey": true
		},
		"url": ""
	}
}