From 6b6c11eb632d7f274c37e1b7c98560e0605f558b Mon Sep 17 00:00:00 2001 From: Greg Linton Date: Thu, 18 May 2017 12:16:11 -0600 Subject: [PATCH] Add boxfile and example config --- .gitignore | 1 + README.md | 5 +++-- boxfile.yml | 33 +++++++++++++++++++++++++++++++++ config.json | 15 +++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 boxfile.yml create mode 100644 config.json diff --git a/.gitignore b/.gitignore index ee464f1..782d34c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ build logvac logvac.json *.cover* +db diff --git a/README.md b/README.md index d32088b..f64c9d2 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ curl -k "https://127.0.0.1:6360?type=log&auth=TOKEN" ``` #### Gotchas -- If you're seeing the following error, run logvac with admin or sudo privileges: -`FATAL Authenticator failed to initialize - open /var/db/log-auth.bolt: permission denied` +- If you're seeing any of the following errors, run logvac with admin or sudo privileges (or adjust your configuration): + - `FATAL Authenticator failed to initialize - open /var/db/log-auth.bolt: permission denied` + - `Collector failed to initialize - listen udp 127.0.0.1:514: bind: permission denied` - If logvac doesn't seem to be doing anything (adding/fecthing logs), there is a chance you've started the server with authentication (the default) but have forgotten to add a token: `logvac add-token -t TOKEN` diff --git a/boxfile.yml b/boxfile.yml new file mode 100644 index 0000000..9a15407 --- /dev/null +++ b/boxfile.yml @@ -0,0 +1,33 @@ +# This boxfile is for use with nanobox.io's `nanbox` cli. Simply +# run `nanobox run` to test/develop, or run `nanobox deploy dry-run` +# to utilize. (Note the port mapping that will occur in dry-run) + +run.config: + engine: 'golang' + engine.config: + package: 'github.com/nanopack/logvac' + extra_steps: + - go get github.com/nanopack/mist + - go build -o logvac + +deploy.config: + extra_steps: + - go get github.com/nanopack/mist + - cp $(which mist) $APP_DIR/mist + - cp $CODE_DIR/config.json $APP_DIR/config.json + +data.storage: + image: nanobox/unfs + +web.logvac: + network_dirs: + data.storage: + - db/ + ports: + - tcp:8080:1445 # for mist (subscribe to logs) + - tcp:6360:6360 # for adding users or posting logs via http + - tcp:6361:6361 # for submitting logs via tcp + - udp:514:6361 # for submitting logs via udp + start: + mist: './mist --server --listeners "tcp://0.0.0.0:1445"' + logvac: './logvac -c config.json' diff --git a/config.json b/config.json new file mode 100644 index 0000000..f938377 --- /dev/null +++ b/config.json @@ -0,0 +1,15 @@ +{ + "listen-http": "0.0.0.0:6360", + "listen-udp": "0.0.0.0:6361", + "listen-tcp": "0.0.0.0:6361", + "pub-address": "mist://localhost:1445", + "pub-auth": "secret", + "db-address": "boltdb:///app/db/db.bolt", + "auth-address": "boltdb:///app/db/log-auth.bolt", + "log-keep": "{\"app\":\"5m\"}", + "log-type": "app", + "log-level": "debug", + "token": "secret", + "server": true, + "insecure": true +}