From cef7abaea1360b03071f7dbc38862e02da44fb77 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 17 Oct 2026 21:35:38 +0000 Subject: [PATCH] pit promo configure takes --config (the CLI keeps --json for output); nginx body limit 1m for campaign snapshot imports Co-Authored-By: Claude Opus 5.5 --- bin/install.conf | 2 +- src/promotion-cli.ts | 6 +++--- test/promotion.test.ts | 13 +++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/install.conf b/bin/install.conf index 189f052..0df40d1 100644 --- a/bin/install.conf +++ b/bin/install.conf @@ -11,5 +11,5 @@ HEALTH_PATH=/health DOMAINS=pit.world www.pit.world TLS=1 TLS_EMAIL=anthony@profullstack.com -MAX_BODY=64k +MAX_BODY=1m ACCESS_LOG=off diff --git a/src/promotion-cli.ts b/src/promotion-cli.ts index 4baa452..3a7b4af 100644 --- a/src/promotion-cli.ts +++ b/src/promotion-cli.ts @@ -11,7 +11,7 @@ export const PROMO_HELP = `pit promo: promotion campaigns (operators; needs PIT_ pit promo campaigns every campaign pit promo create --source-ref cmp_... --name N --slug S --title T [--intro TEXT] pit promo show ID overview: members, holds, posts, windows, reports - pit promo configure ID --json '{"spotlightAccounts":[...]}' + pit promo configure ID --config '{"spotlightAccounts":[...]}' (or --config @FILE.json) pit promo import ID SNAPSHOT.json [--dry-run] a complete OutreachGraph snapshot (scripts/outreachgraph-campaign-export.sh) @@ -98,8 +98,8 @@ export async function promoMain(args: string[], out: Out, client: PitClient, jso }) } case 'configure': { - need(id && f.json, `configure ID --json '{...}'`) - return show(await client.promo('PATCH', `/campaigns/${e(id)}`, { config: JSON.parse(f.json!) })) + need(id && f.config, `configure ID --config '{...}' | --config @FILE.json`) + return show(await client.promo('PATCH', `/campaigns/${e(id)}`, { config: JSON.parse(f.config!.startsWith('@') ? readFileSync(f.config!.slice(1), 'utf8') : f.config!) })) } case 'import': { need(id && rest[1], 'import ID SNAPSHOT.json [--dry-run]') diff --git a/test/promotion.test.ts b/test/promotion.test.ts index e177dc5..13a9b90 100644 --- a/test/promotion.test.ts +++ b/test/promotion.test.ts @@ -539,6 +539,19 @@ describe('promotion: the verifier is not a visitor', () => { }) }) +describe('promotion: the CLI', () => { + it('passes configure --config through the top-level argument handling (which takes --json for itself)', async () => { + const { main } = await import('../src/cli.ts') + const h = setup() + process.env.PIT_ADMIN_TOKEN = 'admintoken' + const client = new PitClient('https://pit.world', (async (input: any, init: any) => h.app.request(String(input).replace('https://pit.world', ''), init, { ip: '127.0.0.1' })) as any) + const lines: string[] = [] + const out = { log: (t: string) => lines.push(t), error: (t: string) => lines.push(`ERR ${t}`) } + expect(await main(['promo', 'configure', h.campaign, '--config', '{"perAccountPerDay":3}'], out, client)).toBe(0) + expect(h.promo.campaign(h.campaign).config.perAccountPerDay).toBe(3) + }) +}) + afterAll(() => { delete process.env.PIT_ADMIN_TOKEN })