create-authhero 0.46.0 → 0.47.0
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/cloudflare-control-plane/.dev.vars.example +17 -0
- package/dist/cloudflare-control-plane/README.md +59 -0
- package/dist/cloudflare-control-plane/copy-assets.js +132 -0
- package/dist/cloudflare-control-plane/drizzle.config.ts +17 -0
- package/dist/cloudflare-control-plane/scripts/decrypt-field.mjs +33 -0
- package/dist/cloudflare-control-plane/scripts/generate-encryption-key.mjs +7 -0
- package/dist/cloudflare-control-plane/seed-helper.js +113 -0
- package/dist/cloudflare-control-plane/src/app.ts +74 -0
- package/dist/cloudflare-control-plane/src/index.ts +72 -0
- package/dist/cloudflare-control-plane/src/seed.ts +56 -0
- package/dist/cloudflare-control-plane/src/types.ts +14 -0
- package/dist/cloudflare-control-plane/tsconfig.json +14 -0
- package/dist/cloudflare-control-plane/wrangler.toml +46 -0
- package/dist/cloudflare-wfp-tenant/.dev.vars.example +17 -0
- package/dist/cloudflare-wfp-tenant/README.md +62 -0
- package/dist/cloudflare-wfp-tenant/copy-assets.js +132 -0
- package/dist/cloudflare-wfp-tenant/drizzle.config.ts +17 -0
- package/dist/cloudflare-wfp-tenant/scripts/decrypt-field.mjs +33 -0
- package/dist/cloudflare-wfp-tenant/scripts/generate-encryption-key.mjs +7 -0
- package/dist/cloudflare-wfp-tenant/src/app.ts +37 -0
- package/dist/cloudflare-wfp-tenant/src/index.ts +69 -0
- package/dist/cloudflare-wfp-tenant/src/types.ts +16 -0
- package/dist/cloudflare-wfp-tenant/tsconfig.json +14 -0
- package/dist/cloudflare-wfp-tenant/wrangler.toml +46 -0
- package/dist/create-authhero.js +134 -27
- package/package.json +1 -1
package/dist/create-authhero.js
CHANGED
|
@@ -135,6 +135,93 @@ var c = new e(), l = {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
+
"cloudflare-wfp-tenant": {
|
|
139
|
+
name: "Cloudflare Workers for Platforms — Tenant Worker",
|
|
140
|
+
description: "Per-tenant authhero worker (own D1) that inherits control plane defaults via runtime fallback + keyed encryption (deploy into the dispatch namespace; pair with the control-plane template)",
|
|
141
|
+
templateDir: "cloudflare-wfp-tenant",
|
|
142
|
+
packageJson: (e, t, n, r) => {
|
|
143
|
+
let i = r ? "workspace:*" : "latest";
|
|
144
|
+
return {
|
|
145
|
+
name: e,
|
|
146
|
+
version: "1.0.0",
|
|
147
|
+
type: "module",
|
|
148
|
+
scripts: {
|
|
149
|
+
postinstall: "node copy-assets.js",
|
|
150
|
+
"copy-assets": "node copy-assets.js",
|
|
151
|
+
dev: "node copy-assets.js && wrangler dev --port 3002 --local-protocol https",
|
|
152
|
+
"dev:remote": "node copy-assets.js && wrangler dev --port 3002 --local-protocol https --remote --config wrangler.local.toml",
|
|
153
|
+
deploy: "node copy-assets.js && wrangler deploy --config wrangler.local.toml",
|
|
154
|
+
"db:migrate:local": "wrangler d1 migrations apply AUTH_DB --local",
|
|
155
|
+
"db:migrate:remote": "wrangler d1 migrations apply AUTH_DB --remote --config wrangler.local.toml",
|
|
156
|
+
migrate: "wrangler d1 migrations apply AUTH_DB --local",
|
|
157
|
+
setup: "cp wrangler.toml wrangler.local.toml && cp .dev.vars.example .dev.vars && echo '✅ Created wrangler.local.toml and .dev.vars - update with your IDs and CONTROL_PLANE_ENCRYPTION_KEY'",
|
|
158
|
+
"gen:key": "node scripts/generate-encryption-key.mjs",
|
|
159
|
+
decrypt: "node --env-file=.dev.vars scripts/decrypt-field.mjs"
|
|
160
|
+
},
|
|
161
|
+
dependencies: {
|
|
162
|
+
"@authhero/drizzle": i,
|
|
163
|
+
"@authhero/multi-tenancy": i,
|
|
164
|
+
"@authhero/widget": i,
|
|
165
|
+
"@hono/swagger-ui": "^0.5.0",
|
|
166
|
+
"@hono/zod-openapi": "^0.19.0",
|
|
167
|
+
authhero: i,
|
|
168
|
+
"drizzle-orm": "^0.44.0",
|
|
169
|
+
hono: "^4.6.0"
|
|
170
|
+
},
|
|
171
|
+
devDependencies: {
|
|
172
|
+
"@cloudflare/workers-types": "^4.0.0",
|
|
173
|
+
"drizzle-kit": "^0.31.0",
|
|
174
|
+
typescript: "^5.5.0",
|
|
175
|
+
wrangler: "^3.0.0"
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"cloudflare-control-plane": {
|
|
181
|
+
name: "Cloudflare Workers for Platforms — Control Plane",
|
|
182
|
+
description: "Control plane worker: tenant management + rollout source that projects default connections/prompts/branding into each WFP tenant's database (pair with the dispatcher and tenant templates)",
|
|
183
|
+
templateDir: "cloudflare-control-plane",
|
|
184
|
+
packageJson: (e, t, n, r) => {
|
|
185
|
+
let i = r ? "workspace:*" : "latest";
|
|
186
|
+
return {
|
|
187
|
+
name: e,
|
|
188
|
+
version: "1.0.0",
|
|
189
|
+
type: "module",
|
|
190
|
+
scripts: {
|
|
191
|
+
postinstall: "node copy-assets.js",
|
|
192
|
+
"copy-assets": "node copy-assets.js",
|
|
193
|
+
dev: "node copy-assets.js && wrangler dev --port 3000 --local-protocol https",
|
|
194
|
+
"dev:remote": "node copy-assets.js && wrangler dev --port 3000 --local-protocol https --remote --config wrangler.local.toml",
|
|
195
|
+
deploy: "node copy-assets.js && wrangler deploy --config wrangler.local.toml",
|
|
196
|
+
"db:migrate:local": "wrangler d1 migrations apply AUTH_DB --local",
|
|
197
|
+
"db:migrate:remote": "wrangler d1 migrations apply AUTH_DB --remote --config wrangler.local.toml",
|
|
198
|
+
migrate: "wrangler d1 migrations apply AUTH_DB --local",
|
|
199
|
+
"seed:local": "node seed-helper.js",
|
|
200
|
+
"seed:remote": "node seed-helper.js '' '' remote",
|
|
201
|
+
seed: "node seed-helper.js",
|
|
202
|
+
setup: "cp wrangler.toml wrangler.local.toml && cp .dev.vars.example .dev.vars && echo '✅ Created wrangler.local.toml and .dev.vars - update with your IDs and CONTROL_PLANE_ENCRYPTION_KEY'",
|
|
203
|
+
"gen:key": "node scripts/generate-encryption-key.mjs",
|
|
204
|
+
decrypt: "node --env-file=.dev.vars scripts/decrypt-field.mjs"
|
|
205
|
+
},
|
|
206
|
+
dependencies: {
|
|
207
|
+
"@authhero/drizzle": i,
|
|
208
|
+
"@authhero/multi-tenancy": i,
|
|
209
|
+
"@authhero/widget": i,
|
|
210
|
+
"@hono/swagger-ui": "^0.5.0",
|
|
211
|
+
"@hono/zod-openapi": "^0.19.0",
|
|
212
|
+
authhero: i,
|
|
213
|
+
"drizzle-orm": "^0.44.0",
|
|
214
|
+
hono: "^4.6.0"
|
|
215
|
+
},
|
|
216
|
+
devDependencies: {
|
|
217
|
+
"@cloudflare/workers-types": "^4.0.0",
|
|
218
|
+
"drizzle-kit": "^0.31.0",
|
|
219
|
+
typescript: "^5.5.0",
|
|
220
|
+
wrangler: "^3.0.0"
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
},
|
|
138
225
|
proxy: {
|
|
139
226
|
name: "Proxy (Cloudflare Workers)",
|
|
140
227
|
description: "Host-based reverse proxy on Cloudflare Workers — static config, no DB",
|
|
@@ -846,9 +933,15 @@ function w() {
|
|
|
846
933
|
console.log("\n" + "─".repeat(50)), console.log("🛰️ WFP dispatcher running at https://localhost:3001"), console.log("📦 Pair with the `cloudflare` template to deploy tenant workers:"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth"), console.log("📖 See README.md for the full onboarding workflow"), console.log("─".repeat(50) + "\n");
|
|
847
934
|
}
|
|
848
935
|
function T() {
|
|
849
|
-
console.log("\n" + "─".repeat(50)), console.log("
|
|
936
|
+
console.log("\n" + "─".repeat(50)), console.log("🏠 WFP tenant worker running at https://localhost:3002"), console.log("🔑 Set CONTROL_PLANE_ENCRYPTION_KEY in .dev.vars to match the"), console.log(" control plane, then run the control plane's sync-defaults."), console.log("📦 Deploy into the namespace:"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth"), console.log("─".repeat(50) + "\n");
|
|
850
937
|
}
|
|
851
938
|
function E() {
|
|
939
|
+
console.log("\n" + "─".repeat(50)), console.log("🛰️ Control plane running at https://localhost:3000"), console.log("🚀 Open https://localhost:3000/setup to complete initial setup"), console.log("🔁 Project defaults into a tenant: POST /internal/tenants/:id/sync-defaults"), console.log(" (wire buildTenantAdapters() in src/index.ts and protect the route first)"), console.log("─".repeat(50) + "\n");
|
|
940
|
+
}
|
|
941
|
+
function D() {
|
|
942
|
+
console.log("\n" + "─".repeat(50)), console.log("🛰️ AuthHero proxy running at http://localhost:8787"), console.log("✏️ Edit src/proxy.config.ts to add hosts and routes"), console.log("📖 See README.md for deployment instructions"), console.log("─".repeat(50) + "\n");
|
|
943
|
+
}
|
|
944
|
+
function O() {
|
|
852
945
|
console.log("\n" + "─".repeat(50)), console.log("✅ Self-signed certificates generated with openssl"), console.log("⚠️ You may need to trust the certificate in your browser"), console.log("🔐 AuthHero server running at http://localhost:3000"), console.log("📚 API documentation available at http://localhost:3000/docs"), console.log("🚀 Open http://localhost:3000/setup to complete initial setup"), console.log("─".repeat(50) + "\n");
|
|
853
946
|
}
|
|
854
947
|
c.version("1.0.0").description("Create a new AuthHero project").argument("[project-name]", "name of the project").option("-t, --template <type>", "template type: local, cloudflare, aws-sst, or proxy").option("--package-manager <pm>", "package manager to use: npm, yarn, pnpm, or bun").option("--multi-tenant", "enable multi-tenant mode").option("--admin-ui", "include admin UI at /admin").option("--skip-install", "skip installing dependencies").option("--skip-migrate", "skip running database migrations").option("--skip-start", "skip starting the development server").option("--github-ci", "include GitHub CI workflows with semantic versioning").option("--conformance", "add OpenID conformance suite test clients").option("--conformance-alias <alias>", "alias for conformance suite (default: authhero-local)").option("--workspace", "use workspace:* dependencies for local monorepo development").option("-y, --yes", "skip all prompts and use defaults/provided options").action(async (e, i) => {
|
|
@@ -869,9 +962,11 @@ c.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
869
962
|
"local",
|
|
870
963
|
"cloudflare",
|
|
871
964
|
"cloudflare-wfp-dispatcher",
|
|
965
|
+
"cloudflare-wfp-tenant",
|
|
966
|
+
"cloudflare-control-plane",
|
|
872
967
|
"aws-sst",
|
|
873
968
|
"proxy"
|
|
874
|
-
].includes(i.template) || (console.error(`❌ Invalid template: ${i.template}`), console.error("Valid options: local, cloudflare, cloudflare-wfp-dispatcher, aws-sst, proxy"), process.exit(1)), m = i.template, console.log(`Using template: ${l[m].name}`)) : m = (await t.prompt([{
|
|
969
|
+
].includes(i.template) || (console.error(`❌ Invalid template: ${i.template}`), console.error("Valid options: local, cloudflare, cloudflare-wfp-dispatcher, cloudflare-wfp-tenant, cloudflare-control-plane, aws-sst, proxy"), process.exit(1)), m = i.template, console.log(`Using template: ${l[m].name}`)) : m = (await t.prompt([{
|
|
875
970
|
type: "list",
|
|
876
971
|
name: "setupType",
|
|
877
972
|
message: "Select your setup type:",
|
|
@@ -891,6 +986,16 @@ c.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
891
986
|
value: "cloudflare-wfp-dispatcher",
|
|
892
987
|
short: l["cloudflare-wfp-dispatcher"].name
|
|
893
988
|
},
|
|
989
|
+
{
|
|
990
|
+
name: `${l["cloudflare-control-plane"].name}\n ${l["cloudflare-control-plane"].description}`,
|
|
991
|
+
value: "cloudflare-control-plane",
|
|
992
|
+
short: l["cloudflare-control-plane"].name
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: `${l["cloudflare-wfp-tenant"].name}\n ${l["cloudflare-wfp-tenant"].description}`,
|
|
996
|
+
value: "cloudflare-wfp-tenant",
|
|
997
|
+
short: l["cloudflare-wfp-tenant"].name
|
|
998
|
+
},
|
|
894
999
|
{
|
|
895
1000
|
name: `${l["aws-sst"].name}\n ${l["aws-sst"].description}`,
|
|
896
1001
|
value: "aws-sst",
|
|
@@ -904,7 +1009,7 @@ c.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
904
1009
|
]
|
|
905
1010
|
}])).setupType;
|
|
906
1011
|
let h;
|
|
907
|
-
h = m === "proxy" || m === "cloudflare-wfp-dispatcher" ? !1 : i.multiTenant === void 0 ? o ? !1 : (await t.prompt([{
|
|
1012
|
+
h = m === "cloudflare-control-plane" ? !0 : m === "proxy" || m === "cloudflare-wfp-dispatcher" || m === "cloudflare-wfp-tenant" ? !1 : i.multiTenant === void 0 ? o ? !1 : (await t.prompt([{
|
|
908
1013
|
type: "confirm",
|
|
909
1014
|
name: "multiTenant",
|
|
910
1015
|
message: "Would you like to enable multi-tenant mode?",
|
|
@@ -917,28 +1022,30 @@ c.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
917
1022
|
message: "Would you like to include the admin UI at /admin?",
|
|
918
1023
|
default: !0
|
|
919
1024
|
}])).adminUi : i.adminUi, g && console.log("Admin UI: enabled (available at /admin)"));
|
|
920
|
-
let
|
|
921
|
-
|
|
922
|
-
let
|
|
923
|
-
|
|
924
|
-
let
|
|
925
|
-
n.mkdirSync(p, { recursive: !0 }), n.writeFileSync(r.join(p, "package.json"), JSON.stringify(
|
|
926
|
-
let
|
|
927
|
-
|
|
1025
|
+
let k = i.conformance || !1, A = i.conformanceAlias || "authhero-local";
|
|
1026
|
+
k && console.log(`OpenID Conformance Suite: enabled (alias: ${A})`);
|
|
1027
|
+
let j = i.workspace || !1;
|
|
1028
|
+
j && console.log("Workspace mode: enabled (using workspace:* dependencies)");
|
|
1029
|
+
let M = l[m];
|
|
1030
|
+
n.mkdirSync(p, { recursive: !0 }), n.writeFileSync(r.join(p, "package.json"), JSON.stringify(M.packageJson(c, h, k, j, g), null, 2));
|
|
1031
|
+
let N = M.templateDir, P = r.dirname(a(import.meta.url)), F = [r.join(P, N), r.join(P, "..", "templates", N)], I = F.find((e) => n.existsSync(e));
|
|
1032
|
+
I ? u(I, p) : (console.error(`❌ Template directory not found. Looked in:\n ${F.join("\n ")}`), process.exit(1)), m === "cloudflare" && S(p, h, g);
|
|
1033
|
+
let L = m === "cloudflare" || m === "cloudflare-wfp-dispatcher" || m === "cloudflare-wfp-tenant" || m === "cloudflare-control-plane", R = m === "cloudflare" || m === "cloudflare-wfp-tenant" || m === "cloudflare-control-plane", z = m === "cloudflare-wfp-tenant" || m === "cloudflare-control-plane";
|
|
1034
|
+
if (L) {
|
|
928
1035
|
let e = r.join(p, "wrangler.toml"), t = r.join(p, "wrangler.local.toml");
|
|
929
|
-
if (n.existsSync(e) && !n.existsSync(t) && n.copyFileSync(e, t),
|
|
1036
|
+
if (n.existsSync(e) && !n.existsSync(t) && n.copyFileSync(e, t), R) {
|
|
930
1037
|
let e = r.join(p, ".dev.vars.example"), t = r.join(p, ".dev.vars");
|
|
931
|
-
n.existsSync(e) && (n.copyFileSync(e, t), n.appendFileSync(t, `\n# Generated at-rest encryption key (local dev). Use a separate secret in production.\nENCRYPTION_KEY=${s()}\n`), console.log("🔒 Added a generated ENCRYPTION_KEY to .dev.vars")), console.log("📁 Created wrangler.local.toml and .dev.vars for local development");
|
|
1038
|
+
n.existsSync(e) && (n.copyFileSync(e, t), n.appendFileSync(t, `\n# Generated at-rest encryption key (local dev). Use a separate secret in production.\nENCRYPTION_KEY=${s()}\n`), z ? (n.appendFileSync(t, `# Shared control-plane key id "cp". Must be byte-identical across the control plane and every tenant worker.\nCONTROL_PLANE_ENCRYPTION_KEY=${s()}\n`), console.log("🔒 Added generated ENCRYPTION_KEY + CONTROL_PLANE_ENCRYPTION_KEY to .dev.vars"), console.log("⚠️ Align CONTROL_PLANE_ENCRYPTION_KEY across the control plane and all tenant workers.")) : console.log("🔒 Added a generated ENCRYPTION_KEY to .dev.vars")), console.log("📁 Created wrangler.local.toml and .dev.vars for local development");
|
|
932
1039
|
} else console.log("📁 Created wrangler.local.toml for local development");
|
|
933
1040
|
}
|
|
934
|
-
let
|
|
935
|
-
if (m === "cloudflare" && (i.githubCi === void 0 ? o || (
|
|
1041
|
+
let B = !1;
|
|
1042
|
+
if (m === "cloudflare" && (i.githubCi === void 0 ? o || (B = (await t.prompt([{
|
|
936
1043
|
type: "confirm",
|
|
937
1044
|
name: "includeGithubCi",
|
|
938
1045
|
message: "Would you like to include GitHub CI with semantic versioning?",
|
|
939
1046
|
default: !1
|
|
940
|
-
}])).includeGithubCi) : (
|
|
941
|
-
let e = d(h,
|
|
1047
|
+
}])).includeGithubCi) : (B = i.githubCi, B && console.log("Including GitHub CI workflows with semantic versioning")), B && (y(p), b(p))), m === "local") {
|
|
1048
|
+
let e = d(h, k, A, g);
|
|
942
1049
|
n.writeFileSync(r.join(p, "src/seed.ts"), e);
|
|
943
1050
|
let t = f(h, g);
|
|
944
1051
|
n.writeFileSync(r.join(p, "src/app.ts"), t);
|
|
@@ -949,9 +1056,9 @@ ENCRYPTION_KEY=${s()}
|
|
|
949
1056
|
`;
|
|
950
1057
|
n.writeFileSync(r.join(p, ".env"), i), console.log("🔒 Generated .env with an at-rest encryption key");
|
|
951
1058
|
}
|
|
952
|
-
if (m === "aws-sst" && _(p, h),
|
|
1059
|
+
if (m === "aws-sst" && _(p, h), k) {
|
|
953
1060
|
let e = {
|
|
954
|
-
alias:
|
|
1061
|
+
alias: A,
|
|
955
1062
|
description: "AuthHero Conformance Test",
|
|
956
1063
|
server: { discoveryUrl: "http://host.docker.internal:3000/.well-known/openid-configuration" },
|
|
957
1064
|
client: {
|
|
@@ -966,15 +1073,15 @@ ENCRYPTION_KEY=${s()}
|
|
|
966
1073
|
};
|
|
967
1074
|
n.writeFileSync(r.join(p, "conformance-config.json"), JSON.stringify(e, null, 2)), console.log("📝 Created conformance-config.json for OpenID Conformance Suite");
|
|
968
1075
|
}
|
|
969
|
-
let
|
|
970
|
-
console.log(`\n✅ Project "${c}" has been created with ${
|
|
971
|
-
let
|
|
972
|
-
if (
|
|
1076
|
+
let V = h ? "multi-tenant" : "single-tenant";
|
|
1077
|
+
console.log(`\n✅ Project "${c}" has been created with ${M.name} (${V}) setup!\n`);
|
|
1078
|
+
let H;
|
|
1079
|
+
if (H = i.skipInstall ? !1 : o ? !0 : (await t.prompt([{
|
|
973
1080
|
type: "confirm",
|
|
974
1081
|
name: "shouldInstall",
|
|
975
1082
|
message: "Would you like to install dependencies now?",
|
|
976
1083
|
default: !0
|
|
977
|
-
}])).shouldInstall,
|
|
1084
|
+
}])).shouldInstall, H) {
|
|
978
1085
|
let e;
|
|
979
1086
|
i.packageManager ? ([
|
|
980
1087
|
"npm",
|
|
@@ -1006,7 +1113,7 @@ ENCRYPTION_KEY=${s()}
|
|
|
1006
1113
|
default: "pnpm"
|
|
1007
1114
|
}])).packageManager, console.log(`\n📦 Installing dependencies with ${e}...\n`);
|
|
1008
1115
|
try {
|
|
1009
|
-
if (await x(e === "pnpm" ? "pnpm install --ignore-workspace" : `${e} install`, p), m === "local" && (console.log("\n🔧 Building native modules...\n"), await x("npm rebuild better-sqlite3", p)), console.log("\n✅ Dependencies installed successfully!\n"), (m === "local" || m === "cloudflare") && !i.skipMigrate) {
|
|
1116
|
+
if (await x(e === "pnpm" ? "pnpm install --ignore-workspace" : `${e} install`, p), m === "local" && (console.log("\n🔧 Building native modules...\n"), await x("npm rebuild better-sqlite3", p)), console.log("\n✅ Dependencies installed successfully!\n"), (m === "local" || m === "cloudflare" || m === "cloudflare-wfp-tenant" || m === "cloudflare-control-plane") && !i.skipMigrate) {
|
|
1010
1117
|
let n;
|
|
1011
1118
|
n = o ? !0 : (await t.prompt([{
|
|
1012
1119
|
type: "confirm",
|
|
@@ -1021,11 +1128,11 @@ ENCRYPTION_KEY=${s()}
|
|
|
1021
1128
|
name: "shouldStart",
|
|
1022
1129
|
message: "Would you like to start the development server?",
|
|
1023
1130
|
default: !0
|
|
1024
|
-
}])).shouldStart, n && (m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "aws-sst" ? v() : m === "proxy" ?
|
|
1131
|
+
}])).shouldStart, n && (m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O(), console.log("🚀 Starting development server...\n"), await x(`${e} run dev`, p)), o && !n && (console.log("\n✅ Setup complete!"), console.log("\nTo start the development server:"), console.log(` cd ${c}`), console.log(" npm run dev"), m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O());
|
|
1025
1132
|
} catch (e) {
|
|
1026
1133
|
console.error("\n❌ An error occurred:", e), process.exit(1);
|
|
1027
1134
|
}
|
|
1028
1135
|
}
|
|
1029
|
-
|
|
1136
|
+
H || (console.log("Next steps:"), console.log(` cd ${c}`), m === "local" ? (console.log(" npm install"), console.log(" npm run migrate"), console.log(" npm run dev"), console.log("\nOpen http://localhost:3000/setup to complete initial setup")) : m === "cloudflare" ? (console.log(" npm install"), console.log(" npm run migrate # or npm run db:migrate:remote for production"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nOpen https://localhost:3000/setup to complete initial setup")) : m === "cloudflare-wfp-dispatcher" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml — paste your database_id"), console.log(" npx wrangler dispatch-namespace create authhero-tenants"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nDeploy tenant workers separately (`cloudflare` template):"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth")) : m === "cloudflare-control-plane" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml + .dev.vars"), console.log(" # set CONTROL_PLANE_ENCRYPTION_KEY in .dev.vars (share it with every tenant worker)"), console.log(" npm run migrate"), console.log(" npm run seed"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nWire buildTenantAdapters() in src/index.ts, then project defaults:"), console.log(" POST /internal/tenants/:id/sync-defaults")) : m === "cloudflare-wfp-tenant" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml + .dev.vars"), console.log(" # set CONTROL_PLANE_ENCRYPTION_KEY in .dev.vars (must match the control plane)"), console.log(" npm run migrate"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nDeploy into the dispatch namespace:"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth")) : m === "aws-sst" ? (console.log(" npm install"), console.log(" npm run dev # Deploys to AWS in development mode"), console.log("\nOpen your server URL /setup to complete initial setup")) : m === "proxy" && (console.log(" npm install"), console.log(" npm run dev"), console.log("\nEdit src/proxy.config.ts to add hosts and routes")), console.log(`\nServer will be available at: http://localhost:${m === "proxy" ? 8787 : m === "cloudflare-wfp-dispatcher" ? 3001 : m === "cloudflare-wfp-tenant" ? 3002 : 3e3}`), k && (console.log("\n🧪 OpenID Conformance Suite Testing:"), console.log(" 1. Clone and start the conformance suite (if not already running):"), console.log(" git clone https://gitlab.com/openid/conformance-suite.git"), console.log(" cd conformance-suite && mvn clean package"), console.log(" docker-compose up -d"), console.log(" 2. Open https://localhost.emobix.co.uk:8443"), console.log(" 3. Create a test plan and use conformance-config.json for settings"), console.log(` 4. Use alias: ${A}`)), console.log("\nFor more information, visit: https://authhero.net/docs\n"));
|
|
1030
1137
|
}), c.parse(process.argv);
|
|
1031
1138
|
//#endregion
|