Update OneUptime URL and secret key

This commit is contained in:
Simon Larsen
2024-03-16 19:13:51 +00:00
parent 6524b09b75
commit 98e1c3a41d
3 changed files with 10 additions and 7 deletions

View File

@@ -10,13 +10,13 @@ const usage: string =
const argv: {
[x: string]: unknown;
k: string;
h: string | undefined;
u: string | undefined;
_: (string | number)[];
$0: string;
} | Promise<{
[x: string]: unknown;
k: string;
h: string | undefined;
u: string | undefined;
_: (string | number)[];
$0: string;
}> = yargs
@@ -28,8 +28,8 @@ const argv: {
type: 'string',
demandOption: true,
})
.option('h', {
alias: 'oneuptime-host',
.option('u', {
alias: 'oneuptime-url',
describe: 'OneUptime Host. By default this is https://oneuptime.com',
type: 'string',
demandOption: false,
@@ -37,7 +37,7 @@ const argv: {
.help(true).argv;
const secretKey: string | undefined = (argv as any)['secret-key'];
const oneuptimeHost: string = (argv as any)['oneuptime-host'] || 'https://oneuptime.com'
const oneuptimeUrl: string = (argv as any)['oneuptime-url'] || 'https://oneuptime.com'
if (!secretKey) {
throw new Error(
@@ -45,4 +45,4 @@ if (!secretKey) {
);
}
MonitorInfrastructure.initJob(secretKey, oneuptimeHost);
MonitorInfrastructure.initJob(secretKey, oneuptimeUrl);

View File

@@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"start": "node --require ts-node/register Index.ts",
"start": "node --require ts-node/register Index.ts --secret-key=412d0d60-e3c8-11ee-b6b0-472ce913f697 --oneuptime-url=http://localhost",
"build": "esbuild Index.ts --bundle --platform=node --outfile=./build/Index.js --loader:.node=file",
"compile": "tsc",
"clear-modules": "rm -rf node_modules && rm package-lock.json && npm install",

View File

@@ -26,6 +26,9 @@ router.get(
next: NextFunction
): Promise<void> => {
try {
debugger;
const monitorSecretKeyAsString: string | undefined =
req.params['secretkey'];