Normalize and record a host value for vulnerable host counting
(candidate)
| 3136 | 'unnumbered_units': unnumbered, |
| 3137 | # Mesh-wide health, rolled up server-side so a fleet of thousands is |
| 3138 | # one small object here instead of the browser crunching every node. |
| 3139 | 'health': health_rollup, |
| 3140 | }, |
| 3141 | }) |
| 3142 | |
| 3143 | |
| 3144 | @app.route('/api/mesh/control', methods=['POST']) |
| 3145 | def mesh_control(): |
| 3146 | """Start/stop one of this unit's monitors — the mesh's write endpoint. |
| 3147 | |
| 3148 | Reachable two ways, both trusted: |
| 3149 | * a tagged peer Ragnar over the tailnet (the auth bypass in |
| 3150 | check_authentication lets THIS one POST through on WireGuard identity); |
| 3151 | * the local operator with a session (self-control, no network hop). |
| 3152 | |
| 3153 | Everything actuable is allowlisted in `_mesh_apply_control`; there is no way |
| 3154 | to reach an arbitrary route from here. |
| 3155 | """ |
| 3156 | if not mesh_available: |
| 3157 | return jsonify({'success': False, 'error': 'mesh_manager unavailable'}), 503 |
| 3158 | data = request.get_json(silent=True) or {} |
| 3159 | result = _mesh_apply_control(data.get('feature'), data.get('action')) |
no test coverage detected