More bugfixes

This commit is contained in:
Owen
2025-10-29 17:21:32 -07:00
parent 6dc4cbe448
commit 0e649883cb
6 changed files with 15 additions and 12 deletions

View File

@@ -52,7 +52,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
try {
const deleteResult = await db
await db
.delete(accessAuditLog)
.where(
and(
@@ -62,7 +62,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
);
logger.debug(
`Cleaned up ${deleteResult.changes} access audit logs older than ${retentionDays} days`
`Cleaned up access audit logs older than ${retentionDays} days`
);
} catch (error) {
logger.error("Error cleaning up old action audit logs:", error);

View File

@@ -51,7 +51,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
try {
const deleteResult = await db
await db
.delete(actionAuditLog)
.where(
and(
@@ -61,7 +61,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
);
logger.debug(
`Cleaned up ${deleteResult.changes} action audit logs older than ${retentionDays} days`
`Cleaned up action audit logs older than ${retentionDays} days`
);
} catch (error) {
logger.error("Error cleaning up old action audit logs:", error);

View File

@@ -60,7 +60,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
const cutoffTimestamp = now - retentionDays * 24 * 60 * 60;
try {
const deleteResult = await db
await db
.delete(requestAuditLog)
.where(
and(
@@ -70,7 +70,7 @@ export async function cleanUpOldLogs(orgId: string, retentionDays: number) {
);
logger.debug(
`Cleaned up ${deleteResult.changes} request audit logs older than ${retentionDays} days`
`Cleaned up request audit logs older than ${retentionDays} days`
);
} catch (error) {
logger.error("Error cleaning up old request audit logs:", error);

View File

@@ -10,10 +10,10 @@ import logger from "@server/logger";
import { fromError } from "zod-validation-error";
import { OpenAPITags, registry } from "@server/openApi";
import { build } from "@server/build";
import { UserType } from "@server/types/UserTypes";
import license from "#dynamic/license/license";
import { getOrgTierData } from "#dynamic/lib/billing";
import { TierId } from "@server/lib/billing/tiers";
import { cache } from "@server/lib/cache";
const updateOrgParamsSchema = z
.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, {
data: updatedOrg[0],
success: true,

View File

@@ -119,7 +119,7 @@ export default async function migration() {
// insert two records into the dnsRecords table for each domain
await db.execute(sql`
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`
INSERT INTO "dnsRecords" ("domainId", "recordType", "baseDomain", "value", "verified")

View File

@@ -186,10 +186,8 @@ export default function DomainsTable({ domains, orgId }: Props) {
cell: ({ row }) => {
const { verified, failed, type } = row.original;
if (verified) {
type === "wildcard" ? (
<Badge variant="outlinePrimary">
{t("manual", { fallback: "Manual" })}
</Badge>
return type == "wildcard" ? (
<Badge variant="outlinePrimary">{t("manual")}</Badge>
) : (
<Badge variant="green">{t("verified")}</Badge>
);