Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d01e3aa0 | ||
|
|
292dfbed8c | ||
|
|
00fad39792 | ||
|
|
778533a62e |
No files matched your search
@@ -40,11 +40,14 @@ An optional description that can be shown as tooltip on the app widget.
|
|||||||
|
|
||||||
The URL to the website you want to link to. Clicking on the app widget or bookmark will open this URL.
|
The URL to the website you want to link to. Clicking on the app widget or bookmark will open this URL.
|
||||||
|
|
||||||
|
You can also use custom URI schemes such as `vscode://file/path`, `microsoft-edge:https://example.com`, or `myapp://open` to link to local applications or third-party programs. We trust that you know what you are doing — only `javascript:` URIs are blocked for security reasons.
|
||||||
|
|
||||||
### Ping URL
|
### Ping URL
|
||||||
|
|
||||||
When you want to use another url for the simple status check you can set it here.
|
When you want to use another url for the simple status check you can set it here.
|
||||||
This will allow you to set a different URL for the ping than the URL that is opened when clicking on the app widget.
|
This will allow you to set a different URL for the ping than the URL that is opened when clicking on the app widget.
|
||||||
It's useful when you want to ping the service internally for example with a custom ip but open the website externally.
|
It's useful when you want to ping the service internally for example with a custom ip but open the website externally.
|
||||||
|
Note that the ping URL only accepts `http://` and `https://` URLs — custom URI schemes are not supported for pings.
|
||||||
|
|
||||||
## List of apps
|
## List of apps
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { notFound } from "next/navigation";
|
|
||||||
import { Container, Fieldset, Group, Stack, Title } from "@mantine/core";
|
import { Container, Fieldset, Group, Stack, Title } from "@mantine/core";
|
||||||
|
|
||||||
import { auth } from "@homarr/auth/next";
|
|
||||||
import { api } from "@homarr/api/server";
|
import { api } from "@homarr/api/server";
|
||||||
import { getIntegrationName } from "@homarr/definitions";
|
import { getIntegrationName } from "@homarr/definitions";
|
||||||
import { getI18n, getScopedI18n } from "@homarr/translation/server";
|
import { getI18n, getScopedI18n } from "@homarr/translation/server";
|
||||||
@@ -18,11 +16,6 @@ interface EditIntegrationPageProps {
|
|||||||
|
|
||||||
export default async function EditIntegrationPage(props: EditIntegrationPageProps) {
|
export default async function EditIntegrationPage(props: EditIntegrationPageProps) {
|
||||||
const params = await props.params;
|
const params = await props.params;
|
||||||
const session = await auth();
|
|
||||||
|
|
||||||
if (!session?.user.permissions.includes("integration-full-all")) {
|
|
||||||
notFound();
|
|
||||||
}
|
|
||||||
const editT = await getScopedI18n("integration.page.edit");
|
const editT = await getScopedI18n("integration.page.edit");
|
||||||
const t = await getI18n();
|
const t = await getI18n();
|
||||||
const integration = await api.integration.byId({ id: params.id }).catch(catchTrpcNotFound);
|
const integration = await api.integration.byId({ id: params.id }).catch(catchTrpcNotFound);
|
||||||
|
|||||||
@@ -23,10 +23,7 @@ interface NewIntegrationPageProps {
|
|||||||
export default async function IntegrationsNewPage(props: NewIntegrationPageProps) {
|
export default async function IntegrationsNewPage(props: NewIntegrationPageProps) {
|
||||||
const searchParams = await props.searchParams;
|
const searchParams = await props.searchParams;
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (
|
if (!session?.user.permissions.includes("integration-create")) {
|
||||||
!session?.user.permissions.includes("integration-full-all") ||
|
|
||||||
!session?.user.permissions.includes("integration-create")
|
|
||||||
) {
|
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import { notFound, redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
AccordionControl,
|
AccordionControl,
|
||||||
AccordionItem,
|
AccordionItem,
|
||||||
@@ -50,9 +50,6 @@ export default async function IntegrationsPage(props: IntegrationsPageProps) {
|
|||||||
if (!session) {
|
if (!session) {
|
||||||
redirect("/auth/login");
|
redirect("/auth/login");
|
||||||
}
|
}
|
||||||
if (!session.user.permissions.includes("integration-full-all")) {
|
|
||||||
notFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
const integrations = await api.integration.all();
|
const integrations = await api.integration.all();
|
||||||
const t = await getScopedI18n("integration");
|
const t = await getScopedI18n("integration");
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
|
|||||||
icon: IconAffiliateFilled,
|
icon: IconAffiliateFilled,
|
||||||
href: "/manage/integrations",
|
href: "/manage/integrations",
|
||||||
label: t("items.integrations"),
|
label: t("items.integrations"),
|
||||||
hidden: !session?.user.permissions.includes("integration-full-all"),
|
hidden: !session?.user.permissions.includes("integration-create"),
|
||||||
"data-onboarding-tour-id": "manage-integrations",
|
"data-onboarding-tour-id": "manage-integrations",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export const appRouter = createTRPCRouter({
|
|||||||
mcp: {
|
mcp: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
description:
|
description:
|
||||||
"Create a new app (bookmark/shortcut to a service). REQUIRED: name (string), iconUrl (icon URL string), href (app URL, http/https or blank). OPTIONAL: description (string or null), pingUrl (URL to check reachability, or empty string)",
|
"Create a new app (bookmark/shortcut to a service). REQUIRED: name (string), iconUrl (icon URL string), href (app URL or custom URI scheme such as vscode://, or blank). OPTIONAL: description (string or null), pingUrl (URL to check reachability, or empty string)",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export const homeRouter = createTRPCRouter({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.session?.user.permissions.includes("integration-full-all")) {
|
if (ctx.session?.user.permissions.includes("integration-create")) {
|
||||||
statistics.push({
|
statistics.push({
|
||||||
titleKey: "integration",
|
titleKey: "integration",
|
||||||
subtitleKey: "resources",
|
subtitleKey: "resources",
|
||||||
|
|||||||
@@ -62,13 +62,12 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
requiredSecrets: def.secretKinds,
|
requiredSecrets: def.secretKinds,
|
||||||
}));
|
}));
|
||||||
}),
|
}),
|
||||||
all: permissionRequiredProcedure
|
all: protectedProcedure
|
||||||
.requiresPermission("integration-full-all")
|
|
||||||
.meta({
|
.meta({
|
||||||
mcp: {
|
mcp: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
description:
|
description:
|
||||||
"List all configured integrations (connections to services like Sonarr, Radarr, Plex, etc.). Requires integration-full-all permission. Returns each integration's id, name, kind, url, and permissions. Use the 'id' field as 'integrationId' in other tools. Check permissions.hasUseAccess before reading data and permissions.hasInteractAccess before performing actions — false means the API key owner lacks that permission level for this integration, not an error",
|
"List all configured integrations (connections to services like Sonarr, Radarr, Plex, etc.). Returns each integration's id, name, kind, url, and permissions. Use the 'id' field as 'integrationId' in other tools. Check permissions.hasUseAccess before reading data and permissions.hasInteractAccess before performing actions — false means the API key owner lacks that permission level for this integration, not an error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.query(async ({ ctx }) => {
|
.query(async ({ ctx }) => {
|
||||||
@@ -297,7 +296,6 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
create: permissionRequiredProcedure
|
create: permissionRequiredProcedure
|
||||||
.requiresPermission("integration-full-all")
|
|
||||||
.requiresPermission("integration-create")
|
.requiresPermission("integration-create")
|
||||||
.meta({
|
.meta({
|
||||||
mcp: {
|
mcp: {
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ export const releasesRouter = createTRPCRouter({
|
|||||||
id: repositoryId,
|
id: repositoryId,
|
||||||
provider: repository.provider,
|
provider: repository.provider,
|
||||||
timestamp: response.timestamp,
|
timestamp: response.timestamp,
|
||||||
success: true as const,
|
|
||||||
...response.data,
|
...response.data,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -95,9 +95,7 @@ export const globalCommandGroup = createGroup<Command>({
|
|||||||
icon: IconPlug,
|
icon: IconPlug,
|
||||||
name: tOption("newIntegration.label"),
|
name: tOption("newIntegration.label"),
|
||||||
useInteraction: interaction.children(newIntegrationChildrenOptions),
|
useInteraction: interaction.children(newIntegrationChildrenOptions),
|
||||||
hidden:
|
hidden: !session?.user.permissions.includes("integration-create"),
|
||||||
!session?.user.permissions.includes("integration-full-all") ||
|
|
||||||
!session?.user.permissions.includes("integration-create"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
commandKey: "newUser",
|
commandKey: "newUser",
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export const pagesSearchGroup = createGroup<{
|
|||||||
icon: IconPlug,
|
icon: IconPlug,
|
||||||
path: "/manage/integrations",
|
path: "/manage/integrations",
|
||||||
name: t("manageIntegration.label"),
|
name: t("manageIntegration.label"),
|
||||||
hidden: !session?.user.permissions.includes("integration-full-all"),
|
hidden: !session,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: IconSearch,
|
icon: IconSearch,
|
||||||
|
|||||||
@@ -3,12 +3,7 @@ import { z } from "zod/v4";
|
|||||||
export const appHrefSchema = z
|
export const appHrefSchema = z
|
||||||
.string()
|
.string()
|
||||||
.trim()
|
.trim()
|
||||||
.url()
|
.refine((val) => !/^javascript:/i.test(val), "JavaScript URIs are not permitted")
|
||||||
.regex(/^(?!javascript)[a-zA-Z]*:\/\//i) // javascript: is not allowed, i for case insensitive (so Javascript: is also not allowed)
|
|
||||||
.or(z.string().trim().includes("[homarr_base]"))
|
|
||||||
.or(z.string().trim().includes("[homarr_hostname]"))
|
|
||||||
.or(z.string().trim().includes("[homarr_domain]"))
|
|
||||||
.or(z.string().trim().includes("[homarr_protocol]"))
|
|
||||||
.or(z.literal(""))
|
.or(z.literal(""))
|
||||||
.transform((value) => (value.length === 0 ? null : value))
|
.transform((value) => (value.length === 0 ? null : value))
|
||||||
.nullable();
|
.nullable();
|
||||||
|
|||||||
Reference in new issue
Block a user