-
-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathinfo.yaml
More file actions
1419 lines (1413 loc) · 49.2 KB
/
info.yaml
File metadata and controls
1419 lines (1413 loc) · 49.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.2
components:
paths:
client:
get:
summary: Get information about requesting client
tags:
- "FTL information"
security: []
operationId: "get_client"
description: |
The property `timer` may contain additional details concerning a temporary en-/disabling.
It is `null` when no timer is active (the current status is permanent).
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/client/remote_addr'
- $ref: 'info.yaml#/components/schemas/client/http_version'
- $ref: 'info.yaml#/components/schemas/client/method'
- $ref: 'info.yaml#/components/schemas/client/headers'
- $ref: 'common.yaml#/components/schemas/took'
logs:
dns:
get:
summary: Get DNS log content
tags:
- "FTL information"
operationId: "get_dns_log"
description: |
This API hook returns content from the log of the embedded DNS resolver `dnsmasq`.
Every successful request will return a `nextID`.
This ID can be used on the next request to only get lines which were added *after* the last request.
This makes periodic polling for new log lines easy as no check for duplicated log lines is necessary.
The expected behavior for an immediate re-request of a log line with the same ID is an empty response.
As soon as the next message arrived, this will be included in your request and `nextID` is incremented by one.
parameters:
- $ref: 'info.yaml#/components/parameters/logs/dns/nextID'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/logs/dns/log'
- $ref: 'info.yaml#/components/schemas/logs/dns/nextID'
- $ref: 'common.yaml#/components/schemas/took'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
system:
get:
summary: Get info about various system parameters
tags:
- "FTL information"
operationId: "get_systeminfo"
description: |
This API hook returns a collection of various system infos.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/system'
- $ref: 'common.yaml#/components/schemas/took'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
host:
get:
summary: Get info about various host parameters
tags:
- "FTL information"
operationId: "get_hostinfo"
description: |
This API hook returns a collection of host infos.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/host'
- $ref: 'common.yaml#/components/schemas/took'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
ftl:
get:
summary: Get info about various ftl parameters
tags:
- "FTL information"
operationId: "get_ftlinfo"
description: |
This API hook returns a collection of various ftl infos.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/ftl'
- $ref: 'common.yaml#/components/schemas/took'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
sensors:
get:
summary: Get info about various sensors
tags:
- "FTL information"
operationId: "get_sensors"
description: |
This API hook returns a collection of various sensors.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/sensors'
- $ref: 'common.yaml#/components/schemas/took'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
database:
get:
summary: Get info about long-term database
tags:
- "FTL information"
operationId: "get_dbinfo"
description: |
This API hook returns a collection of various long-term database properties infos.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/database'
- $ref: 'common.yaml#/components/schemas/took'
version:
get:
summary: Get Pi-hole version
tags:
- "FTL information"
operationId: "get_version"
description: |
Request versions of the individual Pi-hole components
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/version'
- $ref: 'common.yaml#/components/schemas/took'
messages:
get:
summary: Get Pi-hole diagnosis messages
tags:
- "FTL information"
operationId: "get_messages"
description: |
Request Pi-hole diagnosis messages
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/messages'
- $ref: 'common.yaml#/components/schemas/took'
messages_with_id:
delete:
summary: Delete Pi-hole diagnosis message
tags:
- "FTL information"
operationId: "delete_message"
parameters:
- $ref: 'info.yaml#/components/parameters/message_id'
description: |
You may specify multiple IDs to delete multiple messages at once (comma-separated in the path like `1,2,3`)
responses:
'204':
description: Item deleted
'404':
description: Not found
content:
application/json:
schema:
$ref: 'common.yaml#/components/schemas/took'
'400':
description: Bad request
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/bad_request'
- $ref: 'common.yaml#/components/schemas/took'
examples:
uri_error:
$ref: 'info.yaml#/components/examples/errors/messages/uri_error'
bad_request:
$ref: 'info.yaml#/components/examples/errors/messages/bad_request'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
messages_count:
get:
summary: Get count of Pi-hole diagnosis messages
tags:
- "FTL information"
operationId: "get_messages_count"
description: |
Request number of Pi-hole diagnosis messages
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/count'
- $ref: 'common.yaml#/components/schemas/took'
metrics:
get:
summary: Get metrics info
tags:
- "FTL information"
operationId: "get_metricsinfo"
description: |
This API hook returns live information about the DNS and DHCP metrics.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/metrics'
- $ref: 'common.yaml#/components/schemas/took'
examples:
metrics:
$ref: 'info.yaml#/components/examples/metrics'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
login:
get:
summary: Login page related information
tags:
- "FTL information"
operationId: "get_logininfo"
security: []
description: |
This API hook returns information used on the login page to possibly display messages/warnings.
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'info.yaml#/components/schemas/login'
- $ref: 'common.yaml#/components/schemas/took'
schemas:
client:
remote_addr:
type: object
properties:
remote_addr:
type: string
description: Address of requesting client
example: "127.0.0.1"
http_version:
type: object
properties:
http_version:
type: string
description: HTTP version of request
example: "1.1"
method:
type: object
properties:
method:
type: string
description: Request method
example: "GET"
headers:
type: object
properties:
headers:
type: array
description: Request headers
items:
type: object
properties:
name:
type: string
description: Header name
value:
type: string
description: Header value
example:
- name: "Accept"
value: "application/json"
- name: "Connection"
value: "keep-alive"
- name: "Pragma"
value: "no-cache"
logs:
dns:
log:
type: object
properties:
log:
type: array
description: Request headers
items:
type: object
properties:
timestamp:
type: number
description: Unix timestamp of log line creation (server time)
message:
type: string
description: Log line content
example:
- timestamp: 1611729969.0
message: "started, version pi-hole-2.84 cachesize 10000"
- timestamp: 1611729969.0
message: "reading /etc/resolv.conf"
- timestamp: 1611729969.0
message: "read /etc/hosts - 7 addresses"
- timestamp: 1611729969.0
message: "query[A] connectivity-check.ubuntu.com from 127.0.0.1"
nextID:
type: object
properties:
nextID:
type: integer
description: next ID to query if checking for new log lines
example: 0
system:
type: object
properties:
system:
type: object
properties:
uptime:
type: integer
description: How long the system has been running (seconds)
example: 67906
memory:
type: object
description: Memory info given in kilobytes
properties:
ram:
type: object
description: RAM
properties:
total:
type: integer
description: Total RAM
example: 10317877
free:
type: integer
description: Total free RAM
example: 308736
used:
type: integer
description: Used RAM
example: 8920416
available:
type: integer
description: Total available RAM
example: 972304
"%used":
type: number
description: Used RAM in percent
example: 26.854
swap:
type: object
description: swap memory
properties:
total:
type: integer
description: Total swap
example: 10317877
used:
type: integer
description: Used swap
example: 8920416
free:
type: integer
description: Total free swap memory
example: 308736
"%used":
type: number
description: Used swap in percent
example: 1.67
procs:
type: integer
description: Number of current processes
example: 1452
cpu:
type: object
description: CPU info
properties:
nprocs:
type: integer
description: Number of available processors
example: 8
"%cpu":
type: number
description: Total CPU usage in percent (may be higher than 100% on multi-core systems and negative if the value cannot be computed)
example: 0.0
load:
type: object
description: 1, 5, and 15 minute load averages
properties:
raw:
type: array
description: raw values
items:
type: number
example: [0.58837890625, 0.64990234375, 0.66748046875]
percent:
type: array
description: raw values
items:
type: number
example: [4.903157711029053, 5.415853023529053, 5.562337398529053]
ftl:
type: object
description: FTL process info
properties:
"%mem":
type: number
description: Percentage of total RAM memory used by FTL
example: 0.1
"%cpu":
type: number
description: Percentage of total CPU used by FTL
example: 1.2
sensors:
type: object
properties:
sensors:
type: object
properties:
list:
type: array
description: Sensor information (temperature)
items:
type: object
properties:
name:
type: string
nullable: true
description: Description of temperature sensor (if available, `null` otherwise)
path:
type: string
description: Short path of temperature sensor
source:
type: string
description: Path-like device description
temps:
type: array
items:
type: object
properties:
name:
type: string
nullable: true
description: Description of temperature sensor (if available, `null` otherwise)
value:
type: number
description: Sensor value
max:
type: number
nullable: true
description: Maximum sensor value (if available, `null` otherwise)
crit:
type: number
nullable: true
description: Critical sensor value (if available, `null` otherwise)
sensor:
type: string
description: Short path of temperature sensor
example:
- name: "amdgpu"
path: "hwmon1"
source: "devices/pci0000:00/0000:00:08.1/0000:05:00.0"
temps:
- name: "edge"
value: 40.0
max: null
crit: null
sensor: "temp1"
- name: "nct6793"
path: "hwmon2"
source: "devices/platform/nct6775.656"
temps:
- name: "SMBUSMASTER 0"
value: 59.5
max: null
crit: null
sensor: "temp1"
- name: CPUTIN
value: 40.0
max: null
crit: null
sensor: "temp2"
- name: "k10temp"
path: "hwmon3"
source: "devices/pci0000:00/0000:00:18.3"
temps:
- name: "Tdie"
value: 58.875
max: 70.0
crit: null
sensor: "temp1"
- name: "Tctl"
value: 58.875
max: null
crit: null
sensor: "temp2"
- name: "coretemp"
path: "hwmon4"
source: "devices/platform/coretemp.0"
temps:
- name: "Package id 0"
value: 48.0
max: 100.0
crit: 100.0
sensor: "temp1"
- name: "Core 0"
value: 48.0
max: 100.0
crit: 100.0
sensor: "temp2"
- name: "Core 1"
value: 47.0
max: 100.0
crit: 100.0
sensor: "temp3"
cpu_temp:
type: number
description: CPU temperature (best guess, may be *null* if no sensor can be reliably identified, please report if you encounter this)
nullable: true
example: 48.0
hot_limit:
type: number
description: Limit defined in FTL's config beyond which the CPU should be considered hot
example: 60.0
unit:
type: string
description: Sensor value unit
example: "C"
host:
type: object
properties:
host:
type: object
properties:
uname:
type: object
properties:
domainname:
type: string
example: "(none)"
machine:
type: string
example: "x86_64"
nodename:
type: string
example: "raspberrypi"
release:
type: string
example: "5.15.0-52-generic"
sysname:
type: string
example: "Linux"
version:
type: string
example: "#58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022"
model:
type: string
description: Device model (if available, `null` otherwise)
example: "Raspberry Pi Model 4B"
nullable: true
dmi:
type: object
properties:
bios:
type: object
properties:
vendor:
type: string
description: BIOS vendor (if available, `null` otherwise)
example: "American Megatrends Inc."
nullable: true
board:
type: object
properties:
name:
type: string
description: Board name (if available, `null` otherwise)
example: "Raspberry Pi 4 Model B Rev 1.4"
nullable: true
vendor:
type: string
description: Board vendor (if available, `null` otherwise)
example: "Raspberry Pi Foundation"
nullable: true
version:
type: string
description: Board version (if available, `null` otherwise)
example: "0x14"
nullable: true
product:
type: object
properties:
name:
type: string
description: Product name (if available, `null` otherwise)
example: "Raspberry Pi 4 Model B Rev 1.4"
nullable: true
version:
type: string
description: Product version (if available, `null` otherwise)
example: "0x14"
nullable: true
family:
type: string
description: Product family (if available, `null` otherwise)
example: "Raspberry Pi 4 Model B Rev 1.4"
nullable: true
sys:
type: object
properties:
vendor:
type: string
description: System vendor (if available, `null` otherwise)
example: "Raspberry Pi Foundation"
nullable: true
ftl:
type: object
properties:
ftl:
type: object
properties:
database:
type: object
properties:
gravity:
type: integer
description: Number of collected exact domains on blocking lists
example: 67906
antigravity:
type: integer
description: Number of collected exact domains on allowing lists
example: 0
groups:
type: integer
description: Number of groups
example: 6
lists:
type: integer
description: Number of lists
example: 1
clients:
type: integer
description: Number of configured clients
example: 5
domains:
type: object
properties:
allowed:
type: object
properties:
total:
type: integer
description: Number of allowed domains (total)
example: 67906
enabled:
type: integer
description: Number of allowed domains (enabled)
example: 4
denied:
type: object
properties:
total:
type: integer
description: Number of denied domains (total)
example: 4
enabled:
type: integer
description: Number of denied domains (enabled)
example: 2
regex:
type: object
properties:
allowed:
type: object
properties:
total:
type: integer
description: Number of allowed regex filters (total)
example: 67906
enabled:
type: integer
description: Number of allowed regex filters (enabled)
example: 4
denied:
type: object
properties:
total:
type: integer
description: Number of denied regex filters (total)
example: 10
enabled:
type: integer
description: Number of denied regex filters (enabled)
example: 2
privacy_level:
type: integer
description: Currently used privacy level
example: 0
query_frequency:
type: number
description: Average number of queries per second
example: 1.1
clients:
type: object
properties:
total:
type: integer
description: Number of clients FTL has seen in its lfetime
example: 10
active:
type: integer
description: Number of clients actively using FTL
example: 8
pid:
type: integer
description: PID of FTL process
example: 1234
uptime:
type: number
description: Uptime of FTL in milliseconds
example: 123456789
"%mem":
type: number
description: Percentage of total RAM memory used by FTL
example: 0.1
"%cpu":
type: number
description: Percentage of total CPU used by FTL (ten seconds average)
example: 1.2
allow_destructive:
type: boolean
description: Whether or not FTL is allowed to perform destructive actions
example: true
dnsmasq:
type: object
description: Metrics from the embedded dnsmasq resolver
properties:
dns_cache_inserted:
type: integer
description: Number of inserted entries in DNS cache
example: 8
dns_cache_live_freed:
type: integer
description: Number of freed live entries in DNS cache
example: 0
dns_queries_forwarded:
type: integer
description: Number of forwarded DNS queries
example: 2
dns_auth_answered:
type: integer
description: Number of DNS queries for authoritative zones
example: 0
dns_local_answered:
type: integer
description: Number of DNS queries answered from local cache
example: 74
dns_stale_answered:
type: integer
description: Number of DNS queries answered from local cache (stale entries)
example: 0
dns_unanswered:
type: integer
description: Number of unanswered DNS queries
example: 0
bootp:
type: integer
description: Number of BOOTP requests
example: 0
pxe:
type: integer
description: Number of PXE requests
example: 0
dhcp_ack:
type: integer
description: Number of DHCP ACK
example: 0
dhcp_decline:
type: integer
description: Number of DHCP DECLINE
example: 0
dhcp_discover:
type: integer
description: Number of DHCP DISCOVER
example: 0
dhcp_inform:
type: integer
description: Number of DHCP INFORM
example: 0
dhcp_nak:
type: integer
description: Number of DHCP NAK
example: 0
dhcp_offer:
type: integer
description: Number of DHCP OFFER
example: 0
dhcp_release:
type: integer
description: Number of DHCP RELEASE
example: 0
dhcp_request:
type: integer
description: Number of DHCP REQUEST
example: 0
noanswer:
type: integer
description: Number of DHCP requests without answer (rapid commit)
example: 0
leases_allocated_4:
type: integer
description: Number of allocated IPv4 leases
example: 0
leases_pruned_4:
type: integer
description: Number of pruned IPv4 leases
example: 0
leases_allocated_6:
type: integer
description: Number of allocated IPv6 leases
example: 0
leases_pruned_6:
type: integer
description: Number of pruned IPv6 leases
example: 0
tcp_connections:
type: integer
description: Number of dedicated TCP workers
example: 0
dhcp_leasequery:
type: integer
description: Number of DHCP lease queries
example: 0
dhcp_lease_unassigned:
type: integer
description: Number of DHCP lease unassigned
example: 0
dhcp_lease_actve:
type: integer
description: Number of DHCP lease active
example: 0
dhcp_lease_unknown:
type: integer
description: Number of DHCP lease unknown
example: 0
dnssec_max_crypto_use:
type: integer
description: DNSSEC per-query crypto work HWM
example: 0
dnssec_max_sig_fail:
type: integer
description: DNSSEC per-RRSet signature fails HWM
example: 0
dnssec_max_work:
type: integer
description: DNSSEC per-query subqueries HWM
example: 0
database:
type: object
properties:
size:
type: integer
description: Database size in bytes
example: 3690496
type:
type: string
description: Database file type
example: "Regular file"
mode:
type: string
description: Database file mode
example: "rw-r--r--"
atime:
type: integer
description: Timestamp of last access
example: 1611742120
mtime:
type: integer
description: Timestamp of last modification
example: 1611742120
ctime:
type: integer
description: Timestamp of last status change
example: 1611742120
owner:
type: object
properties:
user:
type: object
properties:
uid:
type: integer
description: UID of database owner
example: 998
name:
type: string
description: Name of database owner (user)
example: "pihole"
info:
type: string
description: User info
example: ""
group:
type: object
properties:
gid:
type: integer
description: GID of database owner
example: 998
name:
type: string
description: Name of database owner (group)
example: "pihole"
queries:
type: integer