@homeflare/alchemy 0.19.1 → 0.21.0
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/README.md +25 -0
- package/dist/caddy/access-forward-auth.d.ts +56 -0
- package/dist/caddy/access-forward-auth.d.ts.map +1 -0
- package/dist/caddy/index.d.ts +6 -0
- package/dist/caddy/index.d.ts.map +1 -1
- package/dist/caddy/index.js +169 -75
- package/dist/caddy/index.js.map +10 -7
- package/dist/cloudflare/mcp-server-api.d.ts +135 -0
- package/dist/cloudflare/mcp-server-api.d.ts.map +1 -0
- package/dist/cloudflare/mcp-server-form.d.ts +116 -0
- package/dist/cloudflare/mcp-server-form.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/launchd/file-converge.d.ts +70 -0
- package/dist/launchd/file-converge.d.ts.map +1 -0
- package/dist/launchd/file-identity.d.ts +32 -0
- package/dist/launchd/file-identity.d.ts.map +1 -0
- package/dist/launchd/host-file-form.d.ts +2 -0
- package/dist/launchd/host-file-form.d.ts.map +1 -1
- package/dist/launchd/host-file-lifecycle.d.ts +11 -24
- package/dist/launchd/host-file-lifecycle.d.ts.map +1 -1
- package/dist/launchd/host-file.d.ts.map +1 -1
- package/dist/launchd/index.js +173 -120
- package/dist/launchd/index.js.map +12 -10
- package/dist/launchd/local-runner.d.ts.map +1 -1
- package/dist/launchd/runner.d.ts +17 -2
- package/dist/launchd/runner.d.ts.map +1 -1
- package/dist/launchd/sudo-runner.d.ts +11 -0
- package/dist/launchd/sudo-runner.d.ts.map +1 -1
- package/dist/linux/index.js +37 -11
- package/dist/linux/index.js.map +10 -10
- package/dist/linux/region.d.ts +11 -0
- package/dist/linux/region.d.ts.map +1 -1
- package/dist/linux/remote-file-lifecycle.d.ts.map +1 -1
- package/dist/linux/remote-file-plan.d.ts +22 -0
- package/dist/linux/remote-file-plan.d.ts.map +1 -1
- package/dist/linux/remote-file.d.ts +4 -1
- package/dist/linux/remote-file.d.ts.map +1 -1
- package/dist/linux/sudo-listing.d.ts +47 -0
- package/dist/linux/sudo-listing.d.ts.map +1 -0
- package/dist/linux/unit-handlers.d.ts.map +1 -1
- package/dist/linux/unit-preflight.d.ts +10 -1
- package/dist/linux/unit-preflight.d.ts.map +1 -1
- package/dist/proxmox/credential-literals.d.ts +1 -1
- package/dist/proxmox/credential-literals.d.ts.map +1 -1
- package/dist/proxmox/generated/pbs/nodes-node.d.ts +1 -1
- package/dist/proxmox/generated/pbs/nodes-node.d.ts.map +1 -1
- package/dist/proxmox/generated/pbs.d.ts +7 -0
- package/dist/proxmox/generated/pbs.d.ts.map +1 -1
- package/dist/proxmox/generated/pve.d.ts +7 -0
- package/dist/proxmox/generated/pve.d.ts.map +1 -1
- package/dist/proxmox/index.d.ts +16 -4
- package/dist/proxmox/index.d.ts.map +1 -1
- package/dist/proxmox/index.js +5 -2
- package/dist/proxmox/index.js.map +9 -9
- package/dist/proxmox/pbs-notification-target-form.d.ts +1 -1
- package/dist/proxmox/pbs-notification-target-form.d.ts.map +1 -1
- package/dist/proxmox/pbs-notification-target.d.ts +1 -1
- package/dist/proxmox/pbs-notification-target.d.ts.map +1 -1
- package/dist/release/archive.d.ts +11 -0
- package/dist/release/archive.d.ts.map +1 -0
- package/dist/release/binary-claim.d.ts +53 -0
- package/dist/release/binary-claim.d.ts.map +1 -0
- package/dist/release/binary-diff.d.ts +38 -0
- package/dist/release/binary-diff.d.ts.map +1 -0
- package/dist/release/binary-form.d.ts +118 -0
- package/dist/release/binary-form.d.ts.map +1 -0
- package/dist/release/binary-lifecycle.d.ts +55 -0
- package/dist/release/binary-lifecycle.d.ts.map +1 -0
- package/dist/release/binary-read.d.ts +11 -0
- package/dist/release/binary-read.d.ts.map +1 -0
- package/dist/release/binary.d.ts +68 -0
- package/dist/release/binary.d.ts.map +1 -0
- package/dist/release/catalog.d.ts +76 -0
- package/dist/release/catalog.d.ts.map +1 -0
- package/dist/release/checksums.d.ts +22 -0
- package/dist/release/checksums.d.ts.map +1 -0
- package/dist/release/declared-pins.d.ts +4 -0
- package/dist/release/declared-pins.d.ts.map +1 -0
- package/dist/release/download.d.ts +44 -0
- package/dist/release/download.d.ts.map +1 -0
- package/dist/release/fake-deploy.d.ts +48 -0
- package/dist/release/fake-deploy.d.ts.map +1 -0
- package/dist/release/fake-engine.d.ts +8 -0
- package/dist/release/fake-engine.d.ts.map +1 -0
- package/dist/release/fake-install.d.ts +39 -0
- package/dist/release/fake-install.d.ts.map +1 -0
- package/dist/release/fake-provider.d.ts +58 -0
- package/dist/release/fake-provider.d.ts.map +1 -0
- package/dist/release/fake-release.d.ts +95 -0
- package/dist/release/fake-release.d.ts.map +1 -0
- package/dist/release/index.d.ts +24 -0
- package/dist/release/index.d.ts.map +1 -0
- package/dist/release/index.js +1365 -0
- package/dist/release/index.js.map +35 -0
- package/dist/release/providers.d.ts +19 -0
- package/dist/release/providers.d.ts.map +1 -0
- package/dist/release/refused.d.ts +39 -0
- package/dist/release/refused.d.ts.map +1 -0
- package/dist/release/tar.d.ts +14 -0
- package/dist/release/tar.d.ts.map +1 -0
- package/dist/release/victoria.d.ts +36 -0
- package/dist/release/victoria.d.ts.map +1 -0
- package/dist/{proxmox → secrets}/write-only.d.ts.map +1 -1
- package/docs/adopted-deploys.md +13 -0
- package/docs/linux-host.md +5 -1
- package/docs/provider-standard.md +138 -0
- package/docs/release-binary-catalogs.md +113 -0
- package/docs/release-binary-measured.md +163 -0
- package/docs/release-binary-refusals.md +57 -0
- package/docs/release-binary-upstream.md +163 -0
- package/docs/release-binary.md +154 -0
- package/docs/upstream-conformance.md +164 -0
- package/package.json +5 -1
- package/src/caddy/access-forward-auth.test.ts +63 -0
- package/src/caddy/access-forward-auth.ts +120 -0
- package/src/caddy/index.ts +10 -0
- package/src/caddy/providers.test.ts +4 -0
- package/src/cloudflare/mcp-server-api.ts +294 -0
- package/src/cloudflare/mcp-server-form.ts +219 -0
- package/src/index.ts +1 -0
- package/src/launchd/file-converge.ts +233 -0
- package/src/launchd/file-identity.ts +69 -0
- package/src/launchd/host-file-alias.test.ts +65 -0
- package/src/launchd/host-file-form.ts +2 -1
- package/src/launchd/host-file-lifecycle.ts +25 -144
- package/src/launchd/host-file.ts +8 -2
- package/src/launchd/local-runner.test.ts +12 -1
- package/src/launchd/local-runner.ts +2 -0
- package/src/launchd/runner.ts +17 -2
- package/src/launchd/sudo-runner.ts +11 -0
- package/src/linux/region.ts +15 -0
- package/src/linux/remote-file-lifecycle.test.ts +0 -88
- package/src/linux/remote-file-lifecycle.ts +25 -7
- package/src/linux/remote-file-plan.ts +37 -1
- package/src/linux/remote-file-region.test.ts +181 -0
- package/src/linux/remote-file.ts +4 -1
- package/src/linux/sudo-listing.ts +122 -0
- package/src/linux/unit-handlers.ts +12 -5
- package/src/linux/unit-preflight.ts +20 -4
- package/src/linux/unit-rename.test.ts +76 -0
- package/src/proxmox/ceph-adopt.test.ts +210 -0
- package/src/proxmox/credential-literals.ts +1 -1
- package/src/proxmox/generated/pbs/nodes-node.ts +1 -1
- package/src/proxmox/generated/pbs.ts +7 -0
- package/src/proxmox/generated/pve.ts +7 -0
- package/src/proxmox/index.test.ts +7 -4
- package/src/proxmox/index.ts +16 -4
- package/src/proxmox/pbs-notification-target-form.ts +1 -1
- package/src/proxmox/pbs-notification-target-lifecycle.ts +1 -1
- package/src/proxmox/pbs-notification-target-wire.ts +1 -1
- package/src/proxmox/pbs-notification-target.ts +1 -1
- package/src/release/adopt-parity.test.ts +106 -0
- package/src/release/apply-pins.test.ts +128 -0
- package/src/release/archive.ts +94 -0
- package/src/release/binary-alias.test.ts +109 -0
- package/src/release/binary-claim.ts +80 -0
- package/src/release/binary-claims.test.ts +47 -0
- package/src/release/binary-diff.ts +73 -0
- package/src/release/binary-form.ts +229 -0
- package/src/release/binary-lifecycle.test.ts +90 -0
- package/src/release/binary-lifecycle.ts +202 -0
- package/src/release/binary-read.ts +55 -0
- package/src/release/binary-refusals.test.ts +192 -0
- package/src/release/binary-sudo.test.ts +93 -0
- package/src/release/binary.ts +181 -0
- package/src/release/catalog.test.ts +96 -0
- package/src/release/catalog.ts +175 -0
- package/src/release/checksums.test.ts +35 -0
- package/src/release/checksums.ts +43 -0
- package/src/release/declared-pins.ts +39 -0
- package/src/release/download.test.ts +138 -0
- package/src/release/download.ts +110 -0
- package/src/release/error-channel.test.ts +69 -0
- package/src/release/fake-deploy.ts +87 -0
- package/src/release/fake-engine.ts +50 -0
- package/src/release/fake-install.ts +59 -0
- package/src/release/fake-provider.ts +68 -0
- package/src/release/fake-release.ts +185 -0
- package/src/release/fixtures/victoria/darwin-arm64-assets.txt +22 -0
- package/src/release/fixtures/victoria/victoria-logs-darwin-arm64-v1.52.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/victoria-metrics-darwin-arm64-v1.151.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/victoria-traces-darwin-arm64-v0.10.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/vmutils-darwin-arm64-v1.151.0_checksums.txt +8 -0
- package/src/release/index.ts +41 -0
- package/src/release/plan.test.ts +189 -0
- package/src/release/provider-refusals.test.ts +48 -0
- package/src/release/providers.test.ts +174 -0
- package/src/release/providers.ts +24 -0
- package/src/release/recovery-read.test.ts +44 -0
- package/src/release/refused.ts +40 -0
- package/src/release/tar.test.ts +142 -0
- package/src/release/tar.ts +195 -0
- package/src/release/victoria.test.ts +108 -0
- package/src/release/victoria.ts +154 -0
- package/src/{proxmox → secrets}/write-only.ts +6 -0
- /package/dist/{proxmox → secrets}/write-only.d.ts +0 -0
- /package/src/{proxmox → secrets}/write-only.test.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/local-runner.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAwB,UAAU,EAAgB,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,MAAM,GAAG,SAGrC,CAAC;AAqEhB,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,
|
|
1
|
+
{"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/local-runner.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAwB,UAAU,EAAgB,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,MAAM,GAAG,SAGrC,CAAC;AAqEhB,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,UAkD9D,CAAC"}
|
package/dist/launchd/runner.d.ts
CHANGED
|
@@ -31,9 +31,22 @@ export type FileStat = {
|
|
|
31
31
|
readonly uid: number;
|
|
32
32
|
readonly gid: number;
|
|
33
33
|
readonly size: number;
|
|
34
|
+
/**
|
|
35
|
+
* The entry's identity, device and inode, when the runner can say. ★ Two spellings of ONE file
|
|
36
|
+
* (`/tmp/x` and `/private/tmp/x`; `Bin` and `bin` on case-insensitive APFS) differ as strings
|
|
37
|
+
* and match here, and a move must not delete its old path when that path IS the new file
|
|
38
|
+
* (file-identity.ts). Optional: a runner that leaves them out gets a check after the fact.
|
|
39
|
+
*/
|
|
40
|
+
readonly dev?: number;
|
|
41
|
+
readonly ino?: number;
|
|
34
42
|
};
|
|
35
43
|
export type WriteOptions = {
|
|
36
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Permission bits for the final file. localRunner applies them BEFORE the file is visible at
|
|
46
|
+
* `path`. ⚠️ sudoRunner's `install -S` does NOT: MEASURED 2026-09-22 on macOS 27.2 (an lstat
|
|
47
|
+
* poller racing /usr/bin/install), the new inode appears at `path` as 0600 and is chmodded
|
|
48
|
+
* 0.2–0.4 ms later. Never torn, never wider than declared, but briefly not executable.
|
|
49
|
+
*/
|
|
37
50
|
readonly mode: number;
|
|
38
51
|
/** Numeric owner; omitted means whoever the runner writes as. */
|
|
39
52
|
readonly uid?: number;
|
|
@@ -68,7 +81,9 @@ export interface HostRunner {
|
|
|
68
81
|
stat(path: string): Promise<FileStat | undefined>;
|
|
69
82
|
/**
|
|
70
83
|
* Write `bytes` so that `path` holds either the old file or the new one, never a torn mix:
|
|
71
|
-
* a temporary file in the same directory, mode and owner set on it, then rename(2) over `path
|
|
84
|
+
* a temporary file in the same directory, mode and owner set on it, then rename(2) over `path`
|
|
85
|
+
* (sudoRunner: the mode just after the rename, measured — see WriteOptions.mode; the owner too,
|
|
86
|
+
* ⚠️ REASONED NOT MEASURED, since measuring it needs root).
|
|
72
87
|
* ⚠️ The parent directory must exist; creating it would invent an owner and mode nobody declared.
|
|
73
88
|
*/
|
|
74
89
|
writeFileAtomic(path: string, bytes: Uint8Array, options: WriteOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/launchd/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1D,mEAAmE;IACnE,QAA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E,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;;AAED,uEAAuE;AACvE,qBAAa,iBAAkB,SAAQ,sBAEtC;CAAG;AAEJ,0FAA0F;AAC1F,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CACxC,CAAC;AAE3C,oFAAoF;AACpF,eAAO,MAAM,YAAY,WAAY,UAAU,KAAG,OACA,CAAC"}
|
|
@@ -21,6 +21,17 @@
|
|
|
21
21
|
* ★ `install -S`: install(1) on macOS 27.2 (read 2026-09-21) always writes a temp file in the
|
|
22
22
|
* target directory and renames it, so the file is never torn, and -S adds the fsync that
|
|
23
23
|
* localRunner's `handle.sync()` does.
|
|
24
|
+
* ⚠️ BUT IT CHMODS AFTER THE RENAME. MEASURED 2026-09-22 (an lstat poller racing
|
|
25
|
+
* `/usr/bin/install -S -m 0755`, 300 MB, six runs, target absent and present): the new inode
|
|
26
|
+
* is visible at the path as 0600, then 0755 0.2–0.4 ms later. Only ever narrower than declared.
|
|
27
|
+
* ⚠️ REASONED NOT MEASURED: a launchd start inside that window gets EACCES and retries after its
|
|
28
|
+
* throttle, and an install killed inside it leaves a root-owned 0600 file the operator cannot
|
|
29
|
+
* read back. Closing it needs a second privileged step (install to a temp name, then rename),
|
|
30
|
+
* which is a change to this allowlist and wants its own red team.
|
|
31
|
+
* ⚠️ AND IT COPIES XATTRS, com.apple.quarantine included (MEASURED 2026-09-22: a quarantined
|
|
32
|
+
* source installed as a quarantined target). The staged file is written by this process, and
|
|
33
|
+
* node:fs writes here carried only com.apple.provenance (measured the same day) — so nothing
|
|
34
|
+
* is quarantined today, but a quarantined staging file would be installed quarantined.
|
|
24
35
|
* ⚠️ REASONED, NOT MEASURED: sudo's failure text (sudo-said.ts has the strings and their sources).
|
|
25
36
|
* ⛔ EVERY CHECK BEFORE SUDO ALSO RUNS AT PLAN TIME (`checkWrite`, 2026-09-21): the mode, the
|
|
26
37
|
* directories from the prefix down, the read-back. Reads only, as the operator — never sudo.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sudo-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-runner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sudo-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAc,UAAU,EAAgB,MAAM,aAAa,CAAC;AACxE,OAAO,EAIL,gBAAgB,EAMjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,uFAAuF;IACvF,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,iGAAiG;AACjG,MAAM,MAAM,QAAQ,GAAG;IACrB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IAC9D,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,cAAc,eAAgB,SAAS,MAAM,EAAE,QAAQ,QAAQ,KAAG,UAgI9E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAa,iBAAiB,KAAG,UAYvD,CAAC"}
|
package/dist/linux/index.js
CHANGED
|
@@ -624,6 +624,7 @@ var tokens = (spec) => {
|
|
|
624
624
|
end: `${comment} END ${spec.name}`
|
|
625
625
|
};
|
|
626
626
|
};
|
|
627
|
+
var sameRegion = (a, b) => a === undefined || b === undefined ? a === undefined && b === undefined : a.name === b.name && (a.comment ?? DEFAULT_COMMENT) === (b.comment ?? DEFAULT_COMMENT);
|
|
627
628
|
var regionProblems = (spec) => {
|
|
628
629
|
const found = [];
|
|
629
630
|
const comment = spec.comment ?? DEFAULT_COMMENT;
|
|
@@ -748,6 +749,16 @@ var identity = async (runner, props) => {
|
|
|
748
749
|
return { ...uid === undefined ? {} : { uid }, ...gid === undefined ? {} : { gid } };
|
|
749
750
|
};
|
|
750
751
|
var digestOf = (text) => sha256Hex(encoder.encode(text));
|
|
752
|
+
var relocation = (props, output) => {
|
|
753
|
+
if (props.path !== output.path)
|
|
754
|
+
return "path";
|
|
755
|
+
if (sameRegion(props.region, output.region))
|
|
756
|
+
return "none";
|
|
757
|
+
if (props.region === undefined || output.region === undefined) {
|
|
758
|
+
throw refuse3(props.path, `changes between owning the whole file and owning the managed region ` + `${JSON.stringify((props.region ?? output.region)?.name ?? "")} at the same path. Those ` + "are two different claims on one file: destroy this resource and declare a new one.");
|
|
759
|
+
}
|
|
760
|
+
return "region";
|
|
761
|
+
};
|
|
751
762
|
var ownedDigest = (file, region) => {
|
|
752
763
|
if (file === undefined)
|
|
753
764
|
return;
|
|
@@ -814,7 +825,7 @@ var planWrite = async (runner, props, want) => {
|
|
|
814
825
|
// src/linux/remote-file-lifecycle.ts
|
|
815
826
|
var diffFile = async (runner, news, output) => {
|
|
816
827
|
const want = await identity(runner, news);
|
|
817
|
-
if (news
|
|
828
|
+
if (relocation(news, output) === "path") {
|
|
818
829
|
await runner.checkWrite?.(news.path, { mode: news.mode ?? DEFAULT_MODE2, ...want });
|
|
819
830
|
return { action: "replace" };
|
|
820
831
|
}
|
|
@@ -830,8 +841,8 @@ var reconcileFile = async (runner, props, output, adopt = false) => {
|
|
|
830
841
|
if (want.uid !== undefined && want.uid !== runner.effectiveUid() && !canActAsRoot(runner)) {
|
|
831
842
|
throw refuse3(props.path, `owner ${String(props.owner)} is not the deploying user; only root may chown. Deploy through ` + "a root destination or a privileged HostRunner. This provider never calls sudo itself.");
|
|
832
843
|
}
|
|
833
|
-
const
|
|
834
|
-
const prior =
|
|
844
|
+
const move = output === undefined ? "none" : relocation(props, output);
|
|
845
|
+
const prior = move === "none" ? output : undefined;
|
|
835
846
|
const planned = await planWrite(runner, props, want);
|
|
836
847
|
const live = ownedDigest(planned.before, props.region);
|
|
837
848
|
const declared = digestOf(props.content);
|
|
@@ -849,9 +860,16 @@ var reconcileFile = async (runner, props, output, adopt = false) => {
|
|
|
849
860
|
}
|
|
850
861
|
throw refuse3(props.path, "the write returned but the file on disk does not match the declaration");
|
|
851
862
|
}
|
|
852
|
-
if (
|
|
853
|
-
|
|
854
|
-
|
|
863
|
+
if (move === "none" || output === undefined)
|
|
864
|
+
return after;
|
|
865
|
+
await deleteFile(runner, output);
|
|
866
|
+
if (move === "path")
|
|
867
|
+
return after;
|
|
868
|
+
const settled = await readFileAttributes(runner, props.path, props.region);
|
|
869
|
+
if (settled === undefined || settled.contentSha256 !== declared) {
|
|
870
|
+
throw refuse3(props.path, "removing the previous managed block did not leave ours intact");
|
|
871
|
+
}
|
|
872
|
+
return settled;
|
|
855
873
|
};
|
|
856
874
|
var deleteFile = async (runner, output) => {
|
|
857
875
|
const stat = await runner.stat(output.path);
|
|
@@ -1148,11 +1166,14 @@ var assertUnclaimed = async (runner, props) => {
|
|
|
1148
1166
|
throw refuse4(props.name, `${path} is already on this host and is not this resource. Remove it, or declare it as a ` + "new resource and deploy with --adopt.");
|
|
1149
1167
|
}
|
|
1150
1168
|
};
|
|
1169
|
+
var assertRenameTarget = async (runner, old, name) => {
|
|
1170
|
+
assertMayWrite(runner, old.name);
|
|
1171
|
+
assertMayWrite(runner, name);
|
|
1172
|
+
assertUsable({ name }, await showUnit(runner, name));
|
|
1173
|
+
};
|
|
1151
1174
|
var assertReplaceable = async (runner, next, old, expect) => {
|
|
1152
1175
|
assertValid(next, expect);
|
|
1153
|
-
|
|
1154
|
-
assertMayWrite(runner, next.name);
|
|
1155
|
-
assertUsable(next, await showUnit(runner, next.name));
|
|
1176
|
+
await assertRenameTarget(runner, old, next.name);
|
|
1156
1177
|
await assertUnclaimed(runner, next);
|
|
1157
1178
|
await runner.checkWrite?.(unitPathFor(next), UNIT_WRITE);
|
|
1158
1179
|
};
|
|
@@ -1253,7 +1274,12 @@ var diffHandler = (runner, instanceId, news, output, expect) => {
|
|
|
1253
1274
|
if (isResolved3(news))
|
|
1254
1275
|
return lift(() => diffUnit(runner, news, output, expect));
|
|
1255
1276
|
const name = resolvedString(news, "name");
|
|
1256
|
-
|
|
1277
|
+
if (name === undefined || name === output.name)
|
|
1278
|
+
return Effect8.succeed(undefined);
|
|
1279
|
+
return lift(async () => {
|
|
1280
|
+
await assertRenameTarget(runner, output, name);
|
|
1281
|
+
return { action: "replace", deleteFirst: true };
|
|
1282
|
+
});
|
|
1257
1283
|
};
|
|
1258
1284
|
var reconcileHandler = (runner, args, expect) => Effect8.flatMap(adoptsAtApply(args), (adopt) => lift(() => reconcileUnit(runner, args.news, args.output, adopt, expect)));
|
|
1259
1285
|
var deleteHandler = (runner, output) => lift(() => deleteUnit(runner, output));
|
|
@@ -1571,5 +1597,5 @@ export {
|
|
|
1571
1597
|
sshRunner
|
|
1572
1598
|
};
|
|
1573
1599
|
|
|
1574
|
-
//# debugId=
|
|
1600
|
+
//# debugId=999A0F25FFF74BEF64756E2164756E21
|
|
1575
1601
|
//# sourceMappingURL=index.js.map
|