✅ Purpose

Represents a target domain and the SFTP credentials used to deploy landings.

🧩 Fields

  • domain — unique domain string, validated by DomainValidator (regex in settings)
  • sftp_host — IP address only (HostValidator)
  • sftp_port — default 22
  • sftp_username / sftp_password — SFTP credentials
  • notes — optional, up to 300 chars
  • owner — FK to User
  • created_at, updated_at

🧠 Properties & methods

  • root_directory/home/<sftp_username>/public_html
  • dir_exists(dir_path) → checks if <root_directory>/<dir_path> exists on SFTP
    • SFTP host key checking is disabled (CnOpts.hostkeys = None)

🔗 Relations

  • Landing.domains — Many‑to‑Many
  • Deployment.domain — FK
  • LandingTransferLog.new_domain — FK

⚠️ Notes

SFTP password is stored directly in the DB (no encryption at model level).