mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
More bugfixes
This commit is contained in:
@@ -52,7 +52,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const deleteResult = await db
|
await db
|
||||||
.delete(accessAuditLog)
|
.delete(accessAuditLog)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
@@ -62,7 +62,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Cleaned up ${deleteResult.changes} access audit logs older than ${retentionDays} days`
|
`Cleaned up access audit logs older than ${retentionDays} days`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error("Error cleaning up old action audit logs:", error);
|
logger.error("Error cleaning up old action audit logs:", error);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const deleteResult = await db
|
await db
|
||||||
.delete(actionAuditLog)
|
.delete(actionAuditLog)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
@@ -61,7 +61,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Cleaned up ${deleteResult.changes} action audit logs older than ${retentionDays} days`
|
`Cleaned up action audit logs older than ${retentionDays} days`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error("Error cleaning up old action audit logs:", error);
|
logger.error("Error cleaning up old action audit logs:", error);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const deleteResult = await db
|
await db
|
||||||
.delete(requestAuditLog)
|
.delete(requestAuditLog)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
@@ -70,7 +70,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Cleaned up ${deleteResult.changes} request audit logs older than ${retentionDays} days`
|
`Cleaned up request audit logs older than ${retentionDays} days`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error("Error cleaning up old request audit logs:", error);
|
logger.error("Error cleaning up old request audit logs:", error);
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import logger from "@server/logger";
|
|||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { UserType } from "@server/types/UserTypes";
|
|
||||||
import license from "#dynamic/license/license";
|
import license from "#dynamic/license/license";
|
||||||
import { getOrgTierData } from "#dynamic/lib/billing";
|
import { getOrgTierData } from "#dynamic/lib/billing";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
|
import { cache } from "@server/lib/cache";
|
||||||
|
|
||||||
const updateOrgParamsSchema = z
|
const updateOrgParamsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -138,6 +138,11 @@ export async function updateOrg(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invalidate the cache for all of the orgs retention days
|
||||||
|
cache.del(`org_${orgId}_retentionDays`);
|
||||||
|
cache.del(`org_${orgId}_actionDays`);
|
||||||
|
cache.del(`org_${orgId}_accessDays`);
|
||||||
|
|
||||||
return response(res, {
|
return response(res, {
|
||||||
data: updatedOrg[0],
|
data: updatedOrg[0],
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default async function migration() {
|
|||||||
// insert two records into the dnsRecords table for each domain
|
// insert two records into the dnsRecords table for each domain
|
||||||
await db.execute(sql`
|
await db.execute(sql`
|
||||||
INSERT INTO "dnsRecords" ("domainId", "recordType", "baseDomain", "value", "verified")
|
INSERT INTO "dnsRecords" ("domainId", "recordType", "baseDomain", "value", "verified")
|
||||||
VALUES (${domain.domainId}, 'A', ${`*.${domain.baseDomain}`}, ${'Server IP Address'}, true)
|
VALUES (${"*." + domain.domainId}, 'A', ${`*.${domain.baseDomain}`}, ${'Server IP Address'}, true)
|
||||||
`);
|
`);
|
||||||
await db.execute(sql`
|
await db.execute(sql`
|
||||||
INSERT INTO "dnsRecords" ("domainId", "recordType", "baseDomain", "value", "verified")
|
INSERT INTO "dnsRecords" ("domainId", "recordType", "baseDomain", "value", "verified")
|
||||||
|
|||||||
@@ -186,10 +186,8 @@ export default function DomainsTable({ domains, orgId }: Props) {
|
|||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const { verified, failed, type } = row.original;
|
const { verified, failed, type } = row.original;
|
||||||
if (verified) {
|
if (verified) {
|
||||||
type === "wildcard" ? (
|
return type == "wildcard" ? (
|
||||||
<Badge variant="outlinePrimary">
|
<Badge variant="outlinePrimary">{t("manual")}</Badge>
|
||||||
{t("manual", { fallback: "Manual" })}
|
|
||||||
</Badge>
|
|
||||||
) : (
|
) : (
|
||||||
<Badge variant="green">{t("verified")}</Badge>
|
<Badge variant="green">{t("verified")}</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user