{"draft":null,"from":26,"to":27,"files":[{"path":"client/src/key-admin.ts","added":7,"removed":6,"diff":"--- a/client/src/key-admin.ts\n+++ b/client/src/key-admin.ts\n@@ -6,6 +6,7 @@\n import { join } from \"node:path\";\n import { UsageError } from \"./args.ts\";\n import type { Config } from \"./config.ts\";\n+import { fromEnv } from \"./env-names.ts\";\n import { homeFile } from \"./state-dir.ts\";\n \n function originOf(server: string): string {\n@@ -16,7 +17,7 @@\n \t}\n }\n \n-/** The admin token goes only to a server named in AVCS_ADMIN_SERVERS (comma-separated): none is built in. */\n+/** The admin token goes only to a server named in ABSO_ADMIN_SERVERS (comma-separated): none is built in. */\n export function adminGoesTo(server: string, extra = \"\"): boolean {\n \tconst allowed = [\n \t\t...extra\n@@ -29,13 +30,13 @@\n }\n \n export function adminToken(env: Readonly<Record<string, string | undefined>> = process.env): string {\n-\tconst fromEnv = env.AVCS_ADMIN_TOKEN?.trim();\n-\tif (fromEnv) return fromEnv;\n+\tconst fromVar = fromEnv(env, \"ADMIN_TOKEN\")?.trim();\n+\tif (fromVar) return fromVar;\n \ttry {\n \t\tconst fromFile = readFileSync(homeFile(homedir(), \"admin-token\"), \"utf8\").trim();\n \t\tif (fromFile) return fromFile;\n \t} catch {}\n-\tthrow new UsageError(\"abso key needs the admin token in AVCS_ADMIN_TOKEN or ~/.abso/admin-token\");\n+\tthrow new UsageError(\"abso key needs the admin token in ABSO_ADMIN_TOKEN or ~/.abso/admin-token\");\n }\n \n function scrub(text: string, secrets: readonly string[]): string {\n@@ -45,9 +46,9 @@\n }\n \n async function call(config: Config, admin: string, method: \"GET\" | \"POST\", path: string): Promise<unknown> {\n-\tif (!adminGoesTo(config.server, process.env.AVCS_ADMIN_SERVERS))\n+\tif (!adminGoesTo(config.server, fromEnv(process.env, \"ADMIN_SERVERS\")))\n \t\tthrow new UsageError(\n-\t\t\t`abso key will not send the admin token to ${config.server}; AVCS_ADMIN_SERVERS names the servers it may go to`,\n+\t\t\t`abso key will not send the admin token to ${config.server}; ABSO_ADMIN_SERVERS names the servers it may go to`,\n \t\t);\n \tconst secrets = [admin, config.token ?? \"\"].filter((s) => s.length > 0);\n \tlet response: Response;"}],"unmatched":[]}