The configuration below is used to set the default values of the configuration settings.
(self)
| 593 | except Exception as exc: |
| 594 | logger.error(f"Unable to activate network storage for '{ssid}': {exc}") |
| 595 | return |
| 596 | |
| 597 | # Skip reconfiguration if the network did not really change. Comparing |
| 598 | # against the overridable self.active_network_* here is what let a |
| 599 | # multi-interface Ethernet scan ('LAN') read as a switch away from the |
| 600 | # Wi-Fi SSID and degrade every host once per cycle (issue #818). |
| 601 | if prev_slug is not None and (context.get('slug') == prev_slug and |
| 602 | context.get('ssid') == prev_ssid): |
| 603 | registry = getattr(self, 'context_registry', None) |
| 604 | if registry is None or not registry.is_overridden(): |
| 605 | # Keep the in-memory context aligned; no storage switch. |
| 606 | self._apply_network_context(context, configure_db=False) |
| 607 | return |
| 608 | |
| 609 | # Mark every alive host in the OUTGOING database as degraded so |
| 610 | # that hosts from the old network never linger as "alive" inside |
| 611 | # the new network's store (race-condition safety net) and so |
| 612 | # that stale hosts are immediately visible as offline if the |
| 613 | # user switches back later. |
| 614 | try: |
| 615 | if get_db is not None and not self._pager_mode: |
| 616 | outgoing_db = get_db(currentdir=self.currentdir) |
| 617 | outgoing_db.mark_all_hosts_degraded() |
| 618 | except Exception as exc: |
| 619 | logger.warning(f"Failed to mark outgoing hosts as degraded: {exc}") |
| 620 | |
| 621 | self._apply_network_context(context, configure_db=False) |
| 622 | self._refresh_network_components() |
| 623 | logger.info( |
| 624 | f"Active network context updated: ssid={self.active_network_ssid or 'default'} " |
| 625 | f"slug={self.active_network_slug}" |
| 626 | ) |
| 627 | |
| 628 | def get_default_config(self): |
| 629 | """ The configuration below is used to set the default values of the configuration settings.""" |
| 630 | """ It can be used to reset the configuration settings to their default values.""" |
| 631 | """ You can mofify the json file shared_config.json or on the web page to change the default values of the configuration settings.""" |
| 632 | default_profile = DISPLAY_PROFILES.get(DEFAULT_EPD_TYPE, {"ref_width": 122, "ref_height": 250, "default_flip": False}) |
| 633 | return { |
| 634 | "__title_Ragnar__": "Settings", |
| 635 | "manual_mode": False, |
| 636 | "websrv": True, |
| 637 | "web_bind_interface": "", |
| 638 | "web_increment": False, |
| 639 | "debug_mode": False, |
| 640 | "scan_vuln_running": True, |
| 641 | "scan_vuln_no_ports": False, |
| 642 | "enable_attacks": False, |
| 643 | "release_gate_enabled": False, |
| 644 | "release_gate_message": "", |
| 645 | "retry_success_actions": True, |
| 646 | "retry_failed_actions": True, |
| 647 | "blacklistcheck": True, |
| 648 | "displaying_csv": True, |
| 649 | "log_debug": False, |
| 650 | "log_info": False, |
| 651 | "log_warning": True, |
| 652 | "log_error": True, |