@datatruck/cli 0.11.6 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Repository/ResticRepository.js +13 -1
- package/config.schema.json +18 -2
- package/package.json +1 -1
- package/util/ResticUtil.d.ts +4 -2
- package/util/ResticUtil.js +6 -3
|
@@ -55,7 +55,19 @@ exports.resticRepositoryDefinition = {
|
|
|
55
55
|
},
|
|
56
56
|
host: { type: "string" },
|
|
57
57
|
username: { type: "string" },
|
|
58
|
-
|
|
58
|
+
password: {
|
|
59
|
+
anyOf: [
|
|
60
|
+
{ type: "string" },
|
|
61
|
+
{
|
|
62
|
+
type: "object",
|
|
63
|
+
additionalProperties: false,
|
|
64
|
+
required: ["path"],
|
|
65
|
+
properties: {
|
|
66
|
+
path: { type: "string" },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
59
71
|
port: { type: "integer" },
|
|
60
72
|
path: { type: "string" },
|
|
61
73
|
},
|
package/config.schema.json
CHANGED
|
@@ -565,8 +565,24 @@
|
|
|
565
565
|
"username": {
|
|
566
566
|
"type": "string"
|
|
567
567
|
},
|
|
568
|
-
"
|
|
569
|
-
"
|
|
568
|
+
"password": {
|
|
569
|
+
"anyOf": [
|
|
570
|
+
{
|
|
571
|
+
"type": "string"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"type": "object",
|
|
575
|
+
"additionalProperties": false,
|
|
576
|
+
"required": [
|
|
577
|
+
"path"
|
|
578
|
+
],
|
|
579
|
+
"properties": {
|
|
580
|
+
"path": {
|
|
581
|
+
"type": "string"
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
]
|
|
570
586
|
},
|
|
571
587
|
"port": {
|
|
572
588
|
"type": "integer"
|
package/package.json
CHANGED
package/util/ResticUtil.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ import { UriType } from "./string-util";
|
|
|
3
3
|
export declare type RepositoryType = {
|
|
4
4
|
name?: string;
|
|
5
5
|
env?: Record<string, string>;
|
|
6
|
-
|
|
6
|
+
password?: string | {
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
7
9
|
backend: "local" | "rest" | "sftp" | "s3" | "azure" | "gs" | "rclone";
|
|
8
|
-
} & UriType
|
|
10
|
+
} & Omit<UriType, "password">;
|
|
9
11
|
export declare type BackupStreamType = {
|
|
10
12
|
message_type: "status";
|
|
11
13
|
seconds_elapsed: number;
|
package/util/ResticUtil.js
CHANGED
|
@@ -16,12 +16,15 @@ class ResticUtil {
|
|
|
16
16
|
throw new Error(`Invalid path at "${input.name}" repository: ${input.path}`);
|
|
17
17
|
return (0, path_1.resolve)(input.path);
|
|
18
18
|
}
|
|
19
|
-
if (input.
|
|
19
|
+
if (input.password) {
|
|
20
20
|
input = {
|
|
21
21
|
...input,
|
|
22
|
-
password:
|
|
22
|
+
password: typeof input.password === "string"
|
|
23
|
+
? input.password
|
|
24
|
+
: (await (0, promises_1.readFile)(input.password.path)).toString(),
|
|
23
25
|
};
|
|
24
|
-
|
|
26
|
+
}
|
|
27
|
+
return `${input.backend}:${(0, string_util_1.formatUri)({ ...input, password: input.password }, hidePassword)}`;
|
|
25
28
|
}
|
|
26
29
|
async exec(args, settings, options) {
|
|
27
30
|
return await (0, process_util_1.exec)("restic", args, {
|