{"draft":null,"from":26,"to":27,"files":[{"path":"client/src/config.ts","added":11,"removed":9,"diff":"--- a/client/src/config.ts\n+++ b/client/src/config.ts\n@@ -1,7 +1,7 @@\n // The folder's settings (.avcs/config.json), finding the folder that holds\n // them, and the token.\n //\n-// The token is never in the folder: it comes from the AVCS_TOKEN environment\n+// The token is never in the folder: it comes from the ABSO_TOKEN environment\n // variable, or else from ~/.avcs/token, outside every repo.\n \n import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\n@@ -9,6 +9,7 @@\n import { basename, dirname, join, resolve } from \"node:path\";\n import { UsageError } from \"./args.ts\";\n import { type MachineServers, machineServers, TOKEN_SERVERS, tokenGoesTo, trustedList } from \"./core.ts\";\n+import { fromEnv } from \"./env-names.ts\";\n import { homeFile, stateDir } from \"./state-dir.ts\";\n \n /** What .avcs/config.json holds. */\n@@ -166,15 +167,15 @@\n \tconst trusted = trustedServers(env);\n \tif (token === undefined || tokenGoesTo(server, trusted)) return token;\n \tthrow new UsageError(\n-\t\t`this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, \"this machine\"].join(\", \")}, and the servers ~/.abso/servers.json or AVCS_TRUSTED_SERVERS name. ` +\n-\t\t\t`If ${server} is yours, name it in ~/.abso/servers.json or AVCS_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,\n+\t\t`this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, \"this machine\"].join(\", \")}, and the servers ~/.abso/servers.json or ABSO_TRUSTED_SERVERS name. ` +\n+\t\t\t`If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,\n \t);\n }\n \n let machine: MachineServers | undefined;\n-/** This machine's servers (core.ts machineServers), from ~/.abso/servers.json (or ~/.abso/servers.json), read once. AVCS_SERVERS_FILE names another file (tests). */\n+/** This machine's servers (core.ts machineServers), from ~/.abso/servers.json (or the older ~/.avcs/servers.json), read once. ABSO_SERVERS_FILE names another file (tests). */\n export function readMachineServers(env: Readonly<Record<string, string | undefined>> = process.env): MachineServers {\n-\tif (env.AVCS_SERVERS_FILE !== undefined) return machineServers(readOr(env.AVCS_SERVERS_FILE));\n+\tif (fromEnv(env, \"SERVERS_FILE\") !== undefined) return machineServers(readOr(fromEnv(env, \"SERVERS_FILE\") as string));\n \tmachine ??= machineServers(readOr(homeFile(homedir(), \"servers.json\")));\n \treturn machine;\n }\n@@ -186,14 +187,15 @@\n \t}\n };\n \n-/** The servers the token may go to beyond abso's own: AVCS_TRUSTED_SERVERS, then this machine's servers.json. */\n+/** The servers the token may go to beyond abso's own: ABSO_TRUSTED_SERVERS, then this machine's servers.json. */\n export function trustedServers(env: Readonly<Record<string, string | undefined>> = process.env): string {\n-\treturn trustedList(env.AVCS_TRUSTED_SERVERS, readMachineServers(env));\n+\treturn trustedList(fromEnv(env, \"TRUSTED_SERVERS\"), readMachineServers(env));\n }\n \n-/** AVCS_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */\n+/** ABSO_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */\n export function readToken(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {\n-\tif (env.AVCS_TOKEN) return env.AVCS_TOKEN.trim();\n+\tconst fromVar = fromEnv(env, \"TOKEN\");\n+\tif (fromVar) return fromVar.trim();\n \ttry {\n \t\treturn readFileSync(homeFile(homedir(), \"token\"), \"utf8\").trim() || undefined;\n \t} catch {"}],"unmatched":[]}