@hydra-acp/archiver 0.1.17 → 0.1.18
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 +26 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,24 @@ Conflict resolution is last-writer-wins by envelope `uploadedAt`. The envelope f
|
|
|
20
20
|
From npm (recommended once published):
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
npm install -g @hydra-acp/archiver
|
|
23
|
+
npm install -g @hydra-acp/cli @hydra-acp/archiver
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This drops the `hydra-acp` (and `hydra`) CLI plus a `hydra-acp-archiver` binary on your PATH. The CLI dispatches `hydra-acp <name>` to any `hydra-acp-<name>` binary on PATH, so the archiver is also reachable as `hydra-acp archiver`.
|
|
27
|
+
|
|
28
|
+
Or from source:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
git clone git@github.com:smagnuso/hydra-acp-archiver.git ~/dev/hydra-acp-archiver
|
|
32
|
+
cd ~/dev/hydra-acp-archiver
|
|
33
|
+
npm install
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Setup
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
hydra-acp archiver setup
|
|
24
41
|
```
|
|
25
42
|
|
|
26
43
|
Or from source:
|
|
@@ -40,7 +57,7 @@ hydra-acp-archiver setup
|
|
|
40
57
|
|
|
41
58
|
The wizard walks you through picking a backend (Google Drive / S3 / Filesystem), configuring credentials, optionally generating an AES-256-GCM key for encryption, writing `~/.hydra-acp/archiver.conf`, and registering the archiver as a hydra extension. About 1 minute for S3/Filesystem; about 5–8 minutes for Google Drive (the GCP Console click-through is the long pole).
|
|
42
59
|
|
|
43
|
-
Re-run `hydra-acp
|
|
60
|
+
Re-run `hydra-acp archiver setup` any time to switch backends or rotate keys — it preserves existing custom config keys.
|
|
44
61
|
|
|
45
62
|
<details>
|
|
46
63
|
<summary>Manual Google Drive setup (if you prefer not to run the wizard)</summary>
|
|
@@ -54,7 +71,7 @@ You provide your own OAuth client (Google's terms make it impractical to ship a
|
|
|
54
71
|
3. Configure the **OAuth consent screen**. User type: **External**. Add your Google account under **Test Users**.
|
|
55
72
|
4. **Credentials → Create credentials → OAuth client ID**. Application type: **Desktop app**.
|
|
56
73
|
5. Download the resulting JSON and save it to `~/.hydra-acp/archiver-google-credentials.json` (or anywhere, and set `HYDRA_ACP_ARCHIVER_GOOGLE_CREDENTIALS`).
|
|
57
|
-
6. Run `hydra-acp
|
|
74
|
+
6. Run `hydra-acp archiver gdrive login`. Your browser opens to Google's consent screen. The "Google hasn't verified this app" interstitial is expected for an unverified personal-use client — click **Advanced → Go to (unsafe)** and approve. The redirect lands on a transient local server, the archiver writes `~/.hydra-acp/archiver-google-token.json` (mode 0600), and you're done.
|
|
58
75
|
7. Register: `hydra-acp extensions add hydra-acp-archiver`.
|
|
59
76
|
|
|
60
77
|
After this, restart the daemon. The archiver process starts up, creates a `hydra-acp-archive/` folder in your Drive on first upload, and begins syncing.
|
|
@@ -84,7 +101,7 @@ That writes the equivalent entry into `~/.hydra-acp/config.json`. On `hydra-acp
|
|
|
84
101
|
|
|
85
102
|
## Multi-machine setup
|
|
86
103
|
|
|
87
|
-
Run `hydra-acp
|
|
104
|
+
Run `hydra-acp archiver setup` on each machine that should sync. For Google Drive, log in with the **same Google account** and use the **same Drive folder name** so each machine points at the shared archive. For S3, point each machine at the same bucket. For filesystem, point each at a directory that some external sync tool (Syncthing, Dropbox, iCloud) mirrors.
|
|
88
105
|
|
|
89
106
|
If you turned on encryption, copy `~/.hydra-acp/archiver-key` from your first machine to each peer; the wizard's fingerprint output lets you verify they match.
|
|
90
107
|
|
|
@@ -152,7 +169,7 @@ All three backends support optional AES-256-GCM encryption. When enabled, blobs
|
|
|
152
169
|
Generate a key on one machine:
|
|
153
170
|
|
|
154
171
|
```sh
|
|
155
|
-
hydra-acp
|
|
172
|
+
hydra-acp archiver keygen
|
|
156
173
|
```
|
|
157
174
|
|
|
158
175
|
This writes a 32-byte key as a hex file (mode 0600) and prints:
|
|
@@ -207,7 +224,7 @@ Set `HYDRA_ACP_ARCHIVER_HOST_ID` to override the default (`os.hostname()` saniti
|
|
|
207
224
|
|
|
208
225
|
### Key rotation and re-upload
|
|
209
226
|
|
|
210
|
-
When encryption is enabled and you regenerate the key (`hydra-acp
|
|
227
|
+
When encryption is enabled and you regenerate the key (`hydra-acp archiver keygen`), the fingerprint prefix changes. The new prefix namespace is empty, so the cold sweep on the next daemon start re-uploads all sessions encrypted with the new key. Old blobs under the previous prefix are simply ignored — no decryption errors, no manual cleanup required (though you can delete the old prefix from the bucket/dir when convenient).
|
|
211
228
|
|
|
212
229
|
## Configuration file
|
|
213
230
|
|
|
@@ -296,13 +313,13 @@ Return `false` to skip an upload. Any other value (including `undefined`) archiv
|
|
|
296
313
|
|
|
297
314
|
- `~/.hydra-acp/archiver-state.json` — per-lineage cache of last uploaded hash + last seen remote upload, used for self-loop suppression. Safe to delete; archiver will rebuild it.
|
|
298
315
|
- `~/.hydra-acp/archiver-google-credentials.json` — OAuth client JSON you downloaded.
|
|
299
|
-
- `~/.hydra-acp/archiver-google-token.json` — refresh + access token (mode 0600). Re-run `hydra-acp
|
|
300
|
-
- `~/.hydra-acp/archiver-key` — encryption key (mode 0600), written by `hydra-acp
|
|
316
|
+
- `~/.hydra-acp/archiver-google-token.json` — refresh + access token (mode 0600). Re-run `hydra-acp archiver login` to refresh.
|
|
317
|
+
- `~/.hydra-acp/archiver-key` — encryption key (mode 0600), written by `hydra-acp archiver keygen`. Copy this file to every machine in your sync group. Keep it safe — losing it means losing access to encrypted blobs.
|
|
301
318
|
|
|
302
319
|
## Troubleshooting
|
|
303
320
|
|
|
304
321
|
- **`Missing HYDRA_ACP_TOKEN env var`** — you ran the archiver directly instead of via the daemon. Run it as a registered extension.
|
|
305
|
-
- **`No Google OAuth token at …`** — run `hydra-acp
|
|
322
|
+
- **`No Google OAuth token at …`** — run `hydra-acp archiver gdrive login` first.
|
|
306
323
|
- **`OAuth credentials file not found`** — follow the **First-time Google setup** steps to download the client JSON from GCP Console.
|
|
307
324
|
- **Files aren't appearing in Drive** — check `~/.hydra-acp/extensions/hydra-acp-archiver.log` for errors. Common: consent-screen test-user list doesn't include your Google account.
|
|
308
325
|
- **Two machines kept overwriting each other** — that's last-writer-wins working as designed if both are actively editing the same session. Avoid editing the same session on two machines simultaneously; one of them will lose its diff. A future `activeOn` claim-lock will close this gap.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydra-acp/archiver",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "Session sync extension for hydra-acp — uploads session bundles to a shared backend (Google Drive, fs) and imports peers' bundles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|