From 5a87e333af11571ac81eccdda41cb6e5e61324b0 Mon Sep 17 00:00:00 2001
From: Paul Makles <me@insrt.uk>
Date: Sun, 30 Jun 2024 15:57:26 +0100
Subject: [PATCH] chore: begin scaffolding rsync agent

---
 src/planner.ts | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/planner.ts b/src/planner.ts
index cd9d660..fb7eb55 100644
--- a/src/planner.ts
+++ b/src/planner.ts
@@ -19,9 +19,12 @@ type Destination = {
   host: string;
 
   /**
+   * For ssh-agent:
    * Path to folder or leading path for the file
-   *
    * e.g. /backups/ or /path/to/backup_
+   *
+   * For rsync-agent:
+   * Corresponding destination path on machine
    */
   path: string;
 };
@@ -47,6 +50,13 @@ export type Blueprint = {
       strategy: BackupStrategy;
       destinations: Destination[];
     }
+  | {
+      mode: "rsync-agent";
+      host: string;
+      hooks?: Hooks;
+      path: string;
+      destinations: Destination[];
+    }
   | {
       mode: "dummy";
     }
@@ -167,7 +177,13 @@ export function createPlan(
         id: blueprint._id,
         mode: "skipped",
       };
-    } else {
+    } else if (blueprint.mode === "rsync-agent") {
+      return {
+        id: blueprint._id,
+        mode: "skipped",
+      };
+    }
+    {
       const host = hosts[blueprint.host];
       if (!host) throw `Host ${colors.gray(blueprint.host)} does not exist!`;
       if (!host.available) throw "Host is unavailable!";
-- 
GitLab