insta 0.0.34 → 0.0.35
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.
|
@@ -35,7 +35,7 @@ export const LIMITS = {
|
|
|
35
35
|
// control is server-side (per-IP rate limit + weekly dedup). Env overrides are for tests and
|
|
36
36
|
// emergency rotation.
|
|
37
37
|
const FEEDBACK_ENDPOINT = process.env.INSTA_FEEDBACK_URL ||
|
|
38
|
-
'https://
|
|
38
|
+
'https://feedback.instacloud.com/v1/feedback';
|
|
39
39
|
const FEEDBACK_INGEST_TOKEN = process.env.INSTA_FEEDBACK_TOKEN || 'insta-feedback-public-v1';
|
|
40
40
|
const FEEDBACK_TIMEOUT_MS = 10_000;
|
|
41
41
|
const MAX_FILE_BYTES = 256 * 1024;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// `insta services` — manage a project's opt-in services (postgres | storage | compute).
|
|
1
|
+
// `insta services` — manage a project's opt-in services (postgres | storage | compute | redis).
|
|
2
2
|
import { ApiClient, requireProject } from '../api.js';
|
|
3
3
|
import { info, printJson, handleApproval, renderNextActions } from '../util.js';
|
|
4
|
-
export const SERVICE_TYPES = ['postgres', 'storage', 'compute'];
|
|
4
|
+
export const SERVICE_TYPES = ['postgres', 'storage', 'compute', 'redis'];
|
|
5
5
|
const SERVICE_NAME_RE = /^[a-z0-9][a-z0-9-]{0,38}$/;
|
|
6
6
|
export function q(branch) {
|
|
7
7
|
return branch ? `?branch=${encodeURIComponent(branch)}` : '';
|
|
@@ -124,7 +124,8 @@ export async function servicesAdd(type, name, opts = {}) {
|
|
|
124
124
|
export function serviceListLine(s) {
|
|
125
125
|
const extra = s.type === 'compute'
|
|
126
126
|
? ` x${s.machine_count}${s.volume_gib ? ` vol ${s.volume_gib}Gi` : ''}${s.image ? ` running ${s.image}${s.port ? `:${s.port}` : ''}` : ''}`
|
|
127
|
-
: s.type === '
|
|
127
|
+
: s.type === 'redis' ? ` tcp/${s.port ?? 6379}${s.volume_gib ? ` vol ${s.volume_gib}Gi` : ''}`
|
|
128
|
+
: s.type === 'storage' ? ` ${s.public ? 'public' : 'private'}` : '';
|
|
128
129
|
return `${s.type}/${s.name} [${s.status}]${extra}${s.domain ? ` ${s.domain}` : ''} ${s.id}`;
|
|
129
130
|
}
|
|
130
131
|
export async function servicesList(opts) {
|
|
@@ -135,7 +136,7 @@ export async function servicesList(opts) {
|
|
|
135
136
|
if (opts.json)
|
|
136
137
|
return printJson(services);
|
|
137
138
|
if (!services.length)
|
|
138
|
-
return info(`(no services on ${branch ?? 'default'} — add one with \`insta services add <postgres|storage|compute> <name>\`)`);
|
|
139
|
+
return info(`(no services on ${branch ?? 'default'} — add one with \`insta services add <postgres|storage|compute|redis> <name>\`)`);
|
|
139
140
|
for (const s of services)
|
|
140
141
|
info(serviceListLine(s));
|
|
141
142
|
}
|
package/dist/index.js
CHANGED
|
@@ -109,14 +109,14 @@ br.command('switch <name>').action(guard((name) => branch.branchSwitch(name)));
|
|
|
109
109
|
br.command('delete <name>').action(guard((name) => branch.branchDelete(name)));
|
|
110
110
|
br.command('merge <source>').description('Merge a branch service set into another (structural, no data)')
|
|
111
111
|
.option('--into <branch>', 'target branch (default: current)').action(guard((source, o) => branch.branchMerge(source, o)));
|
|
112
|
-
// ---- services (opt-in postgres/storage/compute) ----
|
|
113
|
-
const svc = program.command('services').alias('svc').description('Manage project services (postgres|storage|compute)');
|
|
112
|
+
// ---- services (opt-in postgres/storage/compute/redis) ----
|
|
113
|
+
const svc = program.command('services').alias('svc').description('Manage project services (postgres|storage|compute|redis)');
|
|
114
114
|
// [type] [name] are optional so the command can answer "what can I add?" — a terminal is walked
|
|
115
115
|
// through the dashboard's Add Service kinds, anything else gets that list back as an error
|
|
116
116
|
// (resolve-service.ts). Picking Docker Image also fills in --image/--port from the answers.
|
|
117
117
|
svc.command('add [type] [name]').description('Provision a service on demand (assigns a default domain for postgres/compute); with no type/name, a terminal picks from the service kinds')
|
|
118
118
|
.option('--branch <branch>', 'target branch (default: current)')
|
|
119
|
-
.option('--region <region>', 'region for postgres/compute, e.g. us-east (see `insta regions`)')
|
|
119
|
+
.option('--region <region>', 'region for postgres/compute/redis, e.g. us-east (see `insta regions`)')
|
|
120
120
|
.option('--public', 'storage only: serve the bucket with anonymous public-read (default private)')
|
|
121
121
|
.option('--image <url>', 'compute only: run this container image at creation')
|
|
122
122
|
.option('--port <n>', 'compute only: port the image listens on (default 8080)')
|
package/dist/resolve-service.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `insta services add` with no type (or no name): the kinds are otherwise only discoverable by
|
|
2
|
-
// guessing wrong and reading `type must be postgres|storage|compute`, so missing arguments answer
|
|
2
|
+
// guessing wrong and reading `type must be postgres|storage|compute|redis`, so missing arguments answer
|
|
3
3
|
// "what can I add?" instead. The list mirrors the dashboard's Add Service menu (frontend
|
|
4
4
|
// `add-service-button.tsx`) — Docker Image sits BESIDE Empty Service, not under it, because
|
|
5
5
|
// picking an image is a different intent rather than a compute flag. An agent gets the same list
|
|
@@ -11,6 +11,7 @@ import { SERVICE_TYPES, assertServiceName, parsePort } from './commands/services
|
|
|
11
11
|
export const SERVICE_KINDS = [
|
|
12
12
|
{ id: 'image', label: 'Docker Image', type: 'compute', hint: 'run an existing container image', needsImage: true },
|
|
13
13
|
{ id: 'postgres', label: 'Postgres', type: 'postgres', hint: 'relational DB, usable as soon as it is added', defaultName: 'main-db' },
|
|
14
|
+
{ id: 'redis', label: 'Redis', type: 'redis', hint: 'private Redis-compatible cache', defaultName: 'cache' },
|
|
14
15
|
{ id: 'storage', label: 'Storage', type: 'storage', hint: 'S3-compatible bucket, private by default', defaultName: 'assets' },
|
|
15
16
|
{ id: 'compute', label: 'Empty Service', type: 'compute', hint: 'an app to deploy code to (empty until `insta deploy`)', defaultName: 'compute' },
|
|
16
17
|
];
|