Commit acb76b61 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Improve the README, make it easier to start

parent cc0c4565
Pipeline #1150 failed with stages
in 5 minutes and 23 seconds
......@@ -8,27 +8,8 @@ directory.
## Requirements
* [Go](https://golang.org/) (v1.12+ recommended)
## Quickstart
To install tank, use the `go get` command:
```sh
$ go get gitlab.servus.at/autoradio/tank/...
```
Create configuration file see:
https://gitlab.servus.at/autoradio/tank/blob/master/contrib/sample-cfg.yaml
Make sure that the directory pointed to by `store.path` exists and is writeable
for the user running the daemon, and a Postgres database is present and set up
according to the configuration.
And then run the `tank` binary:
```sh
$ $GOPATH/bin/tank --config config.yaml run --listen localhost:8040
```
* Docker (v20.10+)
* GNU Make (v4)
## Development
......@@ -40,7 +21,22 @@ $ cd tank
$ make
```
### Database Setup
## Configuration
Create a configuration file, `tank.yaml`, based on:
https://gitlab.servus.at/aura/tank/-/blob/master/contrib/sample-cfg.yaml
Make sure that the directory pointed to by `store.path` exists and is writeable
for the user running the daemon.
### OIDC Client
After [Registering clients at
Steering](https://gitlab.servus.at/aura/meta/-/blob/master/docs/administration/oidc-client-config.md#registering-clients-at-steering),
update `OIDC_CLIENT_ID` and `OIDC_CLIENT_SECRET` in `contrib/run.sh` to match
your installation.
## Database Setup
First, we need to start a Postgres container:
......@@ -49,25 +45,14 @@ $ ./contrib/run_server.sh
```
Wait for the server to boot up and then initialize the database using a second
terminal, initialize the database:
terminal:
```sh
$ ./contrib/run_client.sh
$$$ psql < init.sql
```
This command can also be used to empty the database if you want to start with a
new one.
After the daemon has applied the initial migrations you may check out the
schema of the database:
```sh
$$$ psql < info.sql
```
Once you are done with the database you can stop the server by pressing
`CTRL-C` inside the terminal of the server.
Once the database is created, you can quit by pressing `CTRL-C`.
Now, you may run the daemon using the following command:
......@@ -75,10 +60,7 @@ Now, you may run the daemon using the following command:
$ ./contrib/run.sh
```
This script is using `contrib/sample-cfg.yaml` and depends on a postgres server
running on localhost.
You may use the scripts inside `contrib/` to start docker containers for this purpose.
This script uses `tank.yaml` and depends on the postgres server running.
## Running behind reverse proxies
......
#!/bin/bash
BASE_D=$(realpath "${BASH_SOURCE%/*}/..")
CONFIG="$BASE_D/tank.yaml"
export AURA_TANK_DEBUG=1
export AURA_TANK_LISTEN=127.0.0.1:8040
......@@ -10,10 +11,7 @@ mkdir -p "${STORE_PATH}"
export ADMIN_PASSWORD="very-secret"
export AURA_ENGINE_SECRET="rather-secret"
export OIDC_CLIENT_ID="693347"
export OIDC_CLIENT_SECRET="f9475d777a2180f71c02cb0d0d56839f8ee6e66e1e2ef5df6c55451b"
export OIDC_CLIENT_ID="937574"
export OIDC_CLIENT_SECRET="ovvJzW2H98bZe2TGxvdhHjLs15xEcr9y"
#export OIDC_CLIENT_ID="106243"
#export OIDC_CLIENT_SECRET="942234084668700fd3c86227a04be646aa9323afa7f69f913d8abe99"
"$BASE_D/tank" --config "$BASE_D/contrib/sample-cfg.yaml" run
[ -f $CONFIG ] && "$BASE_D/tank" --config "$CONFIG" run || echo "tank.yaml is missing"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment