fastbangs
This project functions as a meta search engine, resolving shortcuts to other search engines we call "bangs" (which work the same as the bangs from duckduckgo). When no bang is given, the user will be redirected to a default search engine, which is configurable by each user. This evaluation is done on the client; the server doesn't ever see your search query.
The server keeps its own list of bangs, initialized with those from duckduckgo. Users are thus able to submit their own bangs on the website, which need to be approved by an administrator before coming into effect for all users.
There is a public instance running at search.metamuffin.org, running on a server in germany.
Building
The build-time dependencies are curl, make, esbuild, sassc, and stack. Under arch linux, you may install these with paru -Syu make esbuild sassc stack-static
, replacing paru
with your AUR-helper of choice.
With these installed, run make
. This will take a few minutes, but recompiling after an update should be quick.
Running
Building leaves you with a directory named deploy
. Copy this onto the machine you want to run the server on and run the fastbangs
executable found inside, using the deploy
directory as your working directory.
Configuration
Configuration is done through environment variables, or a file named "fastbangs.yaml" sitting in the working directory of the server. Running make
will include a default config.
If you go with environment variables, the following options are available: - PORT: port to bind to. Default: 20546 - BIND_ADDR: address to bind to. Default: any ipv4/ipv6 interface - BASE_URL: url of the deployed website, without trailing slash. Default: "http://localhost:20546" - ADMIN_USER: username for logging into the interface for accepting/rejecting bangs. Default: "bleb" - ADMIN_PW_HASH: hash of the passwort used for logging in. Default: "" - EMAIL_CMD: path to an executable for sending emails. Will be called with the recipient, subject and body as command-line arguments. Default: "" - ADMIN_EMAIL: Email that receives notifications about pending bangs using EMAIL_CMD. Default: ""
On the password hash:
The default setting makes it impossible to log in, forcing you to set your own. You DON'T NEED TO DO THIS if you don't plan on adding custom bangs. The format is the sha512 hash of the password, converted to base64.
You can generate a password using the following command: echo -n YOUR_PASSWORD | sha512sum | awk '{print $1}' | xxd -r -p | base64 | tr -d '\n'