-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpihole.skeleton
executable file
·119 lines (119 loc) · 2.75 KB
/
pihole.skeleton
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
{
name: `Pi Hole`,
description: `Network-wide Ad Blocking`,
image: `pihole/pihole`,
uuid: `7CCA69ED-DA29-4DCE-95DD-A14878568B54`,
tags: [
`Ad Blocking`, `Networking`, `Dns`
],
actions: [
],
properties: [
{
type: `Feature`,
name: `localtime`,
},
{
type: `Directory`,
name: `/etc/pihole`,
style: `store`
},
{
type: `Directory`,
name: `/etc/dnsmasq.d`,
style: `boot`
},
{
type: `Environment`,
name: `IPv6`,
value: `{{!!__HOMEIP6}}`
},
{
type: `Environment`,
name: `WEBPASSWORD`,
value: ``
},
{
type: `Environment`,
name: `DNS1`,
value: `127.0.0.1`
},
{
type: `Environment`,
name: `DNS2`,
value: `127.0.0.1`
},
{
type: `Environment`,
name: `VIRTUAL_HOST`,
value: `{{__HOSTIP}}`
},
{
type: `Environment`,
name: `DNSMASQ_LISTENING`,
value: `all`
},
{
type: `Port`,
name: `443/tcp`,
port: 443,
protocol: `TCP`
},
{
type: `Port`,
name: `53/tcp`,
port: 53,
protocol: `TCP`
},
{
type: `Port`,
name: `53/udp`,
port: 53,
protocol: `UDP`,
dns: true
},
{
type: `Port`,
name: `80/tcp`,
port: 80,
protocol: `TCP`,
web: {
tab: `newtab`,
widget: `newtab`,
path: `/admin/`
}
},
{
type: `Network`,
name: `primary`,
value: `home`
},
{
type: `Network`,
name: `secondary`,
value: `dns`
}
],
monitor: {
cmd: `pihole -c --json`,
init: `
<style>
.ph-o { display: inline-block; width: 200px; padding-top: 20px; float: right; }
.ph-b { color: var(--secondary-text-color); text-align: right; padding: 0 5px 10px 0; font-size: 12px; }
.ph-r { display: inline-block; font-size: 24px; color: var(--primary-text-color); }
</style>
<div class="ph-o">
<div class="ph-b"><div id="{{ID}}_b" class="ph-r">0</div><div>Blocked in last 24 hours</div></div>
<div class="ph-b"><div id="{{ID}}_p"class="ph-r">0%</div><div>Percentage Blocked</div></div>
<div class="ph-b"><div id="{{ID}}_t"class="ph-r">0</div><div>Domains Being Blocked</div></div>
</div>
<script>
window.monitor("{{ID}}", 60, (input) => {
const output = JSON.parse(input);
document.getElementById("{{ID}}_b").innerText = output.ads_blocked_today.toLocaleString();
document.getElementById("{{ID}}_p").innerText = output.ads_percentage_today.toFixed(1) + "%";
document.getElementById("{{ID}}_t").innerText = output.domains_being_blocked.toLocaleString();
});
</script>`
}
}