feat(prod): production deployment fixes - env loader, mongoose module, CSS static files, security hardening, PDF export, new UI components
This commit is contained in:
1 parent
a403f752f3
commit
46f33eb088
69 files changed
+7367
-744
No files matched your search
@@ -1,5 +1,9 @@
|
||||
"use server";
|
||||
|
||||
if (typeof globalThis.crypto === 'undefined') {
|
||||
globalThis.crypto = require('crypto');
|
||||
}
|
||||
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { cookies } from "next/headers";
|
||||
import jwt from "jsonwebtoken";
|
||||
@@ -203,7 +207,7 @@ export async function createAgent(agentId: string, label: string) {
|
||||
try {
|
||||
const API_KEY = getApiKey();
|
||||
if (API_KEY && API_KEY.startsWith("sk_db_")) {
|
||||
return { success: false, message: "Aksi ditolak: Site-scoped API Key tidak diperbolehkan membuat Agents." };
|
||||
return { success: false, message: "Action denied: Site-scoped API Key is not allowed to create Agents." };
|
||||
}
|
||||
|
||||
const url = agentId
|
||||
@@ -231,7 +235,7 @@ export async function updateAgent(agentId: string, label: string) {
|
||||
try {
|
||||
const API_KEY = getApiKey();
|
||||
if (API_KEY && API_KEY.startsWith("sk_db_")) {
|
||||
return { success: false, message: "Aksi ditolak: Site-scoped API Key tidak diperbolehkan mengubah Agents." };
|
||||
return { success: false, message: "Action denied: Site-scoped API Key is not allowed to modify Agents." };
|
||||
}
|
||||
|
||||
const response = await fetch(`${API_URL}/${encodeURIComponent(agentId)}?label=${encodeURIComponent(label)}`, {
|
||||
@@ -255,7 +259,7 @@ export async function deleteAgent(agentId: string) {
|
||||
try {
|
||||
const API_KEY = getApiKey();
|
||||
if (API_KEY && API_KEY.startsWith("sk_db_")) {
|
||||
return { success: false, message: "Aksi ditolak: Site-scoped API Key tidak diperbolehkan menghapus Agents." };
|
||||
return { success: false, message: "Action denied: Site-scoped API Key is not allowed to delete Agents." };
|
||||
}
|
||||
|
||||
const response = await fetch(`${API_URL}/${encodeURIComponent(agentId)}`, {
|
||||
|
||||
Reference in new issue
Block a user