A search engine shim with DuckDuckGo bangs
- TypeScript 100%
| .editorconfig | ||
| .gitignore | ||
| config.ts | ||
| COPYING | ||
| deno.json | ||
| deno.lock | ||
| main.ts | ||
| README.md | ||
⸘interro‽
interro is a free, libre, open-source implementation of DuckDuckGo !Bangs. Built with Deno.
Run
- Clone repo
- When running locally:
deno task start - 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
- Settings > Search engine > Manage search engines and site search > Add
- Use
https://<INTERRO_HOSTNAME>/?q=%sas 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.devwill allow searching on my own website with!kytta
How to apply the configuration
You have three options:
- By setting the environment variables yourself. Do this in your Dockerfile, Compose configuration, systemd unit, direnv's .envrc, you name it
- By using
--envwithdeno run. When you start interro usingdeno run, you can provide the path to the .env file using--env. - 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.comis 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.csvis required to populate the CSV cache. It is only required if you chose to download Bangs from DuckDuckGo--allow-read=./bangs.csvis required to use the CSV cache. You can use it instead of downloading the fresh !Bangs--allow-net=localhost:8000is required to host the app
Licence
© 2024 Nikita Karamov
Licensed under the GNU Affero General Public License v3.0 only.