Skip to content
Snippets Groups Projects
Unverified Commit 5a87e333 authored by izzy's avatar izzy
Browse files

chore: begin scaffolding rsync agent

parent 63d199a8
No related merge requests found
...@@ -19,9 +19,12 @@ type Destination = { ...@@ -19,9 +19,12 @@ type Destination = {
host: string; host: string;
/** /**
* For ssh-agent:
* Path to folder or leading path for the file * Path to folder or leading path for the file
*
* e.g. /backups/ or /path/to/backup_ * e.g. /backups/ or /path/to/backup_
*
* For rsync-agent:
* Corresponding destination path on machine
*/ */
path: string; path: string;
}; };
...@@ -47,6 +50,13 @@ export type Blueprint = { ...@@ -47,6 +50,13 @@ export type Blueprint = {
strategy: BackupStrategy; strategy: BackupStrategy;
destinations: Destination[]; destinations: Destination[];
} }
| {
mode: "rsync-agent";
host: string;
hooks?: Hooks;
path: string;
destinations: Destination[];
}
| { | {
mode: "dummy"; mode: "dummy";
} }
...@@ -167,7 +177,13 @@ export function createPlan( ...@@ -167,7 +177,13 @@ export function createPlan(
id: blueprint._id, id: blueprint._id,
mode: "skipped", mode: "skipped",
}; };
} else { } else if (blueprint.mode === "rsync-agent") {
return {
id: blueprint._id,
mode: "skipped",
};
}
{
const host = hosts[blueprint.host]; const host = hosts[blueprint.host];
if (!host) throw `Host ${colors.gray(blueprint.host)} does not exist!`; if (!host) throw `Host ${colors.gray(blueprint.host)} does not exist!`;
if (!host.available) throw "Host is unavailable!"; if (!host.available) throw "Host is unavailable!";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment