Run your personal hound instance on a Raspberry Pi with auto-indexing repositories
Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox: Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API.
Source code for Hound, backend and frontend code is here along detailed deployment instructions.
Auto-indexing repositories manually with a Python script at the moment. Additionally, one can configure the script to run as a cron job in order to look for new repositories and generate latest configuration for Hound.
- Deploy hound on balenaCloud
- Add a new device to your newly created fleet, let it index the repos (Takes time) and it will be ready with message in the console.
running server at http://localhost:80
If you are new to balenaCloud, follow the getting started guide.
By default, Hound will be running on balena's GitHub orgs as a way for you to play around with the instance and test it out. You can easily change this creating a new config.json file using the example config-example.json file.
- Edit the following dictionaries in the
confignator.py
file as per your needs. Confignator generates config files for all repositories present in the orgs you specify.
DEFAULT_SETTINGS = {
"max-concurrent-indexers": 4,
"dbpath": "data",
"title" : "Hound",
"health-check-uri" : "/healthz",
}
organizations = [
"balena-io",
"balena-io-library",
"balenalabs",
"balena-io-playground",
]
- Run
confignator.py
. Confignator fetches a fresh list of repositories from the GitHub API, hence make sure not to run it repeatedly in order to avoid hitting the rate limit.
python3 confignator.py
This will create a file called config.,json
in the root directory. Push a new release to your fleet in order for the hound to run on the latest configuration. Additionally, one can configure the script to run as a cron job in order to look for new repositories and generate latest configuration for Hound.