-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patho2s.conf.sample
335 lines (256 loc) · 9.72 KB
/
o2s.conf.sample
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
[defaults]
# logfile defaults to `<program>.log`. It can be overriden by setting
# PROGRAMLOG=/path/to/file.log in the environment where PROGRAM is one
# of CTRLD, PISTA, or O2S
loglevel = DEBUG
logformat = '%(asctime)-15s %(levelname)-5s [%(module)s] %(message)s'
# __ _
# / _| ___ __ _| |_ _ _ _ __ ___ ___
# | |_ / _ \/ _` | __| | | | '__/ _ \/ __|
# | _| __/ (_| | |_| |_| | | | __/\__ \
# |_| \___|\__,_|\__|\__,_|_| \___||___/
#
[features]
# If storage is False, no data will be written to the relational database
# store.
storage = True
# If plmn is True, mobile operator codes are looked up and republished.
# For example, when Greenwich says: ../operators 26201 +26202
# o2s will translate and republish as
# ../operators/26201 T-Mobile (DE)
# ../operators/26202 Vodafone (DE)
plmn = True
# If activo is True then the job selector module is enabled and job
# tracking will take place
activo = False
# If watcher is not None it is the name of a topic to which we publish
# a string representation of incoming data; this is useful for monitoring.
# These pubs are qos=0 and non-retained. {0} is replaced with the name
# of the original topic (owntracks/gw/XX) and a suffix may be appended to
# it, e.g.:
#
# owntracks/gw/XX/cmd/out -> owntracks/gw/XX/././_look/cmd/out
# --------------- -------
# Must not end with a slash
watcher = "_owntracks/_look/{0}"
# Handle waypoints/geofences. If this is not None, it is the path to
# a file which will contain a pickled list of current geofences.
geofences = None
# If rawdata is True, o2s will create a database table (rawdata) to
# store off-the-wire publishes as the're seen. This is useful for
# debugging
rawdata = False
# If alarm is not None, it contains the path to a Python plugin which
# will fire when an alarm is detecte.
alarm = "alarmhelper.py"
# Defines a list of which trigger types (`t') should *not* be persisted to
# the database. This is a Python list.
t_ignore = [ 'p', ]
# If not None, defines a topic to which o2s subscribes with QoS=2. It will
# not process retained messages, irrespective of `skip_retained' below.
# o2s will subscribe to <o2smonitor>/+ to receive commands, and it will
# publish the result of those commands to <o2smonitor>/<cmd>/out
#
# Subscribe with: mosquitto_sub -v -t '_owntracks/o2s/#'
# Talk to it : mosquitto_pub -t _owntracks/o2s/imei -m J4
o2smonitor = "_owntracks/o2s"
# __ __ ___ _____ _____
# | \/ |/ _ \_ _|_ _|
# | |\/| | | | || | | |
# | | | | |_| || | | |
# |_| |_|\__\_\|_| |_|
#
# These parameters define the MQTT broker o2s will connect *to*.
[mqtt]
host = localhost
port = 8883
username = 'jane'
password = 'secret'
client_id = 'yyyx01'
; ca_certs = None
ca_certs = '/path/to/ca.crt'
tls_version = 'tlsv1'
# tls_version = 'sslv3'
tls_insecure = False
# If skip_retained is True, messages retained by the broker will not
# be processed. Note that this can cause duplicate entries in DB.
skip_retained = False
# This is a Python list of topics to track. Note that just the base topic
# is required here; o2s subscribes to the required subtopics
# For example if you have a device publishing to `owntracks/jane/iphone' as
# its base topic, you would specify
#
# base_topics = [ 'owntracks/jane' ]
#
# here.
base_topics = [ 'owntracks/gw', 'owntracks/jane']
# If not None, maptopic is a format string used to publish objects to Pista's
# Map, Status, and Tables pages. {0} is filled with the original location topic
# If this is not defined (i.e. None) those pages will be empty. The same rules
# as for `watcher' apply here.
# _owntracks/_map/<fulltopic>
# _owntracks/_map/owntracks/echle/BB/status
maptopic = "_owntracks/_map/{0}"
# If not None, jobtopic is a format string used to publish objects to Pista's
# Job page. {0} is filled with the original location topic
# If this is not defined (i.e. None) those pages will be empty. The same rules
# as for `watcher' apply here.
# _owntracks/_job/<fulltopic>
# _owntracks/_job/owntracks/echle/BB/status
jobtopic = "_owntracks/_job/{0}"
# If the `geofences' feature is enabled and alert_topic is not None, it is an
# MQTT topic name to which geofence enter/leave events will be published. The
# payload will consist of a JSON object which is populated with the elements
# you wish from the list of available data, which includes any of
#
# tid
# lat
# lon
# cog
# vel
# alt
# tstamp
# compass
# addr
# cc
# status
# topic
# tst
# info
#
# Configure `alert_keys` to be a string of white-space separated names
# of the elements you require in the payload. The JSON payload will, in
# addition, contain the following elements:
#
# "_type" : "alert"
# "event" : "enters" // or "leaves"
# "trigger" : 1 // or 0 (1 == enter, 0 == leave)
# "km" : "2.03" // distance in Km from center of waypoint
# "meters" : 2312 // distance in meters " "
# "wpname" : "Favorite restaurant" // waypoint description from database
# "wplat" : xxx.xx // waypoint-configured lat
# "wplon" : yyy.yy // waypoint-configured lon
#
# These events are also published to _look, if configured
# If `alert_keys` is None, all keys are published.
alert_topic = "_alerts"
# alert_keys = "addr tst lat tid"
alert_keys = None
# ____ ____
# | _ \| __ )
# | | | | _ \
# | |_| | |_) |
# |____/|____/
#
[database]
# Which DB driver to use. One of `sqlite', `mysql', or `postgresql'
#
# mysql: dbhost, dbname, dbuser, dbpasswd
# postgresql: dbhost, dbname, dbuser, dbpasswd, dbport
# sqlite: dbpath
dbengine = mysql
dbhost = 'localhost'
dbname = 'owntracks'
dbuser = 'jane'
dbpasswd = 'secret'
dbpath = "/path/to/owntracks-sqlite.db"
[revgeo]
enabled = True
# Specify the precision for the reverse-geo cache (geo database table).
# Default is 5 which is approximately a 5x5 km area.
#
# http://www.movable-type.co.uk/scripts/geohash.html
# Length Cell width Cell height
# 1 ≤ 5,000km × 5,000km
# 2 ≤ 1,250km × 625km
# 3 ≤ 156km × 156km
# 4 ≤ 39.1km × 19.5km
# 5 ≤ 4.89km × 4.89km
# 6 ≤ 1.22km × 0.61km
# 7 ≤ 153m × 153m
# 8 ≤ 38.2m × 19.1m
ghashlen = 5 ; default=5
# The region_bias is a ccTLD country code which attempts to bias
# the type of data returned. (Compare "Toledo" in Spain with Toledo
# somewhere in the US.) We set map language to the same value.
# https://developers.google.com/maps/documentation/geocoding/?csw=1#RegionCodes
region_bias = "de"
# _ _
# _ __ (_)___| |_ __ _
# | '_ \| / __| __/ _` |
# | |_) | \__ \ || (_| |
# | .__/|_|___/\__\__,_|
# |_|
[pista]
# Which address:port should the Pista app listen on when started?
# Specify listen_host="0.0.0.0" to have it listen on all interfaces
# These settings are only valid when pista runs standalone.
listen_host = "localhost"
listen_port = 8080
# Array of page names which should be visible from the pista menu.
# Chose any from
# ['about', 'map', 'table', 'tracks', 'console', 'status', 'hw', 'jobs', 'jobedit' ]
pages = ['about', 'map', 'table', 'tracks', 'console', 'status', 'hw' ]
# Set to True if Demo site. You should not set this.
is_demo = False
# The following parameters are for the Websocket connections and
# most of these are made available to Web apps via a GET request
# to ../config.js.
[websocket]
# Host/port for Websockets must be reachable from the Web browsers.
# It is quite possible that this will not work through HTTP-only
# proxies
host = "127.0.0.1"
port = 9001
reconnect_in = 5000 ; milliseconds
# If you set usetls = True, it is most likely you'll have to serve the
# Web pages from a TLS-enabled HTTP server.
usetls = False
cleansession = True
# If basic_auth is True, the credentials used during HTTP Basic authentication
# to Pista will be re-used to connect to the MQTT broker. If this setting is
# False, the username/password configured here will be used instead.
basic_auth = True
username = None
password = None
# username = "jjolie"
# password = "sécret"
; if apikey is set, it must be a key obtained for Mapbox use ; (format:
; 'xxxxxx.AAAAAAAA') ; if set to None, OSM is used as map provider
; Be warned that this apikey can leak out to Web browser clients!
apiKey = None
; This is the MQTT topic the Console subscribes to. (See `watcher' above)
console_topic = "_owntracks/_look/#"
; This is the MQTT topic the Map and Table subscribes to. It *must*
; correspond to `maptopic' as configured for o2s, and it must not
; end with a slash.
maptopic = "_owntracks/_map/+/+/+"
; This is the MQTT topic the Job subscribes to. It *must*
; correspond to `jobtopic' as configured for o2s, and it must not
; end with a slash.
jobtopic = "_owntracks/_job/+/+/+"
# TABLE:
; Whether or not to show the topic name in Tables by default (can be toggled ;
; on/off in the UI) by default.
topic_visible = False
## _ _ _
## ___| |_ _ __| | __| |
## / __| __| '__| |/ _` |
## | (__| |_| | | | (_| |
## \___|\__|_| |_|\__,_|
##
# ctrld is a very specialized utility which you'll probably not require.
#
#[ctrld]
#
#; This is the CA certificate file in PEM format which will be returned to
#; clients for them to connect to an MQTT broker. It is not necessarily
#; the same as in [mqtt] above.
#
#cacert_file = '/path/to/cacert.pem'
#
#; Listen port and host for ctrld REST interface (if not running under an
#; HTTP server
#
#listen_host = '127.0.0.1'
#listen_port = 8809