Skip to content
Snippets Groups Projects
Commit 7bb1cc97 authored by Christian Pointner's avatar Christian Pointner
Browse files

added initial app

parent 397fda48
No related branches found
No related tags found
No related merge requests found
tank
##
## tank
##
## Import and Playlist Daemon for autoradio project
##
##
## Copyright (C) 2017 Christian Pointner <equinox@helsinki.at>
##
## This file is part of tank.
##
## tank is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## any later version.
##
## tank is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with tank. If not, see <http://www.gnu.org/licenses/>.
##
GOCMD := go
ifdef GOROOT
GOCMD = $(GOROOT)/bin/go
endif
EXECUTEABLE := tank
all: build
.PHONY: vet format build clean
vet:
$(GOCMD) vet
format:
$(GOCMD) fmt
build:
$(GOCMD) build -o $(EXECUTEABLE)
clean:
rm -f $(EXECUTEABLE)
# whawty.auth app
## How To Install
### Package Manager
The easiest way to install the *whawty.auth app* is by installing one of the packages. For example, Debian packages can be found in the [spreadspace APT Repository](https://build.spreadspace.org/).
### go get
You can install & build the latest development version using `go get`:
```
$ mkdir whawty-auth
$ cd whawty-auth
$ GOPATH=`pwd` go get github.com/whawty/auth/app
$ ./bin/app --help
```
This will create a `app` binary in the `bin` folder, which corresponds to the `whawty-auth` binary.
Since *go get* won't copy static files, you need to specify their location in case you want to run the web app:
```
./bin/app --web-static-dir ./src/github.com/whawty/auth/app/html --store ./auth-store-config.yaml run --web-addr :4242
```
## How To Use
For up to date usage instructions, call the app's binary with the `--help` flag.
Next, you need to create a store, for example by using [init-store.sh](init-store.sh).
//
// tank
//
// Import and Playlist Daemon for autoradio project
//
//
// Copyright (C) 2017 Christian Pointner <equinox@helsinki.at>
//
// This file is part of tank.
//
// tank is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// tank is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with tank. If not, see <http://www.gnu.org/licenses/>.
//
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
)
func cmdInit(c *cli.Context) error {
// TODO: implement this
return cli.NewExitError(fmt.Sprintf("not yet implemented"), -2)
}
func cmdRun(c *cli.Context) error {
// TODO: implement this
return cli.NewExitError(fmt.Sprintf("not yet implemented"), -2)
}
func cmdRunSa(c *cli.Context) error {
// TODO: implement this
return cli.NewExitError(fmt.Sprintf("not yet implemented"), -2)
}
func main() {
app := cli.NewApp()
app.Name = "tank"
app.Version = "0.0.1"
app.Usage = "import & playlist daemon"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config",
Value: "/etc/aura/tank.yaml",
Usage: "path to the configuration file",
EnvVar: "AURA_TANK_CONFIG",
},
}
app.Commands = []cli.Command{
{
Name: "init",
Usage: "initialize the store",
Action: cmdInit,
},
{
Name: "run",
Usage: "run the daemon",
Flags: []cli.Flag{
cli.StringSliceFlag{
Name: "listen",
Usage: "address to listen on for web API",
EnvVar: "AURA_TANK_LISTEN",
},
},
Action: cmdRun,
},
{
Name: "runsa",
Usage: "run the daemon (using systemd socket-activation)",
Action: cmdRunSa,
},
}
app.Run(os.Args)
}
store:
path: "/srv/data"
dbpath: "/var/lib/aura/tank-db.bolt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment