Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: seeding fails

Daniel Hougaard6bfcc59486ec
diff --git a/backend/src/db/seeds/1-user.ts b/backend/src/db/seeds/1-user.ts
index 86cd2be343..5c6245382f 100644
--- a/backend/src/db/seeds/1-user.ts
+++ b/backend/src/db/seeds/1-user.ts
@@ -1,5 +1,9 @@
import { Knex } from "knex";
+import { crypto } from "@app/lib/crypto";
+import { initLogger } from "@app/lib/logger";
+import { superAdminDALFactory } from "@app/services/super-admin/super-admin-dal";
+
import { AuthMethod } from "../../services/auth/auth-type";
import { TableName } from "../schemas";
import { generateUserSrpKeys, seedData1 } from "../seed-data";
@@ -10,6 +14,11 @@ export async function seed(knex: Knex): Promise<void> {
await knex(TableName.UserEncryptionKey).del();
await knex(TableName.SuperAdmin).del();
+ initLogger();
+
+ const superAdminDAL = superAdminDALFactory(knex);
+ await crypto.initialize(superAdminDAL);
+
await knex(TableName.SuperAdmin).insert([
// eslint-disable-next-line
// @ts-ignore
diff --git a/backend/src/lib/crypto/cryptography.ts b/backend/src/lib/crypto/cryptography.ts
index 2bbb9eaddb..4caee64fef 100644
--- a/backend/src/lib/crypto/cryptography.ts
+++ b/backend/src/lib/crypto/cryptography.ts
@@ -415,6 +415,7 @@ const cryptographyFactory = () => {
if (process.env.FIPS_ENABLED !== "true") {
logger.info("[FIPS]: Instance is running in non-FIPS mode.");
+ $setFipsModeEnabled(false);
return false;
}