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