Skip to content

Developer notes

  • Classes in app/addons/kv_offsite_backup/Tygh/Addons/KvOffsiteBackup/: Runner (schedule, archive, check, encrypt, upload, verify, retention, alerts), S3Client (AWS Signature Version 4 in plain PHP + cURL, single PUT and multipart upload with Content-MD5, HEAD, GET, DELETE, ListObjectsV2, presigned URLs), FtpClient (PHP FTP extension, FTPS with ftp_ssl_connect, upload to .part then rename), Crypto (OpenSSL enc format, AES-256-CBC, PBKDF2-HMAC-SHA256 100,000 rounds, 1 MiB chunks), Config.
  • Archives are made by the core Tygh\DataKeeper::backupDatabase() / backupFiles() (same signatures in 4.17.2 and 4.21.2); progress output of the core is discarded.
  • One run at a time: MySQL GET_LOCK per database and table prefix; rows still running after 6 hours are marked as interrupted.
  • Table: ?:kv_ob_runs (one row per run: type, trigger, status, file, size, MD5, SHA-256, remote key, ETag, verification level, log).
  • Cron: php admin.php --dispatch=kv_offsite_backup.cron (console only) or the storefront index.php?dispatch=kv_offsite_backup.cron&key=... (trusted controller, Cache-Control: no-store, X-Robots-Tag: noindex). The cron heartbeat is stored in ?:storage_data (kv_offsite_backup_cron).
  • Hook: dispatch_before_display (admin area only) for the failure / overdue / cron alerts.
  • No storefront templates, scripts or hooks: full page cache (4.21) is not affected.
  • Secrets (secret key, FTP password, encryption password) are masked in every logged error.