mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-17 10:26:39 +00:00
add license system and ui
This commit is contained in:
@@ -3,9 +3,11 @@ import { copyInConfig } from "./copyInConfig";
|
||||
import { setupServerAdmin } from "./setupServerAdmin";
|
||||
import logger from "@server/logger";
|
||||
import { clearStaleData } from "./clearStaleData";
|
||||
import { setHostMeta } from "./setHostMeta";
|
||||
|
||||
export async function runSetupFunctions() {
|
||||
try {
|
||||
await setHostMeta();
|
||||
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
|
||||
|
||||
17
server/setup/setHostMeta.ts
Normal file
17
server/setup/setHostMeta.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import db from "@server/db";
|
||||
import { hostMeta } from "@server/db/schemas";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export async function setHostMeta() {
|
||||
const [existing] = await db.select().from(hostMeta).limit(1);
|
||||
|
||||
if (existing && existing.hostMetaId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = uuidv4();
|
||||
|
||||
await db
|
||||
.insert(hostMeta)
|
||||
.values({ hostMetaId: id, createdAt: new Date().getTime() });
|
||||
}
|
||||
Reference in New Issue
Block a user