Add diagnoser about rfkill blocking Wi-Fi card

This commit is contained in:
tituspijean 2024-05-16 22:59:50 +02:00
parent 498b8d9c43
commit b681b1eb62
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
3 changed files with 22 additions and 3 deletions

View file

@ -781,5 +781,7 @@
"yunohost_configured": "YunoHost is now configured", "yunohost_configured": "YunoHost is now configured",
"yunohost_installing": "Installing YunoHost…", "yunohost_installing": "Installing YunoHost…",
"yunohost_not_installed": "YunoHost is not correctly installed. Please run 'yunohost tools postinstall'", "yunohost_not_installed": "YunoHost is not correctly installed. Please run 'yunohost tools postinstall'",
"yunohost_postinstall_end_tip": "The post-install completed! To finalize your setup, please consider:\n - diagnose potential issues through the 'Diagnosis' section of the webadmin (or 'yunohost diagnosis run' in command-line);\n - reading the 'Finalizing your setup' and 'Getting to know YunoHost' parts in the admin documentation: https://yunohost.org/admindoc." "yunohost_postinstall_end_tip": "The post-install completed! To finalize your setup, please consider:\n - diagnose potential issues through the 'Diagnosis' section of the webadmin (or 'yunohost diagnosis run' in command-line);\n - reading the 'Finalizing your setup' and 'Getting to know YunoHost' parts in the admin documentation: https://yunohost.org/admindoc.",
"diagnosis_rfkill_wifi": "The Wi-Fi card is disabled and a system warning might prevent app installations",
"diagnosis_rfkill_wifi_details": "This warning sneaks in many command outputs, breaking some apps. It is usually required to specify your country code with the command 'sudo raspi-config'. Here is the error:\n{rfkill_wifi_error}"
} }

View file

@ -781,5 +781,7 @@
"log_dyndns_unsubscribe": "Se désabonner d'un sous-domaine YunoHost '{}'", "log_dyndns_unsubscribe": "Se désabonner d'un sous-domaine YunoHost '{}'",
"dyndns_too_many_requests": "Le service dyndns de YunoHost a reçu trop de requêtes/demandes de votre part, attendez environ 1 heure avant de réessayer.", "dyndns_too_many_requests": "Le service dyndns de YunoHost a reçu trop de requêtes/demandes de votre part, attendez environ 1 heure avant de réessayer.",
"ask_dyndns_recovery_password_explain_unavailable": "Ce domaine DynDNS est déjà enregistré. Si vous êtes la personne qui a enregistré ce domaine lors de sa création, vous pouvez entrer le mot de passe de récupération pour récupérer ce domaine.", "ask_dyndns_recovery_password_explain_unavailable": "Ce domaine DynDNS est déjà enregistré. Si vous êtes la personne qui a enregistré ce domaine lors de sa création, vous pouvez entrer le mot de passe de récupération pour récupérer ce domaine.",
"global_settings_setting_ssh_port_help": "Il est préférable d'utiliser un port inférieur à 1024 pour éviter les tentatives d'usurpation par des services non administrateurs sur la machine distante. Vous devez également éviter d'utiliser un port déjà utilisé tel que le 80 ou le 443." "global_settings_setting_ssh_port_help": "Il est préférable d'utiliser un port inférieur à 1024 pour éviter les tentatives d'usurpation par des services non administrateurs sur la machine distante. Vous devez également éviter d'utiliser un port déjà utilisé tel que le 80 ou le 443.",
"diagnosis_rfkill_wifi": "La carte Wi-Fi est désactivée et un avertissement du système pourrait empêcher d'installer des applications",
"diagnosis_rfkill_wifi_details": "Cet avertissement se glisse dans beaucoup de retours de commandes, cassant certaines applications. Il s'agit généralement de spécifier votre code pays avec la commande '`sudo raspi-config'. Voici l'erreur:\n{rfkill_wifi_error}"
} }

View file

@ -192,6 +192,16 @@ class MyDiagnoser(Diagnoser):
summary="diagnosis_high_number_auth_failures", summary="diagnosis_high_number_auth_failures",
) )
rfkill_wifi = self.rfkill_wifi()
if len(rfkill_wifi) > 0:
yield dict(
meta={"test": "rfkill_wifi"},
status="ERROR",
summary="diagnosis_rfkill_wifi",
details=["diagnosis_rfkill_wifi_details"],
data={"rfkill_wifi_error": rfkill_wifi}
)
def bad_sury_packages(self): def bad_sury_packages(self):
packages_to_check = ["openssl", "libssl1.1", "libssl-dev"] packages_to_check = ["openssl", "libssl1.1", "libssl-dev"]
for package in packages_to_check: for package in packages_to_check:
@ -301,3 +311,8 @@ class MyDiagnoser(Diagnoser):
) )
write_to_json(cache_file, CVEs) write_to_json(cache_file, CVEs)
return CVEs[0]["VULNERABLE"] return CVEs[0]["VULNERABLE"]
def rfkill_wifi(self):
if os.path.isfile("/etc/profile.d/wifi-check.sh"):
cmd = "bash /etc/profile.d/wifi-check.sh"
return check_output(cmd)