Skip to content

Commit

Permalink
More detailed setup documents with less assumptions on users (hound-s…
Browse files Browse the repository at this point in the history
…earch#359)

This commit updates the readme to be a little more verbose for people who don't necessarily have Go or Docker set up, but who want to contribute nonetheless. 

* Apply the old patch

* add  some figures

* remove the idea code

* get it untitled

* remove

* add .idea dev tools

* remove simple config

* get config back

* detailing tests and simplifying the setup

* Commit TLS support guide

Co-authored-by: Salem <salemhilal@gmail.com>

* make the statement terser

* delete unused img

* rewording

* back to the old path

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Salem <salemhilal@gmail.com>
  • Loading branch information
rfan-debug and salemhilal committed Oct 22, 2020
1 parent b551906 commit 57d568c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.exe
/db
/data
/.idea
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,66 @@ Hound is an extremely fast source code search engine. The core is based on this
[Regular Expression Matching with a Trigram Index](http://swtch.com/~rsc/regexp/regexp4.html). Hound itself is a static
[React](http://facebook.github.io/react/) frontend that talks to a [Go](http://golang.org/) backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API. Here it is in action:

![Hound Screen Capture](screen_capture.gif)
![Hound Screen Capture](imgs/screen_capture.gif)

## Quick Start Guide

### 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.

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).


```
go get github.com/hound-search/hound/cmds/...
```

2. Create a [config.json](config-example.json) in a directory with your list of repositories.
2. 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):
```json
{
"dbpath" : "db",
"repos" : {
"Hound" : { "url" : "https://github.com/etsy/hound.git" }
}
}
```

3. Run the Hound server with `$GOPATH/bin/houndd`. You should see output similar to:
3. Run the Hound server with `houndd` in the same directory as your `config.json`. You should see output similar to:
```
2015/03/13 09:07:42 Searcher started for statsd
2015/03/13 09:07:42 Searcher started for Hound
2015/03/13 09:07:42 All indexes built!
2015/03/13 09:07:42 running server at http://localhost:6080
```

4. By default, hound hosts a web ui at http://localhost:6080 . Open it in your browser, and start searching.

### Using Docker (1.4+)

1. Create a [config.json](config-example.json) in a directory with your list of repositories.
0. [Install the 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).

2. Run
```
docker run -d -p 6080:6080 --name hound -v $(pwd):/data etsy/hound
```

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. Currently, Hound does not support TLS as most users simply run Hound behind either Apache or nginx. Adding TLS support is pretty straight forward though if anyone wants to add it.
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?

Expand Down Expand Up @@ -128,7 +151,11 @@ 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, and [check out Go's testing docs](https://golang.org/pkg/testing/) for more details on testing Go code.
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.

### Working on the web UI

Expand Down
File renamed without changes

0 comments on commit 57d568c

Please sign in to comment.