pihole-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/pihole-api/client.rb +6 -0
- data/lib/pihole-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2874a4ea6106353b8f3f116cb7f1de4818c7285735de30035aa541162402e8c
|
4
|
+
data.tar.gz: b498f4178586f16544ddf97644aecca6ed76c714ce0785502477700afe08aedf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb54c1075c07f1252b60e62a838ce74d57472fce0c392daae490e7584c36d042d3330a8158cad0e7f8ac2a44620d92ffee064ed16c3aefb03dad738e46ee052b
|
7
|
+
data.tar.gz: df77bb4bf3693b917cc43554d8f47574cf62defcd45892f5b4375315572644d12e0ad12fd2237f5aab2ab4d1e6a4b8aedf50fa2eba8009a003dfd0aa2fa4447c
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ This is an unofficial project and still a work in progress (WIP) ... more to com
|
|
16
16
|
- Login and Auth token generation: `admin/scripts/pi-hole/php/api_token.php`
|
17
17
|
- Undocumented endpointsw
|
18
18
|
- Undocumented filters for getAllQueries
|
19
|
+
- Generate WebPassword Hash
|
19
20
|
|
20
21
|
## Installation
|
21
22
|
|
@@ -41,9 +42,14 @@ Or install it yourself as:
|
|
41
42
|
|
42
43
|
# Some example calls
|
43
44
|
client.type
|
44
|
-
|
45
45
|
```
|
46
46
|
|
47
|
+
Double hash web password to get the api_token. A helper method exists on the client to do this:
|
48
|
+
```ruby
|
49
|
+
require 'pihole-api'
|
50
|
+
PiholeApi::Client.hash_password(password)
|
51
|
+
end
|
52
|
+
|
47
53
|
### Endpoints
|
48
54
|
#### Authorised
|
49
55
|
- `summary_raw`
|
data/lib/pihole-api/client.rb
CHANGED
@@ -23,6 +23,12 @@ module PiholeApi
|
|
23
23
|
'v2 2023-01-21'
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.hash_password(password)
|
27
|
+
require 'digest'
|
28
|
+
hash1 = Digest::SHA256.hexdigest(password)
|
29
|
+
Digest::SHA256.hexdigest(hash1) # Use as hash password for client
|
30
|
+
end
|
31
|
+
|
26
32
|
private
|
27
33
|
|
28
34
|
def authorise_and_send(http_method:, command:, payload: {}, params: {})
|
data/lib/pihole-api/version.rb
CHANGED