Skip to content

Commit

Permalink
support for ssl-connection
Browse files Browse the repository at this point in the history
  • Loading branch information
unltdnetworx committed Jun 25, 2019
1 parent 07dcd65 commit ae4b96e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Logo](admin/pi-hole.png)
# ioBroker.pi-hole
# ioBroker.pi-hole ![Logo](admin/pi-hole.png)

![Number of Installations](http://iobroker.live/badges/pi-hole-installed.svg) ![Number of Installations](http://iobroker.live/badges/pi-hole-stable.svg)

=================
Expand All @@ -16,7 +16,8 @@ USE AT YOUR OWN RISK!!! ABSOLUTELY NO WARRANTY FOR DAMAGES, ETC.!!!

Help or hints are welcome.

## Steps
## Steps

1. Install the adpater

2. Fill in the fields of the adapter-admin. The ip-adress of the pi-hole device, the API-Token, which you can get from the admin web-interface of the pi-hole device (Settings/API/Get token), and obligatory the intervall to renew the values of the pi-hole (renew statistic in iobroker))
Expand All @@ -26,28 +27,41 @@ Help or hints are welcome.
4. Activate the filter by clicking the button "activate pi-hole", deactivate the filter by changing the value of "dactivate pi-hole" (0 for permanently, number for amount of seconds)

## Requirements
* running pi-hole device

* running pi-hole device

## Changelog

### 1.1.0

* (unltdnetworx) support for ssl-connection

### 1.0.1

* (unltdnetworx) bugfixes

### 1.0.0

* (unltdnetworx) rise of version-number - stable version

### 0.2.1

* (unltdnetworx) small bugfix for storage

### 0.2.0

* (unltdnetworx) cleanup and bugfix for restart and storage

### 0.1.0

* (unltdnetworx) fully working release for LTE_API

### 0.0.1

* (unltdnetworx) initial release

## License

MIT License

Copyright (c) 2019 Michael Schuster
Expand All @@ -68,4 +82,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
4 changes: 4 additions & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"name": "pi-hole",
"version": "1.1.0",
"news": {
"1.1.0": {
"en": "support for ssl-connection",
"de": "Ünterstützung von SSL-Verbindungen"
},
"1.0.1": {
"en": "bugfixes",
"de": "Fehlerbehebungen"
Expand Down
12 changes: 0 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const utils = require("@iobroker/adapter-core");
const request = require("request");
//const ca = require("ssl-root-cas/latest").create();
let systemLanguage;
let nameTranslation;
let piholeIntervall;
let valTagLang;
let url;
let bolReject;
const valuePaths = ["getQueryTypes","version","type","summaryRaw","summary","topItems","getQuerySources","overTimeData10mins","getForwardDestinations"];
Expand Down Expand Up @@ -61,10 +59,8 @@ function startAdapter(options) {
} else if (obj) {
if (!obj.common.language) {
adapter.log.info("Language not set. English set therefore.");
//nameTranslation = require(__dirname + "/admin/i18n/en/translations.json")
} else {
systemLanguage = obj.common.language;
//nameTranslation = require(__dirname + "/admin/i18n/" + systemLanguage + "/translations.json")
}
if (adapter.config.piholeAllCerts === true) {
bolReject = false;
Expand Down Expand Up @@ -151,14 +147,6 @@ function activatePihole(){
});
}

function translateName(strName) {
if(nameTranslation[strName]) {
return nameTranslation[strName];
} else {
return strName;
}
}

function getPiholeValues(strURL) {
const httpOptions = {
uri: "http://" + adapter.config.piholeIP + "/admin/api.php?" + strURL + "&auth=" + adapter.config.piholeToken,
Expand Down

0 comments on commit ae4b96e

Please sign in to comment.