fosrl.pangolin/server/setup/index.ts

18 lines
641 B
TypeScript
Raw Normal View History

2024-12-22 12:33:49 -05:00
import { ensureActions } from "./ensureActions";
import { copyInConfig } from "./copyInConfig";
import { setupServerAdmin } from "./setupServerAdmin";
import logger from "@server/logger";
2025-02-24 22:46:55 -05:00
import { clearStaleData } from "./clearStaleData";
2024-12-22 12:33:49 -05:00
export async function runSetupFunctions() {
2024-12-25 15:54:32 -05:00
try {
await copyInConfig(); // copy in the config to the db as needed
await setupServerAdmin();
await ensureActions(); // make sure all of the actions are in the db and the roles
2025-02-24 22:46:55 -05:00
await clearStaleData();
2024-12-25 15:54:32 -05:00
} catch (error) {
logger.error("Error running setup functions:", error);
2024-12-25 15:54:32 -05:00
process.exit(1);
}
}