(feature) Add host doctor checks and Django log viewer
Add host-level checks for address, enabled state, SSH credential selection, and backup directory readiness, and show them on the host detail page. Create host backup directories during host creation and prefill new hosts from the default global config. Add a staff-only logs view backed by journalctl with filtering by pobsync unit, priority, and message text. Improve runtime checks for gunicorn in virtualenv installs and ensure the native installer grants the service user access to the backup root.
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Literal
|
||||
@@ -125,7 +126,7 @@ def _path_check(
|
||||
|
||||
def _binary_checks() -> list[SelfCheck]:
|
||||
checks = []
|
||||
for binary in ("rsync", "ssh", "ssh-keygen", "gunicorn"):
|
||||
for binary in ("rsync", "ssh", "ssh-keygen"):
|
||||
path = shutil.which(binary)
|
||||
checks.append(
|
||||
SelfCheck(
|
||||
@@ -134,6 +135,14 @@ def _binary_checks() -> list[SelfCheck]:
|
||||
path or f"{binary} was not found in PATH.",
|
||||
)
|
||||
)
|
||||
gunicorn_path = shutil.which("gunicorn") or Path(sys.executable).parent / "gunicorn"
|
||||
checks.append(
|
||||
SelfCheck(
|
||||
"Binary: gunicorn",
|
||||
"ok" if Path(gunicorn_path).exists() else "failed",
|
||||
str(gunicorn_path) if Path(gunicorn_path).exists() else "gunicorn was not found in PATH or next to Python.",
|
||||
)
|
||||
)
|
||||
return checks
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user