Skip to content

Commit 03fc50a

Browse files
authored
various README fixes (#3)
* add instructions on adding GITHUB_TOKEN as env variable on machine * add .github-token to gitignore and add additional info in build instructions * remove github-token from gitignore because its meant to be in home dir. Bold this part in the README so its more clear * add ctags installation instructions to readme * link to ctags repo in README * remove unnecessary line change in gitignore
1 parent 7cb0e7e commit 03fc50a

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](.
5353
<details open>
5454
<summary><img src="https://github.com/favicon.ico" width="16" height="16" /> GitHub</summary>
5555

56-
Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new). If you are indexing public repositories only, you can select the `public_repo` scope, otherwise you will need the `repo` scope.
56+
Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new). If you're only indexing public repositories select the `public_repo` scope; otherwise, select the `repo` scope.
57+
58+
You'll need to pass this PAT each time you run Sourcebot, so we recommend adding it as an environment variable. In this guide, we'll add the Github PAT as an environment variable called `GITHUB_TOKEN`:
59+
```sh
60+
export GITHUB_TOKEN=<your-token-here>
61+
```
62+
63+
If you'd like to persist this environment variable across shell sessions, please add this line to your shell config file (ex. `~/.bashrc`, `~/.bash_profile`, etc)
64+
5765

5866
</details>
5967

@@ -78,8 +86,9 @@ Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](.
7886
<details open>
7987
<summary><img src="https://github.com/favicon.ico" width="16" height="16" /> GitHub</summary>
8088

89+
Run the `sourcebot` docker image, passing in the Github PAT you generated in the previous step as an environment variable called `GITHUB_TOKEN`:
8190
```sh
82-
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main
91+
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=$GITHUB_TOKEN ghcr.io/taqlaai/sourcebot:main
8392
```
8493
</details>
8594

@@ -119,14 +128,18 @@ Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](.
119128

120129
## Building Sourcebot
121130

122-
0. Install <a href="https://go.dev/"><img src="https://go.dev/favicon.ico" width="16" height="16"> go</a> and <a href="https://nodejs.org/"><img src="https://nodejs.org/favicon.ico" width="16" height="16"> NodeJS</a>
131+
1. Install <a href="https://go.dev/doc/install"><img src="https://go.dev/favicon.ico" width="16" height="16"> go</a> and <a href="https://nodejs.org/"><img src="https://nodejs.org/favicon.ico" width="16" height="16"> NodeJS</a>. Note that a NodeJS version of at least `21.1.0` is required.
132+
133+
2. Install [ctags](https://github.com/universal-ctags/ctags) (required by zoekt-indexserver):
134+
Mac: `brew install universal-ctags`
135+
Ubuntu: `apt-get install universal-ctags`
123136

124-
1. Clone the repository with submodules:
137+
3. Clone the repository with submodules:
125138
```sh
126139
git clone --recurse-submodules https://github.com/TaqlaAI/sourcebot.git
127140
```
128141

129-
2. Run make to build zoekt and install dependencies:
142+
4. Run make to build zoekt and install dependencies:
130143
```sh
131144
cd sourcebot
132145
make
@@ -157,7 +170,7 @@ The zoekt binaries and web dependencies are placed into `bin` and `node_modules`
157170

158171
Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new). If you are indexing public repositories only, you can select the `public_repo` scope, otherwise you will need the `repo` scope.
159172

160-
Create a text file named `.github-token` in your home directory and paste the token in it. The file should look like:
173+
Create a text file named `.github-token` **in your home directory** and paste the token in it. The file should look like:
161174
```sh
162175
ghp_...
163176
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "npm-run-all --print-label --parallel next:dev zoekt:webserver zoekt:indexserver",
77
"zoekt:webserver": "export PATH=\"$PWD/bin:$PATH\" && zoekt-webserver -index .sourcebot/index -rpc",
8-
"zoekt:indexserver": "export PATH=\"$PWD/bin:$PATH\" && zoekt-indexserver -data_dir .sourcebot -mirror_config config.json",
8+
"zoekt:indexserver": "export PATH=\"$PWD/bin:$PATH\" && export CTAGS_COMMAND=ctags && zoekt-indexserver -data_dir .sourcebot -mirror_config config.json",
99
"next:dev": "next dev",
1010
"build": "next build",
1111
"start": "next start",

0 commit comments

Comments
 (0)