Temporarily switch shared data to the network requested by the client.
()
| 1880 | |
| 1881 | |
| 1882 | @app.route('/api/net/integrity', methods=['GET']) |
| 1883 | def net_integrity_status(): |
| 1884 | """Last verdict from the passive network-integrity monitor (for the |
| 1885 | dashboard chip). Reflects config even when the monitor hasn't run yet.""" |
| 1886 | with _net_integrity_lock: |
| 1887 | state = dict(_net_integrity_state) |
| 1888 | state['monitor_enabled'] = bool(shared_data.config.get('net_integrity_monitor_enabled', False)) |
| 1889 | state['interval_min'] = shared_data.config.get('net_integrity_interval_min', 5) |
| 1890 | state['extended_enabled'] = bool(shared_data.config.get('net_integrity_extended_enabled', True)) |
| 1891 | state['batch_size'] = shared_data.config.get('net_integrity_batch_size', 3) |
| 1892 | state['interface'] = shared_data.config.get('net_integrity_interface', '') or '' |
| 1893 | return jsonify({'success': True, **state}) |
| 1894 | |
| 1895 | |
| 1896 | # ========================================================================== |
| 1897 | # Watchtower — unified alert pane for the standalone passive watchers. |
| 1898 | # The deep daemons (arp_guard, ndpwatch, wifiwatch, certwatch, snmpwatch, |
| 1899 | # isiswatch, igmpwatch) each write their own JSON-lines log; Watchtower tails |
| 1900 | # them all, normalizes into one shape, shows them in one pane, and pages the |
| 1901 | # high/critical ones through a single deduped Pushover path. Read-only over the |
| 1902 | # logs — it captures nothing. Opt-in via watchtower_enabled. |
| 1903 | # ========================================================================== |
| 1904 | |
| 1905 | _watchtower_lock = threading.Lock() |
no test coverage detected