Add contributing guide and setup files (#16)

* Add contributing guide and setup files

* set the default db url to localhost

* minor clarifications

* update docs on installing from source

---------

Co-authored-by: boring_nick <boring-nick@users.noreply.github.com>
This commit is contained in:
boring-nick 2023-09-09 15:48:10 +03:00 committed by GitHub
parent b7a6bfbf7b
commit b160f8452e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 3 deletions

View File

@ -36,9 +36,9 @@ services:
### From source
- Set up Clickhouse
- `cargo install --locked --git https://github.com/boring-nick/rustlog`
- You can now run the `rustlog` binary
- Follow the [Contributing](Contributing) excluding the last step
- `cargo build --release`
- The resulting binary will be at `target/release/rustlog`
## Advantages over justlog
@ -46,5 +46,49 @@ services:
- Blazing fast log queries with response streaming and a [highly performant IRC parser](https://github.com/jprochazk/twitch-rs)
- Support for ndjson logs responses
## Contributing
Requirements:
- rust
- yarn
- docker with docker-compose (optional, will need to set up Clickhouse manually without it)
Steps:
0. Clone the repository (make sure to include submodules!):
```
git clone --recursive https://github.com/boring-nick/rustlog
```
If you already cloned the repo without `--recursive`, you can initialize submodules with:
```
git submodule update --init --recursive
```
1. Set up the database (Clickhouse):
This repository provides a docker-compose to quickly set up Clickhouse. You can use it with:
```
docker-compose -f docker-compose.dev.yml up -d
```
Alternatively, you can install Clickhouse manually using the [official guide](https://clickhouse.com/docs/en/install).
2. Create a config file
Copy `config.dist.json` to `config.json` and configure your database and twitch credentials. If you installed Clickhouse with Docker, the default database configuration works.
3. Build the frontend:
```
cd web
yarn install
yarn build
cd ..
```
4. Build and run rustlog:
```
cargo run
```
You can now access rustlog at http://localhost:8025.
## Migrating from justlog
See [MIGRATION.md](./docs/MIGRATION.md)

12
config.dist.json Normal file
View File

@ -0,0 +1,12 @@
{
"clickhouseUrl": "http://localhost:8123",
"clickhouseDb": "rustlog",
"clickhouseUsername": null,
"clickhousePassword": null,
"listenAddress": "0.0.0.0:8025",
"channels": ["12345"],
"clientID": "id",
"clientSecret": "secret",
"admins": [],
"optOut": {}
}

15
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,15 @@
version: "3.8"
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
volumes:
- "rustlog_ch_data:/var/lib/clickhouse:rw"
environment:
CLICKHOUSE_DB: "rustlog"
ports:
- 8123:8123
- 9000:9000
volumes:
rustlog_ch_data: