insta 0.1.17 → 0.1.18
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/dist/commands/compute.js +2 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/commands/compute.js
CHANGED
|
@@ -1883,7 +1883,8 @@ export async function computeSSH(serviceName, opts, deps = {}) {
|
|
|
1883
1883
|
const mint = deps.mint ?? mintCert;
|
|
1884
1884
|
const emit = deps.emit ?? info;
|
|
1885
1885
|
const api = await (deps.loadApi ?? ApiClient.load)();
|
|
1886
|
-
|
|
1886
|
+
// 'main' is what a link records by default; anything else makes assertAliasFree refuse a setup of the same service from a linked directory.
|
|
1887
|
+
const p = opts.project !== undefined ? { projectId: opts.project, branch: 'main' } : await (deps.loadProject ?? requireProject)();
|
|
1887
1888
|
const branch = opts.branch ?? p.branch;
|
|
1888
1889
|
const { services } = await api.request('GET', `/projects/${p.projectId}/services${q(branch)}`);
|
|
1889
1890
|
const svc = resolveSoleService(services, 'compute', serviceName);
|
package/dist/index.js
CHANGED
|
@@ -388,6 +388,7 @@ compute.command('ssh [service]')
|
|
|
388
388
|
.description("Issue a short-lived SSH certificate for a compute service and print the command that uses it -- this command does NOT open the session itself, it makes `ssh` work. `--setup` does the one-time work: it generates a dedicated key under ~/.insta/ssh (your existing keys are never touched), has the platform sign a SHORT-LIVED certificate for it, adds one @cert-authority line to ~/.ssh/known_hosts so every region is trusted without per-node fingerprint prompts, and writes an ssh_config block AT THE TOP of ~/.ssh/config giving each compute service the alias `<service>.insta`. After that it is plain `ssh api.insta`, scp and -L: the block renews that alias's certificate for you while OpenSSH parses the config. Needs an interactive login -- API keys are refused; use `insta compute exec` for one-shot commands from CI")
|
|
389
389
|
.option('--setup', 'do the one-time client setup as well as issuing a certificate')
|
|
390
390
|
.option('--ensure-cert <alias>', 'renew the certificate for an alias such as api.insta if it is close to expiry, then exit (used by the ssh_config hook; silent by design)')
|
|
391
|
+
.option('--project <id>', 'project to use instead of the linked one; the directory is not linked (branch defaults to main)')
|
|
391
392
|
.option('-b, --branch <branch>', 'branch (default: linked)')
|
|
392
393
|
.option('--json', 'machine-readable output')
|
|
393
394
|
.action(guard((service, o) => computeCmd.computeSSH(service, o)));
|