-
Notifications
You must be signed in to change notification settings - Fork 8
/
phad.conf
229 lines (195 loc) · 7.37 KB
/
phad.conf
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
[main]
# If git_update_version_check is true then phad will attempt to invoke
# 'git remote update' using the git_repo and git_sudo settings whe
# performing a version check. This is mostly helpful when running a
# beta or test version of pihole. This will perform the equivalent
# of sudo git -C /etc/.pihole remote update
git_update_version_check=False
git_repo=/etc/.pihole
git_sudo=True
# By default phad will determine pihole version information using the
# version numbers returned by pihole. To perform version checking with
# hashes instead of version numbers set use_version_hashes to True.
# This is the equivelant of invoking "pihole -v" with the optional
# --hash parameter.
use_version_hashes=False
# The touch screen input device. If you have a RPi with only a touchscreen
# then this is likely the right device to use. If this does not work for
# you then investigating the directories /dev/input/by-id or
# /dev/input-by-path might help, along with the file /proc/bus/input/devices
input_device=/dev/input/event0
# Temporary state data is stored to this file. Manly version details provided
# by pi-hole are stored here so that phad is not querying Github multiple
# times a minute. This data is refreshed once a day.
data_file=./phad.dat
# phad will write its PID to this file so that "phad -r" can then tell phad
# to re-read this file if edits are made.
pid_file=./phad.pid
# Path to the templates to render
template_path=./templates
# Comma seperated list of templates to render. The first one in the list is
# the default.
templates=main.j2,top_ads.j2,top_domains.j2,top_clients.j2,network.j2
# If a touchscreen is used then display_timeout is the number of seconds after
# the screen is last touched before the backlight is turned off (if it exists)
# or the first template is displayed again.
display_timeout=30
# How often phad should query the pi-hole for data
refresh_rate=30
# Maximum number of top ads, clients, and domains to fetch from pi-hole
top_ads_max=20
top_clients_max=20
top_domains_max=20
# If True then phad will attempt to obtain your public IP once a day
# and store it in phad's data_file. The URL that is queried should
# return your public IP and nothing else. Multiple comma-separated
# URLs can be provided. Each URL will be tried in order until one
# successfully returns an IP
get_external_ip=True
external_ip_url=https://www.myexternalip.com/raw,http://ipv4bot.whatismyipaddress.com
# The following section defined settings for querying and toggling the
# backlight of LCD displays
[backlight]
# Location of the file that is used to query/toggle an LCD backlight.
# Common values can include:
# /sys/class/backlight/rpi_backlight/bl_power
# /sys/class/backlight/soc:backlight/bl_power
file_location=/sys/class/backlight/soc:backlight/bl_power
# Whether or not to toggle the LCD backlight
enabled=True
# Use sudo when writing to file_location
use_sudo=True
# Values use for turning the display on and off
on_value=0
off_value=1
# Date/time strings are formatted according to the standard date/time directives
# documented here:
# https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior
[datetime]
formatted=date,time,combined
date="%Y-%m-%d"
time="%H:%M:%S"
combined="%Y-%m-%d %H:%M:%S"
# uptime formats use the self-evident variables 'days', 'hours', 'minutes', 'seconds'
# and 'total_seconds'
[uptime]
strings=long,short,seconds
short="{days:4}:{hours:02}:{minutes:02}"
long="{days:4} days, {hours:2} hours, {minutes:2} minutes "
seconds="{total_seconds:8}"
# All the following sections define how individual data is represented in the JSON
# results that are used to render the templates. The basic methodology behind phad
# is to define formats that pad values with strings so that the resulting values
# of of known fixed lengths. This makes it easy to layout those variables in
# the jinja2 templates used to generate the phad displays.
#
# Each [section] identifies the group of values that the subsequent formatting will
# be applied to. When a [section] name contains a '/', that indicates that the [section]
# formatting applies only to a specific subset of values. [sections] values are applied
# from most specific to most generic, so if [foo/bar/variable] exists then it is used
# to format the variable, otherwise if [foo/bar] exists then it is used, and so on.
#
# Example: If you invoke "./phad -j -l status" it will display all the status variables
# in JSON format. The [status/temp/C] section below will format the celsius temperatore
# value one way, and the [status] section will format all remaining variables in the
# status JSON structure a different way.
#
# There are four primary options that you can specify under each section. All formatting is
# based on the "new style" of python formatting that can be found at https://pyformat.info.
# The three simpler options that can be specified are as follows:
#
# str=<format>
# float=<format>
# int=<format>
#
# The above three options will cast variables as specific types. If a variable is a string,
# such as a domain name, then it can be padded to a specific length using something like
# "str={:20}". Note that it is possible to specify two formats if it makes sense. For
# example, the [stats/ads_percentage_today] section defines both a "str" and "float"
# option.
#
# There are two special types of options that can be specified beyond the three mentioned
# above. The "strings" option provides a way to have a variable be formatted more than
# one way. For example, the [version] section as a "strings" option that specifies "left"
# and "right", after which there is a "left" option that defines a left-padded string
# format and a "right" option that defines a right-padded string format.
#
# The last formatting option is "graph" which can be applied to integer or floating
# values. This will generate a graphical representation of the value. To define a graph,
# the option is in the following format:
#
# graph=length,used_fill,free_fill,used_color,free_color
#
# Only the length is required when defining a graph. All other values are optional
# and default values will be used if they are not specified here. Examples:
#
# graph=40
#
# This will create a graph that is 40 characters long using the default values for
# character fills and colors.
#
# graph=10,X,-,Yellow,Cyan
#
# This will create a graph that is 10 character long. It will use an 'X' to denote
# where the graph is filled, and a hyphen ('-') to denote where it is not filled.
# The 'X's will also be yellow and the '-'s will be cyan.
#
# Any of the following colors can be used when defining graphs:
#
# 'Red'
# 'Green'
# 'Yellow'
# 'Blue'
# 'Magenta'
# 'Cyan'
# 'White'
# 'Bright_Black'
# 'Bright_Red'
# 'Bright_Green'
# 'Bright_Yellow'
# 'Bright_Blue'
# 'Bright_Magenta'
# 'Bright_Cyan'
# 'Bright_White'
[stats/ads_percentage_today]
str={:>20}
float={:5.2f}
graph=40
[stats/domains_being_blocked]
int={:,}
[version]
strings=left,right
left={:10}
right={:>10}
[status]
str={:10}
[status/temp/C]
float="{:4.1f}°C "
[memory/percent]
graph=10,■,■,Magenta,Blue
float="{:4.1f}"
[host/cpuload]
graph=10,-,.,Yellow,Cyan
float="{:4.1f}"
[top/ads/url]
strings=str40
str40={:40.40s}
str={:35.35s}
[top/ads/rank]
int={:2}
[top/domains/url]
strings=str40
str40={:40.40s}
str={:35.35s}
[top/domains/rank]
int={:2}
[top/clients/IP]
str:{:35}
[top/clients/hostname]
str:{:35.35s}
[top/clients/rank]
int={:2}
[client_names/IP]
str={:15}
[querytypes]
str={:5}