@inixiative/archive 0.11.0 → 0.11.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/README.md CHANGED
@@ -21,7 +21,7 @@ archive up # creates ~/.local/share/archive/server.token, then docker compo
21
21
  archive down
22
22
  ```
23
23
 
24
- `up` runs the `compose.yaml` that ships in the package (project `archive`) with `ARCHIVE_DATA_DIR` set to the archive home and the server token from its `server.token`. Postgres data lives in `$ARCHIVE_DATA_DIR/postgres` and the server's configuration (`destinations.json`, destination token files, the Kingdom pairing) in `$ARCHIVE_DATA_DIR/config`, so both survive rebuilds and volume prunes. Compose mounts the config directory at the same absolute path, so the CLI and the server read one `destinations.json` and every path in it resolves for both. Running Compose directly requires an absolute `ARCHIVE_DATA_DIR`. Pin a version with `ARCHIVE_VERSION`; build from a checkout with `docker compose -f compose.yaml -f compose.build.yaml up -d --build`.
24
+ `up` runs the `compose.yaml` that ships in the package (project `archive`) with `ARCHIVE_DATA_DIR` set to the archive home and the server token from its `server.token`. Postgres data lives in `$ARCHIVE_DATA_DIR/postgres` and the server's configuration (`destinations.json`, destination token files, the Kingdom pairing) in `$ARCHIVE_DATA_DIR/config`, so both survive rebuilds and volume prunes. Compose mounts the config directory at the same absolute path, so the CLI and the server read one `destinations.json` and every path in it resolves for both. `up` runs the image tagged with the CLI's own version, so a cached `latest` can never sit under a newer config layout; set `ARCHIVE_VERSION` to run another. Running Compose directly requires an absolute `ARCHIVE_DATA_DIR` and an `ARCHIVE_VERSION`; build from a checkout with `ARCHIVE_VERSION=local docker compose -f compose.yaml -f compose.build.yaml up -d --build`.
25
25
 
26
26
  The server applies its schema migrations on start and requires bearer authentication for data endpoints; `/health` has no session data. Every other command talks to it over HTTP at `--url` (default `http://127.0.0.1:4700`) with the token in `--token-file` (default `~/.local/share/archive/server.token`) or `ARCHIVE_TOKEN`:
27
27
 
package/compose.yaml CHANGED
@@ -19,7 +19,7 @@ services:
19
19
  timeout: 5s
20
20
  retries: 20
21
21
  archive:
22
- image: ghcr.io/inixiative/archive:${ARCHIVE_VERSION:-latest}
22
+ image: ghcr.io/inixiative/archive:${ARCHIVE_VERSION:?archive up sets ARCHIVE_VERSION to the CLI's own version}
23
23
  command: ["bun", "run", "src/cli.ts", "serve", "--home", "${ARCHIVE_DATA_DIR}", "--hostname", "0.0.0.0", "--sync"]
24
24
  depends_on:
25
25
  postgres:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inixiative/archive",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@biomejs/biome": "2.5.2",
46
- "@inixiative/config": "^0.5.64",
46
+ "@inixiative/config": "^0.5.65",
47
47
  "@types/bun": "1.4.2",
48
48
  "lefthook": "2.1.9",
49
49
  "typescript": "6.0.3"
package/src/cli.ts CHANGED
@@ -117,6 +117,12 @@ export async function runCli(args = Bun.argv.slice(2)) {
117
117
  output({ initialized: true, home, tokenFile });
118
118
  return;
119
119
  }
120
+ const packageVersion = () =>
121
+ (
122
+ JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as {
123
+ version: string;
124
+ }
125
+ ).version;
120
126
  if (command === 'up' || command === 'down') {
121
127
  // The machine's one local Archive: the bundled compose file, with its data in the home.
122
128
  if (command === 'up') init();
@@ -135,6 +141,7 @@ export async function runCli(args = Bun.argv.slice(2)) {
135
141
  env: {
136
142
  ...process.env,
137
143
  ARCHIVE_DATA_DIR: home,
144
+ ARCHIVE_VERSION: process.env.ARCHIVE_VERSION ?? packageVersion(),
138
145
  // Compose requires the variable even to stop; down never needs the real token.
139
146
  ARCHIVE_SERVER_TOKEN: readToken() ?? 'x'.repeat(32),
140
147
  },