-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied diffs from #430 as unable to resolve merge conflicts with fork…
…ed codebase due to permissions.
- Loading branch information
dschott
committed
May 5, 2023
1 parent
6b38958
commit fd54717
Showing
9 changed files
with
49 additions
and
816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ["1.18", "1.17", "1.14"] | ||
go: ["1.18", "1.17"] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-go@v2 | ||
|
@@ -82,7 +82,7 @@ jobs: | |
go-test: | ||
strategy: | ||
matrix: | ||
go: ["1.18", "1.17", "1.14"] | ||
go: ["1.18", "1.17"] | ||
os: [windows-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/.vagrant | ||
/.build | ||
.build | ||
/ui/.build | ||
/node_modules | ||
.DS_Store | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ Hound is an extremely fast source code search engine. The core is based on this | |
### Using Go Tools | ||
|
||
|
||
0. [Install Go](https://golang.org/doc/install) if you don't have it already. Hound requires version 1.4 or later. | ||
You might also want to define a [`GOPATH`](https://github.com/golang/go/wiki/GOPATH) environment variable) | ||
(it defaults to $HOME/go if you don't explicitly have one set). If everything is installed properly, `go version` should | ||
print out the installed version of go. | ||
0. [Install Go](https://golang.org/doc/install) if you don't have it already. Hound requires version 1.18 or later. | ||
You might also want to define a [`GOPATH`](https://github.com/golang/go/wiki/GOPATH) environment variable) | ||
(it defaults to $HOME/go if you don't explicitly have one set). If everything is installed properly, `go version` should | ||
print out the installed version of go. | ||
|
||
1. Use the Go tools to install Hound. The binaries `houndd` (server) and `hound` (cli) will be installed in your $GOPATH/bin directory. Your $GOPATH should be in your $PATH (`echo $PATH` to check). | ||
|
||
|
@@ -38,7 +38,7 @@ print out the installed version of go. | |
You might have to change the path of the last command if you installed Go somewhere else on your system. | ||
|
||
2. Create a config.json file in your `$GOPATH/bin` and use it to list your repositories. Check out our [example-config.json](config-example.json) | ||
to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using | ||
to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using | ||
the config found in [default-config.json](default-config.json): | ||
|
||
```json | ||
|
@@ -62,24 +62,24 @@ the config found in [default-config.json](default-config.json): | |
|
||
4. By default, hound hosts a web ui at http://localhost:6080 . Open it in your browser, and start searching. | ||
|
||
### Using Docker (1.4+) | ||
### Using Docker (1.14+) | ||
|
||
0. [Install docker](https://docs.docker.com/get-docker/) if you don't have it. We need at least `Docker >= 1.14`. | ||
|
||
1. Create a config.json file and use it to list your repositories. Check out our [example-config.json](config-example.json) | ||
to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using | ||
the config found in [default-config.json](default-config.json). | ||
1. Create a config.json file and use it to list your repositories. Check out our [example-config.json](config-example.json) | ||
to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using | ||
the config found in [default-config.json](default-config.json). | ||
|
||
2. Run | ||
``` | ||
docker run -d -p 6080:6080 --name hound -v $(pwd):/data ghcr.io/hound-search/hound:latest | ||
``` | ||
|
||
You should be able to navigate to [http://localhost:6080/](http://localhost:6080/) as usual. | ||
You should be able to navigate to [http://localhost:6080/](http://localhost:6080/) as usual. | ||
|
||
## Running in Production | ||
|
||
There are no special flags to run Hound in production. You can use the `--addr=:6880` flag to control the port to which the server binds. | ||
There are no special flags to run Hound in production. You can use the `--addr=:6880` flag to control the port to which the server binds. | ||
Currently, Hound does not support TLS as most users simply run Hound behind either Apache or nginx. However, we are open to contributions to add TLS support. | ||
|
||
## Why Another Code Search Tool? | ||
|
@@ -88,7 +88,7 @@ We've used many similar tools in the past, and most of them are either too slow, | |
Which brings us to... | ||
|
||
## Requirements | ||
* Go 1.13+ | ||
* Go 1.18+ | ||
|
||
Yup, that's it. You can proxy requests to the Go service through Apache/nginx/etc., but that's not required. | ||
|
||
|
@@ -97,7 +97,7 @@ Yup, that's it. You can proxy requests to the Go service through Apache/nginx/et | |
|
||
Currently Hound is only tested on MacOS and CentOS, but it should work on any *nix system. Hound on Windows is not supported but we've heard it compiles and runs just fine (although it helps to exclude your data folder from Windows Search Indexer). | ||
|
||
Hound supports the following version control systems: | ||
Hound supports the following version control systems: | ||
|
||
* Git - This is the default | ||
* Mercurial - use `"vcs" : "hg"` in the config | ||
|
@@ -112,12 +112,12 @@ There are a couple of ways to get Hound to index private repositories: | |
|
||
* Use the `file://` protocol. This allows you to index a local clone of a repository. The downside here is that the polling to keep the repo up to date will | ||
not work. (This also doesn't work on local folders that are not of a supported repository type.) If you're using Docker, you must mount a volume to your repository (e.g., `-v $(pwd)/src:/src`) and use the relative path to the repo in your configuration. | ||
* Use SSH style URLs in the config: `"url" : "[email protected]:foo/bar.git"`. As long as you have your | ||
* Use SSH style URLs in the config: `"url" : "[email protected]:foo/bar.git"`. As long as you have your | ||
[SSH keys](https://help.github.com/articles/generating-ssh-keys/) set up on the box where Hound is running this will work. | ||
|
||
## Keeping Repos Updated | ||
|
||
By default Hound polls the URL in the config for updates every 30 seconds. You can override this value by setting the `ms-between-poll` key on a per repo basis in the config. If you are indexing a large number of repositories, you may also be interested in tweaking the `max-concurrent-indexers` property. You can see how these work in the [example config](config-example.json). | ||
By default Hound polls the URL in the config for updates every 30 seconds. You can override this value by setting the `ms-between-poll` key on a per repo basis in the config. If you are indexing a large number of repositories, you may also be interested in tweaking the `max-concurrent-indexers` property. You can see how these work in the [example config](config-example.json). | ||
|
||
## Editor Integration | ||
|
||
|
@@ -160,8 +160,8 @@ If you want to just run the JavaScript test suite, use: | |
npm test | ||
``` | ||
|
||
Any Go files that end in `_test.go` are assumed to be test files. Similarly, any JavaScript files that ends in `.test.js` are automatically run by Jest, our test runner. Tests should live next to the files that they cover. | ||
[Check out Jest's docs](https://jestjs.io/docs/en/getting-started) for more details on writing Jest tests, | ||
Any Go files that end in `_test.go` are assumed to be test files. Similarly, any JavaScript files that ends in `.test.js` are automatically run by Jest, our test runner. Tests should live next to the files that they cover. | ||
[Check out Jest's docs](https://jestjs.io/docs/en/getting-started) for more details on writing Jest tests, | ||
and [check out Go's testing docs](https://golang.org/pkg/testing/) for more details on testing Go code. | ||
|
||
You need to install `Node.js >= 12` and install `jest` by `npm install jest` to run the JS tests. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
module github.com/hound-search/hound | ||
|
||
go 1.13 | ||
go 1.17 | ||
|
||
require github.com/blang/semver v3.5.1+incompatible | ||
|
||
require ( | ||
github.com/blang/semver v3.5.1+incompatible | ||
github.com/blang/semver/v4 v4.0.0 // indirect | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
github.com/blang/semver v1.1.0 h1:ol1rO7QQB5uy7umSNV7VAmLugfLRD+17sYJujRNYPhg= | ||
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= | ||
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= | ||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= | ||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= | ||
github.com/go-bindata/go-bindata v1.0.0 h1:DZ34txDXWn1DyWa+vQf7V9ANc2ILTtrEjtlsdJRF26M= | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE= | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= |
Oops, something went wrong.