mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-05 03:21:36 +00:00
👌 Change SSL config to boolean
Also make config optional
This commit is contained in:
parent
e380d7ae39
commit
052974a750
3 changed files with 14 additions and 8 deletions
|
@ -71,7 +71,7 @@ Example add-on configuration:
|
|||
"database": "glances",
|
||||
"prefix": "localhost",
|
||||
"interval": 60,
|
||||
"protocol": "http"
|
||||
"ssl": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -174,10 +174,11 @@ The hostname to append for exported data.
|
|||
|
||||
Defines the interval (in seconds) on how often Glances exports data to InfluxDB.
|
||||
|
||||
#### Option `influxdb`: `protocol`
|
||||
#### Option `influxdb`: `ssl`
|
||||
|
||||
Use `http` or `https` to connect to InfluxDB. Set to `http` if using the
|
||||
Community InfluxDB add-on
|
||||
Adding this option will allow SSL to be used on the InfluxDB connection. If not
|
||||
set will default to `false` which is the required setting for the Community
|
||||
InfluxDB add-on.
|
||||
|
||||
## Adding Glances as a sensor into Home Assistant
|
||||
|
||||
|
|
|
@ -53,8 +53,7 @@
|
|||
"password": "",
|
||||
"database": "glances",
|
||||
"prefix": "localhost",
|
||||
"interval": 60,
|
||||
"protocol": "http"
|
||||
"interval": 60
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
|
@ -73,7 +72,7 @@
|
|||
"database": "str",
|
||||
"prefix": "str",
|
||||
"interval": "int",
|
||||
"protocol": "match(^(http|https)$)"
|
||||
"ssl": "bool?"
|
||||
},
|
||||
"leave_front_door_open": "bool?"
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# Community Hass.io Add-ons: Glances
|
||||
# Configures Glances
|
||||
# ==============================================================================
|
||||
declare protocol
|
||||
bashio::require.unprotected
|
||||
|
||||
# Ensure the configuration exists
|
||||
|
@ -18,6 +19,11 @@ fi
|
|||
|
||||
# Export Glances data to InfluxDB
|
||||
if bashio::config.true 'influxdb.enabled'; then
|
||||
if bashio::config.true 'influxdb.ssl'; then
|
||||
protocol='https'
|
||||
else
|
||||
protocol='http'
|
||||
fi
|
||||
# Modify the configuration
|
||||
{
|
||||
echo "[influxdb]"
|
||||
|
@ -27,6 +33,6 @@ if bashio::config.true 'influxdb.enabled'; then
|
|||
echo "password=$(bashio::config 'influxdb.password')"
|
||||
echo "db=$(bashio::config 'influxdb.database')"
|
||||
echo "prefix=$(bashio::config 'influxdb.prefix')"
|
||||
echo "protocol=$(bashio::config 'influxdb.protocol')"
|
||||
echo "protocol=${protocol}"
|
||||
} >> /etc/glances.conf
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue