~bigbes/huntsman

Multi-provider search router — one OpenSearch entry, prefix-routed queries to any engine
766fa805 — Eugene Blikh 6 days ago
Add BSD 2-Clause license
783841b9 — Eugene Blikh 6 days ago
Initial commit: multi-provider search router

refs

master
browse  log 

clone

read-only
https://git.srht.bigb.es/~bigbes/huntsman
read/write
git@git.srht.bigb.es:~bigbes/huntsman

You can also use your local clone with git send-email.

#huntsman

A small self-hosted HTTP service that acts as a multi-provider search router.

It exposes a single OpenSearch description that you can register in your browser's address bar. When you type a query, a short prefix decides which upstream search engine handles it.

#Why

Browsers let you add at most one default search engine. If you regularly search Urban Dictionary, GitHub, and Steam, you end up adding three engines and learning three keywords per browser. This service collapses that into a single <link rel="search"> and a unified prefix grammar that works in any browser, on any device.

#Providers

Prefix Provider Upstream
ud Urban Dictionary urbandictionary.com/define.php
gh GitHub github.com/search
steam Steam Store store.steampowered.com/search

Both ud foo bar and ud:foo bar work. With no recognized prefix the query falls through to the configured default provider.

#Endpoints

Method Path Purpose
GET / Landing page advertising the OSD via <link>
GET /search?q=... 302 redirect to the chosen provider
GET /providers JSON list of registered providers
GET /opensearch.xml Unified OSD pointing at /search
GET /opensearch/{provider}.xml Per-provider OSD pointing directly upstream
GET /healthz, /readyz Liveness & readiness probes

#Quick start

cp config.example.yaml config.yaml
# edit server.public_url to match your deployment
just dev
# then open http://localhost:8080/ in a browser and add the search engine

#Configuration

Config is YAML. Every field can be overridden by an environment variable prefixed APP_ with . replaced by _, e.g. APP_SERVER_PORT=9000.

server:
  host: "0.0.0.0"
  port: 8080
  public_url: "https://search.example.com"  # used in OSD XML
search:
  default_provider: gh                       # ud | gh | steam
log:
  level: info
  format: human                              # human | json

#Build / run

just build           # produces ./huntsman
just test            # unit tests
just lint            # golangci-lint
just docker-build    # container image
just docker-run      # docker compose up -d --build

#License

BSD 2-Clause © bigbes