Skip to content
Snippets Groups Projects
README.md 1.95 KiB
Newer Older
Christian Pointner's avatar
Christian Pointner committed
# Import and Playlist Daemon

Tank implements an AURA import and playlist daemon.

Christian Pointner's avatar
Christian Pointner committed
## 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/cmd/tank/sample-cfg.yaml

Make sure that the directory pointed to by ```store.path``` exists and is writeable
for the user running the daemon

And then run the `tank` binary:

```sh
$ $GOPATH/bin/tank --config config.yaml run --listen localhost:8000
Christian Pointner's avatar
Christian Pointner committed

## Development

Check out the repository and build the daemon:

```sh
git clone gitlab.servus.at/autoradio/tank
cd tank
make
```

If you want to change the UI you need to regenerate the bindata assets and rebuild the daemon:

```sh
make ui
make
```

You may run the daemon using the following command:

```sh
./contrib/run.sh
```

This is using ```contrib/sample-cfg.yaml``` and depends on a mysql or postgres server
running on localhost. You may use the scripts inside ```contrib/``` to start docker
containers for this purpose.

### mysql

```sh
./contrib/mysql/run_server.sh
```

Wait for the server to boot up and then initialize the database using a second terminal:

```sh
./contrib/mysql/run_client.sh
```

Type the following on the mysql command line:

```mysql
source init.sql
```

This command can also be used to empty the database if you want to start with a new one.

Once you are done with the database you can stop the server using:

```sh
./contrib/postgres/stop_server.sh
```

### postgres

```sh
./contrib/postgres/run_server.sh
```

Wait for the server to boot up and then initialize the database using a second terminal:

```sh
./contrib/mysql/run_client.sh
```

Type the following on the mysql command line:

```sh
psql < init.sql
```

This command can also be used to empty the database if you want to start with a new one.

Once you are done with the database you can stop the server by pressing CTRl-C inside the
terminal of the server.