Documentation

Configuration

APIs

Extra functionality such as user log-in and commands, are provided by an external API. For more details, see APIs.

{
	"apis": [{
		"name": "myapi",
		"url": "http://localhost:5000"
	}]
}

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"
			}
		}
	}
}

Datassets

Datasets are SQLite databases containing crawled and indexed data. These datasets contain data such as currency exchange rates, website privacy rating from PrivacySpy.org and world news. We periodically publish new updates to these datasets making sure your local installation stays up-to-date.

  • dir - (string) Local directory path where datasets should be stored
  • disableRemoteSearcher - (boolean) Whether to disable “remote searcher” functionality provided by storage.privian.io. Disabling this feature will force download of all configured datasets and search will be performed on their local copies.
  • load - (string[]) An array of URLs of the datasets to load.
  • trustedOrigins - (string[]) An array of origins which will be labeled as “official” or “trusted”.
{
	"datasets": {
		"dir": null,
		"disableRemoteSearcher": false,
		"load": [
			"https://storage.privian.io/63206a1a00027807f866/datasets/news.db",
			"https://storage.privian.io/63206a1a00027807f866/datasets/ecb_rates.db",
			"https://storage.privian.io/63206a1a00027807f866/datasets/privacyspy.org.db"
		],
		"trustedOrigins": ["https://storage.privian.io"]
	}
}

JWT

Only for the multitenancy mode. Configures the name of the JWT cookie and the shared secret.

{
	"jwt": {
		"cookieName": "privianJwt",
		"secret": "S0me.$ecret"
	}
}

Multitenancy

  • multitenancy - (string | false) Possible values:
    • false - Disables multitenancy;
    • lax - Search functionality is still available to unauthorized users;
    • strict - All functionality requires authorization.
{
	"multitenancy": "lax"
}

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

Security

Privian is intended to be a public-facing server application and as such, it will receve some bot traffic as well. Using these settings, you can catch automated scanners and temporarily ban the from accessing the application. The default settings block common scanners trying to locate wordpress admin pages.

  • catchUris (string[]) - An array of URIs (paths) that lead to temporary ban of the client’s IP when accessing it.
  • catchUserAgents (stting[]) - An array of User Agents (partial strings) that lead to temporary ban of the client’s IP.

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": ""
	}
}