Compare commits
6 Commits
v10.0.0-rc
...
v10.0.0-rc
Author | SHA1 | Date | |
---|---|---|---|
5580248bcd | |||
c9c10b8fba | |||
ed254922e9 | |||
4b7d1e2cec | |||
775ae57258 | |||
96e4cd79ee |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "keycloakify",
|
||||
"version": "10.0.0-rc.139",
|
||||
"version": "10.0.0-rc.142",
|
||||
"description": "Create Keycloak themes using React",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -78,7 +78,7 @@ program
|
||||
|
||||
program
|
||||
.command<{
|
||||
port: number;
|
||||
port: number | undefined;
|
||||
keycloakVersion: string | undefined;
|
||||
realmJsonFilePath: string | undefined;
|
||||
}>({
|
||||
@ -96,7 +96,7 @@ program
|
||||
return name;
|
||||
})(),
|
||||
description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
|
||||
defaultValue: 8080
|
||||
defaultValue: undefined
|
||||
})
|
||||
.option({
|
||||
key: "keycloakVersion",
|
||||
|
@ -72,6 +72,7 @@ export type BuildContext = {
|
||||
keycloakExtraArgs: string[];
|
||||
extensionJars: ({ type: "path"; path: string } | { type: "url"; url: string })[];
|
||||
realmJsonFilePath: string | undefined;
|
||||
port: number | undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@ -93,6 +94,7 @@ export type BuildOptions = {
|
||||
keycloakExtraArgs?: string[];
|
||||
extensionJars?: string[];
|
||||
realmJsonFilePath?: string;
|
||||
port?: number;
|
||||
};
|
||||
} & BuildOptions.AccountThemeImplAndKeycloakVersionTargets;
|
||||
|
||||
@ -328,7 +330,8 @@ export function getBuildContext(params: {
|
||||
extensionJars: z.array(z.string()).optional(),
|
||||
realmJsonFilePath: z.string().optional(),
|
||||
dockerExtraArgs: z.array(z.string()).optional(),
|
||||
keycloakExtraArgs: z.array(z.string()).optional()
|
||||
keycloakExtraArgs: z.array(z.string()).optional(),
|
||||
port: z.number().optional()
|
||||
});
|
||||
|
||||
assert<Equals<z.infer<typeof zTargetType>, TargetType>>();
|
||||
@ -967,7 +970,8 @@ export function getBuildContext(params: {
|
||||
: getAbsoluteAndInOsFormatPath({
|
||||
pathIsh: buildOptions.startKeycloakOptions.realmJsonFilePath,
|
||||
cwd: projectDirPath
|
||||
})
|
||||
}),
|
||||
port: buildOptions.startKeycloakOptions?.port
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import { rm } from "../tools/fs.rm";
|
||||
import { downloadAndExtractArchive } from "../tools/downloadAndExtractArchive";
|
||||
|
||||
export type CliCommandOptions = CliCommandOptions_common & {
|
||||
port: number;
|
||||
port: number | undefined;
|
||||
keycloakVersion: string | undefined;
|
||||
realmJsonFilePath: string | undefined;
|
||||
};
|
||||
@ -334,13 +334,18 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
});
|
||||
} catch {}
|
||||
|
||||
const DEFAULT_PORT = 8080;
|
||||
const port =
|
||||
cliCommandOptions.port ?? buildContext.startKeycloakOptions.port ?? DEFAULT_PORT;
|
||||
|
||||
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
||||
|
||||
const dockerRunArgs: string[] = [
|
||||
`-p${SPACE_PLACEHOLDER}${cliCommandOptions.port}:8080`,
|
||||
`-p${SPACE_PLACEHOLDER}${port}:8080`,
|
||||
`--name${SPACE_PLACEHOLDER}${CONTAINER_NAME}`,
|
||||
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
||||
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
||||
buildContext.startKeycloakOptions.dockerExtraArgs.join(SPACE_PLACEHOLDER),
|
||||
...(realmJsonFilePath === undefined
|
||||
? []
|
||||
: [
|
||||
@ -388,14 +393,13 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
({ name, envValue }) =>
|
||||
`--env${SPACE_PLACEHOLDER}${name}='${envValue.replace(/'/g, "'\\''")}'`
|
||||
),
|
||||
...buildContext.startKeycloakOptions.dockerExtraArgs.join(SPACE_PLACEHOLDER),
|
||||
`${buildContext.startKeycloakOptions.dockerImage?.reference ?? "quay.io/keycloak/keycloak"}:${dockerImageTag}`,
|
||||
"start-dev",
|
||||
...(21 <= keycloakMajorVersionNumber && keycloakMajorVersionNumber < 24
|
||||
? ["--features=declarative-user-profile"]
|
||||
: []),
|
||||
...(realmJsonFilePath === undefined ? [] : ["--import-realm"]),
|
||||
...buildContext.startKeycloakOptions.keycloakExtraArgs.join(SPACE_PLACEHOLDER)
|
||||
buildContext.startKeycloakOptions.keycloakExtraArgs.join(SPACE_PLACEHOLDER)
|
||||
];
|
||||
|
||||
console.log(
|
||||
@ -444,7 +448,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
)} are mounted in the Keycloak container.`,
|
||||
"",
|
||||
`Keycloak Admin console: ${chalk.cyan.bold(
|
||||
`http://localhost:${cliCommandOptions.port}`
|
||||
`http://localhost:${port}`
|
||||
)}`,
|
||||
`- user: ${chalk.cyan.bold("admin")}`,
|
||||
`- password: ${chalk.cyan.bold("admin")}`,
|
||||
@ -452,7 +456,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
"",
|
||||
`${chalk.green("Your theme is accessible at:")}`,
|
||||
`${chalk.green("➜")} ${chalk.cyan.bold(
|
||||
`https://my-theme.keycloakify.dev${cliCommandOptions.port === 8080 ? "" : `?port=${cliCommandOptions.port}`}`
|
||||
`https://my-theme.keycloakify.dev${port === DEFAULT_PORT ? "" : `?port=${port}`}`
|
||||
)}`,
|
||||
"",
|
||||
"You can login with the following credentials:",
|
||||
|
Reference in New Issue
Block a user