-
-
Notifications
You must be signed in to change notification settings - Fork 185
/
config.yaml
839 lines (837 loc) · 25.5 KB
/
config.yaml
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
openapi: 3.0.2
components:
paths:
config:
get:
summary: Get current configuration of your Pi-hole
tags:
- "Pi-hole Configuration"
operationId: "get_config"
description: |
This API hook returns infos about the config of your Pi-hole.
parameters:
- $ref: 'config.yaml#/components/parameters/detailed'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'config.yaml#/components/schemas/config'
- $ref: 'common.yaml#/components/schemas/took'
examples:
config:
$ref: 'config.yaml#/components/examples/config'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
patch:
summary: Change configuration of your Pi-hole
tags:
- "Pi-hole Configuration"
operationId: "patch_config"
description: |
This API hook allows to modify the config of your Pi-hole. This endpoint supports changing multiple properties at once when you specify several in the payload. See examples below.
requestBody:
description: Callback payload
content:
application/json:
schema:
allOf:
- $ref: 'config.yaml#/components/schemas/config'
- $ref: 'common.yaml#/components/schemas/took'
examples:
config_one:
$ref: 'config.yaml#/components/examples/config_one'
config_two:
$ref: 'config.yaml#/components/examples/config_two'
config:
$ref: 'config.yaml#/components/examples/config'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'config.yaml#/components/schemas/config'
- $ref: 'common.yaml#/components/schemas/took'
examples:
config:
$ref: 'config.yaml#/components/examples/config'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
config_elem:
get:
summary: Get specific part of current configuration of your Pi-hole
tags:
- "Pi-hole Configuration"
operationId: "get_config_elem"
description: |
This API hook returns infos about the requested subset of your Pi-hole's configuration.
The response will be a filtered JSON object and a subset of the full `GET /config` response.
parameters:
- $ref: 'config.yaml#/components/parameters/detailed'
- $ref: 'config.yaml#/components/parameters/element'
responses:
'200':
description: OK
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
config_elem_value:
put:
summary: Add config array item
tags:
- "Pi-hole Configuration"
operationId: "add_array_item"
description: |
*Note:* There will be no content on success.
parameters:
- $ref: 'config.yaml#/components/parameters/element'
- $ref: 'config.yaml#/components/parameters/value'
responses:
'201':
description: Item created
'400':
description: Bad request
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/bad_request'
- $ref: 'common.yaml#/components/schemas/took'
examples:
invalid_path_depth:
$ref: 'config.yaml#/components/examples/errors/bad_request/invalid_path_depth'
item_already_present:
$ref: 'config.yaml#/components/examples/errors/bad_request/item_already_present'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
delete:
summary: Delete config array item
tags:
- "Pi-hole Configuration"
operationId: "delete_array_item"
description: |
*Note:* There will be no content on success.
parameters:
- $ref: 'config.yaml#/components/parameters/element'
- $ref: 'config.yaml#/components/parameters/value'
responses:
'204':
description: Item deleted
'404':
description: Item 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:
invalid_path_depth:
$ref: 'config.yaml#/components/examples/errors/bad_request/invalid_path_depth'
item_already_present:
$ref: 'config.yaml#/components/examples/errors/bad_request/item_already_present'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'common.yaml#/components/errors/unauthorized'
- $ref: 'common.yaml#/components/schemas/took'
schemas:
config:
type: object
properties:
config:
type: object
properties:
dns:
type: object
properties:
upstreams:
type: array
items:
type: string
CNAMEdeepInspect:
type: boolean
blockESNI:
type: boolean
EDNS0ECS:
type: boolean
ignoreLocalhost:
type: boolean
showDNSSEC:
type: boolean
analyzeOnlyAandAAAA:
type: boolean
piholePTR:
type: string
replyWhenBusy:
type: string
blockTTL:
type: integer
hosts:
type: array
items:
type: string
domainNeeded:
type: boolean
expandHosts:
type: boolean
domain:
type: string
bogusPriv:
type: boolean
dnssec:
type: boolean
interface:
type: string
hostRecord:
type: string
listeningMode:
type: string
queryLogging:
type: boolean
cnameRecords:
type: array
items:
type: string
port:
type: integer
cache:
type: object
properties:
size:
type: integer
optimizer:
type: integer
revServer:
type: object
properties:
active:
type: boolean
cidr:
type: string
target:
type: string
domain:
type: string
blocking:
type: object
properties:
active:
type: boolean
mode:
type: string
specialDomains:
type: object
properties:
mozillaCanary:
type: boolean
iCloudPrivateRelay:
type: boolean
reply:
type: object
properties:
host:
type: object
properties:
force4:
type: boolean
force6:
type: boolean
IPv4:
type: string
x-format: ipv4
IPv6:
type: string
x-format: ipv6
blocking:
type: object
properties:
force4:
type: boolean
force6:
type: boolean
IPv4:
type: string
x-format: ipv4
IPv6:
type: string
x-format: ipv6
rateLimit:
type: object
properties:
count:
type: integer
interval:
type: integer
dhcp:
type: object
properties:
active:
type: boolean
start:
type: string
x-format: ipv4
end:
type: string
x-format: ipv4
router:
type: string
x-format: ipv4
netmask:
type: string
x-format: ipv4
leaseTime:
type: string
ipv6:
type: boolean
rapidCommit:
type: boolean
multiDNS:
type: boolean
hosts:
type: array
items:
type: string
resolver:
type: object
properties:
resolveIPv4:
type: boolean
resolveIPv6:
type: boolean
networkNames:
type: boolean
refreshNames:
type: string
database:
type: object
properties:
DBimport:
type: boolean
DBexport:
type: boolean
maxDBdays:
type: integer
DBinterval:
type: integer
network:
type: object
properties:
parseARPcache:
type: boolean
expire:
type: integer
webserver:
type: object
properties:
domain:
type: string
acl:
type: string
port:
type: string
session:
type: object
properties:
timeout:
type: integer
restore:
type: boolean
tls:
type: object
properties:
rev_proxy:
type: boolean
cert:
type: string
paths:
type: object
properties:
webroot:
type: string
webhome:
type: string
interface:
type: object
properties:
boxed:
type: boolean
theme:
type: string
api:
type: object
properties:
localAPIauth:
type: boolean
searchAPIauth:
type: boolean
max_sessions:
type: integer
prettyJSON:
type: boolean
password:
description: |
*Note:* Special write-only property used to change the password via the API.
type: string
pwhash:
type: string
totp_secret:
type: string
app_pwhash:
type: string
excludeClients:
type: array
items:
type: string
excludeDomains:
type: array
items:
type: string
maxHistory:
type: integer
maxClients:
type: integer
allow_destructive:
type: boolean
temp:
type: object
properties:
limit:
type: number
unit:
type: string
files:
type: object
properties:
pid:
type: string
database:
type: string
gravity:
type: string
gravity_tmp:
type: string
macvendor:
type: string
setupVars:
type: string
pcap:
type: string
log:
type: object
properties:
ftl:
type: string
dnsmasq:
type: string
webserver:
type: string
misc:
type: object
properties:
nice:
type: integer
delay_startup:
type: integer
addr2line:
type: boolean
etc_dnsmasq_d:
type: boolean
privacylevel:
type: integer
dnsmasq_lines:
type: array
items:
type: string
extraLogging:
type: boolean
check:
type: object
properties:
load:
type: boolean
shmem:
type: integer
disk:
type: integer
debug:
type: object
properties:
database:
type: boolean
networking:
type: boolean
locks:
type: boolean
queries:
type: boolean
flags:
type: boolean
shmem:
type: boolean
gc:
type: boolean
arp:
type: boolean
regex:
type: boolean
api:
type: boolean
tls:
type: boolean
overtime:
type: boolean
status:
type: boolean
caps:
type: boolean
dnssec:
type: boolean
vectors:
type: boolean
resolver:
type: boolean
edns0:
type: boolean
clients:
type: boolean
aliasclients:
type: boolean
events:
type: boolean
helper:
type: boolean
config:
type: boolean
inotify:
type: boolean
webserver:
type: boolean
extra:
type: boolean
reserved:
type: boolean
all:
type: boolean
topics:
type: object
properties:
topics:
type: array
items:
type: object
properties:
name:
type: string
description: The name of the topic
title:
type: string
description: The tab title of the topic
description:
type: string
description: A human-readable description of the topic
server:
type: object
properties:
server:
type: array
items:
type: object
properties:
name:
type: string
description: Human-readable name of this server
v4:
type: array
description: Array of IPv4 addresses (if any)
items:
type: string
v6:
type: array
description: Array of IPv6 addresses (if any)
items:
type: string
examples:
config:
summary: The entire configuration
value:
config:
dns:
upstreams: [ "127.0.0.1#5353", "8.8.8.8" ]
CNAMEdeepInspect: true
blockESNI: true
EDNS0ECS: true
ignoreLocalhost: false
showDNSSEC: true
analyzeOnlyAandAAAA: false
piholePTR: PI.HOLE
replyWhenBusy: ALLOW
blockTTL: 2
hosts:
- "192.168.2.123 mymusicbox"
domainNeeded: true
expandHosts: true
domain: "lan"
bogusPriv: true
dnssec: true
interface: "eth0"
hostRecord: ""
listeningMode: "local"
queryLogging: true
cnameRecords:
- "*.example.com,default.example.com"
- "hourly.yetanother.com,yetanother.com,3600"
port: 53
cache:
size: 10000
optimizer: 3600
revServer:
active: false
cidr: "192.168.0.0/24"
target: "192.168.0.1"
domain: "lan"
blocking:
active: true
mode: 'NULL'
specialDomains:
mozillaCanary: true
iCloudPrivateRelay: true
reply:
host:
force4: false
force6: false
IPv4: 0.0.0.0
IPv6: "::"
blocking:
force4: false
force6: false
IPv4: 0.0.0.0
IPv6: "::"
rateLimit:
count: 0
interval: 0
dhcp:
active: false
start: "192.168.0.10"
end: "192.168.0.250"
router: "192.168.0.1"
netmask: "0.0.0.0"
leaseTime: "24h"
ipv6: true
rapidCommit: true
multiDNS: true
hosts:
- "11:22:33:44:55:66,192.168.1.123"
- "11:22:33:44:55:67,192.168.1.124,hostname"
resolver:
resolveIPv4: true
resolveIPv6: true
networkNames: true
refreshNames: IPV4_ONLY
database:
DBimport: true
DBexport: true
maxDBdays: 365
DBinterval: 60
network:
parseARPcache: true
expire: 365
webserver:
domain: pi.hole
acl: "+0.0.0.0/0,::/0"
port: 80,[::]:80
session:
timeout: 300
restore: true
tls:
rev_proxy: false
cert: "/etc/pihole/tls.pem"
paths:
webroot: "/var/www/html"
webhome: "/admin/"
interface:
boxed: true
theme: "default-darker"
api:
localAPIauth: false
searchAPIauth: false
max_sessions: 16
prettyJSON: false
password: "********"
pwhash: ''
totp_secret: ''
app_pwhash: ''
excludeClients: [ '1\.2\.3\.4', 'localhost', 'fe80::345' ]
excludeDomains: [ 'google\\.de', 'pi-hole\.net' ]
maxHistory: 86400
maxClients: 10
allow_destructive: true
temp:
limit: 60.0
unit: "C"
files:
pid: "/run/pihole-FTL.pid"
database: "/etc/pihole/pihole-FTL.db"
gravity: "/etc/pihole/gravity.db"
gravity_tmp: "/tmp"
macvendor: "/etc/pihole/macvendor.db"
setupVars: "/etc/pihole/setupVars.conf"
pcap: ""
log:
ftl: "/var/log/pihole/FTL.log"
dnsmasq: "/var/log/pihole/pihole.log"
webserver: "/var/log/pihole/webserver.log"
misc:
nice: -10
delay_startup: 10
addr2line: true
privacylevel: 0
etc_dnsmasq_d: false
dnsmasq_lines: [ ]
extraLogging: false
check:
load: true
shmem: 90
disk: 90
debug:
database: false
networking: false
locks: false
queries: false
flags: false
shmem: false
gc: false
arp: false
regex: false
api: false
tls: false
overtime: false
status: false
caps: false
dnssec: false
vectors: false
resolver: false
edns0: false
clients: false
aliasclients: false
events: false
helper: false
config: false
inotify: false
webserver: false
extra: false
reserved: false
all: false
config_one:
summary: One option
value:
config:
dns:
CNAMEdeepInspect: true
config_two:
summary: Two options
value:
config:
dns:
specialDomains:
mozillaCanary: true
misc:
nice: -10
topics:
summary: All topics
value:
topics:
- name: dns
title: DNS
description: DNS settings
- name: dhcp
title: DHCP
description: DHCP settings
server:
summary: Several servers being suggested
value:
server:
- name: Google (ECS, DNSSEC)
v4: ["8.8.8.8", "8.8.4.4"]
v6: ["2001:4860:4860:0:0:0:0:8888","2001:4860:4860:0:0:0:0:8844"]
- name: OpenDNS (ECS, DNSSEC)
v4: ["208.67.222.222", "208.67.220.220"]
v6: ["2620:119:35::35","2620:119:53::53"]
errors:
bad_request:
invalid_path_depth:
summary: Invalid path
value:
error:
key: "bad_request"
message: "Invalid path depth"
hint: "Use, e.g., DELETE /config/dnsmasq/upstreams/127.0.0.1 to remove \"127.0.0.1\" from config.dns.upstreams"
item_already_present:
summary: Item to be added exists already
value:
error:
key: "bad_request"
message: "Item already present"
hint: "Uniqueness of items is enforced"
parameters:
detailed:
name: detailed
in: query
description: Return detailed information about the configuration
required: false
schema:
type: boolean
default: false
example: false
element:
in: path
name: element
schema:
type: string
required: true
description: config element
example: "dnsmasq/upstreams"
value:
in: path
name: value
schema:
type: string
required: true
description: config value
example: "8.8.8.8"