refactor: streamline widget and integration architecture
This commit is contained in:
1 parent
ec295fe26e
commit
425cb653a1
243 files changed
+5722
-2255
No files matched your search
@@ -14,30 +14,6 @@ export const integrationIconSlugs: Record<IntegrationKind, string> = Object.from
|
||||
objectKeys(integrationDefs).map((kind) => [kind, extractIconSlug(integrationDefs[kind].iconUrl)]),
|
||||
) as Record<IntegrationKind, string>;
|
||||
|
||||
const integrationAliases: Partial<Record<IntegrationKind, readonly string[]>> = {
|
||||
piHole: ["pihole", "pi-hole"],
|
||||
adGuardHome: ["adguardhome", "adguard-home", "adguard"],
|
||||
homeAssistant: ["homeassistant", "home-assistant", "hass"],
|
||||
openmediavault: ["omv"],
|
||||
qBittorrent: ["qbittorrent"],
|
||||
sabNzbd: ["sabnzbd"],
|
||||
nzbGet: ["nzbget"],
|
||||
unifiController: ["unifi", "unifi-controller"],
|
||||
jellyseerr: ["jellyseerr"],
|
||||
overseerr: ["overseerr"],
|
||||
dashDot: ["dashdot", "dash-dot", "dash."],
|
||||
speedtestTracker: ["speedtest-tracker"],
|
||||
uptimeKuma: ["uptime-kuma"],
|
||||
audiobookshelf: ["audiobookshelf"],
|
||||
navidrome: ["navidrome"],
|
||||
paperlessNgx: ["paperless-ngx", "paperless"],
|
||||
patchmon: ["patchmon", "patch-mon"],
|
||||
coolify: ["coolify"],
|
||||
truenas: ["truenas"],
|
||||
bazarr: ["bazarr"],
|
||||
synology: ["synology", "diskstation"],
|
||||
};
|
||||
|
||||
export const matchIntegrationKind = (search: string): IntegrationKind | null => {
|
||||
const normalized = search.toLowerCase().trim();
|
||||
if (!normalized) return null;
|
||||
@@ -51,8 +27,8 @@ export const matchIntegrationKind = (search: string): IntegrationKind | null =>
|
||||
if (integrationIconSlugs[kind] === normalized) return kind;
|
||||
}
|
||||
|
||||
for (const [kind, aliases] of Object.entries(integrationAliases) as [IntegrationKind, readonly string[]][]) {
|
||||
if (aliases.some((alias) => alias === normalized)) return kind;
|
||||
for (const kind of objectKeys(integrationDefs)) {
|
||||
if (integrationDefs[kind].features.docker.aliases.some((alias) => alias === normalized)) return kind;
|
||||
}
|
||||
|
||||
for (const kind of objectKeys(integrationDefs)) {
|
||||
@@ -63,8 +39,6 @@ export const matchIntegrationKind = (search: string): IntegrationKind | null =>
|
||||
return null;
|
||||
};
|
||||
|
||||
const notDockerDiscoverable = new Set<IntegrationKind>(["ical", "mock"]);
|
||||
|
||||
interface ContainerMatchInput {
|
||||
image: string;
|
||||
name: string;
|
||||
@@ -73,10 +47,10 @@ interface ContainerMatchInput {
|
||||
export const matchIntegrationKindFromContainer = (container: ContainerMatchInput): IntegrationKind | null => {
|
||||
const imageName = extractContainerImageName(container.image);
|
||||
const fromImage = matchIntegrationKind(imageName);
|
||||
if (fromImage && !notDockerDiscoverable.has(fromImage)) return fromImage;
|
||||
if (fromImage && integrationDefs[fromImage].features.docker.discoverable) return fromImage;
|
||||
|
||||
const fromName = matchIntegrationKind(container.name);
|
||||
if (fromName && !notDockerDiscoverable.has(fromName)) return fromName;
|
||||
if (fromName && integrationDefs[fromName].features.docker.discoverable) return fromName;
|
||||
|
||||
return null;
|
||||
};
|
||||
@@ -1,59 +1,8 @@
|
||||
import type { IntegrationKind } from "../integration";
|
||||
import { objectEntries } from "@homarr/common";
|
||||
|
||||
export const integrationDocSlugs: Record<IntegrationKind, string | null> = {
|
||||
sabNzbd: "sabnzbd",
|
||||
nzbGet: "nzbget",
|
||||
deluge: "deluge",
|
||||
transmission: "transmission",
|
||||
qBittorrent: "q-bittorent",
|
||||
aria2: "aria2",
|
||||
slskd: "slskd",
|
||||
sonarr: "sonarr",
|
||||
radarr: "radarr",
|
||||
lidarr: "lidarr",
|
||||
readarr: "readarr",
|
||||
prowlarr: "prowlarr",
|
||||
bazarr: "bazarr",
|
||||
jellyfin: "jellyfin",
|
||||
emby: "emby",
|
||||
plex: "plex",
|
||||
jellyseerr: "jellyseerr",
|
||||
seerr: "seerr",
|
||||
overseerr: "overseerr",
|
||||
piHole: "pi-hole",
|
||||
adGuardHome: "adguard-home",
|
||||
technitiumDns: "technitium-dns",
|
||||
homeAssistant: "home-assistant",
|
||||
openmediavault: "open-media-vault",
|
||||
dashDot: "dash-dot",
|
||||
glances: "glances",
|
||||
tdarr: "tdarr",
|
||||
proxmox: "proxmox",
|
||||
nextcloud: "nextcloud",
|
||||
unifiController: "unifi-controller",
|
||||
opnsense: "opnsense",
|
||||
ntfy: "ntfy",
|
||||
gotify: "gotify",
|
||||
ical: "ical",
|
||||
anchor: "anchor",
|
||||
truenas: "truenas",
|
||||
synology: "synology",
|
||||
unraid: "unraid",
|
||||
coolify: "coolify",
|
||||
immich: "immich",
|
||||
paperlessNgx: "paperless-ngx",
|
||||
patchmon: "patchmon",
|
||||
tracearr: "tracearr",
|
||||
speedtestTracker: "speedtest-tracker",
|
||||
uptimeKuma: "uptime-kuma",
|
||||
audiobookshelf: "audiobookshelf",
|
||||
navidrome: "navidrome",
|
||||
umami: "umami",
|
||||
gluetun: "gluetun",
|
||||
peaNut: "peanut",
|
||||
beszel: "beszel",
|
||||
traefik: "traefik",
|
||||
archiveTeamWarrior: "archiveteam-warrior",
|
||||
wud: "whats-up-docker",
|
||||
mock: null,
|
||||
};
|
||||
import type { IntegrationKind } from "../integration";
|
||||
import { integrationDefs } from "../integration";
|
||||
|
||||
export const integrationDocSlugs = Object.fromEntries(
|
||||
objectEntries(integrationDefs).map(([kind, definition]) => [kind, definition.documentationSlug]),
|
||||
) as Record<IntegrationKind, string | null>;
|
||||
@@ -1,63 +1,6 @@
|
||||
import type { WidgetKind } from "../widget";
|
||||
import { widgetFeatureCatalog, widgetKinds } from "../widget";
|
||||
|
||||
export const widgetDocSlugs: Record<WidgetKind, string | null> = {
|
||||
clock: "clock",
|
||||
weather: "weather",
|
||||
airQuality: "air-quality",
|
||||
countdown: "countdown",
|
||||
timer: "timer",
|
||||
app: "app",
|
||||
iframe: "iframe",
|
||||
video: "video",
|
||||
notebook: "notebook",
|
||||
anchorNote: "anchor-note",
|
||||
dnsHoleSummary: "dns-hole-summary",
|
||||
dnsHoleControls: "dns-hole-controls",
|
||||
"smartHome-entityState": "smart-home-entity-state",
|
||||
"smartHome-executeAutomation": "smart-home-execute-automation",
|
||||
stockPrice: "stock-price",
|
||||
mediaServer: "media-server",
|
||||
calendar: "calendar",
|
||||
downloads: "downloads",
|
||||
"mediaRequests-requestList": "media-request-list",
|
||||
"mediaRequests-requestStats": "media-request-stats",
|
||||
mediaTranscoding: "media-transcoding",
|
||||
mediaMissing: "media-missing",
|
||||
minecraftServerStatus: "minecraft-server-status",
|
||||
networkControllerSummary: "network-controller-summary",
|
||||
networkControllerStatus: "network-controller-status",
|
||||
rssFeed: "rss-feed",
|
||||
bookmarks: "bookmarks",
|
||||
indexerManager: "indexer-manager",
|
||||
healthMonitoring: "health-monitoring",
|
||||
releases: "releases",
|
||||
mediaReleases: "media-releases",
|
||||
dockerContainers: "docker-containers",
|
||||
firewall: "firewall",
|
||||
notifications: "notifications",
|
||||
systemResources: "system-resources",
|
||||
coolify: "coolify",
|
||||
systemDisks: "system-disks",
|
||||
timetable: "timetable",
|
||||
"immich-serverStats": "immich-server-stats",
|
||||
"immich-albumCarousel": "immich-album-carousel",
|
||||
paperlessNgx: "paperless-ngx",
|
||||
patchmon: "patchmon",
|
||||
bazarr: "bazarr",
|
||||
tracearr: "tracearr",
|
||||
speedtestTracker: "speedtest-tracker",
|
||||
uptimeKuma: "uptime-kuma",
|
||||
audioStats: "audio-stats",
|
||||
umami: "umami",
|
||||
vpn: "vpn",
|
||||
ups: "ups",
|
||||
archiveTeamWarrior: null,
|
||||
beszelSystemTable: "beszel-system-table",
|
||||
beszelSystemGrid: "beszel-system-grid",
|
||||
beszelAlerts: "beszel-alerts",
|
||||
beszelSystemStats: "beszel-system-stats",
|
||||
traefik: "traefik",
|
||||
customApi: "custom-api",
|
||||
assistant: "assistant",
|
||||
wud: "whats-up-docker",
|
||||
};
|
||||
export const widgetDocSlugs = Object.fromEntries(
|
||||
widgetKinds.map((kind) => [kind, widgetFeatureCatalog[kind].documentationSlug]),
|
||||
) as Record<WidgetKind, string | null>;
|
||||
@@ -0,0 +1,12 @@
|
||||
// This file is generated by pnpm integrations:sync. Do not edit it directly.
|
||||
|
||||
export const generatedIntegrationDefinitions = {
|
||||
beszel: {
|
||||
name: "Beszel",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/beszel.svg",
|
||||
category: ["beszel"],
|
||||
documentationSlug: "beszel",
|
||||
defaultPort: 8090,
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,59 @@
|
||||
// This file is generated by pnpm widgets:sync. Do not edit it directly.
|
||||
|
||||
export const generatedWidgetFeatureCatalog = {
|
||||
downloads: {
|
||||
documentationSlug: "downloads",
|
||||
capability: {
|
||||
integrations: ["sabNzbd", "nzbGet", "deluge", "transmission", "qBittorrent", "aria2", "slskd", "mock"] as const,
|
||||
},
|
||||
query: { paths: [["widget", "downloads", "getJobsAndStatuses"]] as const, refetchIntervalSeconds: 10 },
|
||||
},
|
||||
weather: {
|
||||
documentationSlug: "weather",
|
||||
defaultSize: { width: 2, height: 1 },
|
||||
query: { paths: [["widget", "weather", "atLocation"]] as const, refetchIntervalSeconds: 600 },
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const widgetServerCachePolicies = {
|
||||
downloads: {
|
||||
getJobsAndStatuses: { namespace: "downloads:jobs-and-status", ttlMs: 10000, scope: "integration" },
|
||||
},
|
||||
weather: {
|
||||
atLocation: { namespace: "weather:at-location", ttlMs: 300000, scope: "shared" },
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const generatedWidgetOperationPolicies = [
|
||||
{
|
||||
widgetKind: "downloads",
|
||||
operation: "getJobsAndStatuses",
|
||||
kind: "query",
|
||||
path: ["widget", "downloads", "getJobsAndStatuses"],
|
||||
refetchIntervalSeconds: 10,
|
||||
staleTimeSeconds: 10,
|
||||
persist: true,
|
||||
},
|
||||
{
|
||||
widgetKind: "weather",
|
||||
operation: "atLocation",
|
||||
kind: "query",
|
||||
path: ["widget", "weather", "atLocation"],
|
||||
refetchIntervalSeconds: 600,
|
||||
staleTimeSeconds: 300,
|
||||
persist: true,
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const generatedWidgetDocumentationSources = {
|
||||
downloads: "packages/widgets/src/downloads/docs",
|
||||
weather: "packages/widgets/src/weather/docs",
|
||||
} as const;
|
||||
|
||||
export const getWidgetServerCachePolicy = <
|
||||
TKind extends keyof typeof widgetServerCachePolicies,
|
||||
TOperation extends keyof (typeof widgetServerCachePolicies)[TKind],
|
||||
>(
|
||||
kind: TKind,
|
||||
operation: TOperation,
|
||||
): (typeof widgetServerCachePolicies)[TKind][TOperation] => widgetServerCachePolicies[kind][operation];
|
||||
@@ -1,5 +1,7 @@
|
||||
export * from "./board";
|
||||
export * from "./integration";
|
||||
export * from "./integration-module";
|
||||
export * from "./generated/integration-modules";
|
||||
export * from "./section";
|
||||
export * from "./widget";
|
||||
export * from "./widget-name";
|
||||
@@ -14,6 +16,8 @@ export * from "./cookie";
|
||||
export * from "./search-engine";
|
||||
export * from "./onboarding";
|
||||
export * from "./widget-integration-map";
|
||||
export * from "./widget-module";
|
||||
export * from "./generated/widget-modules";
|
||||
export * from "./emptysuperjson";
|
||||
export * from "./hotkeys";
|
||||
export * from "./docker-integration-match";
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import type { IntegrationCategory, IntegrationSecretKind } from "./integration";
|
||||
|
||||
export interface IntegrationModuleDocumentation {
|
||||
slug: string;
|
||||
sourceDirectory: string;
|
||||
}
|
||||
|
||||
export interface IntegrationModuleDockerMetadata {
|
||||
aliases?: readonly string[];
|
||||
discoverable?: boolean;
|
||||
}
|
||||
|
||||
export interface IntegrationModuleOnboardingMetadata {
|
||||
featuredOrder?: number;
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
export type IntegrationModuleCreatorEntry =
|
||||
| {
|
||||
type: "constructor";
|
||||
module: string;
|
||||
exportName: string;
|
||||
}
|
||||
| {
|
||||
type: "factory";
|
||||
module: string;
|
||||
exportName: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Pure, server-safe authoring contract for a vertical integration module.
|
||||
*
|
||||
* Runtime entry points are strings so reading metadata never imports an
|
||||
* integration implementation or its transitive server dependencies.
|
||||
*/
|
||||
export interface IntegrationModuleDefinition {
|
||||
kind: string;
|
||||
name: string;
|
||||
iconUrl: string;
|
||||
secretKinds: readonly [readonly IntegrationSecretKind[], ...(readonly IntegrationSecretKind[])[]];
|
||||
categories: readonly [IntegrationCategory, ...IntegrationCategory[]];
|
||||
documentation: IntegrationModuleDocumentation;
|
||||
creator: IntegrationModuleCreatorEntry;
|
||||
defaultUrl?: string;
|
||||
defaultPort?: number;
|
||||
apiKeySettingsPath?: string;
|
||||
docker?: IntegrationModuleDockerMetadata;
|
||||
onboarding?: IntegrationModuleOnboardingMetadata;
|
||||
}
|
||||
|
||||
export const defineIntegrationModule = <const TDefinition extends IntegrationModuleDefinition>(
|
||||
definition: TDefinition,
|
||||
) => definition;
|
||||
@@ -1,7 +1,12 @@
|
||||
import { objectKeys } from "@homarr/common";
|
||||
import { objectEntries, objectKeys } from "@homarr/common";
|
||||
import type { AtLeastOneOf } from "@homarr/common/types";
|
||||
|
||||
import { createDocumentationLink } from "./docs";
|
||||
import type { HomarrDocumentationPath } from "./docs/homarr-docs-sitemap";
|
||||
import { generatedIntegrationDefinitions } from "./generated/integration-modules";
|
||||
|
||||
type IntegrationDocumentationPath = Extract<HomarrDocumentationPath, `/docs/integrations/${string}`>;
|
||||
type IntegrationDocumentationSlug = string;
|
||||
|
||||
export const integrationSecretKindObject = {
|
||||
apiKey: { isPublic: false, multiline: false },
|
||||
@@ -24,41 +29,107 @@ export const integrationSecretKindObject = {
|
||||
|
||||
export const integrationSecretKinds = objectKeys(integrationSecretKindObject);
|
||||
|
||||
interface IntegrationFeatureMetadata {
|
||||
docker?: {
|
||||
aliases?: readonly string[];
|
||||
discoverable?: boolean;
|
||||
};
|
||||
onboarding?: {
|
||||
featuredOrder?: number;
|
||||
hidden?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
interface ResolvedIntegrationFeatureMetadata {
|
||||
docker: {
|
||||
aliases: readonly string[];
|
||||
discoverable: boolean;
|
||||
};
|
||||
onboarding: {
|
||||
featuredOrder: number | null;
|
||||
hidden: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
interface integrationDefinition {
|
||||
name: string;
|
||||
iconUrl: string;
|
||||
secretKinds: AtLeastOneOf<IntegrationSecretKind[]>; // at least one secret kind set is required
|
||||
category: AtLeastOneOf<IntegrationCategory>;
|
||||
documentationUrl: string | null;
|
||||
secretKinds: readonly [readonly IntegrationSecretKind[], ...(readonly IntegrationSecretKind[])[]];
|
||||
category: readonly [IntegrationCategory, ...IntegrationCategory[]];
|
||||
documentationSlug: IntegrationDocumentationSlug | null;
|
||||
features?: IntegrationFeatureMetadata;
|
||||
defaultUrl?: string;
|
||||
defaultPort?: number;
|
||||
apiKeySettingsPath?: string;
|
||||
}
|
||||
|
||||
export const integrationDefs = {
|
||||
type ResolvedIntegrationDefinitions<TDefinitions extends Record<string, integrationDefinition>> = {
|
||||
[TKind in keyof TDefinitions]: TDefinitions[TKind] & {
|
||||
documentationUrl: string | null;
|
||||
features: ResolvedIntegrationFeatureMetadata;
|
||||
};
|
||||
};
|
||||
|
||||
const createIntegrationDefinitions = <const TDefinitions extends Record<string, integrationDefinition>>(
|
||||
definitions: TDefinitions,
|
||||
): ResolvedIntegrationDefinitions<TDefinitions> => {
|
||||
return Object.fromEntries(
|
||||
objectEntries(definitions).map(([kind, definition]) => {
|
||||
let documentationUrl: string | null = null;
|
||||
if (definition.documentationSlug !== null) {
|
||||
const documentationPath = `/docs/integrations/${definition.documentationSlug}` as IntegrationDocumentationPath;
|
||||
documentationUrl = createDocumentationLink(documentationPath);
|
||||
}
|
||||
return [
|
||||
kind,
|
||||
{
|
||||
...definition,
|
||||
documentationUrl,
|
||||
features: {
|
||||
docker: {
|
||||
aliases: definition.features?.docker?.aliases ?? [],
|
||||
discoverable: definition.features?.docker?.discoverable ?? true,
|
||||
},
|
||||
onboarding: {
|
||||
featuredOrder: definition.features?.onboarding?.featuredOrder ?? null,
|
||||
hidden: definition.features?.onboarding?.hidden ?? false,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
}),
|
||||
) as unknown as ResolvedIntegrationDefinitions<TDefinitions>;
|
||||
};
|
||||
|
||||
export const integrationDefs = createIntegrationDefinitions({
|
||||
sabNzbd: {
|
||||
name: "SABnzbd",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sabnzbd.svg",
|
||||
category: ["downloadClient", "usenet"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/sabnzbd"),
|
||||
documentationSlug: "sabnzbd",
|
||||
defaultPort: 8080,
|
||||
apiKeySettingsPath: "/config/general/",
|
||||
features: {
|
||||
docker: { aliases: ["sabnzbd"] },
|
||||
onboarding: { featuredOrder: 3 },
|
||||
},
|
||||
},
|
||||
nzbGet: {
|
||||
name: "NZBGet",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/nzbget.svg",
|
||||
category: ["downloadClient", "usenet"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/nzbget"),
|
||||
documentationSlug: "nzbget",
|
||||
defaultPort: 6789,
|
||||
features: { docker: { aliases: ["nzbget"] } },
|
||||
},
|
||||
deluge: {
|
||||
name: "Deluge",
|
||||
secretKinds: [["password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/deluge.svg",
|
||||
category: ["downloadClient", "torrent"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/deluge"),
|
||||
documentationSlug: "deluge",
|
||||
defaultPort: 8112,
|
||||
},
|
||||
transmission: {
|
||||
@@ -66,7 +137,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/transmission.svg",
|
||||
category: ["downloadClient", "torrent"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/transmission"),
|
||||
documentationSlug: "transmission",
|
||||
defaultPort: 9091,
|
||||
},
|
||||
qBittorrent: {
|
||||
@@ -74,16 +145,20 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"], ["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/qbittorrent.svg",
|
||||
category: ["downloadClient", "torrent"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/q-bittorent"),
|
||||
documentationSlug: "q-bittorent",
|
||||
defaultPort: 8080,
|
||||
apiKeySettingsPath: "/#/settings/webui",
|
||||
features: {
|
||||
docker: { aliases: ["qbittorrent"] },
|
||||
onboarding: { featuredOrder: 4 },
|
||||
},
|
||||
},
|
||||
aria2: {
|
||||
name: "Aria2",
|
||||
secretKinds: [[], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/PapirusDevelopmentTeam/papirus_icons@latest/src/system_downloads_3.svg",
|
||||
category: ["downloadClient", "torrent", "miscellaneous"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/aria2"),
|
||||
documentationSlug: "aria2",
|
||||
defaultPort: 6800,
|
||||
},
|
||||
slskd: {
|
||||
@@ -91,7 +166,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/slskd.svg",
|
||||
category: ["downloadClient", "miscellaneous"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/slskd"),
|
||||
documentationSlug: "slskd",
|
||||
defaultPort: 5030,
|
||||
},
|
||||
sonarr: {
|
||||
@@ -99,25 +174,27 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sonarr.svg",
|
||||
category: ["calendar", "mediaOrganizer"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/sonarr"),
|
||||
documentationSlug: "sonarr",
|
||||
defaultPort: 8989,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
features: { onboarding: { featuredOrder: 0 } },
|
||||
},
|
||||
radarr: {
|
||||
name: "Radarr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/radarr.svg",
|
||||
category: ["calendar", "mediaOrganizer"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/radarr"),
|
||||
documentationSlug: "radarr",
|
||||
defaultPort: 7878,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
features: { onboarding: { featuredOrder: 1 } },
|
||||
},
|
||||
lidarr: {
|
||||
name: "Lidarr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/lidarr.svg",
|
||||
category: ["calendar"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/lidarr"),
|
||||
documentationSlug: "lidarr",
|
||||
defaultPort: 8686,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
},
|
||||
@@ -126,7 +203,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@main/png/readarr.png",
|
||||
category: ["calendar"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/readarr"),
|
||||
documentationSlug: "readarr",
|
||||
defaultPort: 8787,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
},
|
||||
@@ -135,34 +212,37 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/prowlarr.svg",
|
||||
category: ["indexerManager"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/prowlarr"),
|
||||
documentationSlug: "prowlarr",
|
||||
defaultPort: 9696,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
features: { onboarding: { featuredOrder: 2 } },
|
||||
},
|
||||
bazarr: {
|
||||
name: "Bazarr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/bazarr.svg",
|
||||
category: ["subtitleManager"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/bazarr"),
|
||||
documentationSlug: "bazarr",
|
||||
defaultPort: 6767,
|
||||
apiKeySettingsPath: "/settings/general",
|
||||
features: { docker: { aliases: ["bazarr"] } },
|
||||
},
|
||||
jellyfin: {
|
||||
name: "Jellyfin",
|
||||
secretKinds: [["username", "password"], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/jellyfin.svg",
|
||||
category: ["mediaService", "mediaRelease"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/jellyfin"),
|
||||
documentationSlug: "jellyfin",
|
||||
defaultPort: 8096,
|
||||
apiKeySettingsPath: "/web/index.html#!/dashboard/keys",
|
||||
features: { onboarding: { featuredOrder: 6 } },
|
||||
},
|
||||
emby: {
|
||||
name: "Emby",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/emby.svg",
|
||||
category: ["mediaService", "mediaRelease"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/emby"),
|
||||
documentationSlug: "emby",
|
||||
defaultPort: 8096,
|
||||
},
|
||||
plex: {
|
||||
@@ -170,7 +250,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/plex.svg",
|
||||
category: ["mediaService", "mediaRelease"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/plex"),
|
||||
documentationSlug: "plex",
|
||||
defaultPort: 32400,
|
||||
},
|
||||
jellyseerr: {
|
||||
@@ -178,50 +258,55 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/jellyseerr.svg",
|
||||
category: ["mediaSearch", "mediaRequest", "search"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/jellyseerr"),
|
||||
documentationSlug: "jellyseerr",
|
||||
defaultPort: 5055,
|
||||
apiKeySettingsPath: "/settings",
|
||||
features: { docker: { aliases: ["jellyseerr"] } },
|
||||
},
|
||||
seerr: {
|
||||
name: "Seerr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/seerr.svg",
|
||||
category: ["mediaSearch", "mediaRequest", "search"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/seerr"),
|
||||
documentationSlug: "seerr",
|
||||
defaultPort: 5055,
|
||||
apiKeySettingsPath: "/settings",
|
||||
features: { onboarding: { featuredOrder: 5 } },
|
||||
},
|
||||
overseerr: {
|
||||
name: "Overseerr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/overseerr.svg",
|
||||
category: ["mediaSearch", "mediaRequest", "search"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/overseerr"),
|
||||
documentationSlug: "overseerr",
|
||||
defaultPort: 5055,
|
||||
apiKeySettingsPath: "/settings",
|
||||
features: { docker: { aliases: ["overseerr"] } },
|
||||
},
|
||||
piHole: {
|
||||
name: "Pi-hole",
|
||||
secretKinds: [["apiKey"], []],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/pi-hole.svg",
|
||||
category: ["dnsHole"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/pi-hole"),
|
||||
documentationSlug: "pi-hole",
|
||||
defaultPort: 80,
|
||||
features: { docker: { aliases: ["pihole", "pi-hole"] } },
|
||||
},
|
||||
adGuardHome: {
|
||||
name: "AdGuard Home",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/adguard-home.svg",
|
||||
category: ["dnsHole"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/adguard-home"),
|
||||
documentationSlug: "adguard-home",
|
||||
defaultPort: 3000,
|
||||
features: { docker: { aliases: ["adguardhome", "adguard-home", "adguard"] } },
|
||||
},
|
||||
technitiumDns: {
|
||||
name: "Technitium DNS",
|
||||
secretKinds: [["apiKey"], ["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/technitium.svg",
|
||||
category: ["dnsHole"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/technitium-dns"),
|
||||
documentationSlug: "technitium-dns",
|
||||
defaultPort: 5380,
|
||||
},
|
||||
homeAssistant: {
|
||||
@@ -229,32 +314,35 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/home-assistant.svg",
|
||||
category: ["smartHomeServer", "calendar"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/home-assistant"),
|
||||
documentationSlug: "home-assistant",
|
||||
defaultPort: 8123,
|
||||
apiKeySettingsPath: "/profile/security",
|
||||
features: { docker: { aliases: ["homeassistant", "home-assistant", "hass"] } },
|
||||
},
|
||||
openmediavault: {
|
||||
name: "OpenMediaVault",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/openmediavault.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/open-media-vault"),
|
||||
documentationSlug: "open-media-vault",
|
||||
defaultPort: 80,
|
||||
features: { docker: { aliases: ["omv"] } },
|
||||
},
|
||||
dashDot: {
|
||||
name: "Dash.",
|
||||
secretKinds: [[]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/dashdot.png",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/dash-dot"),
|
||||
documentationSlug: "dash-dot",
|
||||
defaultPort: 3001,
|
||||
features: { docker: { aliases: ["dashdot", "dash-dot", "dash."] } },
|
||||
},
|
||||
glances: {
|
||||
name: "Glances",
|
||||
secretKinds: [[]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/glances.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/glances"),
|
||||
documentationSlug: "glances",
|
||||
defaultPort: 61208,
|
||||
},
|
||||
tdarr: {
|
||||
@@ -262,7 +350,7 @@ export const integrationDefs = {
|
||||
secretKinds: [[], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/tdarr.png",
|
||||
category: ["mediaTranscoding"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/tdarr"),
|
||||
documentationSlug: "tdarr",
|
||||
defaultPort: 8265,
|
||||
},
|
||||
proxmox: {
|
||||
@@ -270,7 +358,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "tokenId", "apiKey", "realm"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/proxmox.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/proxmox"),
|
||||
documentationSlug: "proxmox",
|
||||
defaultPort: 8006,
|
||||
},
|
||||
nextcloud: {
|
||||
@@ -278,7 +366,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/nextcloud.svg",
|
||||
category: ["calendar", "notifications"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/nextcloud"),
|
||||
documentationSlug: "nextcloud",
|
||||
defaultPort: 443,
|
||||
},
|
||||
unifiController: {
|
||||
@@ -286,15 +374,16 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/unifi.png",
|
||||
category: ["networkController"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/unifi-controller"),
|
||||
documentationSlug: "unifi-controller",
|
||||
defaultPort: 8443,
|
||||
features: { docker: { aliases: ["unifi", "unifi-controller"] } },
|
||||
},
|
||||
opnsense: {
|
||||
name: "OPNsense",
|
||||
secretKinds: [["opnsenseApiKey", "opnsenseApiSecret"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/opnsense.svg",
|
||||
category: ["firewall"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/opnsense"),
|
||||
documentationSlug: "opnsense",
|
||||
defaultPort: 443,
|
||||
apiKeySettingsPath: "/system_usermanager.php",
|
||||
},
|
||||
@@ -303,7 +392,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["topic"], ["topic", "apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/ntfy.svg",
|
||||
category: ["notifications"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/ntfy"),
|
||||
documentationSlug: "ntfy",
|
||||
defaultPort: 80,
|
||||
apiKeySettingsPath: "/account",
|
||||
},
|
||||
@@ -312,7 +401,7 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/gotify.svg",
|
||||
category: ["notifications"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/gotify"),
|
||||
documentationSlug: "gotify",
|
||||
defaultPort: 80,
|
||||
},
|
||||
ical: {
|
||||
@@ -320,14 +409,15 @@ export const integrationDefs = {
|
||||
secretKinds: [["url"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/ical.svg",
|
||||
category: ["calendar"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/ical"),
|
||||
documentationSlug: "ical",
|
||||
features: { docker: { discoverable: false } },
|
||||
},
|
||||
anchor: {
|
||||
name: "Anchor",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/anchor.svg",
|
||||
category: ["notes"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/anchor"),
|
||||
documentationSlug: "anchor",
|
||||
defaultPort: 8080,
|
||||
apiKeySettingsPath: "/settings",
|
||||
},
|
||||
@@ -336,23 +426,25 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/truenas.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/truenas"),
|
||||
documentationSlug: "truenas",
|
||||
defaultPort: 80,
|
||||
features: { docker: { aliases: ["truenas"] } },
|
||||
},
|
||||
synology: {
|
||||
name: "Synology DiskStation",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/synology.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/synology"),
|
||||
documentationSlug: "synology",
|
||||
defaultPort: 5000,
|
||||
features: { docker: { aliases: ["synology", "diskstation"] } },
|
||||
},
|
||||
unraid: {
|
||||
name: "Unraid",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/unraid"),
|
||||
documentationSlug: "unraid",
|
||||
defaultPort: 80,
|
||||
apiKeySettingsPath: "/Settings/ManagementAccess",
|
||||
},
|
||||
@@ -361,16 +453,17 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/coolify.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/coolify"),
|
||||
documentationSlug: "coolify",
|
||||
defaultPort: 8000,
|
||||
apiKeySettingsPath: "/security/api-tokens",
|
||||
features: { docker: { aliases: ["coolify"] } },
|
||||
},
|
||||
immich: {
|
||||
name: "Immich",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/immich.svg",
|
||||
category: ["photoService"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/immich"),
|
||||
documentationSlug: "immich",
|
||||
defaultPort: 2283,
|
||||
apiKeySettingsPath: "/user-settings",
|
||||
},
|
||||
@@ -379,24 +472,26 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/paperless-ngx.svg",
|
||||
category: ["documents"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/paperless-ngx"),
|
||||
documentationSlug: "paperless-ngx",
|
||||
defaultPort: 8000,
|
||||
features: { docker: { aliases: ["paperless-ngx", "paperless"] } },
|
||||
},
|
||||
patchmon: {
|
||||
name: "PatchMon",
|
||||
secretKinds: [["patchmonApiKey", "patchmonApiSecret"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/patchmon.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/patchmon"),
|
||||
documentationSlug: "patchmon",
|
||||
defaultPort: 3413,
|
||||
apiKeySettingsPath: "/settings/integrations",
|
||||
features: { docker: { aliases: ["patchmon", "patch-mon"] } },
|
||||
},
|
||||
tracearr: {
|
||||
name: "Tracearr",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/tracearr.svg",
|
||||
category: ["mediaMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/tracearr"),
|
||||
documentationSlug: "tracearr",
|
||||
defaultPort: 7040,
|
||||
apiKeySettingsPath: "/settings",
|
||||
},
|
||||
@@ -405,35 +500,39 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/speedtest-tracker.png",
|
||||
category: ["speedtest"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/speedtest-tracker"),
|
||||
documentationSlug: "speedtest-tracker",
|
||||
defaultPort: 80,
|
||||
apiKeySettingsPath: "/admin/api-tokens",
|
||||
features: { docker: { aliases: ["speedtest-tracker"] } },
|
||||
},
|
||||
uptimeKuma: {
|
||||
name: "Uptime Kuma",
|
||||
secretKinds: [[], ["slug"], ["slug", "apiKey"], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/uptime-kuma.svg",
|
||||
category: ["uptimeMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/uptime-kuma"),
|
||||
documentationSlug: "uptime-kuma",
|
||||
defaultPort: 3001,
|
||||
apiKeySettingsPath: "/settings/api-keys",
|
||||
features: { docker: { aliases: ["uptime-kuma"] } },
|
||||
},
|
||||
audiobookshelf: {
|
||||
name: "Audiobookshelf",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/audiobookshelf.svg",
|
||||
category: ["mediaLibrary"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/audiobookshelf"),
|
||||
documentationSlug: "audiobookshelf",
|
||||
defaultPort: 13378,
|
||||
apiKeySettingsPath: "/account",
|
||||
features: { docker: { aliases: ["audiobookshelf"] } },
|
||||
},
|
||||
navidrome: {
|
||||
name: "Navidrome",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/navidrome.svg",
|
||||
category: ["mediaLibrary", "mediaService"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/navidrome"),
|
||||
documentationSlug: "navidrome",
|
||||
defaultPort: 4533,
|
||||
features: { docker: { aliases: ["navidrome"] } },
|
||||
},
|
||||
umami: {
|
||||
name: "Umami",
|
||||
@@ -441,7 +540,7 @@ export const integrationDefs = {
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/umami.svg",
|
||||
category: ["analytics"],
|
||||
defaultUrl: "https://api.umami.is/v1",
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/umami"),
|
||||
documentationSlug: "umami",
|
||||
defaultPort: 3000,
|
||||
},
|
||||
peaNut: {
|
||||
@@ -449,23 +548,16 @@ export const integrationDefs = {
|
||||
secretKinds: [["username", "password"], []],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/peanut.svg",
|
||||
category: ["ups"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/peanut"),
|
||||
documentationSlug: "peanut",
|
||||
defaultPort: 8080,
|
||||
},
|
||||
beszel: {
|
||||
name: "Beszel",
|
||||
secretKinds: [["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/beszel.svg",
|
||||
category: ["beszel"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/beszel"),
|
||||
defaultPort: 8090,
|
||||
},
|
||||
...generatedIntegrationDefinitions,
|
||||
gluetun: {
|
||||
name: "Gluetun",
|
||||
secretKinds: [["username", "password"], ["apiKey"], []],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/gluetun.svg",
|
||||
category: ["vpn"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/gluetun"),
|
||||
documentationSlug: "gluetun",
|
||||
defaultPort: 8000,
|
||||
},
|
||||
traefik: {
|
||||
@@ -473,7 +565,7 @@ export const integrationDefs = {
|
||||
secretKinds: [[], ["username", "password"], ["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/traefik.svg",
|
||||
category: ["reverseProxy"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/traefik"),
|
||||
documentationSlug: "traefik",
|
||||
defaultPort: 8080,
|
||||
},
|
||||
archiveTeamWarrior: {
|
||||
@@ -481,7 +573,7 @@ export const integrationDefs = {
|
||||
secretKinds: [[], ["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/selfhst/icons/png/archiveteam-warrior.png",
|
||||
category: ["archiving"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/archiveteam-warrior"),
|
||||
documentationSlug: "archiveteam-warrior",
|
||||
defaultPort: 8001,
|
||||
},
|
||||
wud: {
|
||||
@@ -489,7 +581,7 @@ export const integrationDefs = {
|
||||
secretKinds: [[], ["username", "password"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/whats-up-docker.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/whats-up-docker"),
|
||||
documentationSlug: "whats-up-docker",
|
||||
defaultPort: 3000,
|
||||
},
|
||||
// This integration only returns mock data, it is used during development (but can also be used in production by directly going to the create page)
|
||||
@@ -514,9 +606,13 @@ export const integrationDefs = {
|
||||
"uptimeMonitoring",
|
||||
"mediaOrganizer",
|
||||
],
|
||||
documentationUrl: null,
|
||||
documentationSlug: null,
|
||||
features: {
|
||||
docker: { discoverable: false },
|
||||
onboarding: { hidden: true },
|
||||
},
|
||||
},
|
||||
} as const satisfies Record<string, integrationDefinition>;
|
||||
} as const satisfies Record<string, integrationDefinition>);
|
||||
|
||||
export const integrationKinds = objectKeys(integrationDefs) as AtLeastOneOf<IntegrationKind>;
|
||||
|
||||
@@ -524,11 +620,14 @@ export const getIconUrl = (integration: IntegrationKind) => integrationDefs[inte
|
||||
|
||||
export const getIntegrationName = (integration: IntegrationKind) => integrationDefs[integration].name;
|
||||
|
||||
export const getDefaultSecretKinds = (integration: IntegrationKind): IntegrationSecretKind[] =>
|
||||
integrationDefs[integration].secretKinds[0];
|
||||
export const getDefaultSecretKinds = (integration: IntegrationKind): IntegrationSecretKind[] => [
|
||||
...integrationDefs[integration].secretKinds[0],
|
||||
];
|
||||
|
||||
export const getAllSecretKindOptions = (integration: IntegrationKind): AtLeastOneOf<IntegrationSecretKind[]> =>
|
||||
integrationDefs[integration].secretKinds;
|
||||
integrationDefs[integration].secretKinds.map((secretKinds) => [...secretKinds]) as AtLeastOneOf<
|
||||
IntegrationSecretKind[]
|
||||
>;
|
||||
|
||||
export const getIntegrationDefaultUrl = (integration: IntegrationKind) => {
|
||||
const definition = integrationDefs[integration];
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
import type { AtLeastOneOf } from "@homarr/common/types";
|
||||
|
||||
import type { IntegrationKind } from "./integration";
|
||||
import { getIntegrationKindsByCategory } from "./integration";
|
||||
import type { IntegrationKindByCategory } from "./integration";
|
||||
import { generatedWidgetFeatureCatalog } from "./generated/widget-modules";
|
||||
|
||||
const {
|
||||
weather: generatedWeatherFeature,
|
||||
downloads: generatedDownloadsFeature,
|
||||
...additionalGeneratedWidgetFeatures
|
||||
} = generatedWidgetFeatureCatalog;
|
||||
|
||||
export interface NativeFeatureCapabilityDescriptor {
|
||||
integrations: Readonly<AtLeastOneOf<IntegrationKind>>;
|
||||
connectionOptional?: true;
|
||||
serverMaxIntegrations?: number;
|
||||
}
|
||||
|
||||
interface WidgetFeatureDescriptorBase {
|
||||
documentationSlug: string | null;
|
||||
defaultSize?: Readonly<{ width: number; height: number }>;
|
||||
query?: {
|
||||
paths: readonly (readonly string[])[];
|
||||
refetchIntervalSeconds?: number | null;
|
||||
};
|
||||
}
|
||||
|
||||
interface WidgetFeatureDescriptorWithDefaultName extends WidgetFeatureDescriptorBase {
|
||||
displayNameFromIntegration?: false;
|
||||
capability?: NativeFeatureCapabilityDescriptor;
|
||||
}
|
||||
|
||||
interface WidgetFeatureDescriptorWithIntegrationName extends WidgetFeatureDescriptorBase {
|
||||
displayNameFromIntegration: true;
|
||||
capability: Omit<NativeFeatureCapabilityDescriptor, "integrations"> & {
|
||||
integrations: readonly [IntegrationKind];
|
||||
};
|
||||
}
|
||||
|
||||
export type WidgetFeatureDescriptor =
|
||||
| WidgetFeatureDescriptorWithDefaultName
|
||||
| WidgetFeatureDescriptorWithIntegrationName;
|
||||
|
||||
const defineWidgetFeatureCatalog = <const TCatalog extends Record<string, WidgetFeatureDescriptor>>(
|
||||
catalog: TCatalog,
|
||||
) => catalog;
|
||||
|
||||
type GeneralHealthMonitoringIntegrationKind = Exclude<
|
||||
IntegrationKindByCategory<"healthMonitoring">,
|
||||
"patchmon" | "wud"
|
||||
>;
|
||||
|
||||
const generalHealthMonitoringIntegrationKinds = getIntegrationKindsByCategory("healthMonitoring").filter(
|
||||
(kind): kind is GeneralHealthMonitoringIntegrationKind => kind !== "patchmon" && kind !== "wud",
|
||||
) as AtLeastOneOf<GeneralHealthMonitoringIntegrationKind>;
|
||||
|
||||
/**
|
||||
* Server-safe source of truth for native widgets.
|
||||
*
|
||||
* Keep each widget's stable kind, documentation, default size, and integration
|
||||
* contract together so every lightweight consumer can derive the same view.
|
||||
*/
|
||||
export const widgetFeatureCatalog = defineWidgetFeatureCatalog({
|
||||
clock: {
|
||||
documentationSlug: "clock",
|
||||
defaultSize: { width: 2, height: 1 },
|
||||
query: { paths: [["widget", "weather", "atLocation"]] },
|
||||
},
|
||||
weather: generatedWeatherFeature,
|
||||
airQuality: {
|
||||
documentationSlug: "air-quality",
|
||||
defaultSize: { width: 2, height: 1 },
|
||||
query: { paths: [["widget", "airQuality", "atLocation"]], refetchIntervalSeconds: 900 },
|
||||
},
|
||||
countdown: { documentationSlug: "countdown", defaultSize: { width: 2, height: 1 } },
|
||||
timer: { documentationSlug: "timer", defaultSize: { width: 2, height: 1 } },
|
||||
app: {
|
||||
documentationSlug: "app",
|
||||
query: {
|
||||
paths: [
|
||||
["app", "byId"],
|
||||
["widget", "app", "ping"],
|
||||
],
|
||||
},
|
||||
},
|
||||
iframe: { documentationSlug: "iframe" },
|
||||
video: { documentationSlug: "video" },
|
||||
notebook: { documentationSlug: "notebook" },
|
||||
anchorNote: {
|
||||
documentationSlug: "anchor-note",
|
||||
capability: { integrations: ["anchor"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "anchorNotes"]] },
|
||||
},
|
||||
dnsHoleSummary: {
|
||||
documentationSlug: "dns-hole-summary",
|
||||
capability: { integrations: getIntegrationKindsByCategory("dnsHole") },
|
||||
query: { paths: [["widget", "dnsHole"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
dnsHoleControls: {
|
||||
documentationSlug: "dns-hole-controls",
|
||||
capability: { integrations: getIntegrationKindsByCategory("dnsHole") },
|
||||
query: { paths: [["widget", "dnsHole"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
"smartHome-entityState": {
|
||||
documentationSlug: "smart-home-entity-state",
|
||||
capability: {
|
||||
integrations: getIntegrationKindsByCategory("smartHomeServer"),
|
||||
serverMaxIntegrations: 1,
|
||||
},
|
||||
query: { paths: [["widget", "smartHome"]] },
|
||||
},
|
||||
"smartHome-executeAutomation": {
|
||||
documentationSlug: "smart-home-execute-automation",
|
||||
capability: {
|
||||
integrations: getIntegrationKindsByCategory("smartHomeServer"),
|
||||
serverMaxIntegrations: 1,
|
||||
},
|
||||
},
|
||||
stockPrice: {
|
||||
documentationSlug: "stock-price",
|
||||
query: { paths: [["widget", "stockPrice", "getPriceHistory"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
mediaServer: {
|
||||
documentationSlug: "media-server",
|
||||
capability: { integrations: getIntegrationKindsByCategory("mediaService") },
|
||||
query: { paths: [["widget", "mediaServer", "getCurrentStreams"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
calendar: {
|
||||
documentationSlug: "calendar",
|
||||
capability: { integrations: getIntegrationKindsByCategory("calendar"), connectionOptional: true },
|
||||
query: { paths: [["widget", "calendar", "findAllEvents"]] },
|
||||
},
|
||||
downloads: generatedDownloadsFeature,
|
||||
"mediaRequests-requestList": {
|
||||
documentationSlug: "media-request-list",
|
||||
capability: { integrations: getIntegrationKindsByCategory("mediaRequest") },
|
||||
query: { paths: [["widget", "mediaRequests", "getLatestRequests"]] },
|
||||
},
|
||||
"mediaRequests-requestStats": {
|
||||
documentationSlug: "media-request-stats",
|
||||
capability: { integrations: getIntegrationKindsByCategory("mediaRequest") },
|
||||
query: { paths: [["widget", "mediaRequests", "getStats"]] },
|
||||
},
|
||||
mediaTranscoding: {
|
||||
documentationSlug: "media-transcoding",
|
||||
capability: {
|
||||
integrations: getIntegrationKindsByCategory("mediaTranscoding"),
|
||||
serverMaxIntegrations: 1,
|
||||
},
|
||||
query: { paths: [["widget", "mediaTranscoding", "getDataAsync"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
mediaMissing: {
|
||||
documentationSlug: "media-missing",
|
||||
defaultSize: { width: 4, height: 3 },
|
||||
capability: { integrations: getIntegrationKindsByCategory("mediaOrganizer") },
|
||||
query: { paths: [["widget", "mediaOrganizer", "getData"]] },
|
||||
},
|
||||
minecraftServerStatus: {
|
||||
documentationSlug: "minecraft-server-status",
|
||||
query: { paths: [["widget", "minecraft", "getServerStatus"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
networkControllerSummary: {
|
||||
documentationSlug: "network-controller-summary",
|
||||
capability: { integrations: getIntegrationKindsByCategory("networkController") },
|
||||
query: { paths: [["widget", "networkController"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
networkControllerStatus: {
|
||||
documentationSlug: "network-controller-status",
|
||||
capability: { integrations: getIntegrationKindsByCategory("networkController") },
|
||||
query: { paths: [["widget", "networkController"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
rssFeed: {
|
||||
documentationSlug: "rss-feed",
|
||||
query: { paths: [["widget", "rssFeed", "getFeeds"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
bookmarks: {
|
||||
documentationSlug: "bookmarks",
|
||||
defaultSize: { width: 2, height: 2 },
|
||||
query: { paths: [["app", "byIds"]] },
|
||||
},
|
||||
indexerManager: {
|
||||
documentationSlug: "indexer-manager",
|
||||
capability: { integrations: getIntegrationKindsByCategory("indexerManager") },
|
||||
query: { paths: [["widget", "indexerManager"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
healthMonitoring: {
|
||||
documentationSlug: "health-monitoring",
|
||||
capability: { integrations: generalHealthMonitoringIntegrationKinds },
|
||||
query: {
|
||||
paths: [
|
||||
["integration", "byIds"],
|
||||
["widget", "healthMonitoring"],
|
||||
],
|
||||
refetchIntervalSeconds: 10,
|
||||
},
|
||||
},
|
||||
releases: {
|
||||
documentationSlug: "releases",
|
||||
query: { paths: [["widget", "releases", "getLatest"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
mediaReleases: {
|
||||
documentationSlug: "media-releases",
|
||||
capability: { integrations: ["mock", "emby", "jellyfin", "plex"] },
|
||||
query: { paths: [["widget", "mediaRelease"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
dockerContainers: {
|
||||
documentationSlug: "docker-containers",
|
||||
query: { paths: [["docker", "getContainers"]], refetchIntervalSeconds: 30 },
|
||||
},
|
||||
firewall: {
|
||||
documentationSlug: "firewall",
|
||||
capability: { integrations: getIntegrationKindsByCategory("firewall") },
|
||||
query: { paths: [["widget", "firewall"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
notifications: {
|
||||
documentationSlug: "notifications",
|
||||
capability: { integrations: getIntegrationKindsByCategory("notifications") },
|
||||
query: { paths: [["widget", "notifications", "getNotifications"]] },
|
||||
},
|
||||
systemResources: {
|
||||
documentationSlug: "system-resources",
|
||||
capability: {
|
||||
integrations: ["dashDot", "openmediavault", "truenas", "unraid", "glances", "synology"],
|
||||
},
|
||||
query: { paths: [["widget", "healthMonitoring"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
coolify: {
|
||||
documentationSlug: "coolify",
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["coolify"] },
|
||||
query: { paths: [["widget", "coolify"]] },
|
||||
},
|
||||
systemDisks: {
|
||||
documentationSlug: "system-disks",
|
||||
capability: { integrations: ["dashDot", "openmediavault", "truenas", "unraid", "synology"] },
|
||||
query: { paths: [["widget", "healthMonitoring"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
timetable: {
|
||||
documentationSlug: "timetable",
|
||||
query: { paths: [["widget", "timetable"]] },
|
||||
},
|
||||
"immich-serverStats": {
|
||||
documentationSlug: "immich-server-stats",
|
||||
capability: { integrations: ["immich"], serverMaxIntegrations: 1 },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "immich", "getServerStats"],
|
||||
["widget", "immich", "getAlbums"],
|
||||
],
|
||||
refetchIntervalSeconds: null,
|
||||
},
|
||||
},
|
||||
"immich-albumCarousel": {
|
||||
documentationSlug: "immich-album-carousel",
|
||||
capability: { integrations: ["immich"], serverMaxIntegrations: 1 },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "immich", "getAlbum"],
|
||||
["widget", "immich", "getAlbums"],
|
||||
],
|
||||
refetchIntervalSeconds: null,
|
||||
},
|
||||
},
|
||||
paperlessNgx: {
|
||||
documentationSlug: "paperless-ngx",
|
||||
defaultSize: { width: 2, height: 2 },
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["paperlessNgx"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "paperlessNgx"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
patchmon: {
|
||||
documentationSlug: "patchmon",
|
||||
defaultSize: { width: 2, height: 2 },
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["patchmon"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "patchmon"]] },
|
||||
},
|
||||
bazarr: {
|
||||
documentationSlug: "bazarr",
|
||||
defaultSize: { width: 2, height: 2 },
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["bazarr"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "bazarr"]] },
|
||||
},
|
||||
tracearr: {
|
||||
documentationSlug: "tracearr",
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["tracearr"] },
|
||||
query: { paths: [["widget", "tracearr"]], refetchIntervalSeconds: 10 },
|
||||
},
|
||||
speedtestTracker: {
|
||||
documentationSlug: "speedtest-tracker",
|
||||
capability: { integrations: ["speedtestTracker"] },
|
||||
query: { paths: [["widget", "speedtestTracker"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
uptimeKuma: {
|
||||
documentationSlug: "uptime-kuma",
|
||||
defaultSize: { width: 2, height: 3 },
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["uptimeKuma"] },
|
||||
query: { paths: [["widget", "uptimeKuma"]] },
|
||||
},
|
||||
audioStats: {
|
||||
documentationSlug: "audio-stats",
|
||||
defaultSize: { width: 2, height: 2 },
|
||||
capability: { integrations: ["navidrome", "audiobookshelf"], serverMaxIntegrations: 1 },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "audioStats", "getStats"],
|
||||
["widget", "mediaServer", "getCurrentStreams"],
|
||||
],
|
||||
},
|
||||
},
|
||||
umami: {
|
||||
documentationSlug: "umami",
|
||||
capability: { integrations: ["umami"], serverMaxIntegrations: 1 },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "umami", "getVisitorStats"],
|
||||
["widget", "umami", "getActiveVisitors"],
|
||||
["widget", "umami", "getMultiEventTimeSeries"],
|
||||
["widget", "umami", "getTopPages"],
|
||||
["widget", "umami", "getTopReferrers"],
|
||||
],
|
||||
refetchIntervalSeconds: null,
|
||||
},
|
||||
},
|
||||
vpn: {
|
||||
documentationSlug: "vpn",
|
||||
capability: { integrations: getIntegrationKindsByCategory("vpn") },
|
||||
query: { paths: [["widget", "vpn"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
archiveTeamWarrior: {
|
||||
documentationSlug: null,
|
||||
capability: { integrations: ["archiveTeamWarrior"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "archiveTeamWarrior"]] },
|
||||
},
|
||||
ups: {
|
||||
documentationSlug: "ups",
|
||||
capability: { integrations: getIntegrationKindsByCategory("ups") },
|
||||
query: { paths: [["widget", "ups"]] },
|
||||
},
|
||||
beszelSystemTable: {
|
||||
documentationSlug: "beszel-system-table",
|
||||
capability: { integrations: ["beszel", "mock"] },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "beszel", "getSystems"],
|
||||
["widget", "beszel", "getSystemStats"],
|
||||
],
|
||||
},
|
||||
},
|
||||
beszelSystemGrid: {
|
||||
documentationSlug: "beszel-system-grid",
|
||||
capability: { integrations: ["beszel", "mock"] },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "beszel", "getSystems"],
|
||||
["widget", "beszel", "getSystemStats"],
|
||||
],
|
||||
},
|
||||
},
|
||||
beszelAlerts: {
|
||||
documentationSlug: "beszel-alerts",
|
||||
capability: { integrations: ["beszel", "mock"] },
|
||||
query: { paths: [["widget", "beszel", "getAlerts"]] },
|
||||
},
|
||||
beszelSystemStats: {
|
||||
documentationSlug: "beszel-system-stats",
|
||||
capability: { integrations: ["beszel", "mock"] },
|
||||
query: {
|
||||
paths: [
|
||||
["widget", "beszel", "getSystems"],
|
||||
["widget", "beszel", "getSystemStats"],
|
||||
],
|
||||
},
|
||||
},
|
||||
traefik: {
|
||||
documentationSlug: "traefik",
|
||||
displayNameFromIntegration: true,
|
||||
capability: { integrations: ["traefik"] },
|
||||
query: { paths: [["widget", "traefik"]] },
|
||||
},
|
||||
customApi: {
|
||||
documentationSlug: "custom-api",
|
||||
query: { paths: [["widget", "customApi"]] },
|
||||
},
|
||||
assistant: { documentationSlug: "assistant", defaultSize: { width: 10, height: 4 } },
|
||||
wud: {
|
||||
documentationSlug: "whats-up-docker",
|
||||
capability: { integrations: ["wud"], serverMaxIntegrations: 1 },
|
||||
query: { paths: [["widget", "wud"]], refetchIntervalSeconds: null },
|
||||
},
|
||||
...additionalGeneratedWidgetFeatures,
|
||||
});
|
||||
|
||||
export type WidgetFeatureKind = keyof typeof widgetFeatureCatalog;
|
||||
|
||||
export type WidgetIntegrationKind<TKind extends WidgetFeatureKind> = (typeof widgetFeatureCatalog)[TKind] extends {
|
||||
capability: { integrations: readonly (infer TIntegrationKind extends IntegrationKind)[] };
|
||||
}
|
||||
? TIntegrationKind
|
||||
: never;
|
||||
|
||||
export type WidgetKindWithIntegration = {
|
||||
[TKind in WidgetFeatureKind]: WidgetIntegrationKind<TKind> extends never ? never : TKind;
|
||||
}[WidgetFeatureKind];
|
||||
|
||||
export const getWidgetFeatureIntegrationKinds = <TKind extends WidgetKindWithIntegration>(
|
||||
kind: TKind,
|
||||
): AtLeastOneOf<WidgetIntegrationKind<TKind>> => {
|
||||
const descriptor = widgetFeatureCatalog[kind];
|
||||
if (!("capability" in descriptor) || descriptor.capability.integrations.length === 0) {
|
||||
throw new Error(`Widget kind ${kind} does not declare integration support`);
|
||||
}
|
||||
|
||||
return [...descriptor.capability.integrations] as AtLeastOneOf<WidgetIntegrationKind<TKind>>;
|
||||
};
|
||||
@@ -1,73 +1,22 @@
|
||||
import { createDocumentationLink } from "./docs";
|
||||
import type { IntegrationKind } from "./integration";
|
||||
import { getIntegrationKindsByCategory, integrationKinds } from "./integration";
|
||||
import { integrationKinds } from "./integration";
|
||||
import type { WidgetKind } from "./widget";
|
||||
import { widgetDefaultSizes } from "./widget";
|
||||
import { widgetDefaultSizes, widgetFeatureCatalog, widgetKinds } from "./widget";
|
||||
import type { NativeFeatureCapabilityDescriptor } from "./widget-feature-catalog";
|
||||
|
||||
/**
|
||||
* Server-safe capability metadata shared by the API and widget catalog.
|
||||
* Keep this intentionally small: presentation, options, and request contracts
|
||||
* remain owned by their feature packages.
|
||||
*/
|
||||
export interface NativeFeatureCapabilityDescriptor {
|
||||
integrations: readonly IntegrationKind[];
|
||||
connectionOptional?: true;
|
||||
serverMaxIntegrations?: number;
|
||||
}
|
||||
export type { NativeFeatureCapabilityDescriptor } from "./widget-feature-catalog";
|
||||
|
||||
export const nativeFeatureCapabilities = {
|
||||
dnsHoleSummary: { integrations: getIntegrationKindsByCategory("dnsHole") },
|
||||
dnsHoleControls: { integrations: getIntegrationKindsByCategory("dnsHole") },
|
||||
"smartHome-entityState": {
|
||||
integrations: getIntegrationKindsByCategory("smartHomeServer"),
|
||||
serverMaxIntegrations: 1,
|
||||
},
|
||||
"smartHome-executeAutomation": {
|
||||
integrations: getIntegrationKindsByCategory("smartHomeServer"),
|
||||
serverMaxIntegrations: 1,
|
||||
},
|
||||
mediaServer: { integrations: getIntegrationKindsByCategory("mediaService") },
|
||||
calendar: { integrations: getIntegrationKindsByCategory("calendar"), connectionOptional: true },
|
||||
downloads: { integrations: getIntegrationKindsByCategory("downloadClient") },
|
||||
"mediaRequests-requestList": { integrations: getIntegrationKindsByCategory("mediaRequest") },
|
||||
"mediaRequests-requestStats": { integrations: getIntegrationKindsByCategory("mediaRequest") },
|
||||
mediaTranscoding: { integrations: getIntegrationKindsByCategory("mediaTranscoding"), serverMaxIntegrations: 1 },
|
||||
mediaMissing: { integrations: getIntegrationKindsByCategory("mediaOrganizer") },
|
||||
networkControllerSummary: { integrations: getIntegrationKindsByCategory("networkController") },
|
||||
networkControllerStatus: { integrations: getIntegrationKindsByCategory("networkController") },
|
||||
indexerManager: { integrations: getIntegrationKindsByCategory("indexerManager") },
|
||||
healthMonitoring: {
|
||||
integrations: getIntegrationKindsByCategory("healthMonitoring").filter(
|
||||
(kind) => kind !== "patchmon" && kind !== "wud",
|
||||
),
|
||||
},
|
||||
firewall: { integrations: getIntegrationKindsByCategory("firewall") },
|
||||
notifications: { integrations: getIntegrationKindsByCategory("notifications") },
|
||||
mediaReleases: { integrations: ["mock", "emby", "jellyfin", "plex"] },
|
||||
systemResources: { integrations: ["dashDot", "openmediavault", "truenas", "unraid", "glances", "synology"] },
|
||||
systemDisks: { integrations: ["dashDot", "openmediavault", "truenas", "unraid", "synology"] },
|
||||
beszelAlerts: { integrations: ["beszel", "mock"] },
|
||||
beszelSystemGrid: { integrations: ["beszel", "mock"] },
|
||||
beszelSystemStats: { integrations: ["beszel", "mock"] },
|
||||
beszelSystemTable: { integrations: ["beszel", "mock"] },
|
||||
coolify: { integrations: ["coolify"] },
|
||||
"immich-serverStats": { integrations: ["immich"], serverMaxIntegrations: 1 },
|
||||
"immich-albumCarousel": { integrations: ["immich"], serverMaxIntegrations: 1 },
|
||||
paperlessNgx: { integrations: ["paperlessNgx"], serverMaxIntegrations: 1 },
|
||||
patchmon: { integrations: ["patchmon"], serverMaxIntegrations: 1 },
|
||||
bazarr: { integrations: ["bazarr"], serverMaxIntegrations: 1 },
|
||||
tracearr: { integrations: ["tracearr"] },
|
||||
speedtestTracker: { integrations: ["speedtestTracker"] },
|
||||
uptimeKuma: { integrations: ["uptimeKuma"] },
|
||||
audioStats: { integrations: ["navidrome", "audiobookshelf"], serverMaxIntegrations: 1 },
|
||||
umami: { integrations: ["umami"], serverMaxIntegrations: 1 },
|
||||
vpn: { integrations: getIntegrationKindsByCategory("vpn") },
|
||||
ups: { integrations: getIntegrationKindsByCategory("ups") },
|
||||
archiveTeamWarrior: { integrations: ["archiveTeamWarrior"], serverMaxIntegrations: 1 },
|
||||
anchorNote: { integrations: ["anchor"], serverMaxIntegrations: 1 },
|
||||
traefik: { integrations: ["traefik"] },
|
||||
wud: { integrations: ["wud"], serverMaxIntegrations: 1 },
|
||||
} as const satisfies Partial<Record<WidgetKind, NativeFeatureCapabilityDescriptor>>;
|
||||
const createNativeFeatureCapabilities = () => {
|
||||
const result: Partial<Record<WidgetKind, NativeFeatureCapabilityDescriptor>> = {};
|
||||
for (const kind of widgetKinds) {
|
||||
const descriptor = widgetFeatureCatalog[kind];
|
||||
if ("capability" in descriptor) result[kind] = descriptor.capability;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const nativeFeatureCapabilities = createNativeFeatureCapabilities();
|
||||
|
||||
const nativeFeatureCapabilityEntries = Object.entries(nativeFeatureCapabilities) as [
|
||||
WidgetKind,
|
||||
@@ -108,20 +57,24 @@ export type WidgetIntegrationIssue =
|
||||
|
||||
export const getWidgetIntegrationIssue = (
|
||||
widgetKind: WidgetKind,
|
||||
integrationKinds: readonly IntegrationKind[],
|
||||
selectedIntegrationKinds: readonly IntegrationKind[],
|
||||
): WidgetIntegrationIssue | null => {
|
||||
const supportedIntegrations = widgetIntegrationSupport[widgetKind];
|
||||
const integrationLimit = widgetIntegrationLimits[widgetKind] ?? Number.POSITIVE_INFINITY;
|
||||
if (integrationKinds.length > integrationLimit) return { code: "integration-limit", limit: integrationLimit };
|
||||
if (supportedIntegrations === undefined && integrationKinds.length > 0) return { code: "integration-not-supported" };
|
||||
if (selectedIntegrationKinds.length > integrationLimit) {
|
||||
return { code: "integration-limit", limit: integrationLimit };
|
||||
}
|
||||
if (supportedIntegrations === undefined && selectedIntegrationKinds.length > 0) {
|
||||
return { code: "integration-not-supported" };
|
||||
}
|
||||
if (
|
||||
supportedIntegrations !== undefined &&
|
||||
integrationKinds.length === 0 &&
|
||||
selectedIntegrationKinds.length === 0 &&
|
||||
!widgetKindsWithOptionalIntegrations.has(widgetKind)
|
||||
) {
|
||||
return { code: "integration-required" };
|
||||
}
|
||||
const incompatibleKinds = integrationKinds.filter((kind) => !supportedIntegrations?.includes(kind));
|
||||
const incompatibleKinds = selectedIntegrationKinds.filter((kind) => !supportedIntegrations?.includes(kind));
|
||||
return incompatibleKinds.length > 0 ? { code: "incompatible-integration", incompatibleKinds } : null;
|
||||
};
|
||||
|
||||
@@ -147,9 +100,9 @@ const createIntegrationWidgetSupport = () => {
|
||||
|
||||
export const integrationWidgetSupport = createIntegrationWidgetSupport();
|
||||
|
||||
export const getWidgetKindsForIntegration = (integrationKind: IntegrationKind): WidgetKind[] => [
|
||||
...integrationWidgetSupport[integrationKind],
|
||||
];
|
||||
export const getWidgetKindsForIntegration = (integrationKind: IntegrationKind): WidgetKind[] => {
|
||||
return [...integrationWidgetSupport[integrationKind]];
|
||||
};
|
||||
|
||||
export interface DefaultWidgetConfig {
|
||||
kind: WidgetKind;
|
||||
@@ -159,12 +112,28 @@ export interface DefaultWidgetConfig {
|
||||
skip?: boolean;
|
||||
}
|
||||
|
||||
export const defaultWidgetConfigs: DefaultWidgetConfig[] = [
|
||||
{ kind: "clock", width: 2, height: 1 },
|
||||
{ kind: "weather", width: 2, height: 1, options: { showHumidity: false, showCity: false, hasForecast: false } },
|
||||
{ kind: "bookmarks", width: 2, height: 2, options: { title: "Useful Links", layout: "grid", openNewTab: true } },
|
||||
type WidgetKindWithDefaultSize = {
|
||||
[TKind in WidgetKind]: (typeof widgetFeatureCatalog)[TKind] extends { defaultSize: Readonly<{ width: number }> }
|
||||
? TKind
|
||||
: never;
|
||||
}[WidgetKind];
|
||||
|
||||
type DefaultWidgetConfigRecipe = Omit<DefaultWidgetConfig, "kind" | "width" | "height"> & {
|
||||
kind: WidgetKindWithDefaultSize;
|
||||
};
|
||||
|
||||
const defaultWidgetConfigDefinitions: DefaultWidgetConfigRecipe[] = [
|
||||
{ kind: "clock" },
|
||||
{ kind: "weather", options: { showHumidity: false, showCity: false, hasForecast: false } },
|
||||
{ kind: "bookmarks", options: { title: "Useful Links", layout: "grid", openNewTab: true } },
|
||||
];
|
||||
|
||||
export const defaultWidgetConfigs: DefaultWidgetConfig[] = defaultWidgetConfigDefinitions.map((recipe) => {
|
||||
const defaultSize = widgetDefaultSizes[recipe.kind];
|
||||
if (!defaultSize) throw new Error(`Default widget ${recipe.kind} must declare a default size`);
|
||||
return { ...recipe, ...defaultSize };
|
||||
});
|
||||
|
||||
const defaultWidgetConfigByKind = new Map(defaultWidgetConfigs.map((config) => [config.kind, config]));
|
||||
|
||||
export const getDefaultWidgetConfig = (kind: WidgetKind): DefaultWidgetConfig =>
|
||||
@@ -174,18 +143,6 @@ export const generalWidgets: WidgetKind[] = defaultWidgetConfigs
|
||||
.filter((config) => !config.skip)
|
||||
.map((config) => config.kind);
|
||||
|
||||
export const featuredIntegrations: readonly IntegrationKind[] = [
|
||||
"sonarr",
|
||||
"radarr",
|
||||
"prowlarr",
|
||||
"sabNzbd",
|
||||
"qBittorrent",
|
||||
"seerr",
|
||||
"jellyfin",
|
||||
];
|
||||
|
||||
export const hiddenFromOnboarding = new Set<IntegrationKind>(["mock"]);
|
||||
|
||||
export const defaultBookmarkApps = [
|
||||
{
|
||||
name: "Homarr Docs",
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
import type { AtLeastOneOf } from "@homarr/common/types";
|
||||
|
||||
import type { IntegrationCategory, IntegrationKind } from "./integration";
|
||||
|
||||
export type WidgetModuleIconName = `Icon${string}`;
|
||||
export type WidgetModuleOperationKind = "query" | "mutation" | "subscription" | "route";
|
||||
|
||||
export interface WidgetModuleClientPolicy {
|
||||
refetchIntervalSeconds?: number | null;
|
||||
staleTimeSeconds?: number;
|
||||
persist?: boolean;
|
||||
}
|
||||
|
||||
export interface WidgetModuleServerCachePolicy {
|
||||
namespace: string;
|
||||
ttlMs: number;
|
||||
staleIfErrorTtlMs?: number;
|
||||
scope: "integration" | "shared" | "private";
|
||||
}
|
||||
|
||||
export interface WidgetModuleOperation {
|
||||
name: string;
|
||||
kind?: WidgetModuleOperationKind;
|
||||
path: readonly [string, ...string[]];
|
||||
client?: WidgetModuleClientPolicy;
|
||||
serverCache?: WidgetModuleServerCachePolicy;
|
||||
}
|
||||
|
||||
type WidgetModuleIntegrationSelection =
|
||||
| {
|
||||
categories: Readonly<AtLeastOneOf<IntegrationCategory>>;
|
||||
kinds?: readonly IntegrationKind[];
|
||||
}
|
||||
| {
|
||||
categories?: readonly IntegrationCategory[];
|
||||
kinds: Readonly<AtLeastOneOf<IntegrationKind>>;
|
||||
};
|
||||
|
||||
export type WidgetModuleIntegrationCapability = WidgetModuleIntegrationSelection & {
|
||||
excludeKinds?: readonly IntegrationKind[];
|
||||
connectionOptional?: true;
|
||||
serverMaxIntegrations?: number;
|
||||
};
|
||||
|
||||
export interface WidgetModuleRouterRegistration {
|
||||
namespace: string;
|
||||
module: string;
|
||||
exportName: string;
|
||||
additionalWidgetKinds?: readonly string[];
|
||||
mcp?: true | string;
|
||||
}
|
||||
|
||||
export interface WidgetModuleDocumentation {
|
||||
slug: string;
|
||||
sourceDirectory: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pure authoring contract for a vertical widget module.
|
||||
*
|
||||
* This descriptor intentionally contains import paths instead of importing
|
||||
* client or server implementations. The sync tool turns them into explicit
|
||||
* static imports for Next.js and Turbopack without crossing runtime boundaries.
|
||||
*/
|
||||
export interface WidgetModuleDefinition {
|
||||
kind: string;
|
||||
icon: WidgetModuleIconName;
|
||||
clientEntry: string;
|
||||
documentation: WidgetModuleDocumentation;
|
||||
defaultSize?: Readonly<{ width: number; height: number }>;
|
||||
displayNameFromIntegration?: true;
|
||||
integration?: WidgetModuleIntegrationCapability;
|
||||
operations?: readonly WidgetModuleOperation[];
|
||||
routers?: readonly WidgetModuleRouterRegistration[];
|
||||
}
|
||||
|
||||
export const defineWidgetModule = <const TDefinition extends WidgetModuleDefinition>(definition: TDefinition) =>
|
||||
definition;
|
||||
|
||||
export type WidgetServerPermission =
|
||||
| "public"
|
||||
| "authenticated"
|
||||
| "integration-query"
|
||||
| "integration-interact"
|
||||
| "custom";
|
||||
|
||||
export interface WidgetServerInputSchema<TInput> {
|
||||
parseAsync: (input: unknown) => Promise<TInput>;
|
||||
}
|
||||
|
||||
export interface WidgetServerContext<TServices = unknown, TAuthorization = unknown> {
|
||||
services: TServices;
|
||||
authorization: TAuthorization;
|
||||
signal: AbortSignal;
|
||||
}
|
||||
|
||||
export interface WidgetServerOperationDefinition<TInput, TOutput, TContext = WidgetServerContext> {
|
||||
kind: "query" | "mutation";
|
||||
permission: WidgetServerPermission;
|
||||
input: WidgetServerInputSchema<TInput>;
|
||||
cache?: WidgetModuleServerCachePolicy;
|
||||
resolve: (context: TContext, input: TInput) => Promise<TOutput>;
|
||||
}
|
||||
|
||||
export interface WidgetServerSubscriptionDefinition<TInput, TOutput, TContext = WidgetServerContext> {
|
||||
kind: "subscription";
|
||||
permission: WidgetServerPermission;
|
||||
input: WidgetServerInputSchema<TInput>;
|
||||
transport: "sse" | "websocket";
|
||||
subscribe: (context: TContext, input: TInput) => AsyncIterable<TOutput>;
|
||||
}
|
||||
|
||||
export interface WidgetServerRouteDefinition<TRequest = unknown, TResponse = unknown, TContext = WidgetServerContext> {
|
||||
kind: "route";
|
||||
permission: WidgetServerPermission;
|
||||
handle: (context: TContext, request: TRequest) => Promise<TResponse>;
|
||||
}
|
||||
|
||||
export const defineWidgetServerOperation = <TInput, TOutput, TContext = WidgetServerContext>(
|
||||
operation: WidgetServerOperationDefinition<TInput, TOutput, TContext>,
|
||||
) => operation;
|
||||
|
||||
export const defineWidgetServerSubscription = <TInput, TOutput, TContext = WidgetServerContext>(
|
||||
subscription: WidgetServerSubscriptionDefinition<TInput, TOutput, TContext>,
|
||||
) => subscription;
|
||||
|
||||
export const defineWidgetServerRoute = <TRequest, TResponse, TContext = WidgetServerContext>(
|
||||
route: WidgetServerRouteDefinition<TRequest, TResponse, TContext>,
|
||||
) => route;
|
||||
|
||||
export const defineWidgetServerModule = <
|
||||
const TModule extends {
|
||||
operations?: Readonly<Record<string, object>>;
|
||||
subscriptions?: Readonly<Record<string, object>>;
|
||||
routes?: Readonly<Record<string, object>>;
|
||||
},
|
||||
>(
|
||||
module: TModule,
|
||||
) => module;
|
||||
@@ -1,21 +1,11 @@
|
||||
import type { IntegrationKind } from "./integration";
|
||||
import { getIntegrationName } from "./integration";
|
||||
import type { WidgetKind } from "./widget";
|
||||
|
||||
const widgetIntegrationKinds: Partial<Record<WidgetKind, IntegrationKind>> = {
|
||||
coolify: "coolify",
|
||||
tracearr: "tracearr",
|
||||
paperlessNgx: "paperlessNgx",
|
||||
patchmon: "patchmon",
|
||||
bazarr: "bazarr",
|
||||
uptimeKuma: "uptimeKuma",
|
||||
traefik: "traefik",
|
||||
};
|
||||
import { widgetFeatureCatalog } from "./widget-feature-catalog";
|
||||
|
||||
export const getWidgetIntegrationName = (kind: WidgetKind): string | undefined => {
|
||||
const integrationKind = widgetIntegrationKinds[kind];
|
||||
if (!integrationKind) return undefined;
|
||||
return getIntegrationName(integrationKind);
|
||||
const descriptor = widgetFeatureCatalog[kind];
|
||||
if (!("displayNameFromIntegration" in descriptor) || !descriptor.displayNameFromIntegration) return undefined;
|
||||
return getIntegrationName(descriptor.capability.integrations[0]);
|
||||
};
|
||||
|
||||
type WidgetNameTranslator = (key: never) => string;
|
||||
|
||||
@@ -1,75 +1,19 @@
|
||||
export const widgetKinds = [
|
||||
"clock",
|
||||
"weather",
|
||||
"airQuality",
|
||||
"countdown",
|
||||
"timer",
|
||||
"app",
|
||||
"iframe",
|
||||
"video",
|
||||
"notebook",
|
||||
"anchorNote",
|
||||
"dnsHoleSummary",
|
||||
"dnsHoleControls",
|
||||
"smartHome-entityState",
|
||||
"smartHome-executeAutomation",
|
||||
"stockPrice",
|
||||
"mediaServer",
|
||||
"calendar",
|
||||
"downloads",
|
||||
"mediaRequests-requestList",
|
||||
"mediaRequests-requestStats",
|
||||
"mediaTranscoding",
|
||||
"mediaMissing",
|
||||
"minecraftServerStatus",
|
||||
"networkControllerSummary",
|
||||
"networkControllerStatus",
|
||||
"rssFeed",
|
||||
"bookmarks",
|
||||
"indexerManager",
|
||||
"healthMonitoring",
|
||||
"releases",
|
||||
"mediaReleases",
|
||||
"dockerContainers",
|
||||
"firewall",
|
||||
"notifications",
|
||||
"systemResources",
|
||||
"coolify",
|
||||
"systemDisks",
|
||||
"timetable",
|
||||
"immich-serverStats",
|
||||
"immich-albumCarousel",
|
||||
"paperlessNgx",
|
||||
"patchmon",
|
||||
"bazarr",
|
||||
"tracearr",
|
||||
"speedtestTracker",
|
||||
"uptimeKuma",
|
||||
"audioStats",
|
||||
"umami",
|
||||
"vpn",
|
||||
"archiveTeamWarrior",
|
||||
"ups",
|
||||
"beszelSystemTable",
|
||||
"beszelSystemGrid",
|
||||
"beszelAlerts",
|
||||
"beszelSystemStats",
|
||||
"traefik",
|
||||
"customApi",
|
||||
"assistant",
|
||||
"wud",
|
||||
] as const;
|
||||
export type WidgetKind = (typeof widgetKinds)[number];
|
||||
import { widgetFeatureCatalog } from "./widget-feature-catalog";
|
||||
|
||||
export const widgetDefaultSizes: Partial<Record<WidgetKind, { width: number; height: number }>> = {
|
||||
airQuality: { width: 2, height: 1 },
|
||||
countdown: { width: 2, height: 1 },
|
||||
timer: { width: 2, height: 1 },
|
||||
uptimeKuma: { width: 2, height: 3 },
|
||||
audioStats: { width: 2, height: 2 },
|
||||
paperlessNgx: { width: 2, height: 2 },
|
||||
patchmon: { width: 2, height: 2 },
|
||||
mediaMissing: { width: 4, height: 3 },
|
||||
bazarr: { width: 2, height: 2 },
|
||||
assistant: { width: 10, height: 4 },
|
||||
export * from "./widget-feature-catalog";
|
||||
export type { WidgetFeatureDescriptor } from "./widget-feature-catalog";
|
||||
|
||||
export type WidgetKind = keyof typeof widgetFeatureCatalog;
|
||||
|
||||
export const widgetKinds = Object.keys(widgetFeatureCatalog) as unknown as readonly [WidgetKind, ...WidgetKind[]];
|
||||
|
||||
const createWidgetDefaultSizes = () => {
|
||||
const result: Partial<Record<WidgetKind, { width: number; height: number }>> = {};
|
||||
for (const kind of widgetKinds) {
|
||||
const descriptor = widgetFeatureCatalog[kind];
|
||||
if ("defaultSize" in descriptor) result[kind] = descriptor.defaultSize;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const widgetDefaultSizes = createWidgetDefaultSizes();
|
||||
Reference in new issue
Block a user