Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import type { EnvRecord } from "@hivegrid/config";
|
||||
import { createAdminEmailAttachmentProcessor } from "@hivegrid/integrations/admin-email-attachments.server";
|
||||
import { createClamAVBufferScanner } from "@hivegrid/storage";
|
||||
import { resolveWorkerClamdConfig } from "./scanService.js";
|
||||
import {
|
||||
createWorkerStorageDeleteService,
|
||||
getMissingWorkerStorageEnv,
|
||||
} from "./storage.js";
|
||||
|
||||
type AdminEmailAttachmentEnv = EnvRecord & {
|
||||
CLAMD_HOST?: string;
|
||||
CLAMD_PORT?: string;
|
||||
CLAMD_TIMEOUT_MS?: string;
|
||||
CLAMAV_HOST?: string;
|
||||
CLAMAV_PORT?: string;
|
||||
CLAMAV_TIMEOUT_MS?: string;
|
||||
STORAGE_ACCESS_KEY_ID?: string;
|
||||
STORAGE_BUCKET?: string;
|
||||
STORAGE_ENDPOINT?: string;
|
||||
STORAGE_FORCE_PATH_STYLE?: string;
|
||||
STORAGE_PUBLIC_BASE_URL?: string;
|
||||
STORAGE_REGION?: string;
|
||||
STORAGE_SECRET_ACCESS_KEY?: string;
|
||||
STORAGE_SESSION_TOKEN?: string;
|
||||
};
|
||||
|
||||
export function createWorkerAdminEmailAttachmentProcessor(
|
||||
env: AdminEmailAttachmentEnv
|
||||
) {
|
||||
const storage =
|
||||
getMissingWorkerStorageEnv(env).length === 0
|
||||
? createWorkerStorageDeleteService(env)
|
||||
: undefined;
|
||||
const clamd = resolveWorkerClamdConfig(env);
|
||||
const scanner = createClamAVBufferScanner(clamd);
|
||||
return createAdminEmailAttachmentProcessor({ scanner, storage });
|
||||
}
|
||||
Reference in new issue
Block a user