create-authhero 0.32.0 โ 0.33.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/create-authhero.js +108 -144
- package/package.json +1 -1
package/dist/create-authhero.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command as
|
|
3
|
-
import
|
|
2
|
+
import { Command as I } from "commander";
|
|
3
|
+
import m from "inquirer";
|
|
4
4
|
import a from "fs";
|
|
5
5
|
import l from "path";
|
|
6
|
-
import { spawn as
|
|
7
|
-
const T = new
|
|
6
|
+
import { spawn as E } from "child_process";
|
|
7
|
+
const T = new I(), p = {
|
|
8
8
|
local: {
|
|
9
9
|
name: "Local (SQLite)",
|
|
10
10
|
description: "Local development setup with SQLite database - great for getting started",
|
|
@@ -133,27 +133,27 @@ const T = new R(), p = {
|
|
|
133
133
|
seedFile: "seed.ts"
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
function
|
|
136
|
+
function N(o, e) {
|
|
137
137
|
a.readdirSync(o).forEach((n) => {
|
|
138
138
|
const t = l.join(o, n), s = l.join(e, n);
|
|
139
|
-
a.lstatSync(t).isDirectory() ? (a.mkdirSync(s, { recursive: !0 }),
|
|
139
|
+
a.lstatSync(t).isDirectory() ? (a.mkdirSync(s, { recursive: !0 }), N(t, s)) : a.copyFileSync(t, s);
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function P(o, e = !1, r = "authhero-local") {
|
|
143
143
|
const n = o ? "control_plane" : "main", t = o ? "Control Plane" : "Main", s = [
|
|
144
144
|
"https://manage.authhero.net/auth-callback",
|
|
145
145
|
"https://local.authhero.net/auth-callback",
|
|
146
146
|
"http://localhost:5173/auth-callback",
|
|
147
147
|
"https://localhost:3000/auth-callback"
|
|
148
|
-
],
|
|
148
|
+
], i = e ? [
|
|
149
149
|
`https://localhost.emobix.co.uk:8443/test/a/${r}/callback`,
|
|
150
150
|
`https://localhost:8443/test/a/${r}/callback`
|
|
151
|
-
] : [], g = [...s, ...
|
|
151
|
+
] : [], g = [...s, ...i], f = [
|
|
152
152
|
"https://manage.authhero.net",
|
|
153
153
|
"https://local.authhero.net",
|
|
154
154
|
"http://localhost:5173",
|
|
155
155
|
"https://localhost:3000"
|
|
156
|
-
],
|
|
156
|
+
], v = e ? ["https://localhost:8443/", "https://localhost.emobix.co.uk:8443/"] : [], w = [...f, ...v], A = e ? `
|
|
157
157
|
// Create OpenID Conformance Suite test clients and user
|
|
158
158
|
console.log("Creating conformance test clients and user...");
|
|
159
159
|
|
|
@@ -280,16 +280,16 @@ async function main() {
|
|
|
280
280
|
tenantName: "${t}",
|
|
281
281
|
isControlPlane: ${o},
|
|
282
282
|
callbacks: ${JSON.stringify(g)},
|
|
283
|
-
allowedLogoutUrls: ${JSON.stringify(
|
|
283
|
+
allowedLogoutUrls: ${JSON.stringify(w)},
|
|
284
284
|
});
|
|
285
|
-
${
|
|
285
|
+
${A}
|
|
286
286
|
await db.destroy();
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
main().catch(console.error);
|
|
290
290
|
`;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function R(o) {
|
|
293
293
|
return o ? `import { Context } from "hono";
|
|
294
294
|
import { swaggerUI } from "@hono/swagger-ui";
|
|
295
295
|
import { AuthHeroConfig, DataAdapters } from "authhero";
|
|
@@ -393,7 +393,7 @@ export default function createApp(config: AuthHeroConfig) {
|
|
|
393
393
|
}
|
|
394
394
|
`;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function O(o) {
|
|
397
397
|
return `import { D1Dialect } from "kysely-d1";
|
|
398
398
|
import { Kysely } from "kysely";
|
|
399
399
|
import createAdapters from "@authhero/kysely-adapter";
|
|
@@ -453,7 +453,7 @@ export default {
|
|
|
453
453
|
};
|
|
454
454
|
`;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function U(o) {
|
|
457
457
|
return o ? `import { Context } from "hono";
|
|
458
458
|
import { swaggerUI } from "@hono/swagger-ui";
|
|
459
459
|
import { AuthHeroConfig, DataAdapters } from "authhero";
|
|
@@ -533,7 +533,7 @@ export default function createApp(config: AuthHeroConfig) {
|
|
|
533
533
|
}
|
|
534
534
|
`;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function j(o) {
|
|
537
537
|
return o ? `import { Context } from "hono";
|
|
538
538
|
import { swaggerUI } from "@hono/swagger-ui";
|
|
539
539
|
import { AuthHeroConfig, DataAdapters } from "authhero";
|
|
@@ -639,7 +639,7 @@ export default function createApp(config: AppConfig) {
|
|
|
639
639
|
}
|
|
640
640
|
`;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function L(o) {
|
|
643
643
|
return `import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
644
644
|
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
645
645
|
import createAdapters from "@authhero/aws";
|
|
@@ -679,20 +679,22 @@ async function main() {
|
|
|
679
679
|
main().catch(console.error);
|
|
680
680
|
`;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function $(o, e) {
|
|
683
683
|
const r = l.join(o, "src");
|
|
684
684
|
a.writeFileSync(
|
|
685
685
|
l.join(r, "app.ts"),
|
|
686
|
-
|
|
686
|
+
j(e)
|
|
687
687
|
), a.writeFileSync(
|
|
688
688
|
l.join(r, "seed.ts"),
|
|
689
|
-
|
|
689
|
+
L(e)
|
|
690
690
|
);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
693
|
-
console.log("\\n" + "โ".repeat(50)), console.log("๐ AuthHero deployed to AWS!"), console.log("๐ Check SST output for your API URL"), console.log(
|
|
692
|
+
function k() {
|
|
693
|
+
console.log("\\n" + "โ".repeat(50)), console.log("๐ AuthHero deployed to AWS!"), console.log("๐ Check SST output for your API URL"), console.log(
|
|
694
|
+
"๐ Open your server URL /setup to complete initial setup"
|
|
695
|
+
), console.log("๐ Portal available at https://local.authhero.net"), console.log("โ".repeat(50) + "\\n");
|
|
694
696
|
}
|
|
695
|
-
function
|
|
697
|
+
function H(o) {
|
|
696
698
|
const e = l.join(o, ".github", "workflows");
|
|
697
699
|
a.mkdirSync(e, { recursive: !0 });
|
|
698
700
|
const r = `name: Unit tests
|
|
@@ -783,7 +785,7 @@ jobs:
|
|
|
783
785
|
`;
|
|
784
786
|
a.writeFileSync(l.join(e, "unit-tests.yml"), r), a.writeFileSync(l.join(e, "deploy-dev.yml"), n), a.writeFileSync(l.join(e, "release.yml"), t), console.log("\\n๐ฆ GitHub CI workflows created!");
|
|
785
787
|
}
|
|
786
|
-
function
|
|
788
|
+
function M(o) {
|
|
787
789
|
const e = {
|
|
788
790
|
branches: ["main"],
|
|
789
791
|
plugins: [
|
|
@@ -806,9 +808,9 @@ function W(o) {
|
|
|
806
808
|
"type-check": "tsc --noEmit"
|
|
807
809
|
}, a.writeFileSync(r, JSON.stringify(n, null, 2));
|
|
808
810
|
}
|
|
809
|
-
function
|
|
811
|
+
function S(o, e) {
|
|
810
812
|
return new Promise((r, n) => {
|
|
811
|
-
const t =
|
|
813
|
+
const t = E(o, [], {
|
|
812
814
|
cwd: e,
|
|
813
815
|
shell: !0,
|
|
814
816
|
stdio: "inherit"
|
|
@@ -818,43 +820,34 @@ function A(o, e) {
|
|
|
818
820
|
}), t.on("error", n);
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
|
-
function
|
|
822
|
-
return new Promise((n, t) => {
|
|
823
|
-
const s = I(o, [], {
|
|
824
|
-
cwd: e,
|
|
825
|
-
shell: !0,
|
|
826
|
-
stdio: "inherit",
|
|
827
|
-
env: { ...process.env, ...r }
|
|
828
|
-
});
|
|
829
|
-
s.on("close", (c) => {
|
|
830
|
-
c === 0 ? n() : t(new Error(`Command failed with exit code ${c}`));
|
|
831
|
-
}), s.on("error", t);
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
function q(o, e) {
|
|
823
|
+
function F(o, e) {
|
|
835
824
|
const r = l.join(o, "src");
|
|
836
825
|
a.writeFileSync(
|
|
837
826
|
l.join(r, "app.ts"),
|
|
838
|
-
|
|
827
|
+
U(e)
|
|
839
828
|
), a.writeFileSync(
|
|
840
829
|
l.join(r, "seed.ts"),
|
|
841
|
-
|
|
830
|
+
O(e)
|
|
842
831
|
);
|
|
843
832
|
}
|
|
844
|
-
function x(
|
|
833
|
+
function x() {
|
|
845
834
|
console.log(`
|
|
846
|
-
` + "โ".repeat(50)), console.log("๐ AuthHero server running at https://localhost:3000"), console.log("๐ API documentation available at https://localhost:3000/docs"), console.log(
|
|
835
|
+
` + "โ".repeat(50)), console.log("๐ AuthHero server running at https://localhost:3000"), console.log("๐ API documentation available at https://localhost:3000/docs"), console.log(
|
|
836
|
+
"๐ Open https://localhost:3000/setup to complete initial setup"
|
|
837
|
+
), console.log("๐ Portal available at https://local.authhero.net"), console.log("โ".repeat(50) + `
|
|
847
838
|
`);
|
|
848
839
|
}
|
|
849
|
-
function
|
|
840
|
+
function D() {
|
|
850
841
|
console.log(`
|
|
851
|
-
` + "โ".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 https://localhost:3000"), console.log("๐ API documentation available at https://localhost:3000/docs"), console.log(
|
|
842
|
+
` + "โ".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 https://localhost:3000"), console.log("๐ API documentation available at https://localhost:3000/docs"), console.log(
|
|
843
|
+
"๐ Open https://localhost:3000/setup to complete initial setup"
|
|
844
|
+
), console.log("๐ Portal available at https://local.authhero.net"), console.log("โ".repeat(50) + `
|
|
852
845
|
`);
|
|
853
846
|
}
|
|
854
|
-
T.version("1.0.0").description("Create a new AuthHero project").argument("[project-name]", "name of the project").option("-t, --template <type>", "template type: local or cloudflare").option(
|
|
847
|
+
T.version("1.0.0").description("Create a new AuthHero project").argument("[project-name]", "name of the project").option("-t, --template <type>", "template type: local or cloudflare").option(
|
|
855
848
|
"--package-manager <pm>",
|
|
856
849
|
"package manager to use: npm, yarn, pnpm, or bun"
|
|
857
|
-
).option("--multi-tenant", "enable multi-tenant mode").option("--skip-install", "skip installing dependencies").option("--skip-migrate", "skip running database migrations").option("--skip-
|
|
850
|
+
).option("--multi-tenant", "enable multi-tenant mode").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(
|
|
858
851
|
"--conformance-alias <alias>",
|
|
859
852
|
"alias for conformance suite (default: authhero-local)"
|
|
860
853
|
).option(
|
|
@@ -866,19 +859,19 @@ T.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
866
859
|
๐ Welcome to AuthHero!
|
|
867
860
|
`);
|
|
868
861
|
let n = o;
|
|
869
|
-
n || (r ? (n = "auth-server", console.log(`Using default project name: ${n}`)) : n = (await
|
|
862
|
+
n || (r ? (n = "auth-server", console.log(`Using default project name: ${n}`)) : n = (await m.prompt([
|
|
870
863
|
{
|
|
871
864
|
type: "input",
|
|
872
865
|
name: "projectName",
|
|
873
866
|
message: "Project name:",
|
|
874
867
|
default: "auth-server",
|
|
875
|
-
validate: (
|
|
868
|
+
validate: (u) => u !== "" || "Project name cannot be empty"
|
|
876
869
|
}
|
|
877
870
|
])).projectName);
|
|
878
871
|
const t = l.join(process.cwd(), n);
|
|
879
872
|
a.existsSync(t) && (console.error(`โ Project "${n}" already exists.`), process.exit(1));
|
|
880
873
|
let s;
|
|
881
|
-
e.template ? (["local", "cloudflare", "aws-sst"].includes(e.template) || (console.error(`โ Invalid template: ${e.template}`), console.error("Valid options: local, cloudflare, aws-sst"), process.exit(1)), s = e.template, console.log(`Using template: ${p[s].name}`)) : s = (await
|
|
874
|
+
e.template ? (["local", "cloudflare", "aws-sst"].includes(e.template) || (console.error(`โ Invalid template: ${e.template}`), console.error("Valid options: local, cloudflare, aws-sst"), process.exit(1)), s = e.template, console.log(`Using template: ${p[s].name}`)) : s = (await m.prompt([
|
|
882
875
|
{
|
|
883
876
|
type: "list",
|
|
884
877
|
name: "setupType",
|
|
@@ -905,8 +898,8 @@ T.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
905
898
|
]
|
|
906
899
|
}
|
|
907
900
|
])).setupType;
|
|
908
|
-
let
|
|
909
|
-
e.multiTenant !== void 0 ? (
|
|
901
|
+
let i;
|
|
902
|
+
e.multiTenant !== void 0 ? (i = e.multiTenant, console.log(`Multi-tenant mode: ${i ? "enabled" : "disabled"}`)) : r ? i = !1 : i = (await m.prompt([
|
|
910
903
|
{
|
|
911
904
|
type: "confirm",
|
|
912
905
|
name: "multiTenant",
|
|
@@ -915,54 +908,54 @@ T.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
915
908
|
default: !1
|
|
916
909
|
}
|
|
917
910
|
])).multiTenant;
|
|
918
|
-
const g = e.conformance || !1,
|
|
911
|
+
const g = e.conformance || !1, f = e.conformanceAlias || "authhero-local";
|
|
919
912
|
g && console.log(
|
|
920
|
-
`OpenID Conformance Suite: enabled (alias: ${
|
|
913
|
+
`OpenID Conformance Suite: enabled (alias: ${f})`
|
|
921
914
|
);
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
const
|
|
915
|
+
const v = e.workspace || !1;
|
|
916
|
+
v && console.log("Workspace mode: enabled (using workspace:* dependencies)");
|
|
917
|
+
const w = p[s];
|
|
925
918
|
a.mkdirSync(t, { recursive: !0 }), a.writeFileSync(
|
|
926
919
|
l.join(t, "package.json"),
|
|
927
920
|
JSON.stringify(
|
|
928
|
-
|
|
921
|
+
w.packageJson(n, i, g, v),
|
|
929
922
|
null,
|
|
930
923
|
2
|
|
931
924
|
)
|
|
932
925
|
);
|
|
933
|
-
const
|
|
926
|
+
const A = w.templateDir, b = l.join(
|
|
934
927
|
import.meta.url.replace("file://", "").replace("/create-authhero.js", ""),
|
|
935
|
-
|
|
928
|
+
A
|
|
936
929
|
);
|
|
937
|
-
if (a.existsSync(
|
|
938
|
-
const
|
|
939
|
-
a.existsSync(
|
|
940
|
-
const
|
|
941
|
-
a.existsSync(
|
|
930
|
+
if (a.existsSync(b) ? N(b, t) : (console.error(`โ Template directory not found: ${b}`), process.exit(1)), s === "cloudflare" && F(t, i), s === "cloudflare") {
|
|
931
|
+
const c = l.join(t, "wrangler.toml"), u = l.join(t, "wrangler.local.toml");
|
|
932
|
+
a.existsSync(c) && a.copyFileSync(c, u);
|
|
933
|
+
const d = l.join(t, ".dev.vars.example"), h = l.join(t, ".dev.vars");
|
|
934
|
+
a.existsSync(d) && a.copyFileSync(d, h), console.log(
|
|
942
935
|
"๐ Created wrangler.local.toml and .dev.vars for local development"
|
|
943
936
|
);
|
|
944
937
|
}
|
|
945
|
-
let
|
|
946
|
-
if (s === "cloudflare" && (e.githubCi !== void 0 ? (
|
|
938
|
+
let C = !1;
|
|
939
|
+
if (s === "cloudflare" && (e.githubCi !== void 0 ? (C = e.githubCi, C && console.log("Including GitHub CI workflows with semantic versioning")) : r || (C = (await m.prompt([
|
|
947
940
|
{
|
|
948
941
|
type: "confirm",
|
|
949
942
|
name: "includeGithubCi",
|
|
950
943
|
message: "Would you like to include GitHub CI with semantic versioning?",
|
|
951
944
|
default: !1
|
|
952
945
|
}
|
|
953
|
-
])).includeGithubCi),
|
|
954
|
-
const
|
|
955
|
-
|
|
946
|
+
])).includeGithubCi), C && (H(t), M(t))), s === "local") {
|
|
947
|
+
const c = P(
|
|
948
|
+
i,
|
|
956
949
|
g,
|
|
957
|
-
|
|
950
|
+
f
|
|
958
951
|
);
|
|
959
|
-
a.writeFileSync(l.join(t, "src/seed.ts"),
|
|
960
|
-
const
|
|
961
|
-
a.writeFileSync(l.join(t, "src/app.ts"),
|
|
952
|
+
a.writeFileSync(l.join(t, "src/seed.ts"), c);
|
|
953
|
+
const u = R(i);
|
|
954
|
+
a.writeFileSync(l.join(t, "src/app.ts"), u);
|
|
962
955
|
}
|
|
963
|
-
if (s === "aws-sst" &&
|
|
964
|
-
const
|
|
965
|
-
alias:
|
|
956
|
+
if (s === "aws-sst" && $(t, i), g) {
|
|
957
|
+
const c = {
|
|
958
|
+
alias: f,
|
|
966
959
|
description: "AuthHero Conformance Test",
|
|
967
960
|
server: {
|
|
968
961
|
discoveryUrl: "http://host.docker.internal:3000/.well-known/openid-configuration"
|
|
@@ -981,30 +974,30 @@ T.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
981
974
|
};
|
|
982
975
|
a.writeFileSync(
|
|
983
976
|
l.join(t, "conformance-config.json"),
|
|
984
|
-
JSON.stringify(
|
|
977
|
+
JSON.stringify(c, null, 2)
|
|
985
978
|
), console.log(
|
|
986
979
|
"๐ Created conformance-config.json for OpenID Conformance Suite"
|
|
987
980
|
);
|
|
988
981
|
}
|
|
989
|
-
const
|
|
982
|
+
const _ = i ? "multi-tenant" : "single-tenant";
|
|
990
983
|
console.log(
|
|
991
984
|
`
|
|
992
|
-
โ
Project "${n}" has been created with ${
|
|
985
|
+
โ
Project "${n}" has been created with ${w.name} (${_}) setup!
|
|
993
986
|
`
|
|
994
987
|
);
|
|
995
|
-
let
|
|
996
|
-
if (e.skipInstall ?
|
|
988
|
+
let y;
|
|
989
|
+
if (e.skipInstall ? y = !1 : r ? y = !0 : y = (await m.prompt([
|
|
997
990
|
{
|
|
998
991
|
type: "confirm",
|
|
999
992
|
name: "shouldInstall",
|
|
1000
993
|
message: "Would you like to install dependencies now?",
|
|
1001
994
|
default: !0
|
|
1002
995
|
}
|
|
1003
|
-
])).shouldInstall,
|
|
1004
|
-
let
|
|
996
|
+
])).shouldInstall, y) {
|
|
997
|
+
let c;
|
|
1005
998
|
e.packageManager ? (["npm", "yarn", "pnpm", "bun"].includes(e.packageManager) || (console.error(
|
|
1006
999
|
`โ Invalid package manager: ${e.packageManager}`
|
|
1007
|
-
), console.error("Valid options: npm, yarn, pnpm, bun"), process.exit(1)),
|
|
1000
|
+
), console.error("Valid options: npm, yarn, pnpm, bun"), process.exit(1)), c = e.packageManager) : r ? c = "pnpm" : c = (await m.prompt([
|
|
1008
1001
|
{
|
|
1009
1002
|
type: "list",
|
|
1010
1003
|
name: "packageManager",
|
|
@@ -1018,84 +1011,55 @@ T.version("1.0.0").description("Create a new AuthHero project").argument("[proje
|
|
|
1018
1011
|
default: "pnpm"
|
|
1019
1012
|
}
|
|
1020
1013
|
])).packageManager, console.log(`
|
|
1021
|
-
๐ฆ Installing dependencies with ${
|
|
1014
|
+
๐ฆ Installing dependencies with ${c}...
|
|
1022
1015
|
`);
|
|
1023
1016
|
try {
|
|
1024
|
-
const
|
|
1025
|
-
if (await
|
|
1017
|
+
const u = c === "pnpm" ? "pnpm install --ignore-workspace" : `${c} install`;
|
|
1018
|
+
if (await S(u, t), s === "local" && (console.log(`
|
|
1026
1019
|
๐ง Building native modules...
|
|
1027
|
-
`), await
|
|
1020
|
+
`), await S("npm rebuild better-sqlite3", t)), console.log(`
|
|
1028
1021
|
โ
Dependencies installed successfully!
|
|
1029
|
-
`), s === "local" || s === "cloudflare") {
|
|
1030
|
-
let
|
|
1031
|
-
|
|
1022
|
+
`), (s === "local" || s === "cloudflare") && !e.skipMigrate) {
|
|
1023
|
+
let h;
|
|
1024
|
+
r ? h = !0 : h = (await m.prompt([
|
|
1032
1025
|
{
|
|
1033
1026
|
type: "confirm",
|
|
1034
|
-
name: "
|
|
1035
|
-
message: "Would you like to run migrations
|
|
1027
|
+
name: "shouldMigrate",
|
|
1028
|
+
message: "Would you like to run database migrations?",
|
|
1036
1029
|
default: !0
|
|
1037
1030
|
}
|
|
1038
|
-
])).
|
|
1039
|
-
let h;
|
|
1040
|
-
e.email && e.password ? (h = {
|
|
1041
|
-
username: e.email,
|
|
1042
|
-
password: e.password
|
|
1043
|
-
}, console.log(`Using admin username: ${e.email}`)) : h = await u.prompt([
|
|
1044
|
-
{
|
|
1045
|
-
type: "input",
|
|
1046
|
-
name: "username",
|
|
1047
|
-
message: "Admin username:",
|
|
1048
|
-
default: "admin"
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
type: "password",
|
|
1052
|
-
name: "password",
|
|
1053
|
-
message: "Admin password:",
|
|
1054
|
-
mask: "*",
|
|
1055
|
-
default: "admin"
|
|
1056
|
-
}
|
|
1057
|
-
]), e.skipMigrate || (console.log(`
|
|
1031
|
+
])).shouldMigrate, h && (console.log(`
|
|
1058
1032
|
๐ Running migrations...
|
|
1059
|
-
`), await
|
|
1060
|
-
๐ฑ Seeding database...
|
|
1061
|
-
`), s === "local" ? await _(
|
|
1062
|
-
`${i} run seed`,
|
|
1063
|
-
t,
|
|
1064
|
-
{
|
|
1065
|
-
ADMIN_USERNAME: h.username,
|
|
1066
|
-
ADMIN_PASSWORD: h.password
|
|
1067
|
-
}
|
|
1068
|
-
) : await _(
|
|
1069
|
-
`${i} run seed:local`,
|
|
1070
|
-
t,
|
|
1071
|
-
{
|
|
1072
|
-
ADMIN_USERNAME: h.username,
|
|
1073
|
-
ADMIN_PASSWORD: h.password
|
|
1074
|
-
}
|
|
1075
|
-
));
|
|
1076
|
-
}
|
|
1033
|
+
`), await S(`${c} run migrate`, t));
|
|
1077
1034
|
}
|
|
1078
|
-
let
|
|
1079
|
-
e.skipStart || r ?
|
|
1035
|
+
let d;
|
|
1036
|
+
e.skipStart || r ? d = !1 : d = (await m.prompt([
|
|
1080
1037
|
{
|
|
1081
1038
|
type: "confirm",
|
|
1082
1039
|
name: "shouldStart",
|
|
1083
1040
|
message: "Would you like to start the development server?",
|
|
1084
1041
|
default: !0
|
|
1085
1042
|
}
|
|
1086
|
-
])).shouldStart,
|
|
1087
|
-
`), await
|
|
1043
|
+
])).shouldStart, d && (s === "cloudflare" ? x() : s === "aws-sst" ? k() : D(), console.log(`๐ Starting development server...
|
|
1044
|
+
`), await S(`${c} run dev`, t)), r && !d && (console.log(`
|
|
1088
1045
|
โ
Setup complete!`), console.log(`
|
|
1089
|
-
To start the development server:`), console.log(` cd ${n}`), console.log(" npm run dev"), s === "cloudflare" ? x(
|
|
1090
|
-
} catch (
|
|
1046
|
+
To start the development server:`), console.log(` cd ${n}`), console.log(" npm run dev"), s === "cloudflare" ? x() : s === "aws-sst" ? k() : D());
|
|
1047
|
+
} catch (u) {
|
|
1091
1048
|
console.error(`
|
|
1092
|
-
โ An error occurred:`,
|
|
1049
|
+
โ An error occurred:`, u), process.exit(1);
|
|
1093
1050
|
}
|
|
1094
1051
|
}
|
|
1095
|
-
|
|
1052
|
+
y || (console.log("Next steps:"), console.log(` cd ${n}`), s === "local" ? (console.log(" npm install"), console.log(" npm run migrate"), console.log(" npm run dev"), console.log(
|
|
1053
|
+
`
|
|
1054
|
+
Open https://localhost:3000/setup to complete initial setup`
|
|
1055
|
+
)) : s === "cloudflare" ? (console.log(" npm install"), console.log(
|
|
1096
1056
|
" npm run migrate # or npm run db:migrate:remote for production"
|
|
1097
|
-
), console.log(" npm run
|
|
1098
|
-
|
|
1057
|
+
), console.log(" npm run dev # or npm run dev:remote for production"), console.log(
|
|
1058
|
+
`
|
|
1059
|
+
Open https://localhost:3000/setup to complete initial setup`
|
|
1060
|
+
)) : s === "aws-sst" && (console.log(" npm install"), console.log(" npm run dev # Deploys to AWS in development mode"), console.log(
|
|
1061
|
+
`
|
|
1062
|
+
Open your server URL /setup to complete initial setup`
|
|
1099
1063
|
)), console.log(`
|
|
1100
1064
|
Server will be available at: https://localhost:3000`), console.log("Portal available at: https://local.authhero.net"), g && (console.log(`
|
|
1101
1065
|
๐งช OpenID Conformance Suite Testing:`), console.log(
|
|
@@ -1104,7 +1068,7 @@ Server will be available at: https://localhost:3000`), console.log("Portal avail
|
|
|
1104
1068
|
" git clone https://gitlab.com/openid/conformance-suite.git"
|
|
1105
1069
|
), 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(
|
|
1106
1070
|
" 3. Create a test plan and use conformance-config.json for settings"
|
|
1107
|
-
), console.log(` 4. Use alias: ${
|
|
1071
|
+
), console.log(` 4. Use alias: ${f}`)), console.log(`
|
|
1108
1072
|
For more information, visit: https://authhero.net/docs
|
|
1109
1073
|
`));
|
|
1110
1074
|
});
|