Skip to content

Commit 758fa0e

Browse files
committed
Improve the README
1 parent f1597b8 commit 758fa0e

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,43 @@
1-
# starquery
1+
<h1>
2+
<img src="./icon.png" width="48px" style="margin-right: 12px;" align="center">
3+
starquery
4+
</h1>
25

3-
An API that near-realtime tracks whether a user has starred a GitHub repository.
6+
[!["Join us on
7+
Discord"](https://badgen.net/discord/online-members/coder)](https://coder.com/chat?utm_source=github.com/coder/vscode-coder&utm_medium=github&utm_campaign=readme.md)
48

5-
## Deployment
6-
7-
The API is live at `starquery.coder.com`. A Cloudflare Tunnel is used for DDoS protection made with [this guide](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/). The config is:
9+
Query in near-realtime if a user has starred a GitHub repository.
810

9-
```yaml
10-
# Located in /home/kyle/.cloudflared/config.yml
11-
url: http://localhost:8080
12-
tunnel: 7e5e3b0d-4eb3-4aff-9924-e5f6efebcc2d
13-
credentials-file: /home/kyle/.cloudflared/7e5e3b0d-4eb3-4aff-9924-e5f6efebcc2d.json
11+
```
12+
https://starquery.coder.com/coder/coder/user/kylecarbs
1413
```
1514

16-
`cloudflared` is ran in `screen -S cloudflared`:
15+
- Uses GitHub Webhooks for near-realtime accuracy.
16+
- Periodically refreshes all stargazers using GitHub's GraphQL API for accuracy.
17+
- Start tracking a repository by [adding it to the list](https://github.com/coder/starquery/blob/main/cmd/starquery/main.go#L52)!
1718

18-
```
19-
cloudflared tunnel run 7e5e3b0d-4eb3-4aff-9924-e5f6efebcc2d
20-
```
19+
This service is used by [coder/coder](https://github.com/coder/coder) to prompt users to star the repository if they haven't already!
20+
21+
## Deployment
2122

22-
`/run/starquery/environ` must have `WEBHOOK_SECRET`, but here's a template:
23+
starquery is deployed on a tiny VM in Google Cloud. It is exposed via a Cloudflare Tunnel and accessible at: `starquery.coder.com`.
24+
25+
The `./deploy.sh` script can be used to update the service (probably should be automated at some point).
26+
27+
`/run/starquery/environ` must exist. Here is a template:
2328

2429
```env
2530
REDIS_URL=127.0.0.1:6379
2631
BIND_ADDRESS=127.0.0.1:8080
2732
# use cdrci account
2833
GITHUB_TOKEN=
34+
WEBHOOK_SECRET=
35+
```
36+
37+
### Cloudflare Tunnel
38+
39+
See [the config file](./cloudflared.yaml). `cloudflared` is ran in `screen -S cloudflared`:
40+
41+
```sh
42+
cloudflared tunnel run 7e5e3b0d-4eb3-4aff-9924-e5f6efebcc2d
2943
```

icon.png

138 KB
Loading

0 commit comments

Comments
 (0)