Cleanup: remove deprecated up alias and update ingress docs

This commit is contained in:
Peter Steinberger
2025-11-25 12:40:56 +01:00
parent 7998f8b6f3
commit dd32638eb4
6 changed files with 12 additions and 54 deletions

View File

@@ -2,7 +2,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
const sendCommand = vi.fn();
const statusCommand = vi.fn();
const upCommand = vi.fn().mockResolvedValue({ server: undefined });
const webhookCommand = vi.fn().mockResolvedValue(undefined);
const ensureTwilioEnv = vi.fn();
const loginWeb = vi.fn();
@@ -24,7 +23,6 @@ const runtime = {
vi.mock("../commands/send.js", () => ({ sendCommand }));
vi.mock("../commands/status.js", () => ({ statusCommand }));
vi.mock("../commands/up.js", () => ({ upCommand }));
vi.mock("../commands/webhook.js", () => ({ webhookCommand }));
vi.mock("../env.js", () => ({ ensureTwilioEnv }));
vi.mock("../runtime.js", () => ({ defaultRuntime: runtime }));

View File

@@ -1,7 +1,6 @@
import { Command } from "commander";
import { sendCommand } from "../commands/send.js";
import { statusCommand } from "../commands/status.js";
import { upCommand } from "../commands/up.js";
import { webhookCommand } from "../commands/webhook.js";
import { ensureTwilioEnv } from "../env.js";
import { danger, info, setVerbose, setYes, warn } from "../globals.js";
@@ -221,44 +220,6 @@ Examples:
}
});
program
.command("up")
.description(
"Alias: webhook --ingress tailscale (Funnel + Twilio callback)",
)
.option("-p, --port <port>", "Port to listen on", "42873")
.option("--path <path>", "Webhook path", "/webhook/whatsapp")
.option("--verbose", "Verbose logging during setup/webhook", false)
.option("-y, --yes", "Auto-confirm prompts when possible", false)
.option(
"--dry-run",
"Print planned actions without touching network",
false,
)
// istanbul ignore next
.action(async (opts) => {
setVerbose(Boolean(opts.verbose));
setYes(Boolean(opts.yes));
const deps = createDefaultDeps();
try {
const { server } = await upCommand(opts, deps, defaultRuntime);
if (!server) {
defaultRuntime.log(info("Up dry-run complete; no server started."));
return;
}
process.on("SIGINT", () => {
server.close(() => {
console.log("\n👋 Webhook stopped");
defaultRuntime.exit(0);
});
});
await deps.waitForever();
} catch (err) {
defaultRuntime.error(String(err));
defaultRuntime.exit(1);
}
});
program
.command("relay:tmux")
.description(