Get wardriving engine status.
()
| 8153 | |
| 8154 | @app.route('/api/config/export', methods=['GET']) |
| 8155 | def export_config(): |
| 8156 | """Download the current config as a portable JSON for fleet deployment.""" |
| 8157 | try: |
| 8158 | payload = _build_config_export() |
| 8159 | body = json.dumps(payload, indent=2, default=str) |
| 8160 | stamp = datetime.now().strftime('%Y%m%d-%H%M%S') |
| 8161 | fname = f"ragnar-config-{socket.gethostname()}-{stamp}.json" |
| 8162 | # octet-stream (not application/json) so iOS Safari downloads the file |
| 8163 | # instead of previewing it inline; nosniff keeps other browsers from |
| 8164 | # second-guessing that. |
| 8165 | resp = Response(body, mimetype='application/octet-stream') |
| 8166 | resp.headers['Content-Disposition'] = f'attachment; filename="{fname}"' |
| 8167 | resp.headers['X-Content-Type-Options'] = 'nosniff' |
| 8168 | return resp |
| 8169 | except Exception as e: |
| 8170 | logger.error(f"Error exporting config: {e}") |
nothing calls this directly
no test coverage detected