Add a new credential finding
()
| 13230 | 'error': 'Invalid confirmation token. Use "ERASE_ALL_DATA" to confirm.' |
| 13231 | }), 403 |
| 13232 | |
| 13233 | logger.critical("=" * 80) |
| 13234 | logger.critical("KILL SWITCH ACTIVATED - INITIATING COMPLETE DATA ERASURE") |
| 13235 | logger.critical("=" * 80) |
| 13236 | |
| 13237 | results = { |
| 13238 | 'database_deleted': False, |
| 13239 | 'data_folder_deleted': False, |
| 13240 | 'repository_deleted': False, |
| 13241 | 'shutdown_scheduled': False, |
| 13242 | 'errors': [] |
| 13243 | } |
| 13244 | |
| 13245 | # Get the Ragnar directory path |
| 13246 | ragnar_dir = shared_data.currentdir |
| 13247 | home_dir = os.path.expanduser('~') |
| 13248 | ragnar_home_path = os.path.join(home_dir, 'Ragnar') |
| 13249 | |
| 13250 | # Use home path if it exists, otherwise use current directory |
| 13251 | if os.path.exists(ragnar_home_path): |
| 13252 | ragnar_dir = ragnar_home_path |
| 13253 | |
| 13254 | logger.critical(f"Target Ragnar directory: {ragnar_dir}") |
| 13255 | |
| 13256 | # STEP 1: Delete ragnar.db database file |
| 13257 | try: |
| 13258 | db_path = os.path.join(ragnar_dir, 'data', 'ragnar.db') |
| 13259 | logger.critical(f"Step 1/3: Deleting database file: {db_path}") |
| 13260 | |
| 13261 | if os.path.isfile(db_path): |
| 13262 | os.remove(db_path) |
| 13263 | logger.critical(f"✓ Deleted: {db_path}") |
| 13264 | results['database_deleted'] = True |
| 13265 | else: |
| 13266 | logger.warning(f"Database file not found: {db_path}") |
| 13267 | results['database_deleted'] = True # Consider it success if file doesn't exist |
| 13268 | |
| 13269 | except Exception as e: |
| 13270 | error_msg = f"Error deleting database file: {str(e)}" |
| 13271 | logger.error(error_msg) |
| 13272 | results['errors'].append(error_msg) |
| 13273 |
nothing calls this directly
no test coverage detected