Add two regression tests that fail on v1.76.0 and pass with the fix:
- wire-level test: a Headers instance (the shape @immich/sdk hands over)
must reach the remote server with all headers intact
- real-SDK e2e: getServerStatistics through fetchWithTrustedCertificatesAsync
against a live local server must deliver x-api-key
The v1.76.0 User-Agent injection object-spread `fetchOptions.headers`, which
silently drops all headers when the value is a Headers instance. The Immich
SDK passes a Headers object with the merged x-api-key header, so requests
lost their API key and returned 401 (issue #6672). Build a real Headers
instance instead, keeping case-insensitive user-agent handling.
* feat(http): set custom User-Agent on outbound integration requests
Set a default 'User-Agent: Homarr/<version> (+https://homarr.dev)' header
on all outbound HTTP requests made via fetchWithTrustedCertificatesAsync,
so Homarr's integration traffic is distinguishable in reverse-proxy,
WAF, and security-monitoring logs instead of appearing as generic undici.
Closes#6604
* refactor(version): centralize Homarr version in @homarr/version package
Replace fragile deep-relative 'package.json' imports across the monorepo
with a single source of truth: the new @homarr/version leaf package reads
the version once from the root package.json and exports it as VERSION.
Consumers now import by package name incl. the new User-Agent header in
fetchWithTrustedCertificatesAsync (packages/core):
- core, api (info router), analytics, request-handler (update checker)
This also removes all manually-maintained relative version imports.
* fix(http): normalize User-Agent injection with Headers
Object-spreading fetchOptions.headers breaks when callers pass a Headers
instance (spread yields no entries) or a tuple array (numeric keys), and is
case-sensitive. Build a Headers instance and set the default User-Agent only
when no case-insensitive User-Agent entry exists, via a shared helper in both
fetch paths.
Adds unit tests covering record, Headers, tuple-array, and casing variants.
* revert(version): undo version refactor and tests, keep single-file change
Keep the User-Agent change as a single edit to
packages/core/src/infrastructure/http/request.ts. Remove the @homarr/version
package, the consumer migrations, and the unit tests.
* fix(deps): update dependency drizzle-zod to ^0.8.2
* chore: update zod to v4 import
* fix: path is no longer available in transform context
* fix: AnyZodObject does no longer exist
* fix: auth env.ts using wrong createEnv and remove unused file env-validation.ts
* fix: required_error no longer exists on z.string
* fix: zod error map is deprecated and replaced with config
* fix: default requires callback now
* fix: migrate zod resolver for mantine
* fix: remove unused form translation file
* fix: wrong enum type
* fix: record now requires two arguments
* fix: add-confirm-password-refinement type issues
* fix: add missing first record argument for entityStateSchema
* fix: migrate superrefine to check
* fix(deps): upgrade zod-form-data to v3
* fix: migrate superRefine to check for mediaUploadSchema
* fix: authProvidersSchema default is array
* fix: use stringbool instead of custom implementation
* fix: record requires first argument
* fix: migrate superRefine to check for certificate router
* fix: confirm pasword refinement is overwriting types
* fix: email optional not working
* fix: migrate intersection to object converter
* fix: safe parse return value rename
* fix: easier access for min and max number value
* fix: migrate superRefine to check for oldmarr import file
* fix: inference of enum shape for old-import board-size wrong
* fix: errors renamed to issues
* chore: address pull request feedback
* fix: zod form requires object
* fix: inference for use-zod-form not working
* fix: remove unnecessary convertion
* fix(deps): upgrade trpc-to-openapi to v3
* fix: build error
* fix: migrate missing zod imports to v4
* fix: migrate zod records to v4
* fix: missing core package dependency in api module
* fix: unable to convert custom zod schema to openapi schema
* fix(deps): upgrade zod to v4
* chore(renovate): enable zod dependency updates
* test: add simple unit test for convertIntersectionToZodObject
---------
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>