mirror of
https://github.com/outline/outline.git
synced 2026-01-06 02:59:54 -06:00
24 lines
625 B
TypeScript
24 lines
625 B
TypeScript
import { Day } from "@shared/utils/time";
|
|
import {
|
|
PluginManager,
|
|
PluginPriority,
|
|
Hook,
|
|
} from "@server/utils/PluginManager";
|
|
import env from "./env";
|
|
import Iframely from "./iframely";
|
|
|
|
const isDefaultHost = env.IFRAMELY_URL === Iframely.defaultUrl;
|
|
const enabled = (isDefaultHost && !!env.IFRAMELY_API_KEY) || !!env.IFRAMELY_URL;
|
|
|
|
if (enabled) {
|
|
PluginManager.add([
|
|
{
|
|
type: Hook.UnfurlProvider,
|
|
value: { unfurl: Iframely.unfurl, cacheExpiry: Day },
|
|
|
|
// Make sure this is last in the stack to be evaluated after all other unfurl providers
|
|
priority: PluginPriority.VeryLow,
|
|
},
|
|
]);
|
|
}
|