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 | def render_help() -> list[Any]:
"""Build Help modal content.
Returns a list of Dash components representing the Help window.
No side effects. Pure view construction.
"""
return [
html.H1("Help"),
html.P(
[
"TapMap shows the locations of the systems your computer connects to on a "
"world map.",
html.Br(),
"Explore each location for summaries and details about the systems and the local ",
"programs involved.",
]
),
html.H2("Quick start"),
html.Ul(
[
html.Li("Start TapMap."),
html.Li(
[
"If a 'Missing GeoIP databases' window appears:",
html.Ul(
[
html.Li("Click Open data folder."),
html.Li(
"Copy GeoLite2-City.mmdb and GeoLite2-ASN.mmdb into that "
"folder."
),
html.Li("Click Recheck GeoIP databases."),
]
),
]
),
html.Li("Hover map markers for a summary."),
html.Li("Click map markers for detailed information."),
html.Li(
"Use the mouse or Plotly tools (top right) to pan, zoom, or reset the view."
),
]
),
html.H2("Definitions"),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr(
[
html.Td("Snapshot"),
html.Td(
"A readout of network connections at a specific moment "
"(refreshed regularly)."
),
]
),
html.Tr(
[
html.Td("Service"),
html.Td(
"A service on the other side, identified by protocol, IP, and "
"port."
),
]
),
html.Tr(
[
html.Td("Socket"),
html.Td(
[
"One local process using one socket entry in the snapshot.",
html.Br(),
"Multiple sockets can refer to the same service.",
]
),
]
),
html.Tr(
[
html.Td("Map marker"),
html.Td(
[
"A location on the map.",
html.Br(),
"One marker can represent multiple services "
"if they share the same rounded coordinates.",
]
),
]
),
]
),
],
),
html.P(
[
"Scope describes where an address belongs:",
html.Br(),
"external internet (PUBLIC), your local network (LAN), or your own "
"machine (LOCAL).",
]
),
html.H3("Scope"),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr([html.Td("PUBLIC"), html.Td("External internet address.")]),
html.Tr(
[
html.Td("LAN"),
html.Td(
"Private network address, for example 192.168.x.x or 10.x.x.x."
),
]
),
html.Tr(
[
html.Td("LOCAL"),
html.Td("Loopback address, for example 127.0.0.1 or ::1."),
]
),
]
),
],
),
html.P(
"Map markers represent PUBLIC services with geolocation. "
"LAN and LOCAL services are not shown on the map."
),
html.H2("Map legend"),
html.Ul(
[
html.Li(
[
html.Span("Magenta", style={"color": "magenta", "fontSize": "larger"}),
" markers and lines show PUBLIC services with geolocation.",
]
),
html.Li(
[
html.Span("Yellow", style={"color": "yellow", "fontSize": "larger"}),
" markers and lines indicate nearby locations.",
]
),
html.Li(
[
html.Span("Cyan", style={"color": "cyan", "fontSize": "larger"}),
" marker shows your location, if enabled.",
]
),
]
),
html.P(
[
"Yellow is a visual hint. Zoom in or change view direction to separate "
"nearby locations.",
html.Br(),
"Location grouping is separate. PUBLIC services with the same rounded "
"coordinates are shown as one marker.",
]
),
html.H2("Controls"),
html.Table(
className="mx-table",
children=[
html.Colgroup(
[
html.Col(style={"width": "50px"}),
html.Col(),
html.Col(style={"width": "75px"}),
]
),
html.Thead(
html.Tr(
[
html.Th("Key"),
html.Th("Action"),
html.Th("Result"),
]
)
),
html.Tbody(
[
html.Tr(
[
html.Td("U"),
html.Td("Show unmapped public services (missing geolocation)"),
html.Td("Window"),
]
),
html.Tr(
[
html.Td("L"),
html.Td("Show established LAN and LOCAL services"),
html.Td("Window"),
]
),
html.Tr(
[
html.Td("O"),
html.Td("Show open ports (TCP LISTEN and UDP bound)"),
html.Td("Window"),
]
),
html.Tr(
[html.Td("T"), html.Td("Show cache in terminal"), html.Td("Status")]
),
html.Tr([html.Td("C"), html.Td("Clear cache"), html.Td("Status")]),
html.Tr(
[html.Td("R"), html.Td("Recheck GeoIP databases"), html.Td("Status")]
),
html.Tr([html.Td("H"), html.Td("Help"), html.Td("Window")]),
html.Tr([html.Td("A"), html.Td("About"), html.Td("Window")]),
html.Tr([html.Td("ESC"), html.Td("Close window"), html.Td("Window")]),
]
),
],
),
html.H2("Unmapped public services"),
html.P(
"The Unmapped window lists PUBLIC services that are not shown on the map because "
"geolocation is missing."
),
html.P(
"Scope in this window describes where the service address belongs. "
"LAN and LOCAL services are excluded from this view."
),
html.P(
"Count shows how many sockets were merged into the row for the latest snapshot. "
"Rows are grouped by scope, protocol, IP, port, PID, and process."
),
html.P(
"In narrow windows, some fields may be truncated. Hover a cell to see the full value."
),
html.H2("Established LAN/LOCAL services"),
html.P(
"This window lists established TCP sockets where the service is LAN or LOCAL. "
"These services are not shown on the map."
),
html.P(
"Count shows how many sockets were merged into the row for the latest snapshot. "
"Rows are grouped by scope, protocol, IP, port, PID, and process for the other side."
),
html.P("Scope in this window describes where the service address belongs."),
html.H2("Open ports"),
html.P(
[
"The Open ports window lists local TCP sockets in LISTEN state and UDP sockets "
"bound to local ports."
]
),
html.P(
"TCP LISTEN means a local process waits for incoming connections. "
"UDP bound means a local process can receive datagrams on that port."
),
html.P("This is a local view only. Services on the other side are not shown."),
html.P(
"Scope in this window describes how the local process is bound: "
"loopback only, LAN only, or all interfaces."
),
html.P("System processes are hidden by default. Use the toggle to include them."),
html.H2("Show cache in terminal"),
html.P("Print the current cache contents to the terminal where TapMap is running."),
html.H2("Status line"),
html.P(
"Short status messages may appear after commands such as Clear cache or "
"Recheck databases."
),
html.H3("STATUS: WAIT | OK | OFFLINE | ERROR"),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr([html.Td("WAIT"), html.Td("No snapshot received yet.")]),
html.Tr([html.Td("OK"), html.Td("Snapshot received successfully.")]),
html.Tr(
[
html.Td("OFFLINE"),
html.Td(
"Snapshot received, but no internet connectivity detected."
),
]
),
html.Tr(
[
html.Td("ERROR"),
html.Td("Failed to fetch or enrich data. See terminal."),
]
),
]
),
],
),
html.H3("LIVE"),
html.P("LIVE shows counters from the current snapshot."),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr(
[
html.Td("TCP"),
html.Td(
"Total TCP entries in the snapshot, across all TCP states."
),
]
),
html.Tr([html.Td("EST"), html.Td("TCP entries in state ESTABLISHED.")]),
html.Tr(
[
html.Td("LST"),
html.Td("Listening TCP sockets on the local machine."),
]
),
html.Tr(
[
html.Td("UDP R"),
html.Td("UDP entries that have a remote address available."),
]
),
html.Tr([html.Td("UDP B"), html.Td("UDP entries bound to a local port.")]),
]
),
],
),
html.P("TCP includes states such as TIME_WAIT, SYN_SENT, and CLOSE_WAIT."),
html.H3("CACHE"),
html.P("CACHE shows aggregated counters since the last Clear cache or app start."),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr(
[
html.Td("SOCK"),
html.Td("Unique sockets (proto, IP, port, PID or process)."),
]
),
html.Tr(
[
html.Td("SERV"),
html.Td("Unique services (proto, IP, port)."),
]
),
html.Tr(
[
html.Td("MAP"),
html.Td("Unique mapped public services (have geolocation)."),
]
),
html.Tr(
[
html.Td("UNM"),
html.Td("Unique unmapped public services (missing geolocation)."),
]
),
html.Tr([html.Td("LOC"), html.Td("Unique LAN and loopback services.")]),
]
),
],
),
html.P("SERV is derived from SOCK by ignoring PID and process."),
html.H3("UPDATED"),
html.P("Time of the last snapshot."),
html.H3("MYLOC: FIXED | AUTO | AUTO (NO GEO) | OFF"),
html.P("Shows your local map location based on the MY_LOCATION setting in config.py."),
html.Table(
className="mx-table mx-kv",
children=[
html.Tbody(
[
html.Tr(
[html.Td("FIXED"), html.Td("Uses fixed coordinates from config.py.")]
),
html.Tr(
[html.Td("AUTO"), html.Td("Location detected from your public IP.")]
),
html.Tr(
[
html.Td("AUTO (NO GEO)"),
html.Td("Public IP detected, but no geolocation available."),
]
),
html.Tr(
[
html.Td("OFF"),
html.Td("Local marker and connection lines are hidden."),
]
),
]
),
],
),
html.H2("GeoIP databases (MaxMind GeoLite2)"),
html.P(
"TapMap uses local MaxMind mmdb files for geolocation. The databases are not included."
),
html.P("Required files:"),
html.Ul([html.Li("GeoLite2-City.mmdb"), html.Li("GeoLite2-ASN.mmdb")]),
html.P("If the databases are missing, a setup window appears at startup."),
html.P(
"Open the data folder from that window or from About. Copy the files into it and use "
"Recheck GeoIP databases to enable geolocation without restarting."
),
html.P(
[
"The databases are free from MaxMind but require an account and acceptance of "
"license terms. Download them here: ",
html.A(
"MaxMind GeoLite2 download page",
href="https://dev.maxmind.com/geoip/geolite2-free-geolocation-data",
target="_blank",
),
".",
]
),
html.P("Update the databases regularly, for example monthly."),
html.H2("Configuration (config.py)"),
html.P("TapMap reads settings from config.py. Edit this file to adjust behavior."),
html.P("Common settings:"),
html.Table(
className="mx-table mx-kv",
children=[
html.Colgroup([html.Col(style={"width": "130px"}), html.Col()]),
html.Tbody(
[
html.Tr(
[
html.Td("SERVER_PORT"),
html.Td(
"Default port used by the local Dash server. "
"Can be overridden at startup using the "
"TAPMAP_PORT environment variable."
),
]
),
html.Tr(
[
html.Td("MY_LOCATION"),
html.Td(
"'none' hides the local marker. Use (lon, lat) for fixed "
"coordinates, or 'auto' to detect from public IP."
),
]
),
html.Tr(
[
html.Td("POLL_INTERVAL_MS"),
html.Td("Snapshot refresh interval in milliseconds."),
]
),
html.Tr(
[
html.Td("COORD_PRECISION"),
html.Td(
"Decimal precision used to group PUBLIC services into one "
"marker. 3 is approximately 100 meters."
),
]
),
html.Tr(
[
html.Td("ZOOM_NEAR_KM"),
html.Td(
"Distance threshold for marking locations as nearby in yellow."
),
]
),
]
),
],
),
html.H2("Network and location notes"),
html.P("IP based geolocation is approximate."),
html.P(
"ASN and ASN organization identify the network operator, not necessarily the "
"service owner."
),
html.P("CDNs and hosting providers can make a service appear in another country."),
html.P("VPN and Tor can hide the true origin of a PUBLIC service location."),
html.H2("Privacy and safety"),
html.P("TapMap runs locally and reads local network connections."),
html.P("Geolocation lookups are performed locally using the mmdb files."),
html.P(
"If MY_LOCATION is set to 'auto', TapMap may query external services to detect the "
"public IP address. It stops after the first valid result."
),
html.P(
[
"To detect OFFLINE status, TapMap performs short connection checks to ",
"1.1.1.1 and 8.8.8.8.",
]
),
]
|