@lead-routing/cli 0.1.7 → 0.1.9
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/index.js +15 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -676,11 +676,20 @@ async function checkRemotePort(ssh, port) {
|
|
|
676
676
|
const { stdout: occupant } = await ssh.execSilent(
|
|
677
677
|
`ss -tlnp 2>/dev/null | grep ':${port} ' | head -1 || echo "unknown process"`
|
|
678
678
|
);
|
|
679
|
+
const occupantStr = occupant.trim();
|
|
680
|
+
if (occupantStr.includes("docker-proxy")) {
|
|
681
|
+
return {
|
|
682
|
+
ok: false,
|
|
683
|
+
warn: true,
|
|
684
|
+
label: `Port ${port} is held by an existing Docker container (docker-proxy).
|
|
685
|
+
Docker Compose will reclaim it when the new stack starts \u2014 continuing.`
|
|
686
|
+
};
|
|
687
|
+
}
|
|
679
688
|
return {
|
|
680
689
|
ok: false,
|
|
681
|
-
// Hard error — Caddy cannot get TLS certs without these ports
|
|
690
|
+
// Hard error — non-Docker process; Caddy cannot get TLS certs without these ports
|
|
682
691
|
label: `Port ${port} is occupied and could not be freed automatically.
|
|
683
|
-
Occupant: ${
|
|
692
|
+
Occupant: ${occupantStr}
|
|
684
693
|
Stop the conflicting process on the server, then re-run:
|
|
685
694
|
lead-routing init`
|
|
686
695
|
};
|
|
@@ -893,9 +902,9 @@ async function seedAdminUser(localDir, localPort, adminEmail, adminPassword) {
|
|
|
893
902
|
const safeEmail = adminEmail.replace(/'/g, "''");
|
|
894
903
|
const safeWebhookSecret = webhookSecret.replace(/'/g, "''");
|
|
895
904
|
const sql = `
|
|
896
|
-
-- Create initial organisation if none exists (self-hosted defaults: PAID plan, unlimited seats
|
|
897
|
-
INSERT INTO organizations (id, "webhookSecret", plan, "seatsPurchased", "
|
|
898
|
-
SELECT gen_random_uuid(), '${safeWebhookSecret}', 'PAID', 9999,
|
|
905
|
+
-- Create initial organisation if none exists (self-hosted defaults: PAID plan, unlimited seats)
|
|
906
|
+
INSERT INTO organizations (id, "webhookSecret", plan, "seatsPurchased", "isActive", "createdAt", "updatedAt")
|
|
907
|
+
SELECT gen_random_uuid(), '${safeWebhookSecret}', 'PAID', 9999, true, NOW(), NOW()
|
|
899
908
|
WHERE NOT EXISTS (SELECT 1 FROM organizations);
|
|
900
909
|
|
|
901
910
|
-- Create admin AppUser under the first org (idempotent)
|
|
@@ -1998,7 +2007,7 @@ async function runSfdcDeploy() {
|
|
|
1998
2007
|
|
|
1999
2008
|
// src/index.ts
|
|
2000
2009
|
var program = new Command();
|
|
2001
|
-
program.name("lead-routing").description("Self-hosted Lead Routing \u2014 scaffold, deploy, and manage your installation").version("0.1.
|
|
2010
|
+
program.name("lead-routing").description("Self-hosted Lead Routing \u2014 scaffold, deploy, and manage your installation").version("0.1.9");
|
|
2002
2011
|
program.command("init").description("Interactive setup wizard \u2014 configure and deploy the full Lead Routing stack").option("--dry-run", "Generate config files without connecting or deploying").option("--resume", "Skip to health check using existing lead-routing.json (post-timeout recovery)").option("--sandbox", "Use Salesforce sandbox (test.salesforce.com) instead of production").option("--ssh-port <port>", "SSH port (default: 22)", parseInt).option("--ssh-user <user>", "SSH username (default: root)").option("--ssh-key <path>", "Path to SSH private key (overrides auto-detection)").option("--remote-dir <path>", "Remote install directory (default: ~/lead-routing)").option("--external-db <url>", "Use external PostgreSQL URL instead of managed Docker container").option("--external-redis <url>", "Use external Redis URL instead of managed Docker container").action((opts) => runInit({
|
|
2003
2012
|
dryRun: opts.dryRun,
|
|
2004
2013
|
resume: opts.resume,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lead-routing/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Self-hosted deployment CLI for Lead Routing",
|
|
5
5
|
"homepage": "https://github.com/lead-routing/lead-routing",
|
|
6
6
|
"keywords": ["salesforce", "lead-routing", "self-hosted", "deployment", "cli"],
|