From 03edde060cf06661f1268393d70a8e9de6d6fed6 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 28 Dec 2019 20:00:03 -0800
Subject: [PATCH 01/25] update links/readme/license
---
LICENSE | 3 +--
README.md | 36 ++++++++++++++++--------------------
2 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/LICENSE b/LICENSE
index 8a7e32d3..6d5fa682 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,5 @@
MIT LICENSE.
-Copyright (c) 2016 Garrett Bjerkhoel
-Copyright (c) 2018-2019 David Newhall II
+Copyright (c) 2018-2020 David Newhall II
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/README.md b/README.md
index ca07e6d5..c9f7e9ad 100644
--- a/README.md
+++ b/README.md
@@ -1,28 +1,28 @@
-
+
[](https://discord.gg/KnyKYt2)
[](https://twitter.com/TwitchCaptain)
[](http://grafana.com/dashboards?search=unifi-poller)
[](https://hub.docker.com/r/golift/unifi-poller)
-[](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller)
+[](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller)
[](https://github.com/golift/unifi)
[](https://github.com/golift/application-builder)
-[](https://github.com/davidnewhall/unifi-poller)
-[](https://travis-ci.org/davidnewhall/unifi-poller)
+[](https://github.com/unifi-poller/unifi-poller)
+[](https://travis-ci.org/unifi-poller/unifi-poller)
Collect your UniFi controller data and report it to an InfluxDB instance,
or export it for Prometheus collection. Prometheus support is
-[new](https://github.com/davidnewhall/unifi-poller/issues/88), and much
+[new](https://github.com/unifi-poller/unifi-poller/issues/88), and much
of the documentation still needs to be updated; 12/2/2019.
[Ten Grafana Dashboards](http://grafana.com/dashboards?search=unifi-poller)
included; with screenshots. Five for InfluxDB and five for Prometheus.
## Installation
-[See the Wiki!](https://github.com/davidnewhall/unifi-poller/wiki/Installation)
-We have a special place for [Docker Users](https://github.com/davidnewhall/unifi-poller/wiki/Docker).
+[See the Wiki!](https://github.com/unifi-poller/unifi-poller/wiki/Installation)
+We have a special place for [Docker Users](https://github.com/unifi-poller/unifi-poller/wiki/Docker).
I'm willing to help if you have troubles.
-Open an [Issue](https://github.com/davidnewhall/unifi-poller/issues) and
+Open an [Issue](https://github.com/unifi-poller/unifi-poller/issues) and
we'll figure out how to get things working for you. You can also get help in
the #unifi-poller channel on the [Ubiquiti Discord server](https://discord.gg/KnyKYt2).
I've also [provided a forum post](https://community.ui.com/questions/Unifi-Poller-Store-Unifi-Controller-Metrics-in-InfluxDB-without-SNMP/58a0ea34-d2b3-41cd-93bb-d95d3896d1a1) you may use to get additional help.
@@ -45,19 +45,17 @@ Controller API data into Prometheus exports on the fly.
This application requires your controller to be running all the time. If you run
a UniFi controller, there's no excuse not to install
-[Influx](https://github.com/davidnewhall/unifi-poller/wiki/InfluxDB) or
+[Influx](https://github.com/unifi-poller/unifi-poller/wiki/InfluxDB) or
[Prometheus](https://prometheus.io),
-[Grafana](https://github.com/davidnewhall/unifi-poller/wiki/Grafana) and this app.
+[Grafana](https://github.com/unifi-poller/unifi-poller/wiki/Grafana) and this app.
You'll have a plethora of data at your fingertips and the ability to craft custom
graphs to slice the data any way you choose. Good luck!
## Backstory
I found a simple piece of code on GitHub that sorta did what I needed;
we all know that story. I wanted more data, so I added more data collection.
-I believe I've completely rewritten every piece of original code, except the
-copyright/license file and that's fine with me. I probably wouldn't have made
-it this far if [Garrett](https://github.com/dewski/unifi) hadn't written the
-original code I started with. Many props my man.
+I probably wouldn't have made it this far if [Garrett](https://github.com/dewski/unifi)
+hadn't written the original code I started with. Many props my man.
The original code pulled only the client data. This app now pulls data
for clients, access points, security gateways, dream machines and switches. I
@@ -78,7 +76,7 @@ for making this dashboard; it gave me a fantastic start to making my own dashboa
You can control this app with puppet, chef, saltstack, homebrew or a simple bash
script if you needed to. Packages are available for macOS, Linux and Docker.
It comes with a systemd service unit that allows you automatically start it up on most Linux hosts.
-It works just fine on [Windows](https://github.com/davidnewhall/unifi-poller/wiki/Windows) too.
+It works just fine on [Windows](https://github.com/unifi-poller/unifi-poller/wiki/Windows) too.
Most people prefer Docker, and this app is right at home in that environment.
## Development
@@ -88,8 +86,7 @@ means, if you wanted to do something like make telegraf collect your data instea
of UniFi Poller you can achieve that with a little bit of Go code. You could write
a small app that acts as a telegraf input plugin using the [unifi](https://github.com/golift/unifi)
library to grab the data from your controller. As a bonus, all of the code in UniFi Poller is
-[in libraries](https://godoc.org/github.com/davidnewhall/unifi-poller/pkg)
-and can be used in other projects.
+[in libraries](https://github.com/unifi-poller/) and can be used in other projects.
## What's it look like?
@@ -126,8 +123,7 @@ documentation support. This project succeeds because of them. Thank you!
## Copyright & License
-
+
-- Copyright © 2016 Garrett Bjerkhoel.
-- Copyright © 2018-2019 David Newhall II.
+- Copyright © 2018-2020 David Newhall II.
- See [LICENSE](LICENSE) for license information.
From 4140bb274628a2e0cb661edf389d6dbda62defc6 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 28 Dec 2019 20:23:23 -0800
Subject: [PATCH 02/25] Fix import paths
---
go.mod | 8 ++++----
go.sum | 27 ++++++++++-----------------
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/go.mod b/go.mod
index 169f31ca..d3dc1492 100644
--- a/go.mod
+++ b/go.mod
@@ -3,10 +3,10 @@ module github.com/unifi-poller/unifi-poller
go 1.13
require (
- github.com/unifi-poller/influxunifi v0.0.1
- github.com/unifi-poller/inputunifi v0.0.1
- github.com/unifi-poller/poller v0.0.1
- github.com/unifi-poller/promunifi v0.0.1
+ github.com/unifi-poller/influxunifi v0.0.2
+ github.com/unifi-poller/inputunifi v0.0.2
+ github.com/unifi-poller/poller v0.0.2
+ github.com/unifi-poller/promunifi v0.0.2
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 // indirect
gopkg.in/yaml.v2 v2.2.7 // indirect
)
diff --git a/go.sum b/go.sum
index cec9ab94..7c3d629a 100644
--- a/go.sum
+++ b/go.sum
@@ -65,20 +65,17 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/unifi-poller/influxunifi v0.0.0-20191229010055-eac7cb2786a8 h1:6tLYxh52e01ZiL+qxBRssEzXHqKjryog9Ez08hnRdbI=
-github.com/unifi-poller/influxunifi v0.0.0-20191229010055-eac7cb2786a8/go.mod h1:wYuSwHJnuYHMQyLs9ZnDSoZkAj/otg229+8PytZ6lJw=
-github.com/unifi-poller/influxunifi v0.0.1 h1:zHTa1Wf+2bke+qoLoRmgtFjWq/Yr0Cr+ZjtrtawefRM=
-github.com/unifi-poller/influxunifi v0.0.1/go.mod h1:wYuSwHJnuYHMQyLs9ZnDSoZkAj/otg229+8PytZ6lJw=
-github.com/unifi-poller/inputunifi v0.0.0-20191229005859-343b6711d445 h1:bsEkBa6xK1M9/g/rBrIc6qLeel4kqvtqnNyXLDhu4Uw=
-github.com/unifi-poller/inputunifi v0.0.0-20191229005859-343b6711d445/go.mod h1:gmgiDi8RbaAJvtGf9ybDB+eguJzl/xyrpoqH5JUdWEk=
-github.com/unifi-poller/inputunifi v0.0.1 h1:97s6pneYypvYV+RPgI5CgsRsrCYJyqqsVtaBoDprgsk=
-github.com/unifi-poller/inputunifi v0.0.1/go.mod h1:gmgiDi8RbaAJvtGf9ybDB+eguJzl/xyrpoqH5JUdWEk=
-github.com/unifi-poller/poller v0.0.1 h1:/SIsahlUEVJ+v9+C94spjV58+MIqR5DucVZqOstj2vM=
+github.com/unifi-poller/influxunifi v0.0.2 h1:7wCUCIe3DUmXpAFClxkmnmc0oxfMlLkrnogNAVZW62w=
+github.com/unifi-poller/influxunifi v0.0.2/go.mod h1:wYuSwHJnuYHMQyLs9ZnDSoZkAj/otg229+8PytZ6lJw=
+github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
+github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
github.com/unifi-poller/poller v0.0.1/go.mod h1:sZfDL7wcVwenlkrm/92bsSuoKKUnjj0bwcSUCT+aA2s=
-github.com/unifi-poller/promunifi v0.0.0-20191229005654-36c9f9b67ca7 h1:82q6vD+Ij8RmLoGng5/exRrnFRYm2/tpkKOVhEUH864=
-github.com/unifi-poller/promunifi v0.0.0-20191229005654-36c9f9b67ca7/go.mod h1:U1fEJ/lCYTjkHmFhDBdEBMzIECo5Jz2G7ZBKtM7zkAw=
-github.com/unifi-poller/promunifi v0.0.1 h1:KMZPE73VyA/BQDuL3Oo6m5+hAU0solGoZ/9m7dAJtoI=
-github.com/unifi-poller/promunifi v0.0.1/go.mod h1:U1fEJ/lCYTjkHmFhDBdEBMzIECo5Jz2G7ZBKtM7zkAw=
+github.com/unifi-poller/poller v0.0.2 h1:qUDSon8UIqRYOXd+V+3jThf2CSE/glQK8MSDmp20STU=
+github.com/unifi-poller/poller v0.0.2/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
+github.com/unifi-poller/promunifi v0.0.2 h1:NZUJT6CdZkQPNKzjC+lUeZQ/N20njZGIidbAD0pVU0Q=
+github.com/unifi-poller/promunifi v0.0.2/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
+github.com/unifi-poller/unifi v0.0.1 h1:8LTf0RyxMdDLmzm59mk7bz5/qfC1hHmC21u/uqx2vSQ=
+github.com/unifi-poller/unifi v0.0.1/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -90,7 +87,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -99,12 +95,9 @@ golift.io/cnfg v0.0.5 h1:HnMU8Z9C/igKvir1dqaHx5BPuNGZrp99FCtdJyP2Z4I=
golift.io/cnfg v0.0.5/go.mod h1:ScFDIJg/rJGHbRaed/i7g1lBhywEjB0JiP2uZr3xC3A=
golift.io/unifi v0.0.400 h1:r8FlE+p+zmm8jnQdT367H2aGVMTgxZTrHSwbsHBcayA=
golift.io/unifi v0.0.400/go.mod h1:4BjegFlwA3am3mPlY0qHAnSKli4eexLQV42QKaRx9OY=
-golift.io/unifi v4.1.6+incompatible h1:Yhb/+obX2vT9i6PElGislSuQ1WUtOf+l+sRjVxlY6nM=
-golift.io/unifi v4.1.6+incompatible/go.mod h1:Zjw57ZAzTzCMw784pE8CdCFgkYSzVZzmJ++WUttbjto=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
From 00aad69a3f39bdfe85c519c176cd54d3ad4b6211 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sun, 29 Dec 2019 00:17:49 -0800
Subject: [PATCH 03/25] fix imports
---
go.mod | 4 +---
go.sum | 12 +++---------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/go.mod b/go.mod
index d3dc1492..c1c17696 100644
--- a/go.mod
+++ b/go.mod
@@ -3,10 +3,8 @@ module github.com/unifi-poller/unifi-poller
go 1.13
require (
- github.com/unifi-poller/influxunifi v0.0.2
+ github.com/unifi-poller/influxunifi v0.0.3
github.com/unifi-poller/inputunifi v0.0.2
github.com/unifi-poller/poller v0.0.2
github.com/unifi-poller/promunifi v0.0.2
- golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 // indirect
- gopkg.in/yaml.v2 v2.2.7 // indirect
)
diff --git a/go.sum b/go.sum
index 7c3d629a..46cb23ae 100644
--- a/go.sum
+++ b/go.sum
@@ -65,11 +65,10 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/unifi-poller/influxunifi v0.0.2 h1:7wCUCIe3DUmXpAFClxkmnmc0oxfMlLkrnogNAVZW62w=
-github.com/unifi-poller/influxunifi v0.0.2/go.mod h1:wYuSwHJnuYHMQyLs9ZnDSoZkAj/otg229+8PytZ6lJw=
+github.com/unifi-poller/influxunifi v0.0.3 h1:/3Ua1g5Z1toLxulb3Z4VflLWhUDh+/P8XboGl1YqDK4=
+github.com/unifi-poller/influxunifi v0.0.3/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
-github.com/unifi-poller/poller v0.0.1/go.mod h1:sZfDL7wcVwenlkrm/92bsSuoKKUnjj0bwcSUCT+aA2s=
github.com/unifi-poller/poller v0.0.2 h1:qUDSon8UIqRYOXd+V+3jThf2CSE/glQK8MSDmp20STU=
github.com/unifi-poller/poller v0.0.2/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
github.com/unifi-poller/promunifi v0.0.2 h1:NZUJT6CdZkQPNKzjC+lUeZQ/N20njZGIidbAD0pVU0Q=
@@ -88,16 +87,11 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golift.io/cnfg v0.0.5 h1:HnMU8Z9C/igKvir1dqaHx5BPuNGZrp99FCtdJyP2Z4I=
golift.io/cnfg v0.0.5/go.mod h1:ScFDIJg/rJGHbRaed/i7g1lBhywEjB0JiP2uZr3xC3A=
-golift.io/unifi v0.0.400 h1:r8FlE+p+zmm8jnQdT367H2aGVMTgxZTrHSwbsHBcayA=
-golift.io/unifi v0.0.400/go.mod h1:4BjegFlwA3am3mPlY0qHAnSKli4eexLQV42QKaRx9OY=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
-gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
From b4ad0e532fc0375a1d761678130ed2749021f595 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sun, 29 Dec 2019 04:15:18 -0800
Subject: [PATCH 04/25] fix links
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c9f7e9ad..66f6b659 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,12 @@
[](https://twitter.com/TwitchCaptain)
[](http://grafana.com/dashboards?search=unifi-poller)
[](https://hub.docker.com/r/golift/unifi-poller)
-[](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller)
+[](https://www.somsubhra.com/github-release-stats/?username=unifi-poller&repository=unifi-poller)
[](https://github.com/golift/unifi)
[](https://github.com/golift/application-builder)
[](https://github.com/unifi-poller/unifi-poller)
-[](https://travis-ci.org/unifi-poller/unifi-poller)
+[](https://travis-ci.org/unifi-poller/unifi-poller)
Collect your UniFi controller data and report it to an InfluxDB instance,
or export it for Prometheus collection. Prometheus support is
From d18b1f4f2d19a15657dcc9c75e0d481abdfc0b83 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sun, 29 Dec 2019 18:36:32 -0800
Subject: [PATCH 05/25] fix prerelease build
---
init/docker/hooks/push | 11 ++++++++++-
scripts/formula-deploy.sh | 17 -----------------
2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/init/docker/hooks/push b/init/docker/hooks/push
index b4c52546..d3f8e184 100755
--- a/init/docker/hooks/push
+++ b/init/docker/hooks/push
@@ -25,7 +25,16 @@ done
echo "Annotating Images: ${IMAGES}"
# Build all the Docker tags if the source branch is a release and not a branch.
-[ "v$VERSION" != "$SOURCE_BRANCH" ] || TAGS="latest $VERSION $SHORTVER stable"
+if [ "v$VERSION" == "$SOURCE_BRANCH" ]; then
+ TAGS="$VERSION $(echo $VERSION | cut -d. -f1,2)"
+
+ echo $SOURCE_BRANCH | grep -q -- -
+ if [ "$?" == "1" ]; then
+ # tag does not contain a dash, so assume it's a prod tag.
+ TAGS="$TAGS latest stable"
+ fi
+fi
+
echo "Version: $VERSION, Source: $SOURCE_BRANCH, Building tags: ${TAGS}"
# Create multi-architecture manifests for each tag with all the built images.
diff --git a/scripts/formula-deploy.sh b/scripts/formula-deploy.sh
index 843c5139..b93d92e5 100755
--- a/scripts/formula-deploy.sh
+++ b/scripts/formula-deploy.sh
@@ -16,23 +16,6 @@ git config --global user.name "${BINARY}-auto-releaser"
rm -rf homebrew_release_repo
git clone git@github.com:${HBREPO}.git homebrew_release_repo
-# If a bitly token file exists, we'll use that to shorten the link (and allow download counting).
-if [ -f "bitly_token" ]; then
- API=https://api-ssl.bitly.com/v4/bitlinks
- # Request payload. In single quotes with double quotes escaped. :see_no_evil:
- JSON='{\"domain\": \"bit.ly\",\"title\": \"${BINARY}.v${VERSION}-${ITERATION}.tgz\", \
- \"tags\": [\"${BINARY}\"], \"long_url\": \"${SOURCE_PATH}\"}'
- # Request with headers and data. Using bash -c to hide token from bash -x in travis logs.
- OUT=$(bash -c "curl -s -X POST -H 'Content-type: application/json' ${API} -H \"\$( ${BINARY}.rb.new
- if [ "$?" = "0" ] && [ "$LINK" != "null?v=v${VERSION}" ] && [ "$LINK" != "?v=v${VERSION}" ]; then
- mv ${BINARY}.rb.new ${BINARY}.rb
- fi
-fi
-
cp ${BINARY}.rb homebrew_release_repo/Formula
pushd homebrew_release_repo
git add Formula/${BINARY}.rb
From 44965a7bbf07acdbd85331d0a4becb9c672cd8f2 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sun, 29 Dec 2019 20:11:31 -0800
Subject: [PATCH 06/25] update librarires (master)
---
.metadata.sh | 6 ++----
go.mod | 8 ++++----
go.sum | 11 +++++++++++
init/docker/hooks/push | 4 ++--
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/.metadata.sh b/.metadata.sh
index a3346a21..fe0f91d1 100755
--- a/.metadata.sh
+++ b/.metadata.sh
@@ -4,8 +4,6 @@
# Must match the repo name.
BINARY="unifi-poller"
-# github username
-GHUSER="davidnewhall"
# Github repo containing homebrew formula repo.
HBREPO="golift/homebrew-mugs"
MAINT="David Newhall II "
@@ -19,14 +17,14 @@ LICENSE="MIT"
# This affects the homebrew formula (launchd) and linux packages (systemd).
FORMULA="service"
-export BINARY GHUSER HBREPO MAINT VENDOR DESC GOLANGCI_LINT_ARGS CONFIG_FILE LICENSE FORMULA
+export BINARY HBREPO MAINT VENDOR DESC GOLANGCI_LINT_ARGS CONFIG_FILE LICENSE FORMULA
# The rest is mostly automatic.
# Fix the repo if it doesn't match the binary name.
# Provide a better URL if one exists.
# Used for source links and wiki links.
-SOURCE_URL="https://github.com/${GHUSER}/${BINARY}"
+SOURCE_URL="https://github.com/${BINARY}/${BINARY}"
# Used for documentation links.
URL="${SOURCE_URL}"
diff --git a/go.mod b/go.mod
index c1c17696..f4c894bb 100644
--- a/go.mod
+++ b/go.mod
@@ -3,8 +3,8 @@ module github.com/unifi-poller/unifi-poller
go 1.13
require (
- github.com/unifi-poller/influxunifi v0.0.3
- github.com/unifi-poller/inputunifi v0.0.2
- github.com/unifi-poller/poller v0.0.2
- github.com/unifi-poller/promunifi v0.0.2
+ github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad
+ github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703
+ github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4
+ github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8
)
diff --git a/go.sum b/go.sum
index 46cb23ae..88d25dca 100644
--- a/go.sum
+++ b/go.sum
@@ -67,12 +67,22 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/unifi-poller/influxunifi v0.0.3 h1:/3Ua1g5Z1toLxulb3Z4VflLWhUDh+/P8XboGl1YqDK4=
github.com/unifi-poller/influxunifi v0.0.3/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
+github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad h1:jyMZJsZNPv7x/UTaOmMyqdRc/290v6KipEeW0cr4aNY=
+github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
+github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55 h1:LEhiYG1KtaOikcPOJoltWFv63/+X/puP/Cj6cnU71nM=
+github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
+github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703 h1:A/utQrJXY9CxtRQbvMjGXJFe1ayzS1UzzeLIOv4U3m8=
+github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
github.com/unifi-poller/poller v0.0.2 h1:qUDSon8UIqRYOXd+V+3jThf2CSE/glQK8MSDmp20STU=
github.com/unifi-poller/poller v0.0.2/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
+github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4 h1:LV8RbR7zBHIqR7G3EO/TyzJ2Hfz+FI40WgAy9Fd47o4=
+github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
github.com/unifi-poller/promunifi v0.0.2 h1:NZUJT6CdZkQPNKzjC+lUeZQ/N20njZGIidbAD0pVU0Q=
github.com/unifi-poller/promunifi v0.0.2/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
+github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8 h1:gUAvyaSriSYRHNfoVdL2mIVCOtjVjOzKbcGPh80rT5U=
+github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
github.com/unifi-poller/unifi v0.0.1 h1:8LTf0RyxMdDLmzm59mk7bz5/qfC1hHmC21u/uqx2vSQ=
github.com/unifi-poller/unifi v0.0.1/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -86,6 +96,7 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golift.io/cnfg v0.0.5 h1:HnMU8Z9C/igKvir1dqaHx5BPuNGZrp99FCtdJyP2Z4I=
diff --git a/init/docker/hooks/push b/init/docker/hooks/push
index d3f8e184..d345b007 100755
--- a/init/docker/hooks/push
+++ b/init/docker/hooks/push
@@ -25,11 +25,11 @@ done
echo "Annotating Images: ${IMAGES}"
# Build all the Docker tags if the source branch is a release and not a branch.
-if [ "v$VERSION" == "$SOURCE_BRANCH" ]; then
+if [ "v$VERSION" = "$SOURCE_BRANCH" ]; then
TAGS="$VERSION $(echo $VERSION | cut -d. -f1,2)"
echo $SOURCE_BRANCH | grep -q -- -
- if [ "$?" == "1" ]; then
+ if [ "$?" = "1" ]; then
# tag does not contain a dash, so assume it's a prod tag.
TAGS="$TAGS latest stable"
fi
From a7f5bf765c9bfd6e253dae2906e9240e565b8802 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sun, 29 Dec 2019 20:43:55 -0800
Subject: [PATCH 07/25] update contributors
---
CONTRIBUTING.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 004875b7..4802a382 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -68,6 +68,9 @@ hash it out. I'm reasonable.
If you're trying to fix something in the UniFi data collection (ie. you got an
unmarshal error, or you want to add something I didn't include) then you
-should look at the [UniFi library](https://github.com/golift/unifi). All the
+should look at the [UniFi library](https://github.com/unifi-poller/unifi). All the
data collection and export code lives there. Contributions and Issues are welcome
on that code base as well.
+
+This application is very dynamic and built using several package repos.
+They are all in the [UniFi Poller GitHub Org](https://github.com/unifi-poller).
From 0f255aec5b0d0b2146dc52cd7fdb0eed65d8dc85 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Mon, 30 Dec 2019 15:07:43 -0800
Subject: [PATCH 08/25] add plugins folder
---
plugins/README.md | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 plugins/README.md
diff --git a/plugins/README.md b/plugins/README.md
new file mode 100644
index 00000000..1efd89bf
--- /dev/null
+++ b/plugins/README.md
@@ -0,0 +1,3 @@
+Copy your plugins into this folder and run `make plugins` to build them.
+There is an example plugin available:
+[https://github.com/unifi-poller/mysqlunifi](https://github.com/unifi-poller/mysqlunifi)
From 5267bc9e5777cdc6795710618e58b70732ccb719 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Mon, 30 Dec 2019 16:28:09 -0800
Subject: [PATCH 09/25] Update Imports
---
go.mod | 9 +++++----
go.sum | 10 ++++++++++
main.go | 2 ++
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/go.mod b/go.mod
index f4c894bb..0a2a481f 100644
--- a/go.mod
+++ b/go.mod
@@ -3,8 +3,9 @@ module github.com/unifi-poller/unifi-poller
go 1.13
require (
- github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad
- github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703
- github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4
- github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8
+ github.com/unifi-poller/influxunifi v0.0.4
+ github.com/unifi-poller/inputunifi v0.0.4
+ github.com/unifi-poller/poller v0.0.3
+ github.com/unifi-poller/promunifi v0.0.3
+ github.com/unifi-poller/unifi v0.0.2
)
diff --git a/go.sum b/go.sum
index 88d25dca..dc70c7fd 100644
--- a/go.sum
+++ b/go.sum
@@ -69,22 +69,32 @@ github.com/unifi-poller/influxunifi v0.0.3 h1:/3Ua1g5Z1toLxulb3Z4VflLWhUDh+/P8Xb
github.com/unifi-poller/influxunifi v0.0.3/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad h1:jyMZJsZNPv7x/UTaOmMyqdRc/290v6KipEeW0cr4aNY=
github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
+github.com/unifi-poller/influxunifi v0.0.4 h1:gF8OHxgH17p/HoagcJ5y6XJWW30mUpSnU/mSZLShbtI=
+github.com/unifi-poller/influxunifi v0.0.4/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55 h1:LEhiYG1KtaOikcPOJoltWFv63/+X/puP/Cj6cnU71nM=
github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703 h1:A/utQrJXY9CxtRQbvMjGXJFe1ayzS1UzzeLIOv4U3m8=
github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
+github.com/unifi-poller/inputunifi v0.0.4 h1:43fF8gONEICtKnE5eFgj0KFCge4S/+IGYlKLzDx2RqU=
+github.com/unifi-poller/inputunifi v0.0.4/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo=
github.com/unifi-poller/poller v0.0.2 h1:qUDSon8UIqRYOXd+V+3jThf2CSE/glQK8MSDmp20STU=
github.com/unifi-poller/poller v0.0.2/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4 h1:LV8RbR7zBHIqR7G3EO/TyzJ2Hfz+FI40WgAy9Fd47o4=
github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
+github.com/unifi-poller/poller v0.0.3 h1:VrVx+1jvVcRh11TyO9nn58el/nvWcRKtGwzrg80a0SQ=
+github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
github.com/unifi-poller/promunifi v0.0.2 h1:NZUJT6CdZkQPNKzjC+lUeZQ/N20njZGIidbAD0pVU0Q=
github.com/unifi-poller/promunifi v0.0.2/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8 h1:gUAvyaSriSYRHNfoVdL2mIVCOtjVjOzKbcGPh80rT5U=
github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
+github.com/unifi-poller/promunifi v0.0.3 h1:xryrhCh9EXbUY7ZvBLq0lVjH8z6DUfJBU2FRovz0GlM=
+github.com/unifi-poller/promunifi v0.0.3/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/unifi v0.0.1 h1:8LTf0RyxMdDLmzm59mk7bz5/qfC1hHmC21u/uqx2vSQ=
github.com/unifi-poller/unifi v0.0.1/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
+github.com/unifi-poller/unifi v0.0.2 h1:FRa6G+VcxOdvy0/u/QLCHGCRYF6EDcxVYij0dDRCKxg=
+github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
diff --git a/main.go b/main.go
index c39d81fc..b1f088c4 100644
--- a/main.go
+++ b/main.go
@@ -6,6 +6,8 @@ import (
"github.com/unifi-poller/poller"
// Load input plugins!
_ "github.com/unifi-poller/inputunifi"
+ _ "github.com/unifi-poller/unifi"
+
// Load output plugins!
_ "github.com/unifi-poller/influxunifi"
_ "github.com/unifi-poller/promunifi"
From 623e4ef97a88abaa68dd118891d94719c4c64e6e Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Thu, 30 Jan 2020 18:21:34 -0800
Subject: [PATCH 10/25] vendor updates
---
.gitignore | 2 ++
Makefile | 3 +--
go.mod | 9 +++++++++
go.sum | 35 +++++++++++++++++++++++++++++++++++
4 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0ce3cb2d..6471c934 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
/up.conf
/unifi-poller
/unifi-poller*.gz
+/unifi-poller*.txz
/unifi-poller*.zip
/unifi-poller*.1
/unifi-poller*.deb
@@ -8,6 +9,7 @@
/unifi-poller*.arm
/unifi-poller*.exe
/unifi-poller*.macos
+/unifi-poller*.bsd
/unifi-poller*.linux
/unifi-poller.rb
*.sha256
diff --git a/Makefile b/Makefile
index 101e78f6..e39117d7 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,6 @@ IGNORED:=$(shell bash -c "source .metadata.sh ; env | sed 's/=/:=/;s/^/export /'
# md2roff turns markdown into man files and html files.
MD2ROFF_BIN=github.com/github/hub/md2roff-bin
-
# Travis CI passes the version in. Local builds get it from the current git tag.
ifeq ($(VERSION),)
include .metadata.make
@@ -53,7 +52,7 @@ VERSION_LDFLAGS:= \
# Makefile targets follow.
-all: build
+all: clean build
# Prepare a release. Called in Travis CI.
release: clean macos windows linux_packages
diff --git a/go.mod b/go.mod
index 0a2a481f..794fbd40 100644
--- a/go.mod
+++ b/go.mod
@@ -3,9 +3,18 @@ module github.com/unifi-poller/unifi-poller
go 1.13
require (
+ github.com/github/hub v2.11.2+incompatible // indirect
+ github.com/golang/protobuf v1.3.3 // indirect
+ github.com/mattn/go-colorable v0.1.4 // indirect
+ github.com/mattn/go-isatty v0.0.11 // indirect
+ github.com/prometheus/client_golang v1.4.0 // indirect
+ github.com/russross/blackfriday v2.0.0+incompatible // indirect
+ github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/unifi-poller/influxunifi v0.0.4
github.com/unifi-poller/inputunifi v0.0.4
github.com/unifi-poller/poller v0.0.3
github.com/unifi-poller/promunifi v0.0.3
github.com/unifi-poller/unifi v0.0.2
+ golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
+ gopkg.in/yaml.v2 v2.2.8 // indirect
)
diff --git a/go.sum b/go.sum
index dc70c7fd..b67ef474 100644
--- a/go.sum
+++ b/go.sum
@@ -12,6 +12,8 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/github/hub v2.11.2+incompatible h1:H0wUQmNZVxF2+XyGPTsOxUVrRrFnTq133tezo6u4X4U=
+github.com/github/hub v2.11.2+incompatible/go.mod h1:zQrzJEdze2hfWJDgktd/L6sROjAdCThFrzjbxw4keTs=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -22,15 +24,27 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
+github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
+github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
+github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
+github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -45,17 +59,27 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc=
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
+github.com/prometheus/client_golang v1.4.0 h1:YVIb/fVcOTMSqtqZWSKnHpSLBxu8DKgxq8z6RuBZwqI=
+github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE=
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
+github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
+github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
+github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
+github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=
+github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -105,14 +129,25 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
+golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golift.io/cnfg v0.0.5 h1:HnMU8Z9C/igKvir1dqaHx5BPuNGZrp99FCtdJyP2Z4I=
golift.io/cnfg v0.0.5/go.mod h1:ScFDIJg/rJGHbRaed/i7g1lBhywEjB0JiP2uZr3xC3A=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
From 90f57b16c61b207c349188410d13ca40f46fedb3 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Fri, 31 Jan 2020 03:46:29 -0800
Subject: [PATCH 11/25] Working dpi and no bugs.
---
go.mod | 4 ++--
go.sum | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/go.mod b/go.mod
index 794fbd40..b9a1d0a8 100644
--- a/go.mod
+++ b/go.mod
@@ -10,10 +10,10 @@ require (
github.com/prometheus/client_golang v1.4.0 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
- github.com/unifi-poller/influxunifi v0.0.4
+ github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423
github.com/unifi-poller/inputunifi v0.0.4
github.com/unifi-poller/poller v0.0.3
- github.com/unifi-poller/promunifi v0.0.3
+ github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1
github.com/unifi-poller/unifi v0.0.2
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
diff --git a/go.sum b/go.sum
index b67ef474..ea1cb757 100644
--- a/go.sum
+++ b/go.sum
@@ -95,6 +95,12 @@ github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad h1:jyMZ
github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
github.com/unifi-poller/influxunifi v0.0.4 h1:gF8OHxgH17p/HoagcJ5y6XJWW30mUpSnU/mSZLShbtI=
github.com/unifi-poller/influxunifi v0.0.4/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131061321-a5f6e5bfd703 h1:8DTb91CSV6HNuMAcEGF2MzTWxmn5MuIjaO8ZZi+Bj7Y=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131061321-a5f6e5bfd703/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131084108-1564d6469d75 h1:cJifmyzI5fDM31caJjCTufRsQrIZHx5/v8mCa01wfI4=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131084108-1564d6469d75/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423 h1:+vgOu+4VPg6iloKQVcgOVJOSnPLKaXt721htM7D3daA=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55 h1:LEhiYG1KtaOikcPOJoltWFv63/+X/puP/Cj6cnU71nM=
@@ -115,6 +121,12 @@ github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8 h1:gUAvya
github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
github.com/unifi-poller/promunifi v0.0.3 h1:xryrhCh9EXbUY7ZvBLq0lVjH8z6DUfJBU2FRovz0GlM=
github.com/unifi-poller/promunifi v0.0.3/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131061346-656569eed9fa h1:S7dKVHiqYSWF+d154ZYX5LHT3zcn33k43R8AHbul/hY=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131061346-656569eed9fa/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131084046-312143fb88c8 h1:g/JOWFmiyPTCsU1B0XQ5warj2a160AZwVD5zgSlaQY0=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131084046-312143fb88c8/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1 h1:j39XHHNOHUZYNGS5kebBb0D3v3Ts5tvveObNNCySdsM=
+github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/unifi v0.0.1 h1:8LTf0RyxMdDLmzm59mk7bz5/qfC1hHmC21u/uqx2vSQ=
github.com/unifi-poller/unifi v0.0.1/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
github.com/unifi-poller/unifi v0.0.2 h1:FRa6G+VcxOdvy0/u/QLCHGCRYF6EDcxVYij0dDRCKxg=
From 5fe2c0879bb9f85f46999d8d6ccfd1e87b265ae7 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 00:25:25 -0800
Subject: [PATCH 12/25] add freebsd package building
---
.gitignore | 1 +
Makefile | 63 ++++++++++++++++++++++++++++++++-----
examples/MANUAL.md | 6 ++--
examples/up.xml.example | 9 +++---
examples/up.yaml.example | 9 +++---
go.mod | 8 ++---
go.sum | 67 ++++------------------------------------
init/bsd/unifipoller.rc | 24 ++++++++++++++
8 files changed, 104 insertions(+), 83 deletions(-)
create mode 100755 init/bsd/unifipoller.rc
diff --git a/.gitignore b/.gitignore
index 6471c934..63b2d1c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
/unifi-poller*.arm
/unifi-poller*.exe
/unifi-poller*.macos
+/unifi-poller*.freebsd
/unifi-poller*.bsd
/unifi-poller*.linux
/unifi-poller.rb
diff --git a/Makefile b/Makefile
index e39117d7..5d8c7468 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,8 @@ $(PACKAGE_SCRIPTS) \
--maintainer "$(MAINT)" \
--vendor "$(VENDOR)" \
--description "$(DESC)" \
---config-files "/etc/$(BINARY)/$(CONFIG_FILE)"
+--config-files "/etc/$(BINARY)/$(CONFIG_FILE)" \
+--freebsd-origin "golift/$(BINARY)"
endef
PLUGINS:=$(patsubst plugins/%/main.go,%,$(wildcard plugins/*/main.go))
@@ -55,13 +56,13 @@ VERSION_LDFLAGS:= \
all: clean build
# Prepare a release. Called in Travis CI.
-release: clean macos windows linux_packages
+release: clean macos windows linux_packages freebsd_packages
# Prepareing a release!
mkdir -p $@
- mv $(BINARY).*.macos $(BINARY).*.linux $@/
+ mv $(BINARY).*.macos $(BINARY).*.linux $(BINARY).*.freebsd $@/
gzip -9r $@/
for i in $(BINARY)*.exe; do zip -9qm $@/$$i.zip $$i;done
- mv *.rpm *.deb $@/
+ mv *.rpm *.deb *.txz $@/
# Generating File Hashes
openssl dgst -r -sha256 $@/* | sed 's#release/##' | tee $@/checksums.sha256.txt
@@ -69,8 +70,8 @@ release: clean macos windows linux_packages
# Delete all build assets.
clean:
# Cleaning up.
- rm -f $(BINARY) $(BINARY).*.{macos,linux,exe}{,.gz,.zip} $(BINARY).1{,.gz} $(BINARY).rb
- rm -f $(BINARY){_,-}*.{deb,rpm} v*.tar.gz.sha256 examples/MANUAL .metadata.make
+ rm -f $(BINARY) $(BINARY).*.{macos,freebsd,linux,exe}{,.gz,.zip} $(BINARY).1{,.gz} $(BINARY).rb
+ rm -f $(BINARY){_,-}*.{deb,rpm,txz} v*.tar.gz.sha256 examples/MANUAL .metadata.make
rm -f cmd/$(BINARY)/README{,.html} README{,.html} ./$(BINARY)_manual.html
rm -rf package_build_* release
@@ -123,9 +124,20 @@ $(BINARY).armhf.linux: main.go
macos: $(BINARY).amd64.macos
$(BINARY).amd64.macos: main.go
- # Building darwin 64-bit x86 binary.
GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags "-w -s $(VERSION_LDFLAGS)"
+freebsd: $(BINARY).amd64.freebsd
+$(BINARY).amd64.freebsd: main.go
+ GOOS=freebsd GOARCH=amd64 go build -o $@ -ldflags "-w -s $(VERSION_LDFLAGS)"
+
+freebsd386: $(BINARY).i386.freebsd
+$(BINARY).i386.freebsd: main.go
+ GOOS=freebsd GOARCH=386 go build -o $@ -ldflags "-w -s $(VERSION_LDFLAGS)"
+
+freebsdarm: $(BINARY).armhf.freebsd
+$(BINARY).armhf.freebsd: main.go
+ GOOS=freebsd GOARCH=arm go build -o $@ -ldflags "-w -s $(VERSION_LDFLAGS)"
+
exe: $(BINARY).amd64.exe
windows: $(BINARY).amd64.exe
$(BINARY).amd64.exe: main.go
@@ -136,6 +148,8 @@ $(BINARY).amd64.exe: main.go
linux_packages: rpm deb rpm386 deb386 debarm rpmarm debarmhf rpmarmhf
+freebsd_packages: freebsd_pkg freebsd386_pkg freebsdarm_pkg
+
rpm: $(BINARY)-$(RPMVERSION)-$(ITERATION).x86_64.rpm
$(BINARY)-$(RPMVERSION)-$(ITERATION).x86_64.rpm: package_build_linux check_fpm
@echo "Building 'rpm' package for $(BINARY) version '$(RPMVERSION)-$(ITERATION)'."
@@ -184,6 +198,21 @@ $(BINARY)_$(VERSION)-$(ITERATION)_armhf.deb: package_build_linux_armhf check_fpm
fpm -s dir -t deb $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $<
[ "$(SIGNING_KEY)" == "" ] || expect -c "spawn debsigs --default-key="$(SIGNING_KEY)" --sign=origin $(BINARY)_$(VERSION)-$(ITERATION)_armhf.deb; expect -exact \"Enter passphrase: \"; send \"$(PRIVATE_KEY)\r\"; expect eof"
+freebsd_pkg: $(BINARY)-$(VERSION)_$(ITERATION).amd64.txz
+$(BINARY)-$(VERSION)_$(ITERATION).amd64.txz: package_build_freebsd check_fpm
+ @echo "Building 'freebsd pkg' package for $(BINARY) version '$(VERSION)-$(ITERATION)'."
+ fpm -s dir -t freebsd $(PACKAGE_ARGS) -a amd64 -v $(VERSION) -p $(BINARY)-$(VERSION)_$(ITERATION).amd64.txz -C $<
+
+freebsd386_pkg: $(BINARY)-$(VERSION)_$(ITERATION).i386.txz
+$(BINARY)-$(VERSION)_$(ITERATION).i386.txz: package_build_freebsd_386 check_fpm
+ @echo "Building 32-bit 'freebsd pkg' package for $(BINARY) version '$(VERSION)-$(ITERATION)'."
+ fpm -s dir -t freebsd $(PACKAGE_ARGS) -a 386 -v $(VERSION) -p $(BINARY)-$(VERSION)_$(ITERATION).i386.txz -C $<
+
+freebsdarm_pkg: $(BINARY)-$(VERSION)_$(ITERATION).armhf.txz
+$(BINARY)-$(VERSION)_$(ITERATION).armhf.txz: package_build_freebsd_arm check_fpm
+ @echo "Building 32-bit ARM6/7 HF 'freebsd pkg' package for $(BINARY) version '$(VERSION)-$(ITERATION)'."
+ fpm -s dir -t freebsd $(PACKAGE_ARGS) -a arm -v $(VERSION) -p $(BINARY)-$(VERSION)_$(ITERATION).armhf.txz -C $<
+
# Build an environment that can be packaged for linux.
package_build_linux: readme man plugins_linux_amd64 linux
# Building package environment for linux.
@@ -219,6 +248,26 @@ package_build_linux_armhf: package_build_linux armhf
[ ! -f *armhf.so ] || cp *armhf.so $@/usr/lib/$(BINARY)/
cp $(BINARY).armhf.linux $@/usr/bin/$(BINARY)
+# Build an environment that can be packaged for freebsd.
+package_build_freebsd: readme man freebsd
+ mkdir -p $@/usr/local/bin $@/usr/local/etc/{rc.d,$(BINARY)} $@/usr/local/share/man/man1 $@/usr/local/share/doc/$(BINARY)
+ cp $(BINARY).amd64.freebsd $@/usr/local/bin/$(BINARY)
+ cp *.1.gz $@/usr/local/share/man/man1
+ cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/
+ cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/$(CONFIG_FILE)
+ cp LICENSE *.html examples/*?.?* $@/usr/local/share/doc/$(BINARY)/
+ cp init/bsd/unifipoller.rc $@/usr/local/etc/rc.d/unifipoller
+
+package_build_freebsd_386: package_build_freebsd freebsd386
+ mkdir -p $@
+ cp -r $* $@/
+ cp $(BINARY).i386.freebsd $@/usr/local/bin/$(BINARY)
+
+package_build_freebsd_arm: package_build_freebsd freebsdarm
+ mkdir -p $@
+ cp -r $* $@/
+ cp $(BINARY).armhf.freebsd $@/usr/local/bin/$(BINARY)
+
check_fpm:
@fpm --version > /dev/null || (echo "FPM missing. Install FPM: https://fpm.readthedocs.io/en/latest/installing.html" && false)
diff --git a/examples/MANUAL.md b/examples/MANUAL.md
index d12c9ed3..63d9dc9a 100644
--- a/examples/MANUAL.md
+++ b/examples/MANUAL.md
@@ -51,9 +51,9 @@ OPTIONS
CONFIGURATION
---
* Config File Default Location:
- * Linux: `/etc/unifi-poller/up.conf`
- * macOS: `/usr/local/etc/unifi-poller/up.conf`
- * Windows: `C:\ProgramData\unifi-poller\up.conf`
+ * Linux: `/etc/unifi-poller.conf`
+ * macOS/BSD: `/usr/local/etc/unifi-poller.conf`
+ * Windows: `C:\ProgramData\unifi-poller.conf`
* Config File Default Format: `TOML`
* Possible formats: `XML`, `JSON`, `TOML`, `YAML`
diff --git a/examples/up.xml.example b/examples/up.xml.example
index 2ff1eecf..ef3899dd 100644
--- a/examples/up.xml.example
+++ b/examples/up.xml.example
@@ -1,9 +1,10 @@
diff --git a/examples/up.yaml.example b/examples/up.yaml.example
index 4ed27193..a9d9f798 100644
--- a/examples/up.yaml.example
+++ b/examples/up.yaml.example
@@ -1,7 +1,8 @@
-########################################################
-# UniFi Poller primary configuration file. YAML FORMAT #
-# provided values are defaults. See up.conf.example! #
-########################################################
+##############################################
+# UniFi Poller primary configuration file. #
+# YAML FORMAT. Provided values are defaults. #
+# See up.conf.example! #
+##############################################
---
poller:
diff --git a/go.mod b/go.mod
index b9a1d0a8..f5cf746a 100644
--- a/go.mod
+++ b/go.mod
@@ -10,11 +10,11 @@ require (
github.com/prometheus/client_golang v1.4.0 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
- github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423
+ github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d
github.com/unifi-poller/inputunifi v0.0.4
- github.com/unifi-poller/poller v0.0.3
- github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1
- github.com/unifi-poller/unifi v0.0.2
+ github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82
+ github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac
+ github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
diff --git a/go.sum b/go.sum
index ea1cb757..8c6dbbb9 100644
--- a/go.sum
+++ b/go.sum
@@ -1,4 +1,3 @@
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -6,13 +5,10 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
-github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/github/hub v2.11.2+incompatible h1:H0wUQmNZVxF2+XyGPTsOxUVrRrFnTq133tezo6u4X4U=
github.com/github/hub v2.11.2+incompatible/go.mod h1:zQrzJEdze2hfWJDgktd/L6sROjAdCThFrzjbxw4keTs=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -22,14 +18,11 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -40,12 +33,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
-github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -57,80 +47,40 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc=
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
-github.com/prometheus/client_golang v1.4.0 h1:YVIb/fVcOTMSqtqZWSKnHpSLBxu8DKgxq8z6RuBZwqI=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE=
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
-github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
-github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=
github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
-github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/unifi-poller/influxunifi v0.0.3 h1:/3Ua1g5Z1toLxulb3Z4VflLWhUDh+/P8XboGl1YqDK4=
-github.com/unifi-poller/influxunifi v0.0.3/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
-github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad h1:jyMZJsZNPv7x/UTaOmMyqdRc/290v6KipEeW0cr4aNY=
-github.com/unifi-poller/influxunifi v0.0.4-0.20191229230645-c06bd4afccad/go.mod h1:abAL5gE+1KSmZ9nNKwjSBTmVffU1yN1KTDwPKOSpgh8=
-github.com/unifi-poller/influxunifi v0.0.4 h1:gF8OHxgH17p/HoagcJ5y6XJWW30mUpSnU/mSZLShbtI=
-github.com/unifi-poller/influxunifi v0.0.4/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
-github.com/unifi-poller/influxunifi v0.0.5-0.20200131061321-a5f6e5bfd703 h1:8DTb91CSV6HNuMAcEGF2MzTWxmn5MuIjaO8ZZi+Bj7Y=
github.com/unifi-poller/influxunifi v0.0.5-0.20200131061321-a5f6e5bfd703/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
-github.com/unifi-poller/influxunifi v0.0.5-0.20200131084108-1564d6469d75 h1:cJifmyzI5fDM31caJjCTufRsQrIZHx5/v8mCa01wfI4=
-github.com/unifi-poller/influxunifi v0.0.5-0.20200131084108-1564d6469d75/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
-github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423 h1:+vgOu+4VPg6iloKQVcgOVJOSnPLKaXt721htM7D3daA=
github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
-github.com/unifi-poller/inputunifi v0.0.2 h1:oCBu+K3VmKjrEfti7b30m3p/eh3ERZG2xp60eL7s6LE=
-github.com/unifi-poller/inputunifi v0.0.2/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
-github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55 h1:LEhiYG1KtaOikcPOJoltWFv63/+X/puP/Cj6cnU71nM=
-github.com/unifi-poller/inputunifi v0.0.3-0.20191229230346-7226454a2b55/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
-github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703 h1:A/utQrJXY9CxtRQbvMjGXJFe1ayzS1UzzeLIOv4U3m8=
-github.com/unifi-poller/inputunifi v0.0.3-0.20191230031314-6714bca5a703/go.mod h1:aCDjO48d2xgj2zJalcD9ZheASrAYT+lgdsa2mO783eE=
-github.com/unifi-poller/inputunifi v0.0.4 h1:43fF8gONEICtKnE5eFgj0KFCge4S/+IGYlKLzDx2RqU=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d h1:SGXN2vL7Jc/zaqgVeiIpqf7iHf3ikbrShO7xbCWRjxk=
+github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/inputunifi v0.0.4/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo=
-github.com/unifi-poller/poller v0.0.2 h1:qUDSon8UIqRYOXd+V+3jThf2CSE/glQK8MSDmp20STU=
-github.com/unifi-poller/poller v0.0.2/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
-github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4 h1:LV8RbR7zBHIqR7G3EO/TyzJ2Hfz+FI40WgAy9Fd47o4=
-github.com/unifi-poller/poller v0.0.3-0.20191229090254-3d0ea938dfc4/go.mod h1:H1YErnDRLaUQBH09kzd7kNTL3bMNCPuYbg94aJBun7Y=
-github.com/unifi-poller/poller v0.0.3 h1:VrVx+1jvVcRh11TyO9nn58el/nvWcRKtGwzrg80a0SQ=
github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
-github.com/unifi-poller/promunifi v0.0.2 h1:NZUJT6CdZkQPNKzjC+lUeZQ/N20njZGIidbAD0pVU0Q=
-github.com/unifi-poller/promunifi v0.0.2/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
-github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8 h1:gUAvyaSriSYRHNfoVdL2mIVCOtjVjOzKbcGPh80rT5U=
-github.com/unifi-poller/promunifi v0.0.3-0.20191229230625-e67c9d7605c8/go.mod h1:CdEWjrtoF9Z4XyeR/ueAgs8ZswiV0K6rHsybcMRu9jA=
-github.com/unifi-poller/promunifi v0.0.3 h1:xryrhCh9EXbUY7ZvBLq0lVjH8z6DUfJBU2FRovz0GlM=
-github.com/unifi-poller/promunifi v0.0.3/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
-github.com/unifi-poller/promunifi v0.0.4-0.20200131061346-656569eed9fa h1:S7dKVHiqYSWF+d154ZYX5LHT3zcn33k43R8AHbul/hY=
-github.com/unifi-poller/promunifi v0.0.4-0.20200131061346-656569eed9fa/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
-github.com/unifi-poller/promunifi v0.0.4-0.20200131084046-312143fb88c8 h1:g/JOWFmiyPTCsU1B0XQ5warj2a160AZwVD5zgSlaQY0=
-github.com/unifi-poller/promunifi v0.0.4-0.20200131084046-312143fb88c8/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
-github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1 h1:j39XHHNOHUZYNGS5kebBb0D3v3Ts5tvveObNNCySdsM=
+github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
-github.com/unifi-poller/unifi v0.0.1 h1:8LTf0RyxMdDLmzm59mk7bz5/qfC1hHmC21u/uqx2vSQ=
-github.com/unifi-poller/unifi v0.0.1/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
-github.com/unifi-poller/unifi v0.0.2 h1:FRa6G+VcxOdvy0/u/QLCHGCRYF6EDcxVYij0dDRCKxg=
+github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
+github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a h1:erqRCgGquSYxjjD+LNO6J09MKtWfgkl8bewfsDDSisY=
+github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -144,22 +94,17 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golift.io/cnfg v0.0.5 h1:HnMU8Z9C/igKvir1dqaHx5BPuNGZrp99FCtdJyP2Z4I=
golift.io/cnfg v0.0.5/go.mod h1:ScFDIJg/rJGHbRaed/i7g1lBhywEjB0JiP2uZr3xC3A=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/init/bsd/unifipoller.rc b/init/bsd/unifipoller.rc
new file mode 100755
index 00000000..b69dc931
--- /dev/null
+++ b/init/bsd/unifipoller.rc
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# rc.d startup script for unifi-poller. Written for FreeBSD.
+#
+# PROVIDE: unifi-poller
+# REQUIRE: networking syslog
+# KEYWORD:
+
+. /etc/rc.subr
+
+[ -f /usr/local/etc/defaults/unifi-poller ] && . /usr/local/etc/defaults/unifi-poller
+
+name="unifipoller"
+rcvar="unifipoller_enable"
+command="/usr/local/bin/unifi-poller"
+unifipoller_user="nobody"
+unifipoller_config="/usr/local/etc/unifi-poller/up.conf"
+
+start_cmd="/usr/sbin/daemon -T $name -l daemon -u $unifipoller_user $command -c $unifipoller_config"
+
+load_rc_config $name
+: ${unifipoller_enable:=no}
+
+run_rc_command "$1"
From a9c8d3f3d5ccf01720cf809f44e520a916628f5c Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 00:34:43 -0800
Subject: [PATCH 13/25] fixes
---
Makefile | 2 +-
go.sum | 2 ++
init/bsd/{unifipoller.rc => unifi-poller.rc} | 2 --
3 files changed, 3 insertions(+), 3 deletions(-)
rename init/bsd/{unifipoller.rc => unifi-poller.rc} (85%)
diff --git a/Makefile b/Makefile
index 5d8c7468..deffd5c2 100644
--- a/Makefile
+++ b/Makefile
@@ -256,7 +256,7 @@ package_build_freebsd: readme man freebsd
cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/
cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/$(CONFIG_FILE)
cp LICENSE *.html examples/*?.?* $@/usr/local/share/doc/$(BINARY)/
- cp init/bsd/unifipoller.rc $@/usr/local/etc/rc.d/unifipoller
+ cp init/bsd/unifi-poller.rc $@/usr/local/etc/rc.d/unifi-poller
package_build_freebsd_386: package_build_freebsd freebsd386
mkdir -p $@
diff --git a/go.sum b/go.sum
index 8c6dbbb9..e40c4aba 100644
--- a/go.sum
+++ b/go.sum
@@ -75,8 +75,10 @@ github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d h1:SGXN
github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/inputunifi v0.0.4/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo=
github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
+github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82 h1:K5l91RBCkWWgLRw1EX3h8JNiGeiT1wBIRsU5XPC0GSA=
github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
+github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac h1:vh3sBk0/FuZ6rxuRzXn7eLTpDldOWDAS94onFF9Ml0s=
github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a h1:erqRCgGquSYxjjD+LNO6J09MKtWfgkl8bewfsDDSisY=
diff --git a/init/bsd/unifipoller.rc b/init/bsd/unifi-poller.rc
similarity index 85%
rename from init/bsd/unifipoller.rc
rename to init/bsd/unifi-poller.rc
index b69dc931..797fbe24 100755
--- a/init/bsd/unifipoller.rc
+++ b/init/bsd/unifi-poller.rc
@@ -8,8 +8,6 @@
. /etc/rc.subr
-[ -f /usr/local/etc/defaults/unifi-poller ] && . /usr/local/etc/defaults/unifi-poller
-
name="unifipoller"
rcvar="unifipoller_enable"
command="/usr/local/bin/unifi-poller"
From 3b457a5f0074e4e9aa1f218aa17729e14ae9ddc1 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 00:43:19 -0800
Subject: [PATCH 14/25] fixes
---
examples/MANUAL.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/MANUAL.md b/examples/MANUAL.md
index 63d9dc9a..dccdecb4 100644
--- a/examples/MANUAL.md
+++ b/examples/MANUAL.md
@@ -53,7 +53,7 @@ CONFIGURATION
* Config File Default Location:
* Linux: `/etc/unifi-poller.conf`
* macOS/BSD: `/usr/local/etc/unifi-poller.conf`
- * Windows: `C:\ProgramData\unifi-poller.conf`
+ * Windows: `C:\\ProgramData\\unifi-poller.conf`
* Config File Default Format: `TOML`
* Possible formats: `XML`, `JSON`, `TOML`, `YAML`
@@ -92,7 +92,7 @@ AUTHOR
---
* Garrett Bjerkhoel (original code) ~ 2016
* David Newhall II (rewritten) ~ 4/20/2018
-* David Newhall II (still going) ~ 6/7/2019
+* David Newhall II (still going) ~ 2/1/2020
LOCATION
---
From 876d97bfe5e11b1855a31c42b4fe0330c621465d Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 00:45:10 -0800
Subject: [PATCH 15/25] fix paths
---
CONTRIBUTING.md | 2 +-
examples/MANUAL.md | 6 +++---
examples/README.md | 2 +-
init/docker/README.md | 2 +-
init/docker/hooks/README.md | 2 +-
init/launchd/com.github.davidnewhall.unifi-poller.plist | 2 +-
scripts/install.sh | 4 ++--
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4802a382..29ce4965 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,7 +7,7 @@ making changes to it.
## TravisCI
-This repo is tested, built and deployed by [Travis-CI](https://travis-ci.org/davidnewhall/unifi-poller).
+This repo is tested, built and deployed by [Travis-CI](https://travis-ci.org/unifi-poller/unifi-poller).
The [.travis.yml](.travis.yml) file in this repo coordinates the entire process.
As long as this document is kept up to date, this is what the travis file does:
diff --git a/examples/MANUAL.md b/examples/MANUAL.md
index dccdecb4..fcf7e0d3 100644
--- a/examples/MANUAL.md
+++ b/examples/MANUAL.md
@@ -67,14 +67,14 @@ is provided so the application can be easily adapted to any environment.
Configuration file (up.conf) parameters are documented in the wiki.
-* [https://github.com/davidnewhall/unifi-poller/wiki/Configuration](https://github.com/davidnewhall/unifi-poller/wiki/Configuration)
+* [https://github.com/unifi-poller/unifi-poller/wiki/Configuration](https://github.com/unifi-poller/unifi-poller/wiki/Configuration)
`Shell Environment Parameters`
This application can be fully configured using shell environment variables.
Find documentation for this feature on the Docker Wiki page.
-* [https://github.com/davidnewhall/unifi-poller/wiki/Docker](https://github.com/davidnewhall/unifi-poller/wiki/Docker)
+* [https://github.com/unifi-poller/unifi-poller/wiki/Docker](https://github.com/unifi-poller/unifi-poller/wiki/Docker)
GO DURATION
---
@@ -96,6 +96,6 @@ AUTHOR
LOCATION
---
-* UniFi Poller: [https://github.com/davidnewhall/unifi-poller](https://github.com/davidnewhall/unifi-poller)
+* UniFi Poller: [https://github.com/unifi-poller/unifi-poller](https://github.com/unifi-poller/unifi-poller)
* UniFi Library: [https://github.com/golift/unifi](https://github.com/golift/unifi)
* Grafana Dashboards: [https://grafana.com/dashboards?search=unifi-poller](https://grafana.com/dashboards?search=unifi-poller)
diff --git a/examples/README.md b/examples/README.md
index fdefd7d2..93e490f2 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -10,4 +10,4 @@ format is always TOML and may have any _other_ suffix.
#### Dashboards
This folder used to contain Grafana Dashboards.
**They are now located at [Grafana.com](https://grafana.com/dashboards?search=unifi-poller).**
-Also see [Grafana Dashboards](https://github.com/davidnewhall/unifi-poller/wiki/Grafana-Dashboards) Wiki.
+Also see [Grafana Dashboards](https://github.com/unifi-poller/unifi-poller/wiki/Grafana-Dashboards) Wiki.
diff --git a/init/docker/README.md b/init/docker/README.md
index 67b37750..80460d1d 100644
--- a/init/docker/README.md
+++ b/init/docker/README.md
@@ -14,4 +14,4 @@ in InfluxDB by UniFi Poller.
##### HOWTO
**Learn more about how and when to use these *Docker Compose* files in the
-[Docker Wiki](https://github.com/davidnewhall/unifi-poller/wiki/Docker).**
+[Docker Wiki](https://github.com/unifi-poller/unifi-poller/wiki/Docker).**
diff --git a/init/docker/hooks/README.md b/init/docker/hooks/README.md
index 29d4d4f1..7bf127f6 100644
--- a/init/docker/hooks/README.md
+++ b/init/docker/hooks/README.md
@@ -21,7 +21,7 @@ any build. Two environment variables must be passed in from Docker Cloud config.
Keep the build simple; see screenshot. This only supports one build tag, but it creates many more.
-
+
The fancy source tag is `/^v((\d+\.\d+)(?:\.\d+)?)$/` and it allows you to capture
the minor version without patch-level in `{\2}`. I no longer use `{\2}` in my build.
diff --git a/init/launchd/com.github.davidnewhall.unifi-poller.plist b/init/launchd/com.github.davidnewhall.unifi-poller.plist
index d8a18294..c5370da0 100644
--- a/init/launchd/com.github.davidnewhall.unifi-poller.plist
+++ b/init/launchd/com.github.davidnewhall.unifi-poller.plist
@@ -3,7 +3,7 @@
Label
- com.github.davidnewhall.unifi-poller
+ com.github.unifi-poller.unifi-poller
ProgramArguments
/usr/local/bin/unifi-poller
diff --git a/scripts/install.sh b/scripts/install.sh
index ee025434..4caf504c 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -4,14 +4,14 @@
#
# Use it like this: (sudo is optional)
# ===
-# curl https://raw.githubusercontent.com/davidnewhall/unifi-poller/master/scripts/install.sh | sudo bash
+# curl https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo bash
# ===
# If you're on redhat, this installs the latest rpm. If you're on Debian, it installs the latest deb package.
#
# This is part of application-builder.
# https://github.com/golift/application-builder
-REPO=davidnewhall/unifi-poller
+REPO=unifi-poller/unifi-poller
LATEST=https://api.github.com/repos/${REPO}/releases/latest
ARCH=$(uname -m)
From 88d46a31e3ae3419a71cab544ecd63a984fbded7 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 00:56:25 -0800
Subject: [PATCH 16/25] make install script work with freebsd
---
scripts/install.sh | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/scripts/install.sh b/scripts/install.sh
index 4caf504c..dd0f3b5f 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/bin/sh
# This is a quick and drity script to install the latest Linux package.
#
# Use it like this: (sudo is optional)
# ===
-# curl https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo bash
+# curl https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo sh
# ===
# If you're on redhat, this installs the latest rpm. If you're on Debian, it installs the latest deb package.
#
@@ -30,7 +30,7 @@ else
exit 1
fi
-if [ "$1" == "deb" ] || [ "$1" == "rpm" ]; then
+if [ "$1" == "deb" ] || [ "$1" == "rpm" ] || [ "$1" == "txz" ]; then
FILE=$1
else
# If you have both, rpm wins.
@@ -41,12 +41,17 @@ else
dpkg --version > /dev/null 2>&1
if [ "$?" = "0" ]; then
FILE=deb
+ else
+ pkg --version > /dev/null 2>&1
+ if [ "$?" = "0" ]; then
+ FILE=txz
+ fi
fi
fi
fi
if [ "$FILE" = "" ]; then
- echo "No dpkg or rpm package managers found!"
+ echo "No pkg (freebsd), dpkg (debian) or rpm (redhat) package managers found; not sure what package to download!"
exit 1
fi
@@ -70,13 +75,15 @@ fi
URL=$($CMD ${LATEST} | egrep "browser_download_url.*(${ARCH})\.${FILE}\"" | cut -d\" -f 4)
if [ "$?" != "0" ] || [ "$URL" = "" ]; then
- echo "Error locating latest release at ${LATEST}"
+ echo "Error locating latest release for '${FILE} (${ARCH})' at ${LATEST}"
exit 1
fi
INSTALLER="rpm -Uvh"
if [ "$FILE" = "deb" ]; then
INSTALLER="dpkg --force-confdef --force-confold --install"
+elif [ "$FILE" = "txz" ]; then
+ INSTALLER="pkg install"
fi
FILE=$(basename ${URL})
From a3f985983d8de6e69ef3af1bc17fe2cd09e67b1a Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 01:44:36 -0800
Subject: [PATCH 17/25] make install script work on freebsd
---
Makefile | 5 ++--
scripts/install.sh | 68 ++++++++++++++++++++++++++++++----------------
2 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index deffd5c2..c564273e 100644
--- a/Makefile
+++ b/Makefile
@@ -250,13 +250,14 @@ package_build_linux_armhf: package_build_linux armhf
# Build an environment that can be packaged for freebsd.
package_build_freebsd: readme man freebsd
- mkdir -p $@/usr/local/bin $@/usr/local/etc/{rc.d,$(BINARY)} $@/usr/local/share/man/man1 $@/usr/local/share/doc/$(BINARY)
+ mkdir -p $@/usr/local/bin $@/usr/local/etc/$(BINARY) $@/usr/local/share/man/man1 $@/usr/local/share/doc/$(BINARY)
cp $(BINARY).amd64.freebsd $@/usr/local/bin/$(BINARY)
cp *.1.gz $@/usr/local/share/man/man1
cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/
cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/$(CONFIG_FILE)
cp LICENSE *.html examples/*?.?* $@/usr/local/share/doc/$(BINARY)/
- cp init/bsd/unifi-poller.rc $@/usr/local/etc/rc.d/unifi-poller
+ [ "$(FORMULA)" != "service" ] || mkdir -p $@/usr/local/etc/rc.d
+ [ "$(FORMULA)" != "service" ] || cp init/bsd/unifi-poller.rc $@/usr/local/etc/rc.d/unifi-poller
package_build_freebsd_386: package_build_freebsd freebsd386
mkdir -p $@
diff --git a/scripts/install.sh b/scripts/install.sh
index dd0f3b5f..2bc043f7 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -2,35 +2,51 @@
# This is a quick and drity script to install the latest Linux package.
#
-# Use it like this: (sudo is optional)
-# ===
-# curl https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo sh
-# ===
-# If you're on redhat, this installs the latest rpm. If you're on Debian, it installs the latest deb package.
+# Use it like this, pick curl or wget: (sudo is optional)
+# ----
+# curl -s https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo sh
+# wget -qO- https://raw.githubusercontent.com/unifi-poller/unifi-poller/master/scripts/install.sh | sudo sh
+# ----
+#
+# - If you're on RedHat/CentOS/Fedora, installs the latest rpm package.
+# - If you're on Debian/Ubuntu/Gentoo, installs the latest deb package.
+# - If you're on FreeBSD, installs the latest txz package.
#
# This is part of application-builder.
# https://github.com/golift/application-builder
REPO=unifi-poller/unifi-poller
+BREW=golift/mugs/unifi-poller
LATEST=https://api.github.com/repos/${REPO}/releases/latest
ARCH=$(uname -m)
+OS=$(uname -s)
+P=" ==>"
+echo "<-------------------------------------------------->"
+
+if [ "$OS" = "Darwin" ]; then
+ echo "${P} On a mac? Use Homebrew:"
+ echo " brew install ${BREW}"
+ exit
+fi
# $ARCH is passed into egrep to find the right file.
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "amd64" ]; then
ARCH="x86_64|amd64"
-elif [[ $ARCH == *386* ]] || [[ $ARCH == *686* ]]; then
+elif [[ $ARCH = *386* ]] || [[ $ARCH = *686* ]]; then
ARCH="i386"
-elif [[ $ARCH == *arm64* ]] || [[ $ARCH == *armv8* ]] || [[ $ARCH == *aarch64* ]]; then
+elif [[ $ARCH = *arm64* ]] || [[ $ARCH = *armv8* ]] || [[ $ARCH = *aarch64* ]]; then
ARCH="arm64"
-elif [[ $ARCH == *armv6* ]] || [[ $ARCH == *armv7* ]]; then
+elif [[ $ARCH = *armv6* ]] || [[ $ARCH = *armv7* ]]; then
ARCH="armhf"
else
- echo "Unknown Architecture. Submit a pull request to fix this, please."
- echo ==> $ARCH
+ echo "${P} [ERROR] Unknown Architecture: ${ARCH}"
+ echo "${P} $(uname -a)"
+ echo "${P} Please report this, along with the above OS details:"
+ echo " https://github.com/${REPO}/issues/new"
exit 1
fi
-if [ "$1" == "deb" ] || [ "$1" == "rpm" ] || [ "$1" == "txz" ]; then
+if [ "$1" = "deb" ] || [ "$1" = "rpm" ] || [ "$1" = "txz" ]; then
FILE=$1
else
# If you have both, rpm wins.
@@ -51,23 +67,26 @@ else
fi
if [ "$FILE" = "" ]; then
- echo "No pkg (freebsd), dpkg (debian) or rpm (redhat) package managers found; not sure what package to download!"
+ echo "${P} [ERROR] No pkg (freebsd), dpkg (debian) or rpm (redhat) package managers found; not sure what package to download!"
+ echo "${P} $(uname -a)"
+ echo "${P} If you feel this is a mistake, please report this along with the above OS details:"
+ echo " https://github.com/${REPO}/issues/new"
exit 1
fi
# curl or wget?
curl --version > /dev/null 2>&1
if [ "$?" = "0" ]; then
- CMD="curl -L"
+ CMD="curl -sL"
else
wget --version > /dev/null 2>&1
if [ "$?" = "0" ]; then
- CMD="wget -O-"
+ CMD="wget -qO-"
fi
fi
if [ "$CMD" = "" ]; then
- echo "Need curl or wget - could not find either!"
+ echo "${P} [ERROR] Could not locate curl nor wget - please install one to download packages!"
exit 1
fi
@@ -75,7 +94,10 @@ fi
URL=$($CMD ${LATEST} | egrep "browser_download_url.*(${ARCH})\.${FILE}\"" | cut -d\" -f 4)
if [ "$?" != "0" ] || [ "$URL" = "" ]; then
- echo "Error locating latest release for '${FILE} (${ARCH})' at ${LATEST}"
+ echo "${P} [ERROR] Missing latest release for '${FILE}' file ($OS/${ARCH}) at ${LATEST}"
+ echo "${P} $(uname -a)"
+ echo "${P} Please report error this, along with the above OS details:"
+ echo " https://github.com/${REPO}/issues/new"
exit 1
fi
@@ -87,17 +109,17 @@ elif [ "$FILE" = "txz" ]; then
fi
FILE=$(basename ${URL})
-echo "Downloading: ${URL} to /tmp/${FILE}"
+echo "${P} Downloading: ${URL}"
+echo "${P} To Location: /tmp/${FILE}"
$CMD ${URL} > /tmp/${FILE}
# Install it.
if [ "$(id -u)" = "0" ]; then
- echo "==================================="
- echo "Downloaded. Installing the package!"
- echo "Running: ${INSTALLER} /tmp/${FILE}"
+ echo "${P} Downloaded. Installing the package!"
+ echo "${P} Executing: ${INSTALLER} /tmp/${FILE}"
$INSTALLER /tmp/${FILE}
+ echo "<-------------------------------------------------->"
else
- echo "================================"
- echo "Downloaded. Install the package:"
- echo "sudo $INSTALLER /tmp/${FILE}"
+ echo "${P} Downloaded. Install the package like this:"
+ echo " sudo $INSTALLER /tmp/${FILE}"
fi
From 402aeda5f0c388696225c04560404e3e04565c10 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 01:46:49 -0800
Subject: [PATCH 18/25] more fixes
---
scripts/install.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/install.sh b/scripts/install.sh
index 2bc043f7..e395b315 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -18,9 +18,12 @@
REPO=unifi-poller/unifi-poller
BREW=golift/mugs/unifi-poller
LATEST=https://api.github.com/repos/${REPO}/releases/latest
+ISSUES=https://github.com/${REPO}/issues/new
ARCH=$(uname -m)
OS=$(uname -s)
P=" ==>"
+
+# Nothing else needs to be changed. Unless you're fixing things!
echo "<-------------------------------------------------->"
if [ "$OS" = "Darwin" ]; then
@@ -42,7 +45,7 @@ else
echo "${P} [ERROR] Unknown Architecture: ${ARCH}"
echo "${P} $(uname -a)"
echo "${P} Please report this, along with the above OS details:"
- echo " https://github.com/${REPO}/issues/new"
+ echo " ${ISSUES}"
exit 1
fi
@@ -70,7 +73,7 @@ if [ "$FILE" = "" ]; then
echo "${P} [ERROR] No pkg (freebsd), dpkg (debian) or rpm (redhat) package managers found; not sure what package to download!"
echo "${P} $(uname -a)"
echo "${P} If you feel this is a mistake, please report this along with the above OS details:"
- echo " https://github.com/${REPO}/issues/new"
+ echo " ${ISSUES}"
exit 1
fi
@@ -97,7 +100,7 @@ if [ "$?" != "0" ] || [ "$URL" = "" ]; then
echo "${P} [ERROR] Missing latest release for '${FILE}' file ($OS/${ARCH}) at ${LATEST}"
echo "${P} $(uname -a)"
echo "${P} Please report error this, along with the above OS details:"
- echo " https://github.com/${REPO}/issues/new"
+ echo " ${ISSUES}"
exit 1
fi
From e4c3fe52b336437d888efa815ee535cc3464ad68 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 02:21:22 -0800
Subject: [PATCH 19/25] fixes
---
Makefile | 2 +-
scripts/after-install.sh | 9 ++++++---
scripts/before-remove.sh | 7 +++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index c564273e..167a7103 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ $(PACKAGE_SCRIPTS) \
--vendor "$(VENDOR)" \
--description "$(DESC)" \
--config-files "/etc/$(BINARY)/$(CONFIG_FILE)" \
---freebsd-origin "golift/$(BINARY)"
+--freebsd-origin "$(BINARY)/$(BINARY)"
endef
PLUGINS:=$(patsubst plugins/%/main.go,%,$(wildcard plugins/*/main.go))
diff --git a/scripts/after-install.sh b/scripts/after-install.sh
index acf7bafe..a465fdf4 100755
--- a/scripts/after-install.sh
+++ b/scripts/after-install.sh
@@ -1,11 +1,14 @@
-#!/bin/bash
+#!/bin/sh
-# This file is used by deb and rpm packages.
-# FPM adds this as the after-install script.
+# This file is used by txz, deb and rpm packages.
+# FPM adds this as the after-install script to all packages.
if [ -x "/bin/systemctl" ]; then
# Reload and restart - this starts the application as user nobody.
/bin/systemctl daemon-reload
/bin/systemctl enable unifi-poller
/bin/systemctl restart unifi-poller
+elif [ -x /usr/sbin/service ]; then
+ # Do not start or restart on freebsd. That's "bad practice."
+ /usr/sbin/service unifi-poller enabled || /usr/sbin/service unifi-poller enable
fi
diff --git a/scripts/before-remove.sh b/scripts/before-remove.sh
index 83ae4004..a6f2fce3 100755
--- a/scripts/before-remove.sh
+++ b/scripts/before-remove.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-# This file is used by rpm and deb packages. FPM use.
+# This file is used by txz, rpm and deb packages. FPM use.
if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
exit 0
@@ -9,4 +9,7 @@ fi
if [ -x "/bin/systemctl" ]; then
/bin/systemctl stop unifi-poller
/bin/systemctl disable unifi-poller
+elif [ -x /usr/sbin/service ]; then
+ /usr/sbin/service unifi-poller stop
+ /usr/sbin/service unifi-poller disable
fi
From 851009e1efe8fc2806811474ee9f387df37bdbce Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 02:30:11 -0800
Subject: [PATCH 20/25] fix homebrew
---
init/homebrew/service.rb.tmpl | 2 --
1 file changed, 2 deletions(-)
diff --git a/init/homebrew/service.rb.tmpl b/init/homebrew/service.rb.tmpl
index cb10dcb2..de494c11 100644
--- a/init/homebrew/service.rb.tmpl
+++ b/init/homebrew/service.rb.tmpl
@@ -9,14 +9,12 @@ class {{Class}} < Formula
head "{{SOURCE_URL}}"
depends_on "go" => :build
- depends_on "dep"
def install
bin_path = buildpath/"#{name}"
# Copy all files from their current location to buildpath/#{name}
bin_path.install Dir["*",".??*"]
cd bin_path do
- system "make" "vendor"
system "make", "install", "VERSION=#{version}", "ITERATION={{Iter}}", "PREFIX=#{prefix}", "ETC=#{etc}"
# If this fails, the user gets a nice big warning about write permissions on their
# #{var}/log folder. The alternative could be letting the app silently fail
From 8262e792d45ac7f7677124d66fe80f3679ebfcc0 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 03:22:22 -0800
Subject: [PATCH 21/25] make rc.d file dynamic
---
Makefile | 6 +++++-
init/bsd/unifi-poller.rc | 31 +++++++++++++++++++++---------
init/homebrew/service.rb.tmpl | 2 +-
init/launchd/README.md | 2 +-
init/systemd/template.unit.service | 2 +-
5 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index 167a7103..8f921711 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ endif
# rpm is wierd and changes - to _ in versions.
RPMVERSION:=$(shell echo $(VERSION) | tr -- - _)
+BINARYU:=$(shell echo $(BINARY) | tr -- - _)
PACKAGE_SCRIPTS=
ifeq ($(FORMULA),service)
@@ -257,7 +258,10 @@ package_build_freebsd: readme man freebsd
cp examples/$(CONFIG_FILE).example $@/usr/local/etc/$(BINARY)/$(CONFIG_FILE)
cp LICENSE *.html examples/*?.?* $@/usr/local/share/doc/$(BINARY)/
[ "$(FORMULA)" != "service" ] || mkdir -p $@/usr/local/etc/rc.d
- [ "$(FORMULA)" != "service" ] || cp init/bsd/unifi-poller.rc $@/usr/local/etc/rc.d/unifi-poller
+ [ "$(FORMULA)" != "service" ] || \
+ sed -e "s/{{BINARY}}/$(BINARY)/g" -e "s/{{BINARYU}}/$(BINARYU)/g" -e "s/{{CONFIG_FILE}}/$(CONFIG_FILE)/g" \
+ init/bsd/unifi-poller.rc > $@/usr/local/etc/rc.d/unifi-poller
+ [ "$(FORMULA)" != "service" ] || chmod +x $@/usr/local/etc/rc.d/unifi-poller
package_build_freebsd_386: package_build_freebsd freebsd386
mkdir -p $@
diff --git a/init/bsd/unifi-poller.rc b/init/bsd/unifi-poller.rc
index 797fbe24..d0241acb 100755
--- a/init/bsd/unifi-poller.rc
+++ b/init/bsd/unifi-poller.rc
@@ -1,6 +1,11 @@
#!/bin/sh
#
-# rc.d startup script for unifi-poller. Written for FreeBSD.
+# FreeBSD rc.d startup script for unifi-poller.
+# Target like so:
+# sed -e "s/{{BINARY}}/app-name/g"
+# -e "s/{{BINARYU}}/app_name/g" \
+# -e "s/{{CONFIG_FILE}}/app-name.conf/g" \
+# thisfile.rc > /usr/local/etc/rc.d/unifi-poller
#
# PROVIDE: unifi-poller
# REQUIRE: networking syslog
@@ -8,15 +13,23 @@
. /etc/rc.subr
-name="unifipoller"
-rcvar="unifipoller_enable"
-command="/usr/local/bin/unifi-poller"
-unifipoller_user="nobody"
-unifipoller_config="/usr/local/etc/unifi-poller/up.conf"
+name="{{BINARYU}}"
+rcvar="{{BINARYU}}_enable"
+{{BINARYU}}_command="/usr/local/bin/{{BINARY}}"
+{{BINARYU}}_user="nobody"
+{{BINARYU}}_config="/usr/local/etc/{{BINARY}}/{{CONFIG_FILE}}"
+pidfile="/var/run/{{BINARY}}/pid"
-start_cmd="/usr/sbin/daemon -T $name -l daemon -u $unifipoller_user $command -c $unifipoller_config"
+# This runs `daemon` as the `{{BINARYU}}_user` user.
+command="/usr/sbin/daemon"
+command_args="-P ${pidfile} -r -t {{BINARY}} -T {{BINARY}} -l daemon ${{{BINARYU}}_command} -c ${{{BINARYU}}_config}"
-load_rc_config $name
-: ${unifipoller_enable:=no}
+load_rc_config ${name}
+: ${{{BINARYU}}_enable:=no}
+# Make a place for the pid file.
+mkdir -p $(dirname ${pidfile})
+chown -R ${{BINARYU}}_user $(dirname ${pidfile})
+
+# Go!
run_rc_command "$1"
diff --git a/init/homebrew/service.rb.tmpl b/init/homebrew/service.rb.tmpl
index de494c11..00921281 100644
--- a/init/homebrew/service.rb.tmpl
+++ b/init/homebrew/service.rb.tmpl
@@ -1,4 +1,4 @@
-# Homebrew Formula Template. Built by Makefile: `make fomula`
+# macOS Homebrew Formula Template. Built by Makefile: `make fomula`
# This is part of Application Builder.
# https://github.com/golift/application-builder
class {{Class}} < Formula
diff --git a/init/launchd/README.md b/init/launchd/README.md
index 285631f2..d5a6e8ae 100644
--- a/init/launchd/README.md
+++ b/init/launchd/README.md
@@ -1,2 +1,2 @@
This file isn't used by the build or for any packages. The homebrew launchd is
-in the [homebrew](../homebrew) folder. This file is for reference only.
+in the [homebrew](../homebrew) folder. This macOS launchd file is for reference only.
diff --git a/init/systemd/template.unit.service b/init/systemd/template.unit.service
index 82673d82..15ae80c8 100644
--- a/init/systemd/template.unit.service
+++ b/init/systemd/template.unit.service
@@ -1,4 +1,4 @@
-# Systemd service unit for {{BINARY}}.
+# Linux Systemd service unit for {{BINARY}}.
# This is part of Application Builder.
# https://github.com/golift/application-builder
From 30f322e845a0da6138506535f155aa981184da5f Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 03:24:52 -0800
Subject: [PATCH 22/25] fix comments
---
init/bsd/unifi-poller.rc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/init/bsd/unifi-poller.rc b/init/bsd/unifi-poller.rc
index d0241acb..72405718 100755
--- a/init/bsd/unifi-poller.rc
+++ b/init/bsd/unifi-poller.rc
@@ -5,9 +5,9 @@
# sed -e "s/{{BINARY}}/app-name/g"
# -e "s/{{BINARYU}}/app_name/g" \
# -e "s/{{CONFIG_FILE}}/app-name.conf/g" \
-# thisfile.rc > /usr/local/etc/rc.d/unifi-poller
+# thisfile.rc > /usr/local/etc/rc.d/app-name
#
-# PROVIDE: unifi-poller
+# PROVIDE: {{BINARY}}
# REQUIRE: networking syslog
# KEYWORD:
From 07cd6d3e508fa6a93536d716659488f38018abe9 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 03:35:00 -0800
Subject: [PATCH 23/25] fixes
---
Makefile | 4 ++--
init/bsd/README.md | 9 +++++++++
init/bsd/template.rc.d | 31 +++++++++++++++++++++++++++++++
init/bsd/unifi-poller.rc | 35 -----------------------------------
4 files changed, 42 insertions(+), 37 deletions(-)
create mode 100644 init/bsd/README.md
create mode 100755 init/bsd/template.rc.d
delete mode 100755 init/bsd/unifi-poller.rc
diff --git a/Makefile b/Makefile
index 8f921711..34cbc8ed 100644
--- a/Makefile
+++ b/Makefile
@@ -260,8 +260,8 @@ package_build_freebsd: readme man freebsd
[ "$(FORMULA)" != "service" ] || mkdir -p $@/usr/local/etc/rc.d
[ "$(FORMULA)" != "service" ] || \
sed -e "s/{{BINARY}}/$(BINARY)/g" -e "s/{{BINARYU}}/$(BINARYU)/g" -e "s/{{CONFIG_FILE}}/$(CONFIG_FILE)/g" \
- init/bsd/unifi-poller.rc > $@/usr/local/etc/rc.d/unifi-poller
- [ "$(FORMULA)" != "service" ] || chmod +x $@/usr/local/etc/rc.d/unifi-poller
+ init/bsd/template.rc.d > $@/usr/local/etc/rc.d/$(BINARY)
+ [ "$(FORMULA)" != "service" ] || chmod +x $@/usr/local/etc/rc.d/$(BINARY)
package_build_freebsd_386: package_build_freebsd freebsd386
mkdir -p $@
diff --git a/init/bsd/README.md b/init/bsd/README.md
new file mode 100644
index 00000000..98cb4145
--- /dev/null
+++ b/init/bsd/README.md
@@ -0,0 +1,9 @@
+Generic FreeBSD rc.d service file lives here.
+
+- Marshal template like so (example in [Makefile](../../Makefile)):
+```shell
+ sed -e "s/{{BINARY}}/app-name/g" \
+ -e "s/{{BINARYU}}/app_name/g" \
+ -e "s/{{CONFIG_FILE}}/app-name.conf/g" \
+ template.rc.d > /usr/local/etc/rc.d/app-name
+```
diff --git a/init/bsd/template.rc.d b/init/bsd/template.rc.d
new file mode 100755
index 00000000..64b587f3
--- /dev/null
+++ b/init/bsd/template.rc.d
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# FreeBSD rc.d startup script for {{BINARY}}.
+#
+# PROVIDE: {{BINARY}}
+# REQUIRE: networking syslog
+# KEYWORD:
+
+. /etc/rc.subr
+
+name="{{BINARYU}}"
+real_name="{{BINARY}}"
+rcvar="{{BINARYU}}_enable"
+{{BINARYU}}_command="/usr/local/bin/${real_name}"
+{{BINARYU}}_user="nobody"
+{{BINARYU}}_config="/usr/local/etc/${real_name}/{{CONFIG_FILE}}"
+pidfile="/var/run/${real_name}/pid"
+
+# This runs `daemon` as the `{{BINARYU}}_user` user.
+command="/usr/sbin/daemon"
+command_args="-P ${pidfile} -r -t ${real_name} -T ${real_name} -l daemon ${{{BINARYU}}_command} -c ${{{BINARYU}}_config}"
+
+load_rc_config ${name}
+: ${{{BINARYU}}_enable:=no}
+
+# Make a place for the pid file.
+mkdir -p $(dirname ${pidfile})
+chown -R ${{BINARYU}}_user $(dirname ${pidfile})
+
+# Go!
+run_rc_command "$1"
diff --git a/init/bsd/unifi-poller.rc b/init/bsd/unifi-poller.rc
deleted file mode 100755
index 72405718..00000000
--- a/init/bsd/unifi-poller.rc
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# FreeBSD rc.d startup script for unifi-poller.
-# Target like so:
-# sed -e "s/{{BINARY}}/app-name/g"
-# -e "s/{{BINARYU}}/app_name/g" \
-# -e "s/{{CONFIG_FILE}}/app-name.conf/g" \
-# thisfile.rc > /usr/local/etc/rc.d/app-name
-#
-# PROVIDE: {{BINARY}}
-# REQUIRE: networking syslog
-# KEYWORD:
-
-. /etc/rc.subr
-
-name="{{BINARYU}}"
-rcvar="{{BINARYU}}_enable"
-{{BINARYU}}_command="/usr/local/bin/{{BINARY}}"
-{{BINARYU}}_user="nobody"
-{{BINARYU}}_config="/usr/local/etc/{{BINARY}}/{{CONFIG_FILE}}"
-pidfile="/var/run/{{BINARY}}/pid"
-
-# This runs `daemon` as the `{{BINARYU}}_user` user.
-command="/usr/sbin/daemon"
-command_args="-P ${pidfile} -r -t {{BINARY}} -T {{BINARY}} -l daemon ${{{BINARYU}}_command} -c ${{{BINARYU}}_config}"
-
-load_rc_config ${name}
-: ${{{BINARYU}}_enable:=no}
-
-# Make a place for the pid file.
-mkdir -p $(dirname ${pidfile})
-chown -R ${{BINARYU}}_user $(dirname ${pidfile})
-
-# Go!
-run_rc_command "$1"
From 30742fbe54df4b62e0e96bf5ba8d8e083e6ab477 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 04:02:04 -0800
Subject: [PATCH 24/25] Rename and fixes
---
Makefile | 2 +-
examples/MANUAL.md | 8 ++++----
init/bsd/README.md | 2 +-
init/bsd/{template.rc.d => freebsd.rc.d} | 4 ++++
4 files changed, 10 insertions(+), 6 deletions(-)
rename init/bsd/{template.rc.d => freebsd.rc.d} (78%)
diff --git a/Makefile b/Makefile
index 34cbc8ed..76329301 100644
--- a/Makefile
+++ b/Makefile
@@ -260,7 +260,7 @@ package_build_freebsd: readme man freebsd
[ "$(FORMULA)" != "service" ] || mkdir -p $@/usr/local/etc/rc.d
[ "$(FORMULA)" != "service" ] || \
sed -e "s/{{BINARY}}/$(BINARY)/g" -e "s/{{BINARYU}}/$(BINARYU)/g" -e "s/{{CONFIG_FILE}}/$(CONFIG_FILE)/g" \
- init/bsd/template.rc.d > $@/usr/local/etc/rc.d/$(BINARY)
+ init/bsd/freebsd.rc.d > $@/usr/local/etc/rc.d/$(BINARY)
[ "$(FORMULA)" != "service" ] || chmod +x $@/usr/local/etc/rc.d/$(BINARY)
package_build_freebsd_386: package_build_freebsd freebsd386
diff --git a/examples/MANUAL.md b/examples/MANUAL.md
index fcf7e0d3..8dbfb346 100644
--- a/examples/MANUAL.md
+++ b/examples/MANUAL.md
@@ -3,7 +3,7 @@ unifi-poller(1) -- Utility to poll UniFi Controller Metrics and store them in In
SYNOPSIS
---
-`unifi-poller -c /etc/unifi-poller.conf`
+`unifi-poller -c /etc/unifi-poller/up.conf`
This daemon polls a UniFi controller at a short interval and stores the collected
measurements in an Influx Database. The measurements and metrics collected belong
@@ -51,9 +51,9 @@ OPTIONS
CONFIGURATION
---
* Config File Default Location:
- * Linux: `/etc/unifi-poller.conf`
- * macOS/BSD: `/usr/local/etc/unifi-poller.conf`
- * Windows: `C:\\ProgramData\\unifi-poller.conf`
+ * Mac/BSD: `/usr/local/etc/unifi-poller/up.conf`
+ * Windows: `C:\\ProgramData\\unifi-poller\\up.conf`
+ * Others: `/etc/unifi-poller/up.conf`
* Config File Default Format: `TOML`
* Possible formats: `XML`, `JSON`, `TOML`, `YAML`
diff --git a/init/bsd/README.md b/init/bsd/README.md
index 98cb4145..78e7f58c 100644
--- a/init/bsd/README.md
+++ b/init/bsd/README.md
@@ -5,5 +5,5 @@ Generic FreeBSD rc.d service file lives here.
sed -e "s/{{BINARY}}/app-name/g" \
-e "s/{{BINARYU}}/app_name/g" \
-e "s/{{CONFIG_FILE}}/app-name.conf/g" \
- template.rc.d > /usr/local/etc/rc.d/app-name
+ freebsd.rc.d > /usr/local/etc/rc.d/app-name
```
diff --git a/init/bsd/template.rc.d b/init/bsd/freebsd.rc.d
similarity index 78%
rename from init/bsd/template.rc.d
rename to init/bsd/freebsd.rc.d
index 64b587f3..acfc6990 100755
--- a/init/bsd/template.rc.d
+++ b/init/bsd/freebsd.rc.d
@@ -27,5 +27,9 @@ load_rc_config ${name}
mkdir -p $(dirname ${pidfile})
chown -R ${{BINARYU}}_user $(dirname ${pidfile})
+# Suck in optional exported override variables.
+# ie. add something like the following to this file: export UP_POLLER_DEBUG=true
+[ -f "/usr/local/etc/defaults/${real_name}" ] && . "/usr/local/etc/defaults/${real_name}"
+
# Go!
run_rc_command "$1"
From f13f902e7b6f5dcadd8f101b57b727a5a50b5de4 Mon Sep 17 00:00:00 2001
From: davidnewhall2
Date: Sat, 1 Feb 2020 19:19:18 -0800
Subject: [PATCH 25/25] Update deps
---
Makefile | 15 +++++++--------
go.mod | 6 +++---
go.sum | 6 ++++++
main.go | 1 +
4 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 76329301..2dadd0f3 100644
--- a/Makefile
+++ b/Makefile
@@ -335,15 +335,14 @@ lint:
# Checking lint.
golangci-lint run $(GOLANGCI_LINT_ARGS)
-# This is safe; recommended even.
-dep: vendor
-vendor: go.mod go.sum
- go mod download
-
# Don't run this unless you're ready to debug untested vendored dependencies.
-deps: update vendor
-update:
- go get -u -d
+deps:
+ go get -u github.com/unifi-poller/unifi
+ go get -u github.com/unifi-poller/influxunifi
+ go get -u github.com/unifi-poller/promunifi
+ go get -u github.com/unifi-poller/inputunifi
+ go get -u github.com/unifi-poller/poller
+
# Homebrew stuff. macOS only.
diff --git a/go.mod b/go.mod
index f5cf746a..56cd4bb8 100644
--- a/go.mod
+++ b/go.mod
@@ -10,11 +10,11 @@ require (
github.com/prometheus/client_golang v1.4.0 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
- github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d
+ github.com/unifi-poller/influxunifi v0.0.5
github.com/unifi-poller/inputunifi v0.0.4
github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82
- github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac
- github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a
+ github.com/unifi-poller/promunifi v0.0.4
+ github.com/unifi-poller/unifi v0.0.3
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
diff --git a/go.sum b/go.sum
index e40c4aba..8ba3e4c4 100644
--- a/go.sum
+++ b/go.sum
@@ -73,6 +73,8 @@ github.com/unifi-poller/influxunifi v0.0.5-0.20200131061321-a5f6e5bfd703/go.mod
github.com/unifi-poller/influxunifi v0.0.5-0.20200131114444-25224f222423/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d h1:SGXN2vL7Jc/zaqgVeiIpqf7iHf3ikbrShO7xbCWRjxk=
github.com/unifi-poller/influxunifi v0.0.5-0.20200201081102-02a27a18861d/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
+github.com/unifi-poller/influxunifi v0.0.5 h1:ZgiXMBgJ6pMS8qg4Nwo11rvUVXpUfKZ1r0ZJignK9bg=
+github.com/unifi-poller/influxunifi v0.0.5/go.mod h1:TAx1pZCtRHt1KbAw3r7SMpaBB8iAqY2+JFF97LvfbQc=
github.com/unifi-poller/inputunifi v0.0.4/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo=
github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82 h1:K5l91RBCkWWgLRw1EX3h8JNiGeiT1wBIRsU5XPC0GSA=
@@ -80,9 +82,13 @@ github.com/unifi-poller/poller v0.0.4-0.20200201081128-86e147a65d82/go.mod h1:ug
github.com/unifi-poller/promunifi v0.0.4-0.20200131114412-f94a42d976b1/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac h1:vh3sBk0/FuZ6rxuRzXn7eLTpDldOWDAS94onFF9Ml0s=
github.com/unifi-poller/promunifi v0.0.4-0.20200201081044-515621008cac/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
+github.com/unifi-poller/promunifi v0.0.4 h1:aqrxPDyXT8pH9ZqCN/dtSo6AktI8GBFZBqshzg413v0=
+github.com/unifi-poller/promunifi v0.0.4/go.mod h1:mpIlZfVMsXnSoAeZ2IxzKnkba/VlWgRNnDQSYzRnX7c=
github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a h1:erqRCgGquSYxjjD+LNO6J09MKtWfgkl8bewfsDDSisY=
github.com/unifi-poller/unifi v0.0.3-0.20200131201802-b3ed8bd7d27a/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
+github.com/unifi-poller/unifi v0.0.3 h1:6pmjW7MuEEDKKvYoxjL3EZlaLOgmhYyxJBAg4X7GliI=
+github.com/unifi-poller/unifi v0.0.3/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
diff --git a/main.go b/main.go
index b1f088c4..c2a5dfc3 100644
--- a/main.go
+++ b/main.go
@@ -4,6 +4,7 @@ import (
"log"
"github.com/unifi-poller/poller"
+
// Load input plugins!
_ "github.com/unifi-poller/inputunifi"
_ "github.com/unifi-poller/unifi"