deployment fixes
This commit is contained in:
@@ -55,7 +55,9 @@ class Settings(BaseSettings):
|
||||
ssh_host: str = ""
|
||||
ssh_username: str = ""
|
||||
ssh_port: int = 22
|
||||
ssh_key_filename: str = str(Path.home() / ".ssh" / "id_rsa")
|
||||
ssh_key_directory: str = str(Path.home() / ".ssh")
|
||||
ssh_key_name: str = "id_rsa"
|
||||
ssh_key_filename: str = "" # legacy direct override (full path)
|
||||
ssh_password: str = ""
|
||||
|
||||
# Remote paths
|
||||
@@ -71,6 +73,12 @@ class Settings(BaseSettings):
|
||||
def path_prefix(self) -> str:
|
||||
return self.remote_path_prefix or ""
|
||||
|
||||
@property
|
||||
def ssh_key_path(self) -> str:
|
||||
if self.ssh_key_filename:
|
||||
return self.ssh_key_filename
|
||||
return str(Path(self.ssh_key_directory) / self.ssh_key_name)
|
||||
|
||||
model_config = {"env_file": ".env", "env_file_encoding": "utf-8", "extra": "ignore"}
|
||||
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ def get_ssh_client() -> RemoteSSHClient:
|
||||
settings.ssh_host or "<unset>",
|
||||
settings.ssh_username or "<unset>",
|
||||
settings.ssh_port,
|
||||
settings.ssh_key_filename or "<unset>",
|
||||
settings.ssh_key_path or "<unset>",
|
||||
"set" if settings.ssh_password else "missing",
|
||||
)
|
||||
client = RemoteSSHClient(
|
||||
host=settings.ssh_host,
|
||||
username=settings.ssh_username,
|
||||
port=settings.ssh_port,
|
||||
key_filename=settings.ssh_key_filename or None,
|
||||
key_filename=settings.ssh_key_path or None,
|
||||
password=settings.ssh_password or None,
|
||||
)
|
||||
try:
|
||||
|
||||
@@ -52,6 +52,8 @@ def describe_settings(settings: object) -> dict[str, str]:
|
||||
"ssh_host": getattr(settings, "ssh_host", "") or "<unset>",
|
||||
"ssh_username": getattr(settings, "ssh_username", "") or "<unset>",
|
||||
"ssh_port": str(getattr(settings, "ssh_port", 22) or 22),
|
||||
"ssh_key_directory": getattr(settings, "ssh_key_directory", "") or "<unset>",
|
||||
"ssh_key_name": getattr(settings, "ssh_key_name", "") or "<unset>",
|
||||
"ssh_key_filename": "set" if getattr(settings, "ssh_key_filename", "") else "missing",
|
||||
"ssh_password": "set" if getattr(settings, "ssh_password", "") else "missing",
|
||||
"smtp_host": _sanitize_url(getattr(settings, "smtp_host", "")),
|
||||
|
||||
Reference in New Issue
Block a user