Merge commit from fork

* fix(security): resolve ssrf issue with simple ping

* refactor: improve testability of app-access-control and fix tests

* fix: unnecessary space

Co-authored-by: ajnart <thomas@ajnart.fr>

---------

Co-authored-by: ajnart <thomas@ajnart.fr>
This commit is contained in:
Meier Lukasandajnart authored and GitHub committed 2026-01-30 18:31:13 +01:00
1 parent 9ba82133da
commit 8811af5e6e
7 files changed
+179 -68

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
</Tooltip.Floating>
{options.pingEnabled && !settings.forceDisableStatus && !board.disableStatus && app.href ? (
<Suspense fallback={<PingDot icon={IconLoader} color="blue" tooltip={`${t("common.action.loading")}…`} />}>
<PingIndicator href={app.pingUrl ?? app.href} />
<PingIndicator appId={app.id} />
</Suspense>
) : null}
</AppLink>
@@ -7,13 +7,13 @@ import { clientApi } from "@homarr/api/client";
import { PingDot } from "./ping-dot";
interface PingIndicatorProps {
href: string;
appId: string;
}
export const PingIndicator = ({ href }: PingIndicatorProps) => {
export const PingIndicator = ({ appId }: PingIndicatorProps) => {
const [ping] = clientApi.widget.app.ping.useSuspenseQuery(
{
url: href,
id: appId,
},
{
refetchOnMount: false,
@@ -24,7 +24,7 @@ export const PingIndicator = ({ href }: PingIndicatorProps) => {
const [pingResult, setPingResult] = useState<RouterOutputs["widget"]["app"]["ping"]>(ping);
clientApi.widget.app.updatedPing.useSubscription(
{ url: href },
{ id: appId },
{
onData(data) {
setPingResult(data);