2019-12-15 11:57:42 -08:00
|
|
|
# bunbun
|
|
|
|
|
|
|
|
_Self-hostable, easy-to-configure, fast search/jump multiplexer service._
|
|
|
|
|
|
|
|
bunbun is a pure-[Rust][rust-lang] implementation of [bunny1][bunny1], providing
|
|
|
|
a customizable search engine and quick-jump tool in one.
|
|
|
|
|
|
|
|
After adding it to your web-browser and setting it as your default search
|
|
|
|
engine, you'll gain the ability to quick-jump to a specific page or search from
|
|
|
|
a specific engine:
|
|
|
|
|
|
|
|
```
|
|
|
|
g hello world // Searches "hello world" in google
|
|
|
|
r anime // Goes to reddit.com/r/anime
|
|
|
|
ls // Lists all available commands and aliases
|
|
|
|
foo bar // If foo is a defined command, do something with bar
|
|
|
|
// Alternatively, if a default route is set, use the entire
|
|
|
|
// query for the default route
|
|
|
|
```
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
If you have `cargo`, you can simply run `cargo install bunbun`.
|
|
|
|
|
|
|
|
Once installed, simply run it. A default config file will be created if one does
|
|
|
|
not exist. You should model your own custom routes after the provided ones.
|
2019-12-24 11:52:34 -08:00
|
|
|
|
|
|
|
### Building for prod
|
|
|
|
|
|
|
|
If you're looking to build a release binary, here are the steps I use:
|
|
|
|
|
|
|
|
1. `cargo build --release`
|
|
|
|
2. `strip target/release/bunbun`
|
2019-12-26 12:10:27 -08:00
|
|
|
3. `upx --lzma target/release/bunbun`
|
2019-12-24 11:52:34 -08:00
|
|
|
|
|
|
|
LZMA provides the best level of compress for Rust binaries; it performs at the
|
|
|
|
same level as `upx --ultra-brute` without the time cost and [without breaking
|
|
|
|
the binary](https://github.com/upx/upx/issues/224).
|
2019-12-15 11:57:42 -08:00
|
|
|
|
2019-12-15 12:07:26 -08:00
|
|
|
### Configuration
|
|
|
|
|
|
|
|
If configuring for development, no further configuration is required. If running
|
|
|
|
this for production, you should edit the `public_address` field.
|
|
|
|
|
2019-12-22 15:25:41 -08:00
|
|
|
the config file is watched, so updates are immediate unless invalid, or if
|
|
|
|
you're using certain programs such as nvim, which performs updating a file via
|
|
|
|
swapping rather than directly updating the file.
|
2019-12-15 12:07:26 -08:00
|
|
|
|
2019-12-22 15:25:41 -08:00
|
|
|
### Adding bunbun as a search engine
|
2019-12-15 12:07:26 -08:00
|
|
|
|
2019-12-22 15:25:41 -08:00
|
|
|
bunbun supports the [OpenSearch Description Format][osdf]. Visit the root page
|
|
|
|
of your desired instance of bunbun to learn more.
|
2019-12-15 12:07:26 -08:00
|
|
|
|
2019-12-23 21:41:49 -08:00
|
|
|
## Reasons to use bunbun
|
|
|
|
|
|
|
|
- Portable: bunbun runs off a single binary and config file.
|
|
|
|
- Small: binary is 1.3MB (after running `strip` and `upx --lzma` on the release
|
|
|
|
binary).
|
|
|
|
- Convenient: bunbun watches for config changes and refreshes its routes
|
|
|
|
automatically, allowing for rapid development.
|
|
|
|
- Memory-safe: Built with [Rust][rust-lang].
|
|
|
|
|
2019-12-15 11:57:42 -08:00
|
|
|
[rust-lang]: https://www.rust-lang.org/
|
|
|
|
[bunny1]: http://www.bunny1.org/
|
2019-12-15 12:07:26 -08:00
|
|
|
[osdf]: https://developer.mozilla.org/en-US/docs/Web/OpenSearch
|