A search engine shim with DuckDuckGo bangs
  • TypeScript 100%
Find a file
2024-04-28 23:40:04 +02:00
.editorconfig Initial commit 2024-04-27 22:31:46 +02:00
.gitignore Rewrite config module to use environment variables 2024-04-28 20:31:38 +02:00
config.ts Reformat code 2024-04-28 23:32:01 +02:00
COPYING Add licence 2024-04-28 00:08:32 +02:00
deno.json Reformat code 2024-04-28 23:32:01 +02:00
deno.lock Do not read .env files 2024-04-28 23:19:28 +02:00
main.ts Reformat code 2024-04-28 23:32:01 +02:00
README.md Add instructions 2024-04-28 23:40:04 +02:00

⸘interro‽

interro is a free, libre, open-source implementation of DuckDuckGo !Bangs. Built with Deno.

Run

  1. Clone repo
  2. When running locally: deno task start
  3. To deploy via Deno Deploy: deployctl deploy

Consult Deno's guide on deployment to the cloud. Later, I'll add instructions to this repo.

Use as search engine

Chrome

  1. Settings > Search engine > Manage search engines and site search > Add
  2. Use https://<INTERRO_HOSTNAME>/?q=%s as URL

Firefox

Follow this guide.

Configuration

interro tries to be a twelve-factor app, so the configuration is done via environment variables.

  • INTERRO_DEFAULT_SEARCH - your default search engine.
    This is the search engine that you will be redirected to when you don't use any bangs in the query. By default, it's DuckDuckGo. The value should be a URL containing {{{s}}}, which will be replaced by your search query.
    For example: https://www.google.com/search?q={{{s}}}
  • INTERRO_BANG_* - your custom bangs.
    You can create your custom Bangs to override the DuckDuckGo ones. The value of the key is the same as for the default search.
    For example: INTERRO_BANG_KYTTA=https://duckduckgo.com/?q={{{s}}}+site%3Awww.kytta.dev will allow searching on my own website with !kytta

How to apply the configuration

You have three options:

  1. By setting the environment variables yourself. Do this in your Dockerfile, Compose configuration, systemd unit, direnv's .envrc, you name it
  2. By using --env with deno run. When you start interro using deno run, you can provide the path to the .env file using --env.
  3. In Deno Deploy. When deploying to Deno Deploy, you can set variables project-wide

If you have updated your environment variables, you'll probably have to restart the server. If you want to reload the config or fetch fresh DuckDuckGo Bangs, do GET /refresh.

Permissions

interro requires little permissions to work.

  • --allow-net=duckduckgo.com is required at least once. It will be used to download the newest !Bangs from DuckDuckGo. If you "cache" them in the CSV, you don't need this permission afterwards
  • --allow-write=./bangs.csv is required to populate the CSV cache. It is only required if you chose to download Bangs from DuckDuckGo
  • --allow-read=./bangs.csv is required to use the CSV cache. You can use it instead of downloading the fresh !Bangs
  • --allow-net=localhost:8000 is required to host the app

Licence

© 2024 Nikita Karamov
Licensed under the GNU Affero General Public License v3.0 only.