@absolutejs/deploy 0.14.1 → 0.15.0
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 +12 -6
- package/dist/hetzner.d.ts +4 -0
- package/dist/hetzner.js.map +2 -2
- package/dist/hetznerInfrastructure.d.ts +20 -0
- package/dist/hetznerInfrastructure.js +557 -0
- package/dist/hetznerInfrastructure.js.map +14 -0
- package/dist/infrastructureAdapter.d.ts +14 -0
- package/dist/linodeInfrastructure.d.ts +18 -0
- package/dist/linodeInfrastructure.js +573 -0
- package/dist/linodeInfrastructure.js.map +14 -0
- package/dist/vultrInfrastructure.d.ts +18 -0
- package/dist/vultrInfrastructure.js +552 -0
- package/dist/vultrInfrastructure.js.map +14 -0
- package/package.json +17 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/targets.ts", "../src/cloudTarget.ts", "../src/vultr.ts", "../src/infrastructureAdapter.ts", "../src/vultrInfrastructure.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Target interface + bundled adapters (localTarget, sshTarget).\n *\n * A Target is the narrowest abstraction over \"a place I can deploy to\":\n *\n * - `exec(cmd, opts?)` — run a shell command, capture stdout/stderr/exitCode.\n * - `upload(localPath, remotePath, opts?)` — copy a local file or directory\n * to the target. Implementation is free to use whatever is fast (rsync,\n * scp, mv).\n * - `close?()` — optional teardown.\n *\n * Two adapters are bundled:\n *\n * - `localTarget` runs in a temp directory on the local filesystem. Useful\n * for tests and for \"deploy\" workflows that happen on the same host.\n * - `sshTarget` shells out to the system `ssh` and `rsync` binaries. No\n * `ssh2` npm dependency — the controller machine just needs `ssh` and\n * (optionally) `rsync` in PATH, which is universal on Mac/Linux/WSL.\n *\n * Provider-specific targets (Cloudflare Workers HTTP API, Fly Machines API,\n * AWS Fargate) don't fit \"exec + upload\" and ship as siblings later.\n */\n\nimport { mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nexport type ExecOptions = {\n\t/** Working directory on the target. Default: target's root. */\n\tcwd?: string;\n\t/** Env vars to set for this command (merged onto target.env). */\n\tenv?: Record<string, string>;\n\t/** Hard kill after this many ms. Default 600_000 (10 min). 0 disables. */\n\ttimeoutMs?: number;\n\t/** Pipe stdout/stderr through here as it streams (lines, newline-stripped). */\n\tonLog?: (line: string, stream: 'stdout' | 'stderr') => void;\n\t/** Stdin payload — a string is written verbatim. */\n\tstdin?: string;\n};\n\nexport type ExecResult = {\n\tstdout: string;\n\tstderr: string;\n\texitCode: number;\n};\n\nexport type UploadOptions = {\n\t/** Exclude paths matching these globs from a directory upload. */\n\texclude?: string[];\n\t/** When uploading a directory, delete remote files not present locally. */\n\tdeleteOrphans?: boolean;\n};\n\nexport type Target = {\n\t/** Human-readable description (e.g. \"ssh root@droplet-1.example.com\"). */\n\treadonly description: string;\n\texec: (cmd: string, opts?: ExecOptions) => Promise<ExecResult>;\n\tupload: (localPath: string, remotePath: string, opts?: UploadOptions) => Promise<void>;\n\tclose?: () => Promise<void>;\n};\n\n// -----------------------------------------------------------------------------\n// localTarget\n// -----------------------------------------------------------------------------\n\nexport type LocalTargetOptions = {\n\t/** Root directory the target operates in. Created if missing. */\n\troot: string;\n\t/** Env merged into every exec. */\n\tenv?: Record<string, string>;\n};\n\nconst decodeChunks = async (\n\treader: ReadableStream<Uint8Array> | null,\n\tonLine: ((line: string) => void) | undefined,\n): Promise<string> => {\n\tif (!reader) return '';\n\tconst decoder = new TextDecoder();\n\tlet buffer = '';\n\tlet collected = '';\n\tconst stream = reader.getReader();\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await stream.read();\n\t\t\tif (done) break;\n\t\t\tconst chunk = decoder.decode(value, { stream: true });\n\t\t\tcollected += chunk;\n\t\t\tif (!onLine) continue;\n\t\t\tbuffer += chunk;\n\t\t\tlet newline = buffer.indexOf('\\n');\n\t\t\twhile (newline !== -1) {\n\t\t\t\tconst line = buffer.slice(0, newline).replace(/\\r$/, '');\n\t\t\t\tif (line.length > 0) onLine(line);\n\t\t\t\tbuffer = buffer.slice(newline + 1);\n\t\t\t\tnewline = buffer.indexOf('\\n');\n\t\t\t}\n\t\t}\n\t\tconst tail = decoder.decode();\n\t\tcollected += tail;\n\t\tif (onLine && (buffer + tail).length > 0) onLine((buffer + tail).replace(/\\r$/, ''));\n\t} finally {\n\t\tstream.releaseLock();\n\t}\n\treturn collected;\n};\n\nconst runSpawn = async (\n\targv: string[],\n\toptions: {\n\t\tcwd?: string;\n\t\tenv?: Record<string, string>;\n\t\ttimeoutMs?: number;\n\t\tonLog?: ExecOptions['onLog'];\n\t\tstdin?: string;\n\t},\n): Promise<ExecResult> => {\n\tconst proc = Bun.spawn(argv, {\n\t\tcwd: options.cwd,\n\t\tenv: options.env,\n\t\tstderr: 'pipe',\n\t\tstdin: options.stdin === undefined ? 'ignore' : 'pipe',\n\t\tstdout: 'pipe',\n\t});\n\n\tif (options.stdin !== undefined && proc.stdin) {\n\t\t// Bun.spawn returns a FileSink for piped stdin — `write` + `end`, not a\n\t\t// WritableStream. (We use a permissive cast because @types/bun's\n\t\t// Subprocess.stdin discriminant flips based on the stdin generic.)\n\t\tconst sink = proc.stdin as unknown as {\n\t\t\twrite: (chunk: string | Uint8Array) => number | Promise<number>;\n\t\t\tend: () => void | Promise<void>;\n\t\t};\n\t\tconst wrote = sink.write(options.stdin);\n\t\tif (wrote && typeof (wrote as Promise<number>).then === 'function') {\n\t\t\tawait wrote;\n\t\t}\n\t\tconst ended = sink.end();\n\t\tif (ended && typeof (ended as Promise<void>).then === 'function') {\n\t\t\tawait ended;\n\t\t}\n\t}\n\n\tconst timeout = options.timeoutMs ?? 600_000;\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tif (timeout > 0) {\n\t\ttimer = setTimeout(() => {\n\t\t\ttry { proc.kill(); } catch { /* already gone */ }\n\t\t}, timeout);\n\t}\n\n\tconst stdoutPromise = decodeChunks(\n\t\tproc.stdout as unknown as ReadableStream<Uint8Array>,\n\t\toptions.onLog ? (line) => options.onLog!(line, 'stdout') : undefined,\n\t);\n\tconst stderrPromise = decodeChunks(\n\t\tproc.stderr as unknown as ReadableStream<Uint8Array>,\n\t\toptions.onLog ? (line) => options.onLog!(line, 'stderr') : undefined,\n\t);\n\n\tconst [stdout, stderr, exitCode] = await Promise.all([\n\t\tstdoutPromise,\n\t\tstderrPromise,\n\t\tproc.exited,\n\t]);\n\tif (timer) clearTimeout(timer);\n\n\treturn { exitCode: exitCode ?? -1, stderr, stdout };\n};\n\nexport const localTarget = (options: LocalTargetOptions): Target => {\n\tconst baseEnv = { ...options.env };\n\tconst ensureRoot = async () => { await mkdir(options.root, { recursive: true }); };\n\n\treturn {\n\t\tdescription: `local ${options.root}`,\n\t\texec: async (cmd, opts) => {\n\t\t\tawait ensureRoot();\n\t\t\treturn runSpawn(['sh', '-c', cmd], {\n\t\t\t\tcwd: opts?.cwd ?? options.root,\n\t\t\t\tenv: { ...process.env, ...baseEnv, ...(opts?.env ?? {}) } as Record<string, string>,\n\t\t\t\tonLog: opts?.onLog,\n\t\t\t\tstdin: opts?.stdin,\n\t\t\t\ttimeoutMs: opts?.timeoutMs,\n\t\t\t});\n\t\t},\n\t\tupload: async (localPath, remotePath, opts) => {\n\t\t\tawait ensureRoot();\n\t\t\tconst dest = remotePath.startsWith('/') ? remotePath : join(options.root, remotePath);\n\t\t\tconst argv = ['rsync', '-a'];\n\t\t\tif (opts?.deleteOrphans) argv.push('--delete');\n\t\t\tfor (const pattern of opts?.exclude ?? []) argv.push('--exclude', pattern);\n\t\t\t// rsync semantics: a trailing slash on the source copies *contents*; without it the dir itself is nested.\n\t\t\targv.push(localPath, dest);\n\t\t\tconst result = await runSpawn(argv, { timeoutMs: 600_000 });\n\t\t\tif (result.exitCode !== 0) {\n\t\t\t\tthrow new Error(`local upload failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);\n\t\t\t}\n\t\t},\n\t};\n};\n\n// -----------------------------------------------------------------------------\n// sshTarget\n// -----------------------------------------------------------------------------\n\nexport type SshTargetOptions = {\n\t/** Hostname or IP of the remote. */\n\thost: string;\n\t/** Login user. Default `root`. */\n\tuser?: string;\n\t/** SSH port. Default 22. */\n\tport?: number;\n\t/** Path to SSH identity file. Default: ssh's own search. */\n\tidentity?: string;\n\t/** Extra flags appended to every `ssh` invocation. */\n\tsshFlags?: string[];\n\t/**\n\t * Use rsync for `upload`. Default true. When false, falls back to `scp`\n\t * which is universal but doesn't support delete / exclude.\n\t */\n\trsync?: boolean;\n\t/**\n\t * Env vars to forward via `ssh -o SendEnv=...`. Most remote sshd configs\n\t * accept only `LANG` and `LC_*` by default; for app env vars use the\n\t * step `env` option instead, which prepends `KEY=value` to the command.\n\t */\n\tforwardEnv?: string[];\n};\n\nconst sshTargetString = (options: SshTargetOptions): string => {\n\tconst user = options.user ?? 'root';\n\treturn `${user}@${options.host}`;\n};\n\nconst sshBaseFlags = (options: SshTargetOptions): string[] => {\n\tconst flags: string[] = [];\n\tif (options.port !== undefined && options.port !== 22) flags.push('-p', String(options.port));\n\tif (options.identity !== undefined) flags.push('-i', options.identity);\n\t// Never get stuck on a host-key prompt; treat unknown hosts as a fatal config issue rather than a UX detour.\n\tflags.push('-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=accept-new');\n\tfor (const flag of options.sshFlags ?? []) flags.push(flag);\n\treturn flags;\n};\n\nconst shellQuote = (value: string): string => `'${value.replace(/'/g, `'\\\\''`)}'`;\n\nconst buildRemoteCmd = (cmd: string, opts: ExecOptions | undefined): string => {\n\tconst env = opts?.env;\n\tconst envPrefix = env\n\t\t? Object.entries(env).map(([k, v]) => `${k}=${shellQuote(v)}`).join(' ') + ' '\n\t\t: '';\n\tif (opts?.cwd) {\n\t\treturn `cd ${shellQuote(opts.cwd)} && ${envPrefix}${cmd}`;\n\t}\n\treturn `${envPrefix}${cmd}`;\n};\n\nexport const sshTarget = (options: SshTargetOptions): Target => {\n\tconst remote = sshTargetString(options);\n\tconst useRsync = options.rsync ?? true;\n\n\treturn {\n\t\tdescription: `ssh ${remote}${options.port && options.port !== 22 ? `:${options.port}` : ''}`,\n\t\texec: async (cmd, opts) => {\n\t\t\tconst argv = ['ssh', ...sshBaseFlags(options)];\n\t\t\tfor (const name of options.forwardEnv ?? []) argv.push('-o', `SendEnv=${name}`);\n\t\t\targv.push(remote, buildRemoteCmd(cmd, opts));\n\t\t\treturn runSpawn(argv, {\n\t\t\t\tonLog: opts?.onLog,\n\t\t\t\tstdin: opts?.stdin,\n\t\t\t\ttimeoutMs: opts?.timeoutMs,\n\t\t\t});\n\t\t},\n\t\tupload: async (localPath, remotePath, opts) => {\n\t\t\tif (useRsync) {\n\t\t\t\tconst sshCmd = ['ssh', ...sshBaseFlags(options)].map((part) => part.includes(' ') ? `'${part}'` : part).join(' ');\n\t\t\t\tconst argv = ['rsync', '-az', '-e', sshCmd];\n\t\t\t\tif (opts?.deleteOrphans) argv.push('--delete');\n\t\t\t\tfor (const pattern of opts?.exclude ?? []) argv.push('--exclude', pattern);\n\t\t\t\targv.push(localPath, `${remote}:${remotePath}`);\n\t\t\t\tconst result = await runSpawn(argv, { timeoutMs: 600_000 });\n\t\t\t\tif (result.exitCode !== 0) {\n\t\t\t\t\tthrow new Error(`rsync upload failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// scp fallback — no exclude, no delete. We still need -r to copy directories.\n\t\t\tconst argv = ['scp', '-r', ...sshBaseFlags(options), localPath, `${remote}:${remotePath}`];\n\t\t\tconst result = await runSpawn(argv, { timeoutMs: 600_000 });\n\t\t\tif (result.exitCode !== 0) {\n\t\t\t\tthrow new Error(`scp upload failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);\n\t\t\t}\n\t\t},\n\t};\n};\n",
|
|
6
|
+
"/**\n * Shared \"cloud-provider Target\" plumbing used by the\n * provider-specific adapters (`./digitalocean`, `./hetzner`, future\n * `./linode`, `./vultr`, etc.).\n *\n * The provider supplies a small `CloudTargetHooks` bag that knows\n * the provider's:\n *\n * - find-by-name lookup\n * - create call (closure over create params)\n * - fetch-by-id (used to poll for `active`)\n * - destroy-by-id\n * - status + ipv4 + id extraction from the provider's Server shape\n * - readiness predicate (status reached the terminal \"running\" value)\n *\n * `createCloudTarget()` does the universal machinery: provision-or-\n * reuse, poll until ready + IPv4, wait for SSH probe, build\n * `sshTarget` against the IPv4, return the Target wrapped with\n * `{ id, ipv4, destroy() }`.\n *\n * The public adapter (e.g. `digitalOceanTarget`) is a 30-line facade\n * that wires its provider-specific bits and renames `id` → `dropletId`\n * on the way out.\n */\n\nimport type { Target } from './targets';\nimport { sshTarget } from './targets';\n\n/** Provider-specific hooks. Keep these pure of network IO timing — the helper schedules. */\nexport type CloudTargetHooks<Server, Id = number> = {\n\t/** Find a server by name. Returns undefined if absent. */\n\tfindByName: (name: string) => Promise<Server | undefined>;\n\t/** Create the server. Closure over provider-specific create params. */\n\tcreate: () => Promise<Server>;\n\t/** Fetch a fresh copy of the server by id. Used to poll. */\n\tfetch: (id: Id) => Promise<Server>;\n\t/** Destroy a server by id. 404 should be treated as idempotent success. */\n\tdestroy: (id: Id) => Promise<void>;\n\t/** True when the server has reached its terminal \"running\" status. */\n\tisReady: (server: Server) => boolean;\n\t/** Extract the provider-assigned id (number for DO/Hetzner/Linode, string for Vultr). */\n\tgetId: (server: Server) => Id;\n\t/** Extract the public IPv4. Returns undefined while one is being assigned. */\n\tgetIpv4: (server: Server) => string | undefined;\n\t/** Extract the current status as a string (for log lines). */\n\tgetStatus: (server: Server) => string;\n};\n\nexport type CloudTargetOptions = {\n\t/** Provider's idempotency key (server name). */\n\tname: string;\n\t/** Region / location label — used in the \"creating\" log line. */\n\tregion: string;\n\n\t/** SSH login user. Default `'root'`. */\n\tuser?: string;\n\t/** SSH identity file. */\n\tidentity?: string;\n\t/** SSH port. Default 22. */\n\tport?: number;\n\n\t/** Default 5 min. */\n\tprovisionTimeoutMs?: number;\n\t/** Default 2 min. */\n\tsshReadinessTimeoutMs?: number;\n\t/** Default 5 s. */\n\tpollIntervalMs?: number;\n\n\t/** Called with status updates. */\n\tonLog?: (line: string) => void;\n\t/** Override SSH probe — tests skip real TCP IO. */\n\tprobeSsh?: (host: string, port: number) => Promise<boolean>;\n\t/** Override sleep — tests skip real waits. */\n\tsleep?: (ms: number) => Promise<void>;\n\t/** Override clock — tests inject deterministic timestamps. */\n\tnow?: () => number;\n\n\t/**\n\t * Short log prefix, e.g. `'[do]'` or `'[hetzner]'`. Threaded through\n\t * every log line so multi-provider deploys distinguish output.\n\t */\n\tlogPrefix: string;\n\t/**\n\t * Provider's word for the entity in log copy — `'droplet'` for DO,\n\t * `'server'` for Hetzner. Preserves provider-accurate output.\n\t */\n\tentityWord: string;\n\t/**\n\t * Build the Target's `description` field. Receives the resolved\n\t * IPv4 + the wrapped sshTarget description.\n\t */\n\tdescribeTarget: (sshDescription: string) => string;\n};\n\nexport type CloudTargetResult<Id = number> = {\n\tid: Id;\n\tipv4: string;\n\tdescription: string;\n\texec: Target['exec'];\n\tupload: Target['upload'];\n\tclose?: Target['close'];\n\tdestroy: () => Promise<void>;\n};\n\nconst defaultSleep = (ms: number): Promise<void> =>\n\tnew Promise((resolve) => setTimeout(resolve, ms));\n\nconst defaultProbeSsh = async (host: string, port: number): Promise<boolean> => {\n\tconst PROBE_TIMEOUT_MS = 2_000;\n\treturn new Promise<boolean>((resolve) => {\n\t\tlet settled = false;\n\t\tconst settle = (value: boolean) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tresolve(value);\n\t\t};\n\t\tconst timer = setTimeout(() => settle(false), PROBE_TIMEOUT_MS);\n\t\tBun.connect({\n\t\t\thostname: host,\n\t\t\tport,\n\t\t\tsocket: {\n\t\t\t\tdata: () => {},\n\t\t\t\terror: () => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tsettle(false);\n\t\t\t\t},\n\t\t\t\topen: (socket) => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tsocket.end();\n\t\t\t\t\tsettle(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}).catch(() => {\n\t\t\tclearTimeout(timer);\n\t\t\tsettle(false);\n\t\t});\n\t});\n};\n\n/**\n * The shared provision-or-reuse + wait-for-ready + wait-for-SSH\n * pipeline. Provider-specific adapters wire their `CloudTargetHooks`\n * + their option-shape mapping and return a typed result.\n */\nexport const createCloudTarget = async <Server, Id = number>(\n\thooks: CloudTargetHooks<Server, Id>,\n\toptions: CloudTargetOptions\n): Promise<CloudTargetResult<Id>> => {\n\tconst log = options.onLog ?? (() => {});\n\tconst probeSsh = options.probeSsh ?? defaultProbeSsh;\n\tconst sleep = options.sleep ?? defaultSleep;\n\tconst now = options.now ?? Date.now;\n\tconst pollMs = options.pollIntervalMs ?? 5_000;\n\tconst provisionTimeout = options.provisionTimeoutMs ?? 5 * 60_000;\n\tconst sshTimeout = options.sshReadinessTimeoutMs ?? 2 * 60_000;\n\tconst port = options.port ?? 22;\n\tconst prefix = options.logPrefix;\n\tconst noun = options.entityWord;\n\n\tconst existing = await hooks.findByName(options.name);\n\tlet current: Server;\n\tif (existing === undefined) {\n\t\tlog(`${prefix} creating ${noun} \"${options.name}\" in ${options.region}`);\n\t\tcurrent = await hooks.create();\n\t} else {\n\t\tlog(\n\t\t\t`${prefix} reusing ${noun} \"${options.name}\" (id ${hooks.getId(existing)}, status ${hooks.getStatus(existing)})`\n\t\t);\n\t\tcurrent = existing;\n\t}\n\n\t// Wait for status=ready AND public IPv4 assigned.\n\tconst provisionStart = now();\n\tlet ipv4 = hooks.getIpv4(current);\n\twhile (!hooks.isReady(current) || ipv4 === undefined) {\n\t\tif (now() - provisionStart > provisionTimeout) {\n\t\t\tthrow new Error(\n\t\t\t\t`${prefix} provision timeout after ${provisionTimeout}ms — ${noun} ${hooks.getId(current)} status \"${hooks.getStatus(current)}\", ipv4 ${ipv4 ?? '(unassigned)'}`\n\t\t\t);\n\t\t}\n\t\tawait sleep(pollMs);\n\t\tcurrent = await hooks.fetch(hooks.getId(current));\n\t\tipv4 = hooks.getIpv4(current);\n\t\tlog(\n\t\t\t`${prefix} poll: status=${hooks.getStatus(current)} ipv4=${ipv4 ?? '(none yet)'}`\n\t\t);\n\t}\n\tlog(`${prefix} ${noun} ready at ${ipv4}`);\n\n\t// Wait for SSH readiness.\n\tconst sshStart = now();\n\twhile (!(await probeSsh(ipv4, port))) {\n\t\tif (now() - sshStart > sshTimeout) {\n\t\t\tthrow new Error(\n\t\t\t\t`${prefix} SSH readiness timeout after ${sshTimeout}ms — ${ipv4}:${port} did not accept connections`\n\t\t\t);\n\t\t}\n\t\tawait sleep(pollMs);\n\t\tlog(`${prefix} waiting on ssh ${ipv4}:${port}`);\n\t}\n\tlog(`${prefix} ssh ready at ${ipv4}:${port}`);\n\n\tconst ssh = sshTarget({\n\t\thost: ipv4,\n\t\t...(options.user !== undefined ? { user: options.user } : {}),\n\t\t...(options.identity !== undefined ? { identity: options.identity } : {}),\n\t\t...(options.port !== undefined ? { port: options.port } : {})\n\t});\n\n\tconst id = hooks.getId(current);\n\tconst resolvedIpv4 = ipv4;\n\n\treturn {\n\t\tdescription: options.describeTarget(ssh.description),\n\t\tdestroy: () =>\n\t\t\thooks.destroy(id).then(() => {\n\t\t\t\tlog(`${prefix} destroyed ${noun} ${id}`);\n\t\t\t}),\n\t\texec: ssh.exec,\n\t\tid,\n\t\tipv4: resolvedIpv4,\n\t\tupload: ssh.upload,\n\t\t...(ssh.close !== undefined ? { close: ssh.close } : {})\n\t};\n};\n",
|
|
7
|
+
"/**\n * @absolutejs/deploy/vultr — provision-or-reuse Target adapter for\n * Vultr instances. Sibling to digitalOceanTarget + hetznerTarget +\n * linodeTarget; same shape, Vultr v2 API mappings.\n *\n * Idempotent by label. Vultr stores the public IP as `main_ip`\n * (single string, not an array). SSH keys are pre-registered with\n * Vultr and referenced by UUID — different from Linode (raw keys)\n * and DO/Hetzner (fingerprints/ids/names).\n */\n\nimport type { Target } from './targets';\nimport { createCloudTarget, type CloudTargetHooks } from './cloudTarget';\n\nconst VULTR_API_BASE = 'https://api.vultr.com/v2';\n\nexport type VultrClientLike = {\n\trequest: <T = unknown>(\n\t\tmethod: 'GET' | 'POST' | 'DELETE' | 'PATCH',\n\t\tpath: string,\n\t\tbody?: unknown\n\t) => Promise<T>;\n};\n\n/** A Vultr instance, narrowed to what we inspect. */\nexport type VultrInstance = {\n\tid: string;\n\tlabel: string;\n\tstatus: 'active' | 'pending' | 'suspended' | 'resizing';\n\tpower_status?: 'running' | 'stopped' | 'starting';\n\tserver_status?: string;\n\tmain_ip: string;\n\tinternal_ip?: string;\n\tregion?: string;\n\tplan?: string;\n\ttags?: string[];\n};\n\nexport type VultrTargetOptions = {\n\t/** Vultr API key. Required unless `client` is set. */\n\ttoken?: string;\n\tclient?: VultrClientLike;\n\n\t// ── Instance shape ──────────────────────────────────────────────\n\t/** Instance label. Idempotency key. */\n\tname: string;\n\t/** Region slug — `'ewr'`, `'lax'`, `'sgp'`, etc. */\n\tregion: string;\n\t/** Plan slug — `'vc2-1c-1gb'`, `'vc2-2c-4gb'`, etc. */\n\tplan: string;\n\t/** OS id. Numeric — e.g. `1743` for Ubuntu 22.04. */\n\tosId: number;\n\t/**\n\t * SSH key UUIDs already registered in your Vultr account\n\t * (https://my.vultr.com/settings/#ssh-keys). Vultr does NOT accept\n\t * raw key strings — you upload them once, then reference the UUIDs.\n\t */\n\tsshKeys: ReadonlyArray<string>;\n\t/** Tags applied to the instance. */\n\ttags?: ReadonlyArray<string>;\n\t/** Cloud-init user data (will be base64-encoded by us). */\n\tuserData?: string;\n\t/** Enable IPv6. Default false. */\n\tenableIpv6?: boolean;\n\t/** Enable backups. Default false. */\n\tbackups?: boolean;\n\t/** Enable DDoS protection. Default false. */\n\tddosProtection?: boolean;\n\t/** Hostname (Vultr distinguishes label from hostname). Default = name. */\n\thostname?: string;\n\n\t// ── SSH wrap ────────────────────────────────────────────────────\n\tuser?: string;\n\tidentity?: string;\n\tport?: number;\n\n\t// ── Timing ──────────────────────────────────────────────────────\n\tprovisionTimeoutMs?: number;\n\tsshReadinessTimeoutMs?: number;\n\tpollIntervalMs?: number;\n\n\t// ── Observability + injection ───────────────────────────────────\n\tonLog?: (line: string) => void;\n\tprobeSsh?: (host: string, port: number) => Promise<boolean>;\n\tsleep?: (ms: number) => Promise<void>;\n\tnow?: () => number;\n};\n\nexport type VultrTarget = Target & {\n\treadonly instanceId: string;\n\treadonly ipv4: string;\n\tdestroy: () => Promise<void>;\n};\n\nexport class VultrError extends Error {\n\treadonly status: number;\n\treadonly body: unknown;\n\tconstructor(message: string, status: number, body: unknown) {\n\t\tsuper(message);\n\t\tthis.name = 'VultrError';\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t}\n}\n\nexport const createVultrClient = (\n\ttoken: string,\n\toptions: { baseUrl?: string; fetch?: typeof fetch } = {}\n): VultrClientLike => {\n\tconst base = options.baseUrl ?? VULTR_API_BASE;\n\tconst f = options.fetch ?? fetch;\n\treturn {\n\t\trequest: async <T>(\n\t\t\tmethod: 'GET' | 'POST' | 'DELETE' | 'PATCH',\n\t\t\tpath: string,\n\t\t\tbody?: unknown\n\t\t): Promise<T> => {\n\t\t\tconst init: RequestInit = {\n\t\t\t\theaders: {\n\t\t\t\t\tauthorization: `Bearer ${token}`,\n\t\t\t\t\t'content-type': 'application/json'\n\t\t\t\t},\n\t\t\t\tmethod\n\t\t\t};\n\t\t\tif (body !== undefined) init.body = JSON.stringify(body);\n\t\t\tconst response = await f(`${base}${path}`, init);\n\t\t\tif (response.status === 204) return undefined as T;\n\t\t\tconst text = await response.text();\n\t\t\tconst parsed = text.length > 0 ? JSON.parse(text) : undefined;\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new VultrError(\n\t\t\t\t\t`Vultr API ${method} ${path} failed: ${response.status} ${response.statusText}`,\n\t\t\t\t\tresponse.status,\n\t\t\t\t\tparsed\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn parsed as T;\n\t\t}\n\t};\n};\n\nconst resolveClient = (\n\toptions: Pick<VultrTargetOptions, 'client' | 'token'>\n): VultrClientLike => {\n\tif (options.client !== undefined) return options.client;\n\tif (options.token !== undefined && options.token.length > 0) {\n\t\treturn createVultrClient(options.token);\n\t}\n\tthrow new Error(\n\t\t'[deploy/vultr] either `token` or `client` must be provided'\n\t);\n};\n\nconst publicIpv4 = (instance: VultrInstance): string | undefined => {\n\tif (instance.main_ip === '' || instance.main_ip === '0.0.0.0') {\n\t\treturn undefined;\n\t}\n\treturn instance.main_ip;\n};\n\n/** Find an instance by label. Throws on ambiguous duplicates. */\nexport const findVultrInstance = async (\n\tclient: VultrClientLike,\n\tname: string\n): Promise<VultrInstance | undefined> => {\n\tconst body = await client.request<{ instances: VultrInstance[] }>(\n\t\t'GET',\n\t\t`/instances?label=${encodeURIComponent(name)}&per_page=500`\n\t);\n\tconst matches = body.instances.filter((instance) => instance.label === name);\n\tif (matches.length === 0) return undefined;\n\tif (matches.length > 1) {\n\t\tthrow new Error(\n\t\t\t`[deploy/vultr] multiple instances labeled \"${name}\" (${matches\n\t\t\t\t.map((instance) => instance.id)\n\t\t\t\t.join(', ')}). Resolve manually before adopting.`\n\t\t);\n\t}\n\treturn matches[0];\n};\n\nexport const listVultrInstances = async (options: {\n\ttoken?: string;\n\tclient?: VultrClientLike;\n\ttag?: string;\n}): Promise<VultrInstance[]> => {\n\tconst client = resolveClient(options);\n\tconst path =\n\t\toptions.tag !== undefined\n\t\t\t? `/instances?tag=${encodeURIComponent(options.tag)}&per_page=500`\n\t\t\t: '/instances?per_page=500';\n\tconst body = await client.request<{ instances: VultrInstance[] }>('GET', path);\n\treturn body.instances;\n};\n\nexport const destroyVultrInstance = async (options: {\n\ttoken?: string;\n\tclient?: VultrClientLike;\n\tid: string;\n}): Promise<void> => {\n\tconst client = resolveClient(options);\n\ttry {\n\t\tawait client.request('DELETE', `/instances/${options.id}`);\n\t} catch (error) {\n\t\tif (error instanceof VultrError && error.status === 404) return;\n\t\tthrow error;\n\t}\n};\n\nexport const vultrTarget = async (\n\toptions: VultrTargetOptions\n): Promise<VultrTarget> => {\n\tconst client = resolveClient(options);\n\n\tconst hooks: CloudTargetHooks<VultrInstance, string> = {\n\t\tcreate: async () => {\n\t\t\tconst created = await client.request<{ instance: VultrInstance }>(\n\t\t\t\t'POST',\n\t\t\t\t'/instances',\n\t\t\t\t{\n\t\t\t\t\thostname: options.hostname ?? options.name,\n\t\t\t\t\tlabel: options.name,\n\t\t\t\t\tos_id: options.osId,\n\t\t\t\t\tplan: options.plan,\n\t\t\t\t\tregion: options.region,\n\t\t\t\t\tsshkey_id: [...options.sshKeys],\n\t\t\t\t\t...(options.tags !== undefined ? { tags: [...options.tags] } : {}),\n\t\t\t\t\t...(options.userData !== undefined\n\t\t\t\t\t\t? { user_data: btoa(options.userData) }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(options.enableIpv6 === true ? { enable_ipv6: true } : {}),\n\t\t\t\t\t...(options.backups === true ? { backups: 'enabled' } : {}),\n\t\t\t\t\t...(options.ddosProtection === true ? { ddos_protection: true } : {})\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn created.instance;\n\t\t},\n\t\tdestroy: (id) => destroyVultrInstance({ client, id }),\n\t\tfetch: async (id) => {\n\t\t\tconst body = await client.request<{ instance: VultrInstance }>(\n\t\t\t\t'GET',\n\t\t\t\t`/instances/${id}`\n\t\t\t);\n\t\t\treturn body.instance;\n\t\t},\n\t\tfindByName: (name) => findVultrInstance(client, name),\n\t\tgetId: (instance) => instance.id,\n\t\tgetIpv4: publicIpv4,\n\t\tgetStatus: (instance) =>\n\t\t\tinstance.power_status ?? instance.server_status ?? instance.status,\n\t\tisReady: (instance) =>\n\t\t\tinstance.status === 'active' &&\n\t\t\t(instance.power_status === 'running' || instance.power_status === undefined)\n\t};\n\n\tconst result = await createCloudTarget<VultrInstance, string>(hooks, {\n\t\tdescribeTarget: (sshDescription) =>\n\t\t\t`vultr \"${options.name}\" (${sshDescription})`,\n\t\tentityWord: 'instance',\n\t\tlogPrefix: '[vultr]',\n\t\tname: options.name,\n\t\tregion: options.region,\n\t\t...(options.user !== undefined ? { user: options.user } : {}),\n\t\t...(options.identity !== undefined ? { identity: options.identity } : {}),\n\t\t...(options.port !== undefined ? { port: options.port } : {}),\n\t\t...(options.provisionTimeoutMs !== undefined\n\t\t\t? { provisionTimeoutMs: options.provisionTimeoutMs }\n\t\t\t: {}),\n\t\t...(options.sshReadinessTimeoutMs !== undefined\n\t\t\t? { sshReadinessTimeoutMs: options.sshReadinessTimeoutMs }\n\t\t\t: {}),\n\t\t...(options.pollIntervalMs !== undefined\n\t\t\t? { pollIntervalMs: options.pollIntervalMs }\n\t\t\t: {}),\n\t\t...(options.onLog !== undefined ? { onLog: options.onLog } : {}),\n\t\t...(options.probeSsh !== undefined ? { probeSsh: options.probeSsh } : {}),\n\t\t...(options.sleep !== undefined ? { sleep: options.sleep } : {}),\n\t\t...(options.now !== undefined ? { now: options.now } : {})\n\t});\n\n\treturn {\n\t\tdescription: result.description,\n\t\tdestroy: result.destroy,\n\t\texec: result.exec,\n\t\tinstanceId: result.id,\n\t\tipv4: result.ipv4,\n\t\tupload: result.upload,\n\t\t...(result.close !== undefined ? { close: result.close } : {})\n\t};\n};\n",
|
|
8
|
+
"import type { InfrastructureNode } from \"./infrastructure\";\n\nexport type InfrastructureAgentOptions = {\n audience?: string;\n port?: number;\n preferPrivateNetwork?: boolean;\n protocol?: \"http\" | \"https\";\n};\n\nexport const infrastructureAgent = (\n options: InfrastructureAgentOptions | undefined,\n addresses: Pick<InfrastructureNode, \"privateIpv4\" | \"publicIpv4\">,\n) => {\n if (!options) return undefined;\n const host = options.preferPrivateNetwork\n ? (addresses.privateIpv4 ?? addresses.publicIpv4)\n : (addresses.publicIpv4 ?? addresses.privateIpv4);\n if (!host) return undefined;\n\n return {\n url: `${options.protocol ?? \"http\"}://${host}:${options.port ?? 8081}/`,\n ...(options.audience ? { audience: options.audience } : {}),\n };\n};\n\nexport const leastPopulatedRegion = <Region extends { region: string }>(\n regions: readonly Region[],\n observed: readonly string[],\n requested?: string,\n) => {\n const eligible = requested\n ? regions.filter((region) => region.region === requested)\n : [...regions];\n if (eligible.length === 0) return undefined;\n const counts = new Map(eligible.map((region) => [region.region, 0]));\n for (const region of observed) {\n if (counts.has(region)) counts.set(region, (counts.get(region) ?? 0) + 1);\n }\n const selected = [...counts].sort(\n (left, right) =>\n left[1] - right[1] || left[0].localeCompare(right[0]),\n )[0]?.[0];\n\n return eligible.find((region) => region.region === selected);\n};\n",
|
|
9
|
+
"import type {\n InfrastructureNode,\n InfrastructureNodeState,\n InfrastructureProvider,\n} from \"./infrastructure\";\nimport {\n infrastructureAgent,\n leastPopulatedRegion,\n type InfrastructureAgentOptions,\n} from \"./infrastructureAdapter\";\nimport {\n createVultrClient,\n destroyVultrInstance,\n findVultrInstance,\n listVultrInstances,\n type VultrClientLike,\n type VultrInstance,\n} from \"./vultr\";\n\nexport type VultrFleetRegion = {\n osId: number;\n plan: string;\n region: string;\n sshKeys: ReadonlyArray<string>;\n userData?: string;\n};\n\nexport type VultrInfrastructureProviderOptions = {\n agent?: InfrastructureAgentOptions;\n client?: VultrClientLike;\n regions: readonly VultrFleetRegion[];\n tag?: string;\n token?: string;\n};\n\nconst stateFor = (instance: VultrInstance): InfrastructureNodeState => {\n if (\n instance.status === \"active\" &&\n (instance.power_status === \"running\" || !instance.power_status)\n )\n return \"ready\";\n if (\n instance.status === \"pending\" ||\n instance.status === \"resizing\" ||\n instance.power_status === \"starting\"\n )\n return \"pending\";\n\n return \"terminated\";\n};\n\nconst parseNodeId = (id: string) => {\n const match = /^vultr:([a-f0-9-]{16,64})$/.exec(id);\n if (!match?.[1])\n throw new Error(\"[deploy/vultr] invalid infrastructure node id\");\n\n return match[1];\n};\n\nexport const createVultrInfrastructureProvider = (\n options: VultrInfrastructureProviderOptions,\n): InfrastructureProvider => {\n if (options.regions.length === 0)\n throw new Error(\"[deploy/vultr] at least one fleet region is required\");\n const client =\n options.client ?? (options.token ? createVultrClient(options.token) : undefined);\n if (!client)\n throw new Error(\n \"[deploy/vultr] either `token` or `client` must be provided\",\n );\n const tag = options.tag ?? \"absolutejs-paas-node\";\n\n const normalize = (instance: VultrInstance): InfrastructureNode => {\n const publicIpv4 =\n instance.main_ip && instance.main_ip !== \"0.0.0.0\"\n ? instance.main_ip\n : undefined;\n const privateIpv4 = instance.internal_ip || undefined;\n const agent = infrastructureAgent(options.agent, {\n privateIpv4,\n publicIpv4,\n });\n\n return {\n id: `vultr:${instance.id}`,\n label: instance.label,\n provider: \"vultr\",\n region: instance.region ?? \"unknown\",\n state: stateFor(instance),\n ...(publicIpv4 ? { publicIpv4 } : {}),\n ...(privateIpv4 ? { privateIpv4 } : {}),\n ...(agent ? { agent } : {}),\n };\n };\n const list = () => listVultrInstances({ client, tag });\n\n return {\n capabilities: {\n cloudInit: true,\n idempotentProvisioning: true,\n privateNetworking: true,\n regionalPlacement: true,\n regions: options.regions.map(({ region }) => region),\n },\n getNode: async (id) => {\n const result = await client.request<{ instance: VultrInstance }>(\n \"GET\",\n `/instances/${parseNodeId(id)}`,\n );\n\n return normalize(result.instance);\n },\n listNodes: async () => (await list()).map(normalize),\n name: \"vultr\",\n provisionNode: async (input) => {\n const existing = await findVultrInstance(client, input.name);\n if (existing) return normalize(existing);\n const instances = await list();\n const region = leastPopulatedRegion(\n options.regions,\n instances.map((instance) => instance.region ?? \"unknown\"),\n input.region,\n );\n if (!region)\n throw new Error(\n `[deploy/vultr] region ${input.region ?? \"(any)\"} is not configured`,\n );\n const result = await client.request<{ instance: VultrInstance }>(\n \"POST\",\n \"/instances\",\n {\n enable_ipv6: true,\n hostname: input.name,\n label: input.name,\n os_id: region.osId,\n plan: region.plan,\n region: region.region,\n sshkey_id: [...region.sshKeys],\n tags: [tag],\n ...(region.userData ? { user_data: btoa(region.userData) } : {}),\n },\n );\n\n return normalize(result.instance);\n },\n terminateNode: async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
12
|
+
"debugId": "C1FCA37B765F995364756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/deploy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Generic Bun-project deploy pipeline. A Target (localTarget / sshTarget) is anywhere you can exec + upload — DigitalOcean droplets, Linode, Hetzner, Vultr, your own boxes. Bundled pipeline: prepare → upload → install → build → link → restart → verify. Atomic symlink swap, release history, prune, hooks. SSH shells out to system ssh/rsync — zero ssh2 deps.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"release"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "rm -rf dist && bun build src/index.ts src/infrastructure.ts src/digitalocean.ts src/digitaloceanInfrastructure.ts src/gcp.ts src/hetzner.ts src/linode.ts src/vultr.ts src/dns.ts src/cloudflare.ts src/digitaloceanDns.ts src/hetznerDns.ts src/route53.ts src/tls.ts src/env.ts src/preview.ts --outdir dist --root src --sourcemap --target=bun && tsc --project tsconfig.build.json",
|
|
33
|
+
"build": "rm -rf dist && bun build src/index.ts src/infrastructure.ts src/digitalocean.ts src/digitaloceanInfrastructure.ts src/gcp.ts src/hetzner.ts src/hetznerInfrastructure.ts src/linode.ts src/linodeInfrastructure.ts src/vultr.ts src/vultrInfrastructure.ts src/dns.ts src/cloudflare.ts src/digitaloceanDns.ts src/hetznerDns.ts src/route53.ts src/tls.ts src/env.ts src/preview.ts --outdir dist --root src --sourcemap --target=bun && tsc --project tsconfig.build.json",
|
|
34
34
|
"test": "bun test tests/",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
36
36
|
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
@@ -79,6 +79,11 @@
|
|
|
79
79
|
"import": "./dist/hetzner.js",
|
|
80
80
|
"default": "./dist/hetzner.js"
|
|
81
81
|
},
|
|
82
|
+
"./hetzner-infrastructure": {
|
|
83
|
+
"types": "./dist/hetznerInfrastructure.d.ts",
|
|
84
|
+
"import": "./dist/hetznerInfrastructure.js",
|
|
85
|
+
"default": "./dist/hetznerInfrastructure.js"
|
|
86
|
+
},
|
|
82
87
|
"./dns": {
|
|
83
88
|
"types": "./dist/dns.d.ts",
|
|
84
89
|
"import": "./dist/dns.js",
|
|
@@ -104,11 +109,21 @@
|
|
|
104
109
|
"import": "./dist/linode.js",
|
|
105
110
|
"default": "./dist/linode.js"
|
|
106
111
|
},
|
|
112
|
+
"./linode-infrastructure": {
|
|
113
|
+
"types": "./dist/linodeInfrastructure.d.ts",
|
|
114
|
+
"import": "./dist/linodeInfrastructure.js",
|
|
115
|
+
"default": "./dist/linodeInfrastructure.js"
|
|
116
|
+
},
|
|
107
117
|
"./vultr": {
|
|
108
118
|
"types": "./dist/vultr.d.ts",
|
|
109
119
|
"import": "./dist/vultr.js",
|
|
110
120
|
"default": "./dist/vultr.js"
|
|
111
121
|
},
|
|
122
|
+
"./vultr-infrastructure": {
|
|
123
|
+
"types": "./dist/vultrInfrastructure.d.ts",
|
|
124
|
+
"import": "./dist/vultrInfrastructure.js",
|
|
125
|
+
"default": "./dist/vultrInfrastructure.js"
|
|
126
|
+
},
|
|
112
127
|
"./digitalocean-dns": {
|
|
113
128
|
"types": "./dist/digitaloceanDns.d.ts",
|
|
114
129
|
"import": "./dist/digitaloceanDns.js",
|