@procedures/restic 0.27.8 → 0.28.1
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/CHANGELOG.md +62 -0
- package/README.md +11 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/module.d.ts +3 -2
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +3 -2
- package/dist/module.js.map +1 -1
- package/dist/procedures.d.ts +19 -2
- package/dist/procedures.d.ts.map +1 -1
- package/dist/procedures.js +122 -7
- package/dist/procedures.js.map +1 -1
- package/package.json +3 -3
- package/src/module.ts +3 -2
- package/src/procedures.ts +131 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# @procedures/restic
|
|
2
2
|
|
|
3
|
+
## 0.28.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 497e32f: New configuration paths for the five breaks of the second code audit (roadmap O55, decision D35). Each old input keeps working, with a deprecation notice.
|
|
8
|
+
|
|
9
|
+
PATCH: new options and exports, and deprecation notices. No input that works today gets an error. Each notice is a `DeprecationWarning` of Node, one time in each process, and it names the new path.
|
|
10
|
+
|
|
11
|
+
- `@procedures/tailscale` adds `createTailscaleModule({ executable })` and `createTailscaleProcedures({ executable })`. The order of the program is the input `executable`, then the option, then `TAILSCALE_EXE`, then the Windows install folder, then `tailscale`. The input `executable` is `@deprecated`, with the notice `PROCEDURES_TAILSCALE_EXECUTABLE_INPUT`.
|
|
12
|
+
- `@procedures/restic` adds the option `executable` of `createResticModule()` and `createResticProcedures()`. The input `executable` of `restic.run` wins over it, as before. The input is `@deprecated`, with the notice `PROCEDURES_RESTIC_EXECUTABLE_INPUT`.
|
|
13
|
+
- `@procedures/mail` exports `MAIL_PASSWORD_ENV`, the pattern of the names of `passwordEnv`: `IMAP_` or `MAIL_` and more. Another name still works, with the notice `PROCEDURES_MAIL_PASSWORD_ENV`.
|
|
14
|
+
- `@procedures/notify` exports `NOTIFY_TOKEN_ENV`, the pattern of the names of `tokenEnv`: `NTFY_` or `NOTIFY_` and more. Another name still works, with the notice `PROCEDURES_NOTIFY_TOKEN_ENV`.
|
|
15
|
+
|
|
16
|
+
The breaks that come next. Each break is its own MINOR, and the group is released after each one.
|
|
17
|
+
|
|
18
|
+
1. 0.29.0, the host fetch policy: `weather.forecast` and the `mcpHostModules` of `geo` and `ics` refuse a loopback, private or link-local host with `FORBIDDEN`. The option `warnOnRefusal` of `createHostFetch()` goes away.
|
|
19
|
+
- The site, MiniMongo and Graph: no change. They do not call these procedures through a registry of Node.
|
|
20
|
+
- jarvis: no change. `packages/pipeline` calls the function `geocode()` of `@procedures/geo`, not the procedure.
|
|
21
|
+
- Another host with a private server gives `createWeatherModule({ fetch: createHostFetch({ allow: [...] }) })`, or the same for `createGeoModule()` and `createIcsModule()`, before the bundle.
|
|
22
|
+
2. 0.30.0, `tailscale.run` (#182): the input `executable` gets a validation error.
|
|
23
|
+
- jarvis: `packages/instance/src/remote.ts` sends `executable: bin`. Make the caller from `createTailscaleModule({ executable: bin })` in place of `tailscaleModule`, and remove `executable` from the input. Or set `TAILSCALE_EXE` from `JARVIS_TAILSCALE_BIN`.
|
|
24
|
+
- The site, MiniMongo and Graph: no change. They do not call `tailscale.run`.
|
|
25
|
+
3. 0.31.0, `restic.run` (#183): the input `executable` gets a validation error.
|
|
26
|
+
- jarvis: no change. It calls `runRestic()` with the result of `findRestic()`, not `restic.run`.
|
|
27
|
+
- The site, MiniMongo and Graph: no change. They do not call `restic.run`.
|
|
28
|
+
- Another host gives the program to `createResticModule({ executable })`, or sets `RESTIC_EXE`.
|
|
29
|
+
4. 0.32.0, `mail.headers` (#184): a `passwordEnv` without the prefix `IMAP_` or `MAIL_` gets a validation error.
|
|
30
|
+
- The site, MiniMongo, Graph and jarvis: no change. They do not call `mail.headers`.
|
|
31
|
+
- Another host renames the variable, for example `GMAIL_APP_PASSWORD` to `IMAP_GMAIL_PASSWORD`, and gives the new name in `passwordEnv`.
|
|
32
|
+
5. 0.33.0, `notify.send` (#185): a `tokenEnv` without the prefix `NTFY_` or `NOTIFY_` gets a validation error.
|
|
33
|
+
- The site, MiniMongo, Graph and jarvis: no change. They do not give `tokenEnv`.
|
|
34
|
+
- Another host renames the variable, for example `PHONE_TOKEN` to `NTFY_TOKEN`, and gives the new name in `tokenEnv`.
|
|
35
|
+
|
|
36
|
+
Migration now: a host that gets a notice changes to the new path that the notice names. The notice then stops, and the next break does not change the host.
|
|
37
|
+
- 21dc858: Fixes for the security findings of the second code audit (roadmap O55).
|
|
38
|
+
|
|
39
|
+
PATCH: bug fixes and additive options. Each fix refuses only an input that the documentation does not give. A caller that uses the documented behavior sees no change. A request to a loopback, private or link-local host still works, with a deprecation notice. Version 0.29.0 refuses it (decision D35).
|
|
40
|
+
|
|
41
|
+
- `procedure.delete` and `procedure.define` of `@procedures/client` obey the expose rule of the host, as `procedure.get` does (R17). `procedure.delete` does not find a hidden procedure, and `procedure.define` refuses to replace one with `NOT_EXPOSED`. A new procedure at a free path stays possible, as before. Before, a caller could remove or replace a hidden procedure that the host defined.
|
|
42
|
+
- The task store of `@procedures/mcp-server` keeps a task without a session (stdio, an SDK transport) apart from the HTTP sessions, both ways. Before, each HTTP session could list, read and cancel such a task.
|
|
43
|
+
- `restic.run` of `@procedures/restic` refuses each input that lets the caller choose a program for restic to start: `--from-password-command`, `--password-command2`, an extended option that sets `sftp.command`, `sftp.args`, `rclone.program` or `rclone.args` (each spelling), an sftp or rclone repository whose host or remote starts with `-`, and a positional argument that starts with `-` after a last flag without a value. Before, only `--password-command` was refused.
|
|
44
|
+
- `@procedures/http` exports `createHostFetch(options)`: a `fetch` for GET requests through the host policy, with the options of `createHttpModule()`. It also exports `httpSettings(options)`. The deprecated option `warnOnRefusal` keeps a refused host working: the process gets one `DeprecationWarning`, and the request goes through the global `fetch`.
|
|
45
|
+
- `weather.forecast` of `@procedures/weather` sends its request through `createHostFetch()` with `warnOnRefusal`. A `baseUrl` on a loopback, private or link-local address still works, with the warning `PROCEDURES_WEATHER_PRIVATE_HOST`. `createWeatherModule({ fetch })` gives another `fetch`, for a server of the host on such an address.
|
|
46
|
+
- `@procedures/geo` and `@procedures/ics` add `createGeoModule({ fetch })` and `createIcsModule({ fetch })`. Their default stays the global `fetch`, because their roots run in a browser. A refusal of the host policy keeps its code and its reason. The refusal of `ics.fetch` does not name the feed address.
|
|
47
|
+
- `@procedures/bundle-assistant` exports `mcpHostModules`: the modules of `geo` and `ics` with `createHostFetch()` and `warnOnRefusal`. A refused host gets the warning `PROCEDURES_GEO_PRIVATE_HOST` or `PROCEDURES_ICS_PRIVATE_HOST`. The bundle keeps the default modules, so `mark` and the site load it next to `geo` and `ics` as before.
|
|
48
|
+
- The dev-tools server of `@procedures/mcp-dev-tools` gives the `mcpHostModules` of each bundle to `createRegistry()` before the bundles. In one call, the first module of a name counts. Thus `geo.geocode`, `geo.route`, `weather.forecast` and `ics.fetch` of the dev-tools server go through the default host policy.
|
|
49
|
+
|
|
50
|
+
A host that sends `weather.forecast`, or the bundle's `geo` tools, to a server on a private address can remove the warning now. It gives a `fetch` that allows the server: `createWeatherModule({ fetch: createHostFetch({ allow: ["10.0.0.5:8080"] }) })`. This `fetch` refuses each other private host now, as 0.29.0 does by default.
|
|
51
|
+
- Updated dependencies [345c740]
|
|
52
|
+
- Updated dependencies [984c13b]
|
|
53
|
+
- Updated dependencies [21dc858]
|
|
54
|
+
- @procedures/client@0.28.1
|
|
55
|
+
- @procedures/shell@0.28.1
|
|
56
|
+
|
|
57
|
+
## 0.28.0
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [06694d7]
|
|
62
|
+
- @procedures/client@0.28.0
|
|
63
|
+
- @procedures/shell@0.28.0
|
|
64
|
+
|
|
3
65
|
## 0.27.8
|
|
4
66
|
|
|
5
67
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -27,7 +27,14 @@ const { json } = await client.exec(["restic", "run"], { path: ["snapshots"] });
|
|
|
27
27
|
|
|
28
28
|
## Secrets
|
|
29
29
|
|
|
30
|
-
restic reads the repository and its keys from the environment (`RESTIC_REPOSITORY`, `RESTIC_PASSWORD`, `B2_ACCOUNT_ID`, `AWS_ACCESS_KEY_ID` and the others), so no secret is an input.
|
|
30
|
+
restic reads the repository and its keys from the environment (`RESTIC_REPOSITORY`, `RESTIC_PASSWORD`, `B2_ACCOUNT_ID`, `AWS_ACCESS_KEY_ID` and the others), so no secret is an input.
|
|
31
|
+
|
|
32
|
+
`restic.run` refuses each input that lets the caller choose a program for restic to start:
|
|
33
|
+
|
|
34
|
+
- The flags `--password-command`, `--from-password-command` and `--password-command2`.
|
|
35
|
+
- An extended option (`--option`) that sets `sftp.command`, `sftp.args`, `rclone.program` or `rclone.args`, in each spelling that restic reads.
|
|
36
|
+
- An sftp or rclone repository whose host or remote starts with `-`, in `repository`, `--repo`, `--from-repo` or `--repo2`. `ssh` and `rclone` read such a value as an option.
|
|
37
|
+
- A positional argument that starts with `-` after a last flag without a value. Put a flag with a value last, or start the argument with `./`.
|
|
31
38
|
|
|
32
39
|
A host can give the secrets only to the restic process, with the `env` option of `createResticModule()` or `runRestic()`:
|
|
33
40
|
|
|
@@ -50,13 +57,15 @@ The package root exports the functions that `restic.run` uses:
|
|
|
50
57
|
| `runRestic(command, options)` | Starts a restic command with argv, and reads its JSON output. |
|
|
51
58
|
| `findRestic(options)` | Finds the restic program. |
|
|
52
59
|
| `resticArgv(command)` | Gives the argv of a restic command. |
|
|
53
|
-
| `createResticModule(options)` | Gives the module with the settings of the host: `env` and `run`. |
|
|
60
|
+
| `createResticModule(options)` | Gives the module with the settings of the host: `executable`, `env` and `run`. |
|
|
54
61
|
|
|
55
62
|
- `command` has `path`, `positional`, `args`, `repository` and `json`. `json` is true when the command does not set it, as in `restic.run`.
|
|
56
63
|
- `options` of `runRestic` has `executable`, `env`, `cwd`, `timeout`, `signal` and `run`.
|
|
57
64
|
- `runRestic` throws when restic does not start. A failed command gives `success: false`, with `exitCode` and `stderr`.
|
|
58
65
|
- `run` replaces the function that starts restic. A test gives a fake runner.
|
|
59
66
|
- `findRestic` gives `RESTIC_EXE` when it is set. On Windows, it then looks for the `restic*.exe` of a WinGet package. Then it gives `restic`, and the `PATH` gives the program.
|
|
67
|
+
- The program of `restic.run` comes from the host: the `executable` option of `createResticModule()`, then `RESTIC_EXE`, then `restic`.
|
|
68
|
+
- The input `executable` of `restic.run` is deprecated. In 0.28 it still names the program, and the process gets one `DeprecationWarning` with the code `PROCEDURES_RESTIC_EXECUTABLE_INPUT`. Version 0.31.0 refuses it.
|
|
60
69
|
|
|
61
70
|
```ts
|
|
62
71
|
const executable = await findRestic();
|