mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Bug on init.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
export async function register() {
|
export async function register() {
|
||||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||||
const init = await import("@/utils/init");
|
const init = await import("@/utils/init");
|
||||||
init.init();
|
await init.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ export const env = createEnv({
|
|||||||
S3_PORT: z.string().optional(),
|
S3_PORT: z.string().optional(),
|
||||||
S3_USE_SSL: z.string().optional(),
|
S3_USE_SSL: z.string().optional(),
|
||||||
|
|
||||||
STORAGE_TYPE: z.string().optional(),
|
STORAGE_TYPE: z.enum(["local", "s3"]).optional(),
|
||||||
},
|
},
|
||||||
client: {
|
client: {
|
||||||
NEXT_PUBLIC_PROJECT_NAME: z.string().optional(),
|
NEXT_PUBLIC_PROJECT_NAME: z.string().optional(),
|
||||||
|
|||||||
+10
-14
@@ -1,6 +1,6 @@
|
|||||||
import { env } from "@/env.mjs";
|
import {env} from "@/env.mjs";
|
||||||
import {db, makeMigration} from "@/db";
|
import {db, makeMigration} from "@/db";
|
||||||
import { eq } from "drizzle-orm";
|
import {eq} from "drizzle-orm";
|
||||||
import * as drizzleDb from "@/db";
|
import * as drizzleDb from "@/db";
|
||||||
|
|
||||||
|
|
||||||
@@ -10,17 +10,13 @@ export async function init() {
|
|||||||
await makeMigration();
|
await makeMigration();
|
||||||
await createDefaultOrganization();
|
await createDefaultOrganization();
|
||||||
await createSettingsIfNotExist()
|
await createSettingsIfNotExist()
|
||||||
.then(() => {
|
console.log("====Initialization completed====");
|
||||||
console.log("====Initialization completed====");
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error("Error during initialization:", err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createSettingsIfNotExist() {
|
async function createSettingsIfNotExist() {
|
||||||
const configSettings = {
|
const configSettings = {
|
||||||
name: "system",
|
name: "system",
|
||||||
|
storage: env.STORAGE_TYPE!,
|
||||||
smtpPassword: env.SMTP_PASSWORD ?? null,
|
smtpPassword: env.SMTP_PASSWORD ?? null,
|
||||||
smtpFrom: env.SMTP_FROM ?? null,
|
smtpFrom: env.SMTP_FROM ?? null,
|
||||||
smtpHost: env.SMTP_HOST ?? null,
|
smtpHost: env.SMTP_HOST ?? null,
|
||||||
@@ -61,11 +57,11 @@ async function createDefaultOrganization() {
|
|||||||
function consoleAscii() {
|
function consoleAscii() {
|
||||||
console.log(
|
console.log(
|
||||||
"\n" +
|
"\n" +
|
||||||
" ____ __ __ _____ \n" +
|
" ____ __ __ _____ \n" +
|
||||||
" / __ \\ ____ _____ / /_ ____ _ / /_ ____ _ _____ ___ / ___/ ___ _____ _ __ ___ _____\n" +
|
" / __ \\ ____ _____ / /_ ____ _ / /_ ____ _ _____ ___ / ___/ ___ _____ _ __ ___ _____\n" +
|
||||||
" / /_/ // __ \\ / ___// __// __ // __ \\ / __ // ___// _ \\ \\__ \\ / _ \\ / ___/| | / // _ \\ / ___/\n" +
|
" / /_/ // __ \\ / ___// __// __ // __ \\ / __ // ___// _ \\ \\__ \\ / _ \\ / ___/| | / // _ \\ / ___/\n" +
|
||||||
" / ____// /_/ // / / /_ / /_/ // /_/ // /_/ /(__ )/ __/ ___/ // __// / | |/ // __// / \n" +
|
" / ____// /_/ // / / /_ / /_/ // /_/ // /_/ /(__ )/ __/ ___/ // __// / | |/ // __// / \n" +
|
||||||
"/_/ \\____//_/ \\__/ \\__,_//_.___/ \\__,_//____/ \\___/ /____/ \\___//_/ |___/ \\___//_/ \n" +
|
"/_/ \\____//_/ \\__/ \\__,_//_.___/ \\__,_//____/ \\___/ /____/ \\___//_/ |___/ \\___//_/ \n" +
|
||||||
" \n"
|
" \n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user