Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
331925c197 | ||
|
|
0e51f745d3 | ||
|
|
d6f720d0e6 | ||
|
|
5324bf12d4 | ||
|
|
87cdcf28e0 | ||
|
|
441b181e79 | ||
|
|
eba639b59c | ||
|
|
da36283ad1 | ||
|
|
c050368782 | ||
|
|
82b50f0fd7 | ||
|
|
a0149d5894 | ||
|
|
8579fcbfc2 | ||
|
|
b6f3aba23e | ||
|
|
31e218295d |
No files matched your search
@@ -33,6 +33,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
# The below comment is used to insert a new version with on-release.yml
|
# The below comment is used to insert a new version with on-release.yml
|
||||||
#NEXT_VERSION#
|
#NEXT_VERSION#
|
||||||
|
- 1.76.1
|
||||||
- 1.76.0
|
- 1.76.0
|
||||||
- 1.75.0
|
- 1.75.0
|
||||||
- 1.74.0
|
- 1.74.0
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
## [1.76.2](https://github.com/homarr-labs/homarr/compare/v1.76.1...v1.76.2) (2026-08-27)
|
||||||
|
|
||||||
|
## [1.76.1](https://github.com/homarr-labs/homarr/compare/v1.76.0...v1.76.1) (2026-08-26)
|
||||||
|
|
||||||
## [1.76.0](https://github.com/homarr-labs/homarr/compare/v1.75.0...v1.76.0) (2026-08-21)
|
## [1.76.0](https://github.com/homarr-labs/homarr/compare/v1.75.0...v1.76.0) (2026-08-21)
|
||||||
|
|
||||||
## [1.75.0](https://github.com/homarr-labs/homarr/compare/v1.74.0...v1.75.0) (2026-08-14)
|
## [1.75.0](https://github.com/homarr-labs/homarr/compare/v1.74.0...v1.75.0) (2026-08-14)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { db } from "@homarr/db";
|
|||||||
|
|
||||||
import { getPackageVersion } from "~/versions/package-reader";
|
import { getPackageVersion } from "~/versions/package-reader";
|
||||||
import { extractMcpTools } from "../_extract-tools";
|
import { extractMcpTools } from "../_extract-tools";
|
||||||
|
import { serializeMcpToolResult } from "../_serialize-result";
|
||||||
|
|
||||||
const logger = createLogger({ module: "mcpRoute" });
|
const logger = createLogger({ module: "mcpRoute" });
|
||||||
|
|
||||||
@@ -203,7 +204,7 @@ const mcpHandler = createMcpHandler(
|
|||||||
const input = args && Object.keys(args).length > 0 ? args : undefined;
|
const input = args && Object.keys(args).length > 0 ? args : undefined;
|
||||||
const result = await procedure(input);
|
const result = await procedure(input);
|
||||||
return {
|
return {
|
||||||
content: [{ type: "text" as const, text: JSON.stringify(result) }],
|
content: [{ type: "text" as const, text: serializeMcpToolResult(result) }],
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const message = sanitizeErrorMessage(error);
|
const message = sanitizeErrorMessage(error);
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
import { serializeMcpToolResult } from "./_serialize-result";
|
||||||
|
|
||||||
|
describe("serializeMcpToolResult", () => {
|
||||||
|
it("serializes objects as JSON strings", () => {
|
||||||
|
expect(serializeMcpToolResult({ boardId: "1" })).toBe('{"boardId":"1"}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it("serializes primitive values", () => {
|
||||||
|
expect(serializeMcpToolResult("hello")).toBe('"hello"');
|
||||||
|
expect(serializeMcpToolResult(42)).toBe("42");
|
||||||
|
expect(serializeMcpToolResult(true)).toBe("true");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("serializes null as the string null", () => {
|
||||||
|
expect(serializeMcpToolResult(null)).toBe("null");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("serializes void results as the string null so MCP content text is always a string", () => {
|
||||||
|
expect(serializeMcpToolResult(undefined)).toBe("null");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export function serializeMcpToolResult(result: unknown): string {
|
||||||
|
return JSON.stringify(result) ?? "null";
|
||||||
|
}
|
||||||
+2
-2
@@ -9,7 +9,7 @@ http {
|
|||||||
|
|
||||||
# Route websockets traffic to port 3001
|
# Route websockets traffic to port 3001
|
||||||
location /websockets {
|
location /websockets {
|
||||||
proxy_pass http://${HOSTNAME}:3001;
|
proxy_pass http://127.0.0.1:3001;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
@@ -18,7 +18,7 @@ http {
|
|||||||
|
|
||||||
# Route all other traffic to port 3000
|
# Route all other traffic to port 3000
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://${HOSTNAME}:3000;
|
proxy_pass http://127.0.0.1:3000;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homarr",
|
"name": "homarr",
|
||||||
"version": "1.76.0",
|
"version": "1.76.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env CI=true turbo build",
|
"build": "cross-env CI=true turbo build",
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ async function importCookiesAsync() {
|
|||||||
|
|
||||||
function getBaseUrl() {
|
function getBaseUrl() {
|
||||||
if (typeof window !== "undefined") return window.location.origin;
|
if (typeof window !== "undefined") return window.location.origin;
|
||||||
return `http://${process.env.HOSTNAME ?? "localhost"}:3000`;
|
return "http://127.0.0.1:3000";
|
||||||
}
|
}
|
||||||
|
|
||||||
export const trpcPath = "/api/trpc";
|
export const trpcPath = "/api/trpc";
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
|
|||||||
|
|
||||||
import type { TrustedCertificateHostname } from "../certificates/hostnames";
|
import type { TrustedCertificateHostname } from "../certificates/hostnames";
|
||||||
import { withTimeoutAsync } from "./timeout";
|
import { withTimeoutAsync } from "./timeout";
|
||||||
|
|
||||||
import packageJson from "../../../../../package.json";
|
|
||||||
|
|
||||||
export const getDefaultUserAgent = () => `Homarr/${packageJson.version} (+https://homarr.dev)`;
|
|
||||||
|
|
||||||
export const createCustomCheckServerIdentity = (
|
export const createCustomCheckServerIdentity = (
|
||||||
trustedHostnames: TrustedCertificateHostname[],
|
trustedHostnames: TrustedCertificateHostname[],
|
||||||
): typeof checkServerIdentity => {
|
): typeof checkServerIdentity => {
|
||||||
@@ -83,10 +78,6 @@ export const fetchWithTrustedCertificatesAsync = async (
|
|||||||
async (signal) =>
|
async (signal) =>
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
...fetchOptions,
|
...fetchOptions,
|
||||||
headers: {
|
|
||||||
"User-Agent": getDefaultUserAgent(),
|
|
||||||
...fetchOptions.headers,
|
|
||||||
},
|
|
||||||
signal,
|
signal,
|
||||||
dispatcher: agent,
|
dispatcher: agent,
|
||||||
}),
|
}),
|
||||||
@@ -97,10 +88,6 @@ export const fetchWithTrustedCertificatesAsync = async (
|
|||||||
const { bodyTimeout: _bodyTimeout, dispatcher: _dispatcher, ...fetchOptions } = options ?? {};
|
const { bodyTimeout: _bodyTimeout, dispatcher: _dispatcher, ...fetchOptions } = options ?? {};
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
...fetchOptions,
|
...fetchOptions,
|
||||||
headers: {
|
|
||||||
"User-Agent": getDefaultUserAgent(),
|
|
||||||
...fetchOptions.headers,
|
|
||||||
},
|
|
||||||
dispatcher: agent,
|
dispatcher: agent,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
// @vitest-environment node
|
||||||
|
|
||||||
|
import { createServer } from "node:http";
|
||||||
|
import type { AddressInfo } from "node:net";
|
||||||
|
|
||||||
|
import { getServerStatistics, init } from "@immich/sdk";
|
||||||
|
import { describe, expect, test, vi } from "vitest";
|
||||||
|
|
||||||
|
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||||
|
|
||||||
|
vi.mock("@homarr/core/infrastructure/certificates", () => ({
|
||||||
|
getAllTrustedCertificatesAsync: vi.fn(async () => []),
|
||||||
|
getTrustedCertificateHostnamesAsync: vi.fn(async () => []),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe("real @immich/sdk end-to-end through fetchWithTrustedCertificatesAsync", () => {
|
||||||
|
test("x-api-key set via init() reaches the server", async () => {
|
||||||
|
let receivedXApiKey: string | string[] | undefined;
|
||||||
|
const server = createServer((req, res) => {
|
||||||
|
receivedXApiKey = req.headers["x-api-key"];
|
||||||
|
res.writeHead(200, { "Content-Type": "application/json" });
|
||||||
|
res.end(JSON.stringify({ usage: 1000, photos: 5, videos: 2 }));
|
||||||
|
});
|
||||||
|
await new Promise<void>((resolve) => server.listen(0, resolve));
|
||||||
|
const port = (server.address() as AddressInfo).port;
|
||||||
|
|
||||||
|
init({ baseUrl: `http://127.0.0.1:${port}/api`, apiKey: "sdk-configured-key" });
|
||||||
|
try {
|
||||||
|
const stats = await getServerStatistics({
|
||||||
|
fetch: fetchWithTrustedCertificatesAsync as unknown as typeof fetch,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(receivedXApiKey).toBe("sdk-configured-key");
|
||||||
|
expect(stats).toMatchObject({ usage: 1000, photos: 5, videos: 2 });
|
||||||
|
} finally {
|
||||||
|
server.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
+6
-5
@@ -21,20 +21,18 @@ fi
|
|||||||
export AUTH_SECRET=$(openssl rand -base64 32)
|
export AUTH_SECRET=$(openssl rand -base64 32)
|
||||||
|
|
||||||
# Start nginx proxy
|
# Start nginx proxy
|
||||||
# 1. Replace the HOSTNAME in the nginx template file
|
# 1. Create the nginx configuration file from the template
|
||||||
# 2. Create the nginx configuration file from the template
|
# 2. Start the nginx server
|
||||||
# 3. Start the nginx server
|
|
||||||
# Only listen on IPv6 when the host actually has IPv6 configured (#4596).
|
# Only listen on IPv6 when the host actually has IPv6 configured (#4596).
|
||||||
# Otherwise nginx aborts with "socket() [::]:7575 failed (97: Address family
|
# Otherwise nginx aborts with "socket() [::]:7575 failed (97: Address family
|
||||||
# not supported by protocol)". Check HOMARR_DISABLE_IPV6 first so users can
|
# not supported by protocol)". Check HOMARR_DISABLE_IPV6 first so users can
|
||||||
# force IPv4-only even when the host supports IPv6, then probe for IPv6
|
# force IPv4-only even when the host supports IPv6, then probe for IPv6
|
||||||
# addresses via grep (not -s: proc files always report size 0).
|
# addresses via grep (not -s: proc files always report size 0).
|
||||||
export HOSTNAME
|
|
||||||
export NGINX_LISTEN_IPV6=''
|
export NGINX_LISTEN_IPV6=''
|
||||||
if [ "${HOMARR_DISABLE_IPV6:-false}" != "true" ] && grep -q . /proc/net/if_inet6 2>/dev/null; then
|
if [ "${HOMARR_DISABLE_IPV6:-false}" != "true" ] && grep -q . /proc/net/if_inet6 2>/dev/null; then
|
||||||
NGINX_LISTEN_IPV6='listen [::]:7575;'
|
NGINX_LISTEN_IPV6='listen [::]:7575;'
|
||||||
fi
|
fi
|
||||||
envsubst '${HOSTNAME} ${NGINX_LISTEN_IPV6}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
envsubst '${NGINX_LISTEN_IPV6}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||||
# Start services in the background and store their PIDs
|
# Start services in the background and store their PIDs
|
||||||
nginx -g 'daemon off;' &
|
nginx -g 'daemon off;' &
|
||||||
NGINX_PID=$!
|
NGINX_PID=$!
|
||||||
@@ -67,6 +65,9 @@ terminate() {
|
|||||||
|
|
||||||
trap terminate TERM INT
|
trap terminate TERM INT
|
||||||
|
|
||||||
|
# Next.js standalone uses HOSTNAME as its bind address. Docker's generated
|
||||||
|
# hostname can be unresolvable, so bind explicitly while nginx uses loopback.
|
||||||
|
export HOSTNAME=0.0.0.0
|
||||||
node apps/nextjs/server.js &
|
node apps/nextjs/server.js &
|
||||||
NEXTJS_PID=$!
|
NEXTJS_PID=$!
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user