add installation instructions in readme

This commit is contained in:
Miraty 2024-04-25 19:26:51 +02:00
parent cabdcd53e7
commit d3dd930451
1 changed files with 46 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# services
contains 2 binaries:
Contains 2 binaries:
* `services` to display and add new services using a Web interface
* `updater` to update existing services uptime and metadata
@ -31,6 +31,51 @@ contains 2 binaries:
[kdl-rs](https://docs.rs/kdl-rs/)
: parse [KDL](https://kdl.dev/) configuration
## Installation
### Tooling
Install Rust and Cargo. If your distribution doesn't ship with recent enough versions, you can get them with [Rustup](https://rustup.rs/).
Install [Diesel CLI](https://diesel.rs/guides/getting-started#installing-diesel-cli). If your distribution doesn't ship it, you can install it using:
```shell
cargo install diesel_cli --no-default-features --features sqlite
```
### Data setup
Create SQLite database:
```shell
diesel database setup --database-url services.db
```
Download and decompress the combined [IPtoASN](https://iptoasn.com/) TSV file:
```shell
curl https://iptoasn.com/data/ip2asn-combined.tsv.gz | zcat > ip2asn-combined.tsv
```
### For development
```shell
cargo run --bin services
cargo run --bin updater
```
### For real use
Download dependencies:
```shell
cargo fetch --locked
```
Build (delete `` for a development build):
```shell
cargo build --frozen --release
```
* `target/release/services` should be HTTP reverse-proxied
* `target/release/updater` should be run periodically using a cron
## License
You can use, redistribute or modify under the terms of the CNPL-NAv7+ as found in [`LICENSE.md`](LICENSE.md) or at <https://git.pixie.town/thufie/npl-builder>.