refactor(config): ♻️ Redo config structure from scratch, simplify validation code, improve checks, add support for loading sensitive data from paths

This commit is contained in:
Jesse Wierzbinski 2025-02-15 02:47:29 +01:00
parent d4afd84019
commit 54fd81f076
No known key found for this signature in database
118 changed files with 3892 additions and 5291 deletions

View file

@ -1,7 +1,7 @@
import type { ContentFormat } from "@versia/federation/types";
import { htmlToText as htmlToTextLib } from "html-to-text";
import { lookup } from "mime-types";
import { config } from "~/packages/config-manager";
import { config } from "~/config.ts";
export const getBestContentType = (
content?: ContentFormat | null,
@ -67,7 +67,7 @@ export const mimeLookup = (url: URL): Promise<string> => {
const fetchLookup = fetch(url, {
method: "HEAD",
// @ts-expect-error Proxy is a Bun-specific feature
proxy: config.http.proxy.address,
proxy: config.http.proxy_address,
})
.then(
(response) =>