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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0caf0f5f8ec1a96e09e1078ae0ab54e7c7bc6d4f1726250eb17627e146d162e
4
- data.tar.gz: a979aca92108d4149e964bc203b16eb185a3a3b1afa7e4df2eb01037836f60d1
3
+ metadata.gz: d2874a4ea6106353b8f3f116cb7f1de4818c7285735de30035aa541162402e8c
4
+ data.tar.gz: b498f4178586f16544ddf97644aecca6ed76c714ce0785502477700afe08aedf
5
5
  SHA512:
6
- metadata.gz: 4368a1a0310ba474d4cf8d6b44ba42ef6456d46c17f4c944dabb7a93ff3c66d1882235d946954cf8bf91ba5d96ddf931e1053aa68ac40facb0b8a41f33429e16
7
- data.tar.gz: 2e12802fcf1837cd8f19a190311d5f55b3fd0a96dc62bbec965c21020673ed2a0cb2d27ea83e9a8d56eb8f4df97a7e8246ae4fcffd6787b964d7f14a6276dc8d
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`
@@ -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: {})
@@ -1,3 +1,3 @@
1
1
  module PiholeApi
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pihole-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22