(enable: bool)
| 11248 | _kiosk_install_and_start() |
| 11249 | except subprocess.TimeoutExpired: |
| 11250 | logger.error("[kiosk] repair timed out") |
| 11251 | _kiosk_task_set(phase='failed', error='Kiosk repair timed out.') |
| 11252 | except Exception as exc: |
| 11253 | logger.error(f"[kiosk] repair error: {exc}") |
| 11254 | _kiosk_task_set(phase='failed', error=str(exc)) |
| 11255 | finally: |
| 11256 | with _kiosk_task_lock: |
| 11257 | _kiosk_task['busy'] = False |
| 11258 | |
| 11259 | # Remember the intent, so a reboot mid-repair still comes up with the kiosk. |
| 11260 | if not shared_data.config.get('kiosk_enabled'): |
| 11261 | shared_data.config['kiosk_enabled'] = True |
| 11262 | try: |
| 11263 | shared_data.save_config() |
| 11264 | except Exception as exc: |
| 11265 | logger.warning(f"[kiosk] could not persist kiosk_enabled during repair: {exc}") |
| 11266 | |
| 11267 | threading.Thread(target=worker, daemon=True).start() |
| 11268 | return jsonify({'success': True, 'message': 'Reinstalling and starting the kiosk…'}) |
| 11269 | |
| 11270 | |
| 11271 | @app.route('/api/kiosk/diagnose', methods=['POST']) |
| 11272 | def kiosk_diagnose(): |
no test coverage detected