From f71b4497754f2d80a60f12f90caaabefe47db72e Mon Sep 17 00:00:00 2001 From: davidnewhall2 Date: Sat, 28 Dec 2019 20:00:03 -0800 Subject: [PATCH 1/2] update links/readme/license --- LICENSE | 3 +-- README.md | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 18 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..8865d83f 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,28 @@ - + [![discord](https://badgen.net/badge/icon/Discord?color=0011ff&label&icon=https://simpleicons.now.sh/discord/eee "Ubiquiti Discord")](https://discord.gg/KnyKYt2) [![twitter](https://badgen.net/twitter/follow/TwitchCaptain?icon=https://simpleicons.now.sh/twitter/0099ff&label=TwitchCaptain&color=0116ff "TwitchCaptain @ Twitter")](https://twitter.com/TwitchCaptain) [![grafana](https://badgen.net/https/golift.io/bd/grafana/dashboard-downloads/10414,10415,10416,10417,10418,11311,11312,11313,11314,11315?icon=https://simpleicons.now.sh/grafana/ED7F38&color=0011ff "Grafana Dashboard Downloads")](http://grafana.com/dashboards?search=unifi-poller) [![pulls](https://badgen.net/docker/pulls/golift/unifi-poller?icon=https://simpleicons.now.sh/docker/38B1ED&label=pulls&color=0011ff "Docker Pulls")](https://hub.docker.com/r/golift/unifi-poller) -[![DLs](https://img.shields.io/github/downloads/davidnewhall/unifi-poller/total.svg?logo=github&color=0116ff "GitHub Downloads")](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller) +[![DLs](https://img.shields.io/github/downloads/unifi-poller/unifi-poller/total.svg?logo=github&color=0116ff "GitHub Downloads")](https://www.somsubhra.com/github-release-stats/?username=davidnewhall&repository=unifi-poller) [![unifi](https://badgen.net/badge/UniFi/5.11.x,5.12.x,UAP,USG,USW,UDM?list=|&icon=https://docs.golift.io/svg/ubiquiti_color.svg&color=0099ee "UniFi Products Supported")](https://github.com/golift/unifi) [![builer](https://badgen.net/badge/go/Application%20Builder?label=&icon=https://docs.golift.io/svg/go.svg&color=0099ee "Go Application Builder")](https://github.com/golift/application-builder) -[![stars](https://badgen.net/github/stars/davidnewhall/unifi-poller?icon=https://simpleicons.now.sh/macys/fab&label=&color=0099ee "GitHub Stars")](https://github.com/davidnewhall/unifi-poller) -[![travis](https://badgen.net/travis/davidnewhall/unifi-poller?icon=travis&label=build "Travis Build")](https://travis-ci.org/davidnewhall/unifi-poller) +[![stars](https://badgen.net/github/stars/unifi-poller/unifi-poller?icon=https://simpleicons.now.sh/macys/fab&label=&color=0099ee "GitHub Stars")](https://github.com/unifi-poller/unifi-poller) +[![travis](https://badgen.net/travis/davidnewhall/unifi-poller?icon=travis&label=build "Travis Build")](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,9 +45,9 @@ 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! @@ -78,7 +78,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 +88,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 +125,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 f1e4a3f7b0d07516a64372dc71c7dead40d07832 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sun, 29 Dec 2019 13:18:00 +0100 Subject: [PATCH 2/2] Fix up build * Use `go mod download` for "vendor", as the `vendor/` dir is ignored by the build anyway. * Fix branch info embedding when not running in Travis. Signed-off-by: Ben Kochie --- .metadata.sh | 5 ++++- Makefile | 4 ++-- init/docker/Dockerfile | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.metadata.sh b/.metadata.sh index 42b73a6c..a3346a21 100755 --- a/.metadata.sh +++ b/.metadata.sh @@ -38,7 +38,10 @@ ITERATION=$(git rev-list --count --all || echo 0) DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" COMMIT="$(git rev-parse --short HEAD || echo 0)" +GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD || echo unknown)" +BRANCH="${TRAVIS_BRANCH:-${GIT_BRANCH}}" + # This is a custom download path for homebrew formula. SOURCE_PATH=https://golift.io/${BINARY}/archive/v${VERSION}.tar.gz -export SOURCE_URL URL VVERSION VERSION ITERATION DATE COMMIT SOURCE_PATH +export SOURCE_URL URL VVERSION VERSION ITERATION DATE BRANCH COMMIT SOURCE_PATH diff --git a/Makefile b/Makefile index 40a46e67..101e78f6 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ endef PLUGINS:=$(patsubst plugins/%/main.go,%,$(wildcard plugins/*/main.go)) VERSION_LDFLAGS:= \ - -X github.com/prometheus/common/version.Branch=$(TRAVIS_BRANCH) \ + -X github.com/prometheus/common/version.Branch=$(BRANCH) \ -X github.com/prometheus/common/version.BuildDate=$(DATE) \ -X github.com/prometheus/common/version.Revision=$(COMMIT) \ -X github.com/prometheus/common/version.Version=$(VERSION)-$(ITERATION) @@ -285,7 +285,7 @@ lint: # This is safe; recommended even. dep: vendor vendor: go.mod go.sum - go mod vendor + go mod download # Don't run this unless you're ready to debug untested vendored dependencies. deps: update vendor diff --git a/init/docker/Dockerfile b/init/docker/Dockerfile index 2b74c41e..deacf728 100644 --- a/init/docker/Dockerfile +++ b/init/docker/Dockerfile @@ -19,8 +19,7 @@ RUN mkdir -p $GOPATH/pkg/mod $GOPATH/bin $GOPATH/src /${BINARY} COPY . /${BINARY} WORKDIR /${BINARY} -RUN go mod vendor \ - && CGO_ENABLED=0 make ${BINARY}.${ARCH}.${OS} +RUN CGO_ENABLED=0 make ${BINARY}.${ARCH}.${OS} FROM scratch ARG ARCH