From 9df82ecde2a9a23509558881f86147ac327936a9 Mon Sep 17 00:00:00 2001 From: shaned24 Date: Sun, 26 Apr 2020 23:38:28 +0100 Subject: [PATCH] chore: rename pihole api token occurences --- README.md | 6 +++--- config/configuration.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 575d313..204388f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Or use PiHole's `WEBPASSWORD` as an API token instead of the password $ API_TOKEN=$(awk -F= -v key="WEBPASSWORD" '$1==key {print $2}' /etc/pihole/setupVars.conf) $ docker run \ -e 'PIHOLE_HOSTNAME=192.168.1.2' \ - -e "PIHOLE_APITOKEN=$API_TOKEN" \ + -e "PIHOLE_API_TOKEN=$API_TOKEN" \ -e 'INTERVAL=30s' \ -e 'PORT=9617' \ ekofr/pihole-exporter:latest @@ -94,7 +94,7 @@ Or use PiHole's `WEBPASSWORD` as an API token instead of the password ```bash $ API_TOKEN=$(awk -F= -v key="WEBPASSWORD" '$1==key {print $2}' /etc/pihole/setupVars.conf) -$ ./pihole_exporter -pihole_hostname 192.168.1.10 -pihole_apitoken $API_TOKEN +$ ./pihole_exporter -pihole_hostname 192.168.1.10 -pihole_api_token $API_TOKEN ``` ```bash @@ -150,7 +150,7 @@ scrape_configs: # WEBPASSWORD / api token defined on the PI-Hole interface at `/etc/pihole/setupVars.conf` - -pihole_apitoken string (optional) + -pihole_api_token string (optional) # Port to be used for the exporter -port string (optional) (default "9617") diff --git a/config/configuration.go b/config/configuration.go index 7675617..75c7972 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -17,7 +17,7 @@ import ( type Config struct { PIHoleHostname string `config:"pihole_hostname"` PIHolePassword string `config:"pihole_password"` - PIHoleApiToken string `config:"pihole_apitoken"` + PIHoleApiToken string `config:"pihole_api_token"` Port string `config:"port"` Interval time.Duration `config:"interval"` } @@ -73,6 +73,6 @@ func (c Config) show() { func showAuthenticationMethod(name, value string) { if len(value) > 0 { - log.Println(fmt.Sprintf("PiHole Authentication Method : %s", name)) + log.Println(fmt.Sprintf("Pi-Hole Authentication Method : %s", name)) } }