@astrofoundry/pi-astro 0.21.0 → 0.21.2
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/package.json
CHANGED
package/specialists/AGENTS.md
CHANGED
|
@@ -39,7 +39,7 @@ Wrappers ship as TypeScript and run under Node 24 type stripping: erasable synta
|
|
|
39
39
|
- Exit codes: `UsageError` 2, `ServiceError` 1, success 0. Diagnostics on stderr, results on stdout, JSON where possible.
|
|
40
40
|
- Output filters: Arcane responses pass `stripKeys(ARCANE_DENIED_KEYS)`; Zitadel responses pass `redactSecrets`. Add keys there rather than in a wrapper.
|
|
41
41
|
- Fixed remote commands: `DMZ_COMMANDS`, `PULSAR_COMMANDS`, `VPS_COMMANDS`, `OBS_COMMANDS`, `BACKUP_COMMANDS`, `HOST_COMMANDS`, and `INFERENCE_COMMANDS` must match the entry scripts in `entry/remote/` and their tracked copies in the homelab repository (`02-pulsar-proxmox/dmz/system/`, `02-pulsar-proxmox/pulsar/system/`, `00-frontdoor-vps/system/`, `02-pulsar-proxmox/observability/system/`, `02-pulsar-proxmox/hermes/system/`, `04-nexus-macstudio/system/`, and `host/` of the `astronaute77/arcane` repository). Pulsar's root `authorized_keys` carries one forced key per specialist (network, backup, proxmox, inference), each pinned to its own entry script. Change both sides in the same commit and redeploy the remote script. A new privileged step on the VPS also needs its exact line in `spc-edge-frontdoor-sudoers`.
|
|
42
|
-
- Repository access is `lib/repo.ts` (`repoCommand`, `RepoSpec`, `trackedFile`): one clone per specialist under `~/.specialists/work/<checkoutName
|
|
42
|
+
- Repository access is `lib/repo.ts` (`repoCommand`, `RepoSpec`, `trackedFile`): one clone per specialist under `~/.specialists/work/<checkoutName>` (`homelab-edge`, `homelab-identity`; never share a checkout between specialists), a write deploy key, and an optional `writeRoot` that limits `git write`. `edge` (`deploy-nginx`) and `identity` (`dmz deploy-config`) deploy only what origin has: `trackedFile` refuses a dirty, ahead, or behind checkout. The DMZ entry keeps the previous template and restores it when render or restart fails.
|
|
43
43
|
- `network` firewall policy writes are `policyWrite`: JSON body from the agent, checked for the documented required fields, sent as `POST`, `PUT`, or `DELETE` through the same pinned request; UniFi validates the rest.
|
|
44
44
|
- The IAP tunnel is `lib/tunnel.ts`: `gcloud compute start-iap-tunnel <instance> 22 --local-host-port=localhost:<port>` (a documented flag; the hidden `--listen-on-stdin` is not used), ready when the port accepts a connection, closed after the ssh call. `gcloud auth activate-service-account` runs before every tunnel with `CLOUDSDK_CONFIG` under `~/.specialists/work/gcloud` and `CLOUDSDK_PYTHON` from the config, because the Homebrew cask ships no interpreter.
|
|
45
45
|
- `dns` builds every Technitium call from `TECHNITIUM_READS` and `TECHNITIUM_WRITES`; `key=value` record parameters pass through by name (`token` and `node` refused) because the API documents dozens of type-specific parameters. Writes are refused on the secondary in code: the catalog zone is the only replication path.
|
package/specialists/edge/run.ts
CHANGED
|
@@ -154,7 +154,7 @@ async function overTunnel(config: EdgeConfig, remote: string, timeoutMs: number,
|
|
|
154
154
|
function repoSpec(config: EdgeConfig): RepoSpec {
|
|
155
155
|
return {
|
|
156
156
|
service: SERVICE,
|
|
157
|
-
checkoutName: "homelab",
|
|
157
|
+
checkoutName: "homelab-edge",
|
|
158
158
|
remote: config.homelabRemote,
|
|
159
159
|
branch: config.homelabBranch,
|
|
160
160
|
deployKeyField: "HOMELAB_DEPLOY_KEY",
|
|
@@ -118,7 +118,7 @@ async function zitadel(config: IdentityConfig, args: string[]): Promise<number>
|
|
|
118
118
|
function repoSpec(config: IdentityConfig): RepoSpec {
|
|
119
119
|
return {
|
|
120
120
|
service: SERVICE,
|
|
121
|
-
checkoutName: "homelab",
|
|
121
|
+
checkoutName: "homelab-identity",
|
|
122
122
|
remote: config.homelabRemote,
|
|
123
123
|
branch: config.homelabBranch,
|
|
124
124
|
deployKeyField: "HOMELAB_DEPLOY_KEY",
|
package/specialists/lib/repo.ts
CHANGED
|
@@ -30,7 +30,8 @@ export const REPO_HELP = ` git status branch, ahead/behind, ch
|
|
|
30
30
|
git log [n] last n commits (default 10)
|
|
31
31
|
git write <path> <content> write a file inside the checkout (creates folders)
|
|
32
32
|
git commit <message> stage everything and commit
|
|
33
|
-
git push push the branch to origin
|
|
33
|
+
git push push the branch to origin
|
|
34
|
+
git key public key and fingerprint of the deploy key in use`;
|
|
34
35
|
|
|
35
36
|
const TIMEOUT_MS = 240_000;
|
|
36
37
|
|
|
@@ -115,6 +116,16 @@ export async function trackedFile(spec: RepoSpec, rel: string): Promise<string>
|
|
|
115
116
|
|
|
116
117
|
export async function repoCommand(spec: RepoSpec, args: string[]): Promise<number> {
|
|
117
118
|
const [sub, ...rest] = args;
|
|
119
|
+
if (sub === "key") {
|
|
120
|
+
const key = secretPath(spec.service, spec.deployKeyField);
|
|
121
|
+
const [pub, fingerprint] = await Promise.all([
|
|
122
|
+
run("/usr/bin/ssh-keygen", ["-y", "-f", key], { timeoutMs: 10_000 }),
|
|
123
|
+
run("/usr/bin/ssh-keygen", ["-l", "-f", key], { timeoutMs: 10_000 }),
|
|
124
|
+
]);
|
|
125
|
+
if (pub.code !== 0) throw new ServiceError(`deploy key unreadable: ${pub.stderr.trim()}`);
|
|
126
|
+
printJson({ publicKey: pub.stdout.trim(), fingerprint: fingerprint.stdout.trim() });
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
118
129
|
const dir = await ensureCheckout(spec);
|
|
119
130
|
switch (sub) {
|
|
120
131
|
case "status":
|