README.md 2.19 KB
Newer Older
Christian Pointner's avatar
Christian Pointner committed
1
2
# Import and Playlist Daemon

3
4
Tank implements an AURA import and playlist daemon.

Christian Pointner's avatar
Christian Pointner committed
5
## Quickstart
6
7
8
9
10
11
12

To install tank, use the `go get` command:

```sh
$ go get gitlab.servus.at/autoradio/tank/...
```

13
14
15
16
17
18
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

19
20
21
And then run the `tank` binary:

```sh
22
$ $GOPATH/bin/tank --config config.yaml run --listen localhost:8000
23
```
Christian Pointner's avatar
Christian Pointner committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

## 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.
Christian Pointner's avatar
Christian Pointner committed
71
72
After the daemon has ran the initial migrations you may check out the schema of the database:

Christian Pointner's avatar
Christian Pointner committed
73
```mysql
Christian Pointner's avatar
Christian Pointner committed
74
source info.sql
Christian Pointner's avatar
Christian Pointner committed
75
```
Christian Pointner's avatar
Christian Pointner committed
76
77
78
79

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

```sh
Christian Pointner's avatar
Christian Pointner committed
80
./contrib/mysql/stop_server.sh
Christian Pointner's avatar
Christian Pointner committed
81
82
83
84
85
86
87
88
89
90
91
```

### postgres

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

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

```sh
Christian Pointner's avatar
Christian Pointner committed
92
./contrib/postgres/run_client.sh
Christian Pointner's avatar
Christian Pointner committed
93
94
```

Christian Pointner's avatar
Christian Pointner committed
95
Type the following on the command line:
Christian Pointner's avatar
Christian Pointner committed
96
97
98
99
100
101

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

This command can also be used to empty the database if you want to start with a new one.
Christian Pointner's avatar
Christian Pointner committed
102
103
104
105
106
After the daemon has ran the initial migrations you may check out the schema of the database:

```sh
psql < info.sql
```
Christian Pointner's avatar
Christian Pointner committed
107

Christian Pointner's avatar
Christian Pointner committed
108
Once you are done with the database you can stop the server by pressing ```CTRL-C``` inside the
Christian Pointner's avatar
Christian Pointner committed
109
terminal of the server.