Merge branch 'stretch-unstable' into improve-service-status-checks

This commit is contained in:
Alexandre Aubin 2019-11-08 22:17:12 +01:00
commit 64aff46421
4 changed files with 16 additions and 8 deletions

View file

@ -13,16 +13,20 @@ class MailDiagnoser(Diagnoser):
def run(self): def run(self):
# TODO / FIXME TO BE IMPLEMETED in the future ... # Is outgoing port 25 filtered somehow ?
if os.system('/bin/nc -z -w2 yunohost.org 25') == 0:
yield dict(meta={"test": "ougoing_port_25"},
status="SUCCESS",
summary=("diagnosis_mail_ougoing_port_25_ok",{}))
else:
yield dict(meta={"test": "outgoing_port_25"},
status="ERROR",
summary=("diagnosis_mail_ougoing_port_25_blocked",{}))
yield dict(meta={},
status="WARNING",
summary=("nothing_implemented_yet", {}))
# Mail blacklist using dig requests (c.f. ljf's code) # Mail blacklist using dig requests (c.f. ljf's code)
# Outgoing port 25 (c.f. code in monitor.py, a simple 'nc -zv yunohost.org 25' IIRC)
# SMTP reachability (c.f. check-smtp to be implemented on yunohost's remote diagnoser) # SMTP reachability (c.f. check-smtp to be implemented on yunohost's remote diagnoser)
# ideally, SPF / DMARC / DKIM validation ... (c.f. https://github.com/alexAubin/yunoScripts/blob/master/yunoDKIM.py possibly though that looks horrible) # ideally, SPF / DMARC / DKIM validation ... (c.f. https://github.com/alexAubin/yunoScripts/blob/master/yunoDKIM.py possibly though that looks horrible)

View file

@ -15,7 +15,7 @@ class ServicesDiagnoser(Diagnoser):
all_result = service_status() all_result = service_status()
for service, result in all_result.items(): for service, result in sorted(all_result.items()):
item = dict(meta={"service": service}) item = dict(meta={"service": service})

View file

@ -192,6 +192,8 @@
"diagnosis_swap_none": "The system has no swap at all. You should consider adding at least 256 MB of swap to avoid situations where the system runs out of memory.", "diagnosis_swap_none": "The system has no swap at all. You should consider adding at least 256 MB of swap to avoid situations where the system runs out of memory.",
"diagnosis_swap_notsomuch": "The system has only {total_MB} MB swap. You should consider having at least 256 MB to avoid situations where the system runs out of memory.", "diagnosis_swap_notsomuch": "The system has only {total_MB} MB swap. You should consider having at least 256 MB to avoid situations where the system runs out of memory.",
"diagnosis_swap_ok": "The system has {total_MB} MB of swap!", "diagnosis_swap_ok": "The system has {total_MB} MB of swap!",
"diagnosis_mail_ougoing_port_25_ok": "Outgoing port 25 is not blocked and email can be sent to other servers.",
"diagnosis_mail_ougoing_port_25_blocked": "Outgoing port 25 appears to be blocked. You should try to unblock it in your internet service provider (or hoster) configuration panel. Meanwhile, the server won't be able to send emails to other servers.",
"diagnosis_regenconf_allgood": "All configurations files are in line with the recommended configuration!", "diagnosis_regenconf_allgood": "All configurations files are in line with the recommended configuration!",
"diagnosis_regenconf_manually_modified": "Configuration file {file} was manually modified.", "diagnosis_regenconf_manually_modified": "Configuration file {file} was manually modified.",
"diagnosis_regenconf_manually_modified_details": "This is probably OK as long as you know what you're doing ;) !", "diagnosis_regenconf_manually_modified_details": "This is probably OK as long as you know what you're doing ;) !",
@ -208,6 +210,7 @@
"diagnosis_description_systemresources": "System resources", "diagnosis_description_systemresources": "System resources",
"diagnosis_description_ports": "Ports exposure", "diagnosis_description_ports": "Ports exposure",
"diagnosis_description_http": "HTTP exposure", "diagnosis_description_http": "HTTP exposure",
"diagnosis_description_mail": "Email",
"diagnosis_description_regenconf": "System configurations", "diagnosis_description_regenconf": "System configurations",
"diagnosis_description_security": "Security checks", "diagnosis_description_security": "Security checks",
"diagnosis_ports_could_not_diagnose": "Could not diagnose if ports are reachable from outside. Error: {error}", "diagnosis_ports_could_not_diagnose": "Could not diagnose if ports are reachable from outside. Error: {error}",

View file

@ -138,6 +138,7 @@ def regen_conf(operation_logger, names=[], with_diff=False, force=False, dry_run
# services.yml (which will happens only during the regen-conf of # services.yml (which will happens only during the regen-conf of
# 'yunohost', so at the very end of the regen-conf cycle) Anyway, # 'yunohost', so at the very end of the regen-conf cycle) Anyway,
# this can be safely removed once we're in >= 4.0 # this can be safely removed once we're in >= 4.0
if "glances" in names:
names.remove("glances") names.remove("glances")
pre_result = hook_callback('conf_regen', names, pre_callback=_pre_call) pre_result = hook_callback('conf_regen', names, pre_callback=_pre_call)