mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 01:55:10 +02:00
rename auth and start work separating config
This commit is contained in:
parent
d447de9e8a
commit
b199595100
15 changed files with 153 additions and 120 deletions
|
@ -1,18 +1,23 @@
|
|||
import { ensureActions } from "./ensureActions";
|
||||
import { copyInConfig } from "./copyInConfig";
|
||||
import logger from "@server/logger";
|
||||
import { runMigrations } from "./migrations";
|
||||
import { setupServerAdmin } from "./setupServerAdmin";
|
||||
import { loadConfig } from "@server/config";
|
||||
|
||||
export async function runSetupFunctions() {
|
||||
try {
|
||||
logger.info(`Setup for version ${process.env.APP_VERSION}`);
|
||||
await runMigrations(); // run the migrations
|
||||
|
||||
console.log("Migrations completed successfully.")
|
||||
|
||||
// ANYTHING BEFORE THIS LINE CANNOT USE THE CONFIG
|
||||
loadConfig();
|
||||
|
||||
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
|
||||
} catch (error) {
|
||||
logger.error("Error running setup functions", error);
|
||||
console.error("Error running setup functions:", error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue