Compare commits

..
Author SHA1 Message Date
Releases Homarr 3ed31d8f59 chore(release): 1.56.1 [skip ci] 2026-03-20 19:37:26 +00:00
homarr-releases[bot] 1d5b4fd7fb chore(release): automatic release v1.56.1 2026-03-20 19:36:28 +00:00
homarr-renovate[bot] 55cf3c72a3 fix(deps): update tiptap monorepo to v3.20.2 (#5279)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-20 18:59:21 +00:00
homarr-renovate[bot] 9648d9e99f fix(deps): update trpc monorepo to ^11.13.4 (#5278)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-20 14:49:03 +00:00
homarr-renovate[bot] 0e0b857905 fix(deps): update trpc monorepo to ^11.13.3 (#5276)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-20 11:40:40 +00:00
homarr-renovate[bot] 7d93b10032 fix(deps): update trpc monorepo to ^11.13.2 (#5273)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-20 10:45:12 +00:00
homarr-renovate[bot] 6fa9087a11 fix(deps): update mantine monorepo to ^8.3.17 (#5271)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-19 16:04:34 +00:00
homarr-renovate[bot] d2f438f294 fix(deps): update turbo monorepo to ^2.8.17 (#5265)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-19 15:01:48 +00:00
homarr-renovate[bot] 2423ecdce5 fix(deps): update dependency fast-xml-parser to ^5.5.5 (#5270)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-19 15:01:24 +00:00
homarr-renovate[bot] 7094110da2 chore(deps): update dependency fast-xml-parser to v5.5.6 [security] (#5269)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-19 14:52:36 +00:00
homarr-renovate[bot] 72ec253644 chore(deps): update dependency hono@&lt;4.6.5 to >=4.12.8 (#5268)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-19 09:51:42 +00:00
homarr-renovate[bot] 3bbde3cbb8 fix(deps): update dependency next to v16.1.7 [security] (#5263)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 21:41:38 +00:00
homarr-renovate[bot] 6f85b2161f chore(deps): update vitest monorepo to ^4.1.0 (#5259)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 19:27:32 +00:00
homarr-renovate[bot] c85910d24f chore(deps): update dependency vite@&gt;&#x3d;5.0.0 &lt;&#x3d;5.4.18 to v8 (#5261)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 19:55:32 +01:00
homarr-renovate[bot] 397c1d3dbc chore(deps): update dependency esbuild to ^0.27.4 (#5256)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 19:53:21 +01:00
homarr-renovate[bot] 078fb6de93 chore(deps): update dependency esbuild@&lt;&#x3d;0.24.2 to >=0.27.4 (#5257)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 19:53:15 +01:00
homarr-crowdin[bot] 8159b4f146 chore(lang): update translations from crowdin (#5248)
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-17 19:49:40 +01:00
homarr-renovate[bot] e8f6876d24 fix(deps): update dependency isomorphic-dompurify to ^3.3.0 (#5252)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 16:22:11 +00:00
homarr-renovate[bot] 615062c6b1 fix(deps): update dependency dayjs to ^1.11.20 (#5253)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 16:20:32 +00:00
homarr-renovate[bot] d9294ed4bf chore(deps): update dependency @vitejs/plugin-react to ^5.2.0 (#5258)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-17 15:06:30 +00:00
homarr-renovate[bot] d1d8659f95 fix(deps): update dependency fast-xml-parser to ^5.5.3 (#5251)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-16 17:09:31 +00:00
homarr-renovate[bot] ac80008ce0 fix(deps): update turbo monorepo to ^2.8.16 (#5250)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-16 02:42:50 +00:00
homarr-renovate[bot] 13853f2981 chore(deps): update pnpm to v10.32.1 (#5249)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-16 02:41:02 +00:00
homarr-renovate[bot] f995cba157 fix(deps): update dependency sass to ^1.98.0 (#5247)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-15 23:38:23 +00:00
homarr-renovate[bot] 91a9b6bec9 fix(deps): update dependency fast-xml-parser to ^5.5.1 (#5246)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-15 21:37:58 +00:00
homarr-crowdin[bot]andMeier Lukas 314ab3a28e chore(lang): updated translations from crowdin
* chore(lang): update translations from crowdin

* chore(lang): update translations from crowdin

* chore(lang): update translations from crowdin

---------

Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-15 21:55:12 +01:00
homarr-renovate[bot] 7841b58f0f fix(deps): update dependency typescript-eslint to ^8.57.0 (#5241)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 23:37:16 +00:00
homarr-renovate[bot] 63f91b6352 fix(deps): update dependency isomorphic-dompurify to ^3.1.0 (#5239)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 23:36:12 +00:00
homarr-renovate[bot] 4fd8ac9118 chore(deps): update pnpm to v10.32.0 (#5244)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 22:36:25 +00:00
homarr-renovate[bot] 1bd924ea99 fix(deps): update turbo monorepo to ^2.8.15 (#5243)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 22:35:44 +00:00
homarr-renovate[bot] 1040ecac04 fix(deps): update dependency mysql2 to v3.19.1 (#5240)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 16:41:47 +00:00
homarr-renovate[bot] 729b49ffa9 fix(deps): update dependency jotai to ^2.18.1 (#5238)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-14 15:35:15 +00:00
homarr-crowdin[bot]andMeier Lukas dbf5b375f5 chore(lang): updated translations from crowdin
* chore(lang): update translations from crowdin

* chore(lang): update translations from crowdin

---------

Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-14 12:58:16 +00:00
Meier Lukas 7e8723ce57 chore(docs): remove temporary ts-expect-error for documentation-url 2026-03-14 13:53:07 +01:00
homarr-releases[bot] c5e83943a4 chore: update bug report template (#5234)
Co-authored-by: Releases Homarr <175486441+homarr-releases[bot]@users.noreply.github.com>
2026-03-14 08:54:18 +01:00
Releases Homarr d3424ec71b chore(release): 1.56.0 [skip ci] 2026-03-13 19:31:03 +00:00
homarr-releases[bot] 9bfcb04aa2 chore(release): automatic release v1.56.0 2026-03-13 19:30:11 +00:00
homarr-update-contributors[bot] ec24fe22f9 chore: update integrations list readme (#5232)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-03-13 19:35:57 +01:00
StrandedTurtle f68600150a feat: Tracearr integration (#5060) 2026-03-13 19:19:43 +01:00
Meier Lukas d3c2ad134f fix(releases): allow any icon url for repositories (#5229) 2026-03-13 17:49:30 +01:00
homarr-renovate[bot] 25f3b074ee chore(deps): update dependency hono@&lt;4.6.5 to >=4.12.7 [security] (#5211)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-13 16:43:07 +00:00
Meier Lukas ba9c3f3e27 fix(boards): duplication of boards fails with postgresql / mysql (#5228) 2026-03-13 16:32:48 +01:00
homarr-update-contributors[bot] 3daadec358 chore: update contributors (#5227)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-03-13 13:10:58 +00:00
Meier Lukas 21225c979e fix: language changes when searching for some icons (#5224) 2026-03-13 14:09:51 +01:00
Meier Lukas 3091ed6358 fix(glances): unable to parse uptime of 1 day (#5226) 2026-03-13 14:09:42 +01:00
Meier Lukas 451602d1e6 fix(true-nas): ignore offline/exported pools (#5225) 2026-03-13 14:09:30 +01:00
homarr-crowdin[bot] 745121c4b4 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-13 08:58:55 +00:00
homarr-renovate[bot] 0bd3a8728a chore(deps): update pnpm to v10.31.0 (#5223)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-13 02:16:18 +00:00
homarr-renovate[bot] 8ee05e0d49 fix(deps): update turbo monorepo to ^2.8.14 (#5113)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-12 19:50:05 +00:00
homarr-renovate[bot]andMeier Lukas 5c4f394501 fix(deps): update dependency fastify to ^5.8.2 (#5221)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-12 20:33:57 +01:00
Sergio 85c460190c fix(system-disks): format absolute denominator with human-readable size (#5183) 2026-03-12 20:15:11 +01:00
Meier Lukas 7c10becc74 chore: reduce flakiness in e2e tests (#5217) 2026-03-12 20:03:54 +01:00
Meier Lukas 5723da21aa fix(security): harden hashing in image-proxy (#5188) 2026-03-12 20:03:08 +01:00
homarr-renovate[bot] a9085399c0 chore(deps): update dependency eslint to ^9.39.4 (#5218)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-12 07:57:01 +00:00
ManuelandMeier Lukas aa36ce3c47 feat: expand cli (#5159)
* feat: expand cli

* fix: lint issue

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-12 08:47:08 +01:00
homarr-renovate[bot] 12ad241406 fix(deps): update dependency @tabler/icons-react to ^3.40.0 (#5220)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-12 05:52:37 +00:00
homarr-renovate[bot] 22fd8e9b95 fix(deps): update dependency @tabler/icons-react to ^3.39.0 (#5209)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 20:46:03 +00:00
homarr-renovate[bot] c12f1bf2b3 chore(deps): update dependency @types/node to ^24.12.0 (#5212)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 20:43:35 +00:00
homarr-renovate[bot] 1c6e23a4b6 fix(deps): update dependency pg to ^8.20.0 (#5198)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 19:55:40 +00:00
homarr-renovate[bot] c7fa5cdbb3 fix(deps): update mantine monorepo to ^8.3.16 (#5201)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 19:53:29 +00:00
homarr-crowdin[bot] bece83eb8b chore(lang): updated translations from crowdin
* chore(lang): update translations from crowdin

* chore(lang): update translations from crowdin

---------

Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-11 16:58:05 +00:00
homarr-renovate[bot] 00dd32bbe1 fix(deps): update trpc monorepo to ^11.12.0 (#5213)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 14:59:23 +00:00
homarr-renovate[bot] d941ed58fa fix(deps): update tiptap monorepo to v3.20.1 (#5215)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-11 13:10:26 +00:00
homarr-renovate[bot] 324bfd90d1 fix(deps): update dependency mysql2 to v3.19.0 (#5206)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-10 19:10:33 +00:00
homarr-renovate[bot] b02e8cc875 fix(deps): update dependency fastify to ^5.8.1 (#5202)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-10 19:08:25 +00:00
homarr-renovate[bot] 7b207cc83b chore(deps): update dependency tar-fs@&gt;&#x3d;2.0.0 &lt;2.1.3 to >=3.1.2 (#5196)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-10 19:07:20 +00:00
homarr-crowdin[bot] 4b8f8a1785 chore(lang): update translations from crowdin (#5193)
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-10 20:02:47 +01:00
Sergio bbf0adf31a fix(stock-price): align sparkline color with displayed price change (#5181) 2026-03-10 20:01:53 +01:00
homarr-renovate[bot] 8b79e54245 chore(deps): update dependency prettier-plugin-packagejson to ^3.0.2 (#5204)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-10 13:10:34 +00:00
homarr-renovate[bot] 2c9b47bc0b chore(deps): update dependency tar-fs@&gt;&#x3d;3.0.0 &lt;3.0.9 to >=3.1.2 (#5197)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-09 23:36:13 +00:00
homarr-renovate[bot] 217a9fe864 chore(deps): update dependency conventional-changelog-conventionalcommits to ^9.3.0 (#5195)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-09 22:38:39 +00:00
homarr-renovate[bot] 4a2cfcd8b5 chore(deps): update dependency fastify to v5.8.1 [security] (#5191)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-08 22:27:31 +00:00
homarr-renovate[bot] a682cc430b chore(deps): update docker/login-action action to v4 (#5192)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-08 21:40:47 +01:00
Meier Lukas dabe96bd5e feat(boards): show supported integrations in widget selection (#5187)
* feat(boards): show supported integrations in widget selection

* fix: place supported integrations directly above add button
2026-03-08 19:05:23 +01:00
homarr-crowdin[bot] 04e7a202d0 chore(lang): updated translations from crowdin
* chore(lang): update translations from crowdin

* chore(lang): update translations from crowdin

---------

Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-08 17:42:03 +00:00
homarr-renovate[bot] 5159d9f0e7 fix(deps): update dependency fast-xml-parser to ^5.4.2 (#5190)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-08 17:40:22 +00:00
homarr-renovate[bot] 3778338e34 chore(deps): update dependency hono@&lt;4.6.5 to >=4.12.5 [security] (#5171)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-07 11:22:54 +00:00
SergioandMeier Lukas 9a878af414 fix(image-proxy): hash full URL and headers deterministically (#5184)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-07 10:38:47 +01:00
homarr-update-contributors[bot] 4eece0d607 chore: update integrations list readme (#5186)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-03-07 08:51:42 +00:00
Manuel cdd90b8aa0 feat: add immich integration and widget (#5165)
* feat: add immich integration and widget

* feat: use sdk
2026-03-07 09:39:31 +01:00
homarr-renovate[bot] 6aaaf31d8b fix(deps): update dependency @tabler/icons-react to ^3.38.0 (#5182)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-06 22:39:41 +00:00
homarr-renovate[bot] df08046cdf chore(deps): update dependency conventional-changelog-conventionalcommits to ^9.2.0 (#5179)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-06 22:37:37 +00:00
Meier Lukas 340399597b chore(docs): update sitemap 2026-03-06 23:30:00 +01:00
homarr-releases[bot] 671e5621ad chore: update bug report template (#5177)
Co-authored-by: Releases Homarr <175486441+homarr-releases[bot]@users.noreply.github.com>
2026-03-06 20:52:42 +01:00
Releases Homarr 4da8734ff3 chore(release): 1.55.0 [skip ci] 2026-03-06 19:35:05 +00:00
homarr-releases[bot] 9807afcec7 chore(release): automatic release v1.55.0 2026-03-06 19:33:44 +00:00
homarr-renovate[bot] c2f2f96bc7 chore(deps): update dependency @semantic-release/npm to ^13.1.5 (#5175)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-06 16:50:27 +00:00
homarr-renovate[bot] bc2a532a03 fix(deps): update trpc monorepo to ^11.11.0 (#5174)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-06 12:07:35 +00:00
homarr-renovate[bot] 905b7954ca chore(deps): update dependency brace-expansion@&gt;&#x3d;2.0.0 &lt;&#x3d;2.0.1 to >=5.0.4 (#5166)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-05 17:25:57 +00:00
homarr-renovate[bot] e248db4508 chore(deps): update peter-evans/create-pull-request action to v8 (#5053)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-05 17:29:49 +01:00
homarr-renovate[bot] 2893152377 chore(deps): update dependency @types/pg to ^8.18.0 (#5173)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-05 16:28:46 +00:00
homarr-renovate[bot] 751fb35f90 chore(deps): update dependency @types/node to ^24.11.0 (#5172)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-05 16:27:57 +00:00
homarr-renovate[bot] 58a90d3fc5 chore(deps): update dependency brace-expansion@&gt;&#x3d;1.0.0 &lt;&#x3d;1.1.11 to v5 (#5074)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 20:41:55 +01:00
homarr-renovate[bot] ff1159943c fix(deps): update dependency swagger-ui-react to ^5.32.0 (#5167)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 19:35:24 +00:00
homarr-renovate[bot] 663789c891 chore(deps): update dependency axios@&gt;&#x3d;1.0.0 &lt;1.8.2 to >=1.13.6 (#5170)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 19:34:20 +00:00
homarr-renovate[bot] 91015484bd chore(deps): update dependency @types/node to ^24.10.15 (#5163)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 19:32:02 +00:00
homarr-renovate[bot] ec45aacc63 fix(deps): update dependency ldapts to v8.1.7 (#5168)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 19:29:45 +00:00
homarr-renovate[bot] 1c06e562c3 fix(deps): update dependency ioredis to v5.10.0 (#5169)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-04 19:28:45 +00:00
homarr-renovate[bot] 4717a5724d fix(deps): update dependency mysql2 to v3.18.2 (#5164)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-03 22:38:04 +00:00
homarr-update-contributors[bot]andMeier Lukas 8f86944014 chore: update integrations list readme (#5162)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-03 22:41:25 +01:00
ManuelandMeier Lukas 0e29a2fce1 feat: add seerr integration (#5139)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2026-03-03 19:53:50 +01:00
homarr-crowdin[bot] 249a9264e6 chore(lang): update translations from crowdin (#5144)
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-03-03 19:27:41 +01:00
homarr-renovate[bot] 4763908b5d chore(deps): update dependency @types/node to ^24.10.14 (#5155)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-03 13:07:37 +00:00
homarr-renovate[bot] 8bf2a43e06 fix(deps): update dependency mysql2 to v3.18.1 (#5152)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-03 11:40:38 +00:00
homarr-renovate[bot] bcb626600b chore(deps): update pnpm to v10.30.3 (#5157)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-03 10:47:47 +00:00
homarr-renovate[bot] be543dadb6 chore(deps): update dependency hono@&lt;4.6.5 to >=4.12.3 [security] (#5095)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 22:29:59 +00:00
homarr-renovate[bot] eb2f85f6f8 fix(deps): update dependency fast-xml-parser to ^5.4.1 (#5150)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 20:49:19 +00:00
homarr-renovate[bot] a10807a6c4 chore(deps): update node.js to v24.14.0 (#5151)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 19:47:26 +00:00
homarr-renovate[bot] 3df52f4013 chore(deps): update pnpm to v10.30.2 (#5146)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 18:59:12 +00:00
homarr-renovate[bot] 0b0fb1c579 fix(deps): update dependency pg to ^8.19.0 (#5153)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 17:54:46 +00:00
homarr-renovate[bot] 5971af91a8 chore(deps): update node.js (#5147)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-03-02 06:00:09 +00:00
homarr-renovate[bot] ac3b4e7de0 fix(deps): update dependency typescript-eslint to ^8.56.1 (#5142)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-02-28 18:42:59 +00:00
homarr-renovate[bot] 52792af186 fix(deps): update dependency mysql2 to v3.18.0 (#5141)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-02-28 17:34:47 +00:00
homarr-renovate[bot] 66ad67eced fix(deps): update dependency mysql2 to v3.17.5 (#5140)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2026-02-28 09:35:09 +00:00
57 changed files with 1927 additions and 2515 deletions

No files matched your search

+1 -5
View File
@@ -57,7 +57,6 @@ apps/tasks/tasks.cjs
apps/tasks/tasks.css
apps/websocket/wssServer.cjs
apps/websocket/wssServer.css
apps/nextjs/customServer.cjs
apps/nextjs/.million/
packages/cli/cli.cjs
@@ -68,7 +67,4 @@ e2e/shared/tmp
apps/nextjs/public/images/background.png
# next-intl
en.d.json.ts
# Custom server build artifacts
apps/nextjs/customServer.css
en.d.json.ts
-369
View File
@@ -1,369 +0,0 @@
# Memory Optimization Approaches
This document describes the approaches tried and considered for reducing the RAM footprint of Homarr's server processes.
## Baseline Architecture (Before)
Homarr runs **three separate Node.js processes**:
| Process | Port | Purpose |
|---|---|---|
| `apps/nextjs` (Next.js) | 3000 | Web UI + API routes |
| `apps/websocket` (WS server) | 3001 | tRPC WebSocket subscriptions |
| `apps/tasks` (Tasks/Cron server) | 3002 | Cron job scheduling + management API |
Each process loads its own V8 heap, duplicates shared dependencies (`@homarr/db`, `@homarr/auth`, etc.), and runs its own event loop.
**Measured baseline (dev mode, idle):** ~2,954 MB total RSS
---
## Approach 1: Integrate WebSocket Server into Next.js Custom Server
**Status:** ✅ Implemented
Eliminates `apps/websocket` by handling WebSocket upgrades inside a [Next.js custom server](https://nextjs.org/docs/pages/guides/custom-server):
```ts
const app = next({ dev, hostname, port, dir });
const upgradeHandler = app.getUpgradeHandler();
server.on("upgrade", (req, socket, head) => {
if (req.url?.startsWith("/websockets")) {
wss.handleUpgrade(req, socket, head, (ws) => wss.emit("connection", ws, req));
} else {
upgradeHandler(req, socket, head); // HMR, etc.
}
});
```
### PROs
- Eliminates one V8 heap (~208 MB)
- WebSocket runs on same port as HTTP (simpler networking/proxying)
- Shared `@homarr/db` connection pool and module cache
- `getUpgradeHandler()` properly delegates HMR to Next.js in dev mode
### CONs
- Custom server disables some Next.js optimizations (automatic static optimization still works with `output: "standalone"`)
- WebSocket errors could affect the main server process
- Slightly more complex startup code
---
## Approach 2: Integrate Tasks/Cron Server into Next.js Custom Server
**Status:** ✅ Implemented (combined with Approach 1)
Eliminates `apps/tasks` by running the Fastify tRPC cron API and job scheduler inside the same process:
```ts
async function startTasksServer() {
const tasksServer = fastify({ maxParamLength: 5000 });
tasksServer.register(fastifyTRPCPlugin, { ... });
await cleanupSessionsAsync();
await invalidateUpdateCheckerCacheAsync();
await jobGroup.initializeAsync();
await jobGroup.startAllAsync();
await tasksServer.listen({ port: CRON_JOB_API_PORT });
return tasksServer;
}
```
### PROs
- Eliminates another V8 heap (~328 MB)
- Shared database connection pool across Next.js API routes and cron jobs
- Single process to manage (simpler Docker, `run.sh`, monitoring)
- Cron jobs can directly share in-memory state with the web server
### CONs
- A misbehaving cron job could affect web request latency
- Fastify still binds to port 3002 for internal tRPC communication (minor overhead)
- More dependencies in the custom server bundle
---
## Combined Result (Approaches 1 + 2)
| Component | Separate (before) | Integrated (after) |
|---|---|---|
| WebSocket server | ~208 MB | — |
| Tasks/Cron server | ~328 MB | — |
| Next.js (incl. workers) | ~2,418 MB | — |
| Custom Server (all-in-one) | — | ~2,007 MB |
| **Total RSS** | **~2,954 MB** | **~2,007 MB** |
| **Savings** | — | **~947 MB (~32%)** |
---
## Approach 3: Eliminate Fastify — Direct Function Calls for Cron API
**Status:** 📋 Considered, not implemented
Since the cron job API client (`cronJobApi`) is only used from Next.js API routes (same process now), we could replace the HTTP+tRPC client with direct function calls to `JobManager`:
```ts
// Before: HTTP call to localhost:3002/trpc
await cronJobApi.trigger.mutate({ name: "myJob" });
// After: direct call in same process
await jobManager.triggerAsync("myJob");
```
### PROs
- Eliminates Fastify dependency and port 3002 listener entirely
- Zero network overhead for cron API calls
- Simpler architecture (no internal HTTP, no API key needed)
### CONs
- Requires refactoring `packages/api/src/router/cron-jobs.ts` and `packages/cron-job-api`
- Breaks the clean separation between Next.js API and tasks concerns
- If the architecture ever splits back to separate processes, this would need to be reverted
- API key authentication for cron operations would need a different mechanism
---
## Approach 4: Node.js `--max-old-space-size` Flag
**Status:** 📋 Considered, available as user override
Setting `NODE_OPTIONS=--max-old-space-size=N` limits V8 heap growth and forces more aggressive garbage collection.
```dockerfile
# Example: limit heap to 512 MB
ENV NODE_OPTIONS="--max-old-space-size=512"
```
### PROs
- Can reduce peak memory usage in constrained environments
- Easy to configure via environment variable
- No code changes required
### CONs
- Too low a value causes OOM crashes under load
- Doesn't reduce actual memory *needed*, just forces earlier GC
- Default Node.js behavior (~1.7 GB limit on 64-bit) is reasonable for most deployments
- Different deployments have different memory constraints — no single good default
**Recommendation:** Don't set a default in the Dockerfile. Document as a tuning option for users running on low-memory hosts (e.g., `docker run -e NODE_OPTIONS="--max-old-space-size=512"`).
---
## Approach 5: Next.js `output: "standalone"` (Already in Use)
**Status:** ✅ Already configured
The `next.config.ts` already uses `output: "standalone"`, which:
- Traces only the files needed for production
- Creates a minimal `.next/standalone` directory
- Avoids shipping full `node_modules`
This is already optimized and no further action needed.
---
## Approach 6: Shared Redis Connection Pooling
**Status:** 📋 Considered, not implemented
With all services in one process, Redis connection pools could be shared. Currently, each module may create its own Redis client instance.
### PROs
- Fewer open connections to Redis
- Slightly less memory for connection buffers
### CONs
- Marginal memory savings (Redis connections are lightweight)
- Requires auditing all Redis usage across packages
- Risk of connection contention under high load
---
## Summary of Recommendations
| Approach | Impact | Effort | Status |
|---|---|---|---|
| 1. Integrate WS server | ~208 MB saved | Low | ✅ Done |
| 2. Integrate Tasks server | ~328 MB saved | Medium | ✅ Done |
| 3. Eliminate Fastify | ~10-30 MB saved | High | 📋 Future |
| 4. `--max-old-space-size` | Configurable | None | 📋 User option |
| 5. Standalone output | Already optimal | None | ✅ Already done |
| 6. Shared Redis pools | ~5-10 MB saved | Medium | 📋 Future |
| 7. Redis-backed initial query data | Faster page loads | Medium | 📋 POC documented |
| 8. Client-side rendering with ISR shell | Faster TTFB | High | 📋 POC documented |
---
## Approach 7: Redis-Backed TanStack Query Initial Data
**Status:** 📋 POC documented
### Problem
Currently, the dashboard page (`/`) is fully server-rendered on every request:
1. Server calls `api.board.getHomeBoard()` (database query)
2. Server prefetches all widget data via `prefetchForKindAsync()` (multiple database/integration queries)
3. Server renders the full React tree with hydration boundary
4. Client hydrates and takes over
Each page load triggers a cascade: **Client → Next.js Server → tRPC → Database → Back**. For data that doesn't change often (board layout, widget configurations), this is wasteful.
### Approach
Use Redis as a shared cache layer between cron jobs and page loads. Cron jobs already populate Redis with integration data. The idea is to:
1. **Cron jobs write to Redis** (already happening via `createItemAndIntegrationChannel`)
2. **Server reads from Redis first** instead of hitting the database for widget data
3. **Pass Redis data as `initialData`** to TanStack Query on the client
4. **Client-side queries take over** with stale-while-revalidate behavior
```tsx
// POC: In _creator.tsx, read from Redis cache first for widget prefetching
import { createItemAndIntegrationChannel } from "@homarr/redis";
// Instead of always calling the database:
const cachedData = await redisChannel.getAsync();
if (cachedData) {
// Use cached data as initial query data - skip the database call
queryClient.setQueryData(queryKey, cachedData.data);
} else {
// Fall back to normal prefetch
await prefetchForKindAsync(kind, queryClient, items);
}
```
On the client side, TanStack Query's `initialData` option lets us hydrate from cache:
```tsx
// Client component using cached initial data
const { data } = useQuery({
queryKey: ["widget", widgetId],
queryFn: () => fetchWidgetData(widgetId),
initialData: cachedWidgetData, // From Redis via server props
staleTime: 30_000, // Consider fresh for 30s
});
```
### How TanStack Query Initial Data Works
From the [TanStack Query docs](https://tanstack.com/query/v5/docs/framework/react/guides/initial-query-data):
- `initialData` pre-populates the query cache before the component mounts
- The query still revalidates in the background (stale-while-revalidate)
- Combined with `staleTime`, the query won't refetch until the data is considered stale
- This means the page renders instantly with cached data, then silently updates
### PROs
- **Faster page loads**: Redis reads are ~1ms vs ~50-200ms for database queries with joins
- **Reduced database load**: Most page views hit Redis instead of SQLite/MySQL/PostgreSQL
- **Leverages existing infrastructure**: Cron jobs already write widget data to Redis channels
- **Graceful degradation**: Falls back to normal database queries on cache miss
- **Non-breaking**: Can be adopted incrementally per widget type
- **Shared across users**: Non-personal data (board layout, widget data) is the same for all users viewing the same board
### CONs
- **Cache staleness**: Data may be up to one cron interval old (typically 1-5 minutes)
- **Cache invalidation complexity**: Need to invalidate Redis when boards are edited
- **Memory usage**: More data stored in Redis (marginal since it's already stored for pub/sub)
- **Serialization overhead**: superjson parse/stringify on every cache read
- **Testing complexity**: Need to test cache hit/miss/stale scenarios
### Estimated Impact
| Metric | Before | After (cache hit) | Improvement |
|---|---|---|---|
| Dashboard TTFB | ~200-500ms | ~50-100ms | 2-5x faster |
| Database queries per page load | 5-20 (depending on widgets) | 0-2 (board + auth only) | ~90% reduction |
| Redis reads per page load | 0 | 5-20 | Acceptable (~1ms each) |
### Implementation Path
1. Create a `createBoardCacheChannel(boardId)` in `@homarr/redis`
2. Populate it when boards are saved and when cron jobs update widget data
3. In `_creator.tsx`, check cache before `prefetchForKindAsync()`
4. Set `staleTime` to match cron interval for each widget type
5. Add cache invalidation when boards are edited (`board.saveBoard` mutation)
---
## Approach 8: Client-Side Rendering with ISR Static Shell
**Status:** 📋 POC documented (not recommended for Homarr's use case)
### Concept
Instead of server-rendering the entire dashboard on each request, serve a **static HTML shell** via Next.js ISR (Incremental Static Regeneration) and let the client fetch all dynamic content via TanStack Query.
```tsx
// Hypothetical ISR dashboard page
export const revalidate = 60; // Regenerate every 60 seconds
export default function DashboardPage() {
// Return a static shell - no server-side data fetching
return (
<DashboardShell>
<Suspense fallback={<BoardSkeleton />}>
<ClientBoard /> {/* Fetches via useQuery on mount */}
</Suspense>
</DashboardShell>
);
}
```
The client component would then fetch everything:
```tsx
"use client";
function ClientBoard() {
const { data: board, isLoading } = clientApi.board.getHomeBoard.useQuery(undefined, {
initialData: undefined, // Could be populated from Redis via API route
});
if (isLoading) return <BoardSkeleton />;
return <BoardContent board={board} />;
}
```
### How Next.js ISR Works
- On first request, Next.js generates the page and caches it
- Subsequent requests serve the cached HTML instantly (TTFB ~0ms for CDN)
- After `revalidate` seconds, the next request triggers background regeneration
- The stale page is served until the new one is ready (stale-while-revalidate)
### PROs
- **Near-instant TTFB**: Static HTML served from disk/CDN cache
- **Reduced server CPU**: No React SSR on every request
- **Scalable**: Static pages can be served by any CDN or reverse proxy
- **Good for public boards**: Shared boards viewed by many users benefit most
### CONs
- **Layout shift (CLS)**: Dashboard appears empty then fills in — bad UX for dashboards
- **No SSR for SEO**: Not relevant for Homarr (it's a private dashboard app)
- **Slower perceived load**: Users see a skeleton for 200-500ms while queries run
- **Authentication complexity**: ISR pages must be the same for all users. Homarr's dashboard is user-specific (permissions, board access), making ISR caching ineffective for the page itself
- **Breaks existing hydration pattern**: The current `HydrationBoundary` + `dehydrate()` pattern works well and ensures no layout shift
- **WebSocket subscriptions delayed**: Real-time updates don't start until client JS loads and connects
### Benchmark Comparison (Theoretical)
| Metric | Current (SSR) | Approach 7 (Redis initial data) | Approach 8 (ISR + CSR) |
|---|---|---|---|
| TTFB | 200-500ms | 50-100ms | ~10ms (static) |
| Time to Interactive | 200-500ms | 50-100ms | 200-500ms (same) |
| Largest Contentful Paint | 200-500ms | 50-100ms | 400-800ms (worse) |
| Cumulative Layout Shift | ~0 | ~0 | 0.1-0.3 (worse) |
| Server CPU per request | High | Low | Near zero |
### Recommendation
**Approach 7 (Redis-backed initial data) is recommended over Approach 8 (ISR)** for Homarr because:
1. **Dashboards are personalized**: Board access depends on user permissions, making ISR page-level caching ineffective
2. **No layout shift**: Users expect the dashboard to appear fully rendered
3. **Existing infrastructure**: Redis + cron jobs already provide the cache layer needed
4. **Incremental adoption**: Can be applied per-widget without changing the overall rendering strategy
5. **ISR is designed for content sites**: Blog posts, documentation pages, product pages — not interactive dashboards with real-time WebSocket subscriptions
ISR could still be useful for specific Homarr pages like `/manage/about` or documentation pages that don't depend on user state, but the main dashboard is not a good candidate.
+24
View File
@@ -1,3 +1,27 @@
## [1.56.1](https://github.com/homarr-labs/homarr/compare/v1.56.0...v1.56.1) (2026-03-20)
### Bug Fixes
* **deps:** update dependency dayjs to ^1.11.20 ([#5253](https://github.com/homarr-labs/homarr/issues/5253)) ([615062c](https://github.com/homarr-labs/homarr/commit/615062c6b141fa1e4bc91d2fab505fa1652608d2))
* **deps:** update dependency fast-xml-parser to ^5.5.1 ([#5246](https://github.com/homarr-labs/homarr/issues/5246)) ([91a9b6b](https://github.com/homarr-labs/homarr/commit/91a9b6bec9438e9a812960b829cea343e8478c63))
* **deps:** update dependency fast-xml-parser to ^5.5.3 ([#5251](https://github.com/homarr-labs/homarr/issues/5251)) ([d1d8659](https://github.com/homarr-labs/homarr/commit/d1d8659f951cdd22bf4a22b407a4f3027f036ec2))
* **deps:** update dependency fast-xml-parser to ^5.5.5 ([#5270](https://github.com/homarr-labs/homarr/issues/5270)) ([2423ecd](https://github.com/homarr-labs/homarr/commit/2423ecdce57353dd50d678444da800c02a246223))
* **deps:** update dependency isomorphic-dompurify to ^3.1.0 ([#5239](https://github.com/homarr-labs/homarr/issues/5239)) ([63f91b6](https://github.com/homarr-labs/homarr/commit/63f91b6352e9ba58a0823434d86915371f1c1d30))
* **deps:** update dependency isomorphic-dompurify to ^3.3.0 ([#5252](https://github.com/homarr-labs/homarr/issues/5252)) ([e8f6876](https://github.com/homarr-labs/homarr/commit/e8f6876d2477fb0e1936006b81f7324b90b6eb33))
* **deps:** update dependency jotai to ^2.18.1 ([#5238](https://github.com/homarr-labs/homarr/issues/5238)) ([729b49f](https://github.com/homarr-labs/homarr/commit/729b49ffa9b1f91ebd7bcd2300febba4d9d0fbb9))
* **deps:** update dependency mysql2 to v3.19.1 ([#5240](https://github.com/homarr-labs/homarr/issues/5240)) ([1040eca](https://github.com/homarr-labs/homarr/commit/1040ecac04fd0b10e101495d5230a3fa4898097a))
* **deps:** update dependency next to v16.1.7 [security] ([#5263](https://github.com/homarr-labs/homarr/issues/5263)) ([3bbde3c](https://github.com/homarr-labs/homarr/commit/3bbde3cbb8eb3aa528485f17d40817cb982a8687))
* **deps:** update dependency sass to ^1.98.0 ([#5247](https://github.com/homarr-labs/homarr/issues/5247)) ([f995cba](https://github.com/homarr-labs/homarr/commit/f995cba157c9954b6f266bd5b2bb8d60a08f51f1))
* **deps:** update dependency typescript-eslint to ^8.57.0 ([#5241](https://github.com/homarr-labs/homarr/issues/5241)) ([7841b58](https://github.com/homarr-labs/homarr/commit/7841b58f0fdd4a4494b6f3d61881a1efb4c9eba3))
* **deps:** update mantine monorepo to ^8.3.17 ([#5271](https://github.com/homarr-labs/homarr/issues/5271)) ([6fa9087](https://github.com/homarr-labs/homarr/commit/6fa9087a119334dee63e4ca4ed51276b25c4564a))
* **deps:** update tiptap monorepo to v3.20.2 ([#5279](https://github.com/homarr-labs/homarr/issues/5279)) ([55cf3c7](https://github.com/homarr-labs/homarr/commit/55cf3c72a3d9cd9f702e802716d549d7d2644105))
* **deps:** update trpc monorepo to ^11.13.2 ([#5273](https://github.com/homarr-labs/homarr/issues/5273)) ([7d93b10](https://github.com/homarr-labs/homarr/commit/7d93b1003245ab89fdba7175b0b4f745041cd1fe))
* **deps:** update trpc monorepo to ^11.13.3 ([#5276](https://github.com/homarr-labs/homarr/issues/5276)) ([0e0b857](https://github.com/homarr-labs/homarr/commit/0e0b857905a7b5196dbf529520f86467aa94d8ce))
* **deps:** update trpc monorepo to ^11.13.4 ([#5278](https://github.com/homarr-labs/homarr/issues/5278)) ([9648d9e](https://github.com/homarr-labs/homarr/commit/9648d9e99f02be8ba16a5238bd47866f7303724d))
* **deps:** update turbo monorepo to ^2.8.15 ([#5243](https://github.com/homarr-labs/homarr/issues/5243)) ([1bd924e](https://github.com/homarr-labs/homarr/commit/1bd924ea9917949ac64ab754d97964b12c083b82))
* **deps:** update turbo monorepo to ^2.8.16 ([#5250](https://github.com/homarr-labs/homarr/issues/5250)) ([ac80008](https://github.com/homarr-labs/homarr/commit/ac80008ce0796cb6927642c83ff2e667f6e9d24c))
* **deps:** update turbo monorepo to ^2.8.17 ([#5265](https://github.com/homarr-labs/homarr/issues/5265)) ([d2f438f](https://github.com/homarr-labs/homarr/commit/d2f438f294df3093b249213ac0a018b770705e3b))
## [1.56.0](https://github.com/homarr-labs/homarr/compare/v1.55.0...v1.56.0) (2026-03-13)
### Features
+2 -1
View File
@@ -43,7 +43,8 @@ RUN mkdir -p /var/cache/nginx && \
COPY --from=builder /app/apps/nextjs/next.config.ts .
COPY --from=builder /app/apps/nextjs/package.json .
COPY --from=builder /app/apps/nextjs/customServer.cjs ./apps/nextjs/customServer.cjs
COPY --from=builder /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs
COPY --from=builder /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
COPY --from=builder /app/packages/db/migrations ./db/migrations
+17 -28
View File
@@ -4,13 +4,12 @@
"private": true,
"type": "module",
"scripts": {
"build": "pnpm with-env next build && pnpm build:custom-server",
"build:custom-server": "esbuild server.ts --bundle --platform=node --outfile=customServer.cjs --external:next --external:fastify --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
"build": "pnpm with-env next build",
"clean": "git clean -xdf .next .turbo node_modules",
"dev": "pnpm with-env tsx ./server.ts",
"dev": "pnpm with-env next dev",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"start": "pnpm with-env node customServer.cjs",
"start": "pnpm with-env next start",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
@@ -26,10 +25,7 @@
"@homarr/boards": "workspace:^0.1.0",
"@homarr/common": "workspace:^0.1.0",
"@homarr/core": "workspace:^0.1.0",
"@homarr/cron-job-api": "workspace:^0.1.0",
"@homarr/cron-job-status": "workspace:^0.1.0",
"@homarr/cron-jobs": "workspace:^0.1.0",
"@homarr/cron-jobs-core": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/docker": "workspace:^0.1.0",
@@ -44,9 +40,7 @@
"@homarr/notifications": "workspace:^0.1.0",
"@homarr/old-import": "workspace:^0.1.0",
"@homarr/old-schema": "workspace:^0.1.0",
"@homarr/ping": "workspace:^0.1.0",
"@homarr/redis": "workspace:^0.1.0",
"@homarr/request-handler": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@homarr/settings": "workspace:^0.1.0",
"@homarr/spotlight": "workspace:^0.1.0",
@@ -54,47 +48,45 @@
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"@mantine/colors-generator": "^8.3.16",
"@mantine/core": "^8.3.16",
"@mantine/dropzone": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/modals": "^8.3.16",
"@mantine/tiptap": "^8.3.16",
"@mantine/colors-generator": "^8.3.17",
"@mantine/core": "^8.3.17",
"@mantine/dropzone": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"@mantine/modals": "^8.3.17",
"@mantine/tiptap": "^8.3.17",
"@million/lint": "1.0.14",
"@tabler/icons-react": "^3.40.0",
"@tanstack/react-query": "^5.90.21",
"@tanstack/react-query-devtools": "^5.91.3",
"@tanstack/react-query-next-experimental": "^5.91.0",
"@trpc/client": "^11.12.0",
"@trpc/next": "^11.12.0",
"@trpc/react-query": "^11.12.0",
"@trpc/server": "^11.12.0",
"@trpc/client": "^11.13.4",
"@trpc/next": "^11.13.4",
"@trpc/react-query": "^11.13.4",
"@trpc/server": "^11.13.4",
"@xterm/addon-canvas": "^0.7.0",
"@xterm/addon-fit": "0.11.0",
"@xterm/xterm": "^6.0.0",
"babel-plugin-react-compiler": "^1.0.0",
"chroma-js": "^3.2.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.19",
"dayjs": "^1.11.20",
"dotenv": "^17.3.1",
"fastify": "^5.7.4",
"flag-icons": "^7.5.0",
"glob": "^13.0.6",
"isomorphic-dompurify": "^3.1.0",
"isomorphic-dompurify": "^3.3.0",
"jotai": "^2.18.1",
"mantine-react-table": "2.0.0-beta.9",
"next": "16.1.6",
"next": "16.1.7",
"postcss-preset-mantine": "^1.18.0",
"prismjs": "^1.30.0",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-error-boundary": "^6.1.1",
"react-simple-code-editor": "^0.14.1",
"sass": "^1.97.3",
"sass": "^1.98.0",
"superjson": "2.2.6",
"swagger-ui-react": "^5.32.0",
"use-deep-compare-effect": "^1.8.1",
"ws": "^8.19.0",
"zod": "^4.2.1"
},
"devDependencies": {
@@ -107,13 +99,10 @@
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"@types/swagger-ui-react": "^5.18.0",
"@types/ws": "^8.18.1",
"concurrently": "^9.2.1",
"esbuild": "^0.27.3",
"eslint": "^9.39.4",
"node-loader": "^2.1.0",
"prettier": "^3.8.1",
"tsx": "4.20.4",
"typescript": "^5.9.3"
}
}
-318
View File
@@ -1,318 +0,0 @@
// Must be imported first to set up globalThis.AsyncLocalStorage for Next.js
import "next/dist/server/node-environment-baseline";
// Set up undici HTTP agent override (from tasks app)
import { setGlobalDispatcher } from "undici";
import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
setGlobalDispatcher(new UndiciHttpAgent());
import { createServer } from "http";
import path from "path";
import next from "next";
import { parse } from "url";
import { applyWSSHandler } from "@trpc/server/adapters/ws";
import { WebSocketServer } from "ws";
import type { FastifyTRPCPluginOptions } from "@trpc/server/adapters/fastify";
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
import fastify from "fastify";
import { appRouter, createTRPCContext } from "@homarr/api/websocket";
import { getSessionFromToken, sessionTokenCookieName } from "@homarr/auth";
import { env as authEnv } from "@homarr/auth/env";
import { parseCookies } from "@homarr/common";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
import type { JobRouter } from "@homarr/cron-job-api";
import { jobRouter } from "@homarr/cron-job-api";
import { CRON_JOB_API_KEY_HEADER, CRON_JOB_API_PATH, CRON_JOB_API_PORT } from "@homarr/cron-job-api/constants";
import { jobGroup } from "@homarr/cron-jobs";
import { db, eq, inArray } from "@homarr/db";
import { cronJobConfigurations, sessions, users } from "@homarr/db/schema";
import { supportedAuthProviders } from "@homarr/definitions";
import { updateCheckerRequestHandler } from "@homarr/request-handler/update-checker";
import { schedule, validate as validateCron } from "node-cron";
const logger = createLogger({ module: "customServer" });
// --- JobManager (from apps/tasks/src/job-manager.ts) ---
import type { IJobManager } from "@homarr/cron-job-api";
import type { jobGroup as CronJobGroup, JobGroupKeys } from "@homarr/cron-jobs";
import type { Database, InferInsertModel } from "@homarr/db";
class JobManager implements IJobManager {
constructor(
private db: Database,
private jobGroup: typeof CronJobGroup,
) {}
public async startAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.startAsync(name);
}
public async triggerAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.runManuallyAsync(name);
}
public async stopAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.stopAsync(name);
}
public async updateIntervalAsync(name: JobGroupKeys, cron: string): Promise<void> {
logger.info("Updating cron job interval", { name, expression: cron });
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
if (!validateCron(cron)) {
throw new Error(`Invalid cron expression: ${cron}`);
}
if (job.preventCustomInterval && cron !== job.cronExpression) {
throw new Error(`Custom cron expressions are not allowed for job ${name}`);
}
await this.updateConfigurationAsync(name, { cronExpression: cron });
await this.jobGroup.getTask(name)?.destroy();
this.jobGroup.setTask(
name,
schedule(cron, () => void job.executeAsync(), {
name,
}),
);
logger.info("Cron job interval updated", { name, expression: cron });
}
public async disableAsync(name: JobGroupKeys): Promise<void> {
logger.info("Disabling cron job", { name });
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
await this.updateConfigurationAsync(name, { isEnabled: false });
await this.jobGroup.stopAsync(name);
logger.info("Cron job disabled", { name });
}
public async enableAsync(name: JobGroupKeys): Promise<void> {
logger.info("Enabling cron job", { name });
await this.updateConfigurationAsync(name, { isEnabled: true });
await this.jobGroup.startAsync(name);
logger.info("Cron job enabled", { name });
}
private async updateConfigurationAsync(
name: JobGroupKeys,
configuration: Omit<Partial<InferInsertModel<typeof cronJobConfigurations>>, "name">,
) {
const existingConfig = await this.db.query.cronJobConfigurations.findFirst({
where: (table, { eq }) => eq(table.name, name),
});
if (existingConfig) {
await this.db
.update(cronJobConfigurations)
.set({ ...configuration, name: undefined })
.where(eq(cronJobConfigurations.name, name));
return;
}
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
await this.db.insert(cronJobConfigurations).values({
name,
cronExpression: configuration.cronExpression ?? job.cronExpression,
isEnabled: configuration.isEnabled ?? true,
});
}
public async getAllAsync(): Promise<
{
name: JobGroupKeys;
cron: string;
preventManualExecution: boolean;
preventCustomInterval: boolean;
isEnabled: boolean;
}[]
> {
const configurations = await this.db.query.cronJobConfigurations.findMany();
return [...this.jobGroup.getJobRegistry().entries()].map(([name, job]) => {
const config = configurations.find((config) => config.name === name);
return {
name,
cron: config?.cronExpression ?? job.cronExpression,
preventManualExecution: job.preventManualExecution,
preventCustomInterval: job.preventCustomInterval,
isEnabled: config?.isEnabled ?? true,
};
});
}
}
// --- On-start functions (from apps/tasks/src/on-start/) ---
async function cleanupSessionsAsync() {
try {
const currentAuthProviders = authEnv.AUTH_PROVIDERS;
const inactiveAuthProviders = supportedAuthProviders.filter((provider) => !currentAuthProviders.includes(provider));
const subQuery = db
.select({ id: users.id })
.from(users)
.where(inArray(users.provider, inactiveAuthProviders))
.as("sq");
const sessionsWithInactiveProviders = await db
.select({ userId: sessions.userId })
.from(sessions)
.rightJoin(subQuery, eq(sessions.userId, subQuery.id));
const userIds = sessionsWithInactiveProviders.map(({ userId }) => userId).filter((value) => value !== null);
await db.delete(sessions).where(inArray(sessions.userId, userIds));
if (sessionsWithInactiveProviders.length > 0) {
logger.info("Deleted sessions for inactive providers", { count: userIds.length });
}
} catch (error) {
logger.error(new Error("Failed to clean up sessions", { cause: error }));
}
}
async function invalidateUpdateCheckerCacheAsync() {
try {
const handler = updateCheckerRequestHandler.handler({});
await handler.invalidateAsync();
logger.debug("Update checker cache invalidated");
} catch (error) {
logger.error(new Error("Failed to invalidate update checker cache", { cause: error }));
}
}
// --- Tasks/Cron Fastify server setup ---
async function startTasksServer() {
const tasksLogger = createLogger({ module: "tasksMain" });
const tasksServer = fastify({ maxParamLength: 5000 });
tasksServer.register(fastifyTRPCPlugin, {
prefix: CRON_JOB_API_PATH,
trpcOptions: {
router: jobRouter,
createContext: ({ req }) => ({
manager: new JobManager(db, jobGroup),
apiKey: req.headers[CRON_JOB_API_KEY_HEADER] as string | undefined,
}),
onError({ path, error }) {
tasksLogger.error(new ErrorWithMetadata("Error in tasks tRPC handler", { path }, { cause: error }));
},
} satisfies FastifyTRPCPluginOptions<JobRouter>["trpcOptions"],
});
// Run on-start tasks
await cleanupSessionsAsync();
await invalidateUpdateCheckerCacheAsync();
// Initialize and start cron jobs
await jobGroup.initializeAsync();
await jobGroup.startAllAsync();
try {
await tasksServer.listen({ port: CRON_JOB_API_PORT });
tasksLogger.info("Tasks web server started successfully", { port: CRON_JOB_API_PORT });
} catch (err) {
tasksLogger.error(
new ErrorWithMetadata("Failed to start tasks web server", { port: CRON_JOB_API_PORT }, { cause: err }),
);
}
return tasksServer;
}
// --- Main server setup ---
const dev = process.env.NODE_ENV !== "production";
const hostname = process.env.HOSTNAME || "localhost";
const port = parseInt(process.env.PORT || "3000", 10);
// Resolve the directory of this file so Next.js can find the app/pages dirs
const dir = path.resolve(__dirname);
const app = next({ dev, hostname, port, dir });
const handle = app.getRequestHandler();
const upgradeHandler = app.getUpgradeHandler();
app.prepare().then(async () => {
const server = createServer((req, res) => {
const parsedUrl = parse(req.url!, true);
handle(req, res, parsedUrl);
});
// Create WebSocket server in noServer mode so we handle upgrade manually
const wss = new WebSocketServer({ noServer: true });
const wssHandler = applyWSSHandler({
wss,
router: appRouter,
// eslint-disable-next-line no-restricted-syntax
createContext: async ({ req }) => {
try {
const headers = Object.entries(req.headers).map(
([key, value]) => [key, typeof value === "string" ? value : value?.[0]] as [string, string],
);
const nextHeaders = new Headers(headers);
const store = parseCookies(nextHeaders.get("cookie") ?? "");
const sessionToken = store[sessionTokenCookieName];
const session = await getSessionFromToken(db, sessionToken);
return createTRPCContext({
headers: nextHeaders,
session,
});
} catch (error) {
logger.error(error);
return createTRPCContext({
headers: new Headers(),
session: null,
});
}
},
keepAlive: {
enabled: true,
pingMs: 30000,
pongWaitMs: 5000,
},
});
// Handle upgrade requests: route /websockets to our WS server,
// delegate everything else (e.g. HMR _next/webpack-hmr) to Next.js
server.on("upgrade", (req, socket, head) => {
if (req.url?.startsWith("/websockets")) {
wss.handleUpgrade(req, socket, head, (ws) => {
wss.emit("connection", ws, req);
});
} else {
upgradeHandler(req, socket, head);
}
});
wss.on("connection", (websocket, incomingMessage) => {
logger.info(`➕ Connection (${wss.clients.size}) ${incomingMessage.method} ${incomingMessage.url}`);
websocket.once("close", (code, reason) => {
logger.info(`➖ Connection (${wss.clients.size}) ${code} ${reason.toString()}`);
});
});
// Start the integrated tasks/cron server
const tasksServer = await startTasksServer();
server.once("error", (err) => {
logger.error(new ErrorWithMetadata("Server error", {}, { cause: err }));
wssHandler.broadcastReconnectNotification();
wss.close();
tasksServer.close().catch((closeError) => logger.error("Failed to close tasks server", closeError));
server.close(() => process.exit(1));
});
server.listen(port, () => {
logger.info(`✅ Custom server ready on http://${hostname}:${port}`);
logger.info(`✅ WebSocket Server integrated on ws://${hostname}:${port}/websockets`);
logger.info(`✅ Tasks/Cron server integrated on port ${CRON_JOB_API_PORT}`);
});
process.on("SIGTERM", () => {
logger.info("SIGTERM");
wssHandler.broadcastReconnectNotification();
wss.close();
tasksServer.close().catch((closeError) => logger.error("Failed to close tasks server", closeError));
server.close();
});
});
@@ -32,12 +32,13 @@ const getWebSocketProtocol = () => {
};
const constructWebsocketUrl = () => {
const fallback = `${getWebSocketProtocol()}://localhost:3001/websockets`;
if (typeof window === "undefined") {
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
return fallback;
}
if (env.NODE_ENV === "development") {
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
return fallback;
}
return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;
+1 -1
View File
@@ -14,5 +14,5 @@
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": [".", ".next/types/**/*.ts"],
"exclude": ["node_modules", ".next", "customServer.cjs", "customServer.css"]
"exclude": ["node_modules", ".next"]
}
+9
View File
@@ -0,0 +1,9 @@
import baseConfig from "@homarr/eslint-config/base";
/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: ["tasks.cjs"],
},
...baseConfig,
];
+58
View File
@@ -0,0 +1,58 @@
{
"name": "@homarr/tasks",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
"type": "module",
"exports": {
".": "./src/index.ts"
},
"main": "./src/main.ts",
"types": "./src/main.ts",
"scripts": {
"build": "esbuild src/main.ts --bundle --platform=node --loader:.scss=text --external:*.node --external:@opentelemetry/api --external:deasync --external:bcrypt --outfile=tasks.cjs",
"clean": "rm -rf .turbo node_modules",
"dev": "pnpm with-env tsx ./src/main.ts",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/analytics": "workspace:^0.1.0",
"@homarr/auth": "workspace:^0.1.0",
"@homarr/common": "workspace:^0.1.0",
"@homarr/core": "workspace:^",
"@homarr/cron-job-api": "workspace:^0.1.0",
"@homarr/cron-jobs": "workspace:^0.1.0",
"@homarr/cron-jobs-core": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/icons": "workspace:^0.1.0",
"@homarr/integrations": "workspace:^0.1.0",
"@homarr/ping": "workspace:^0.1.0",
"@homarr/redis": "workspace:^0.1.0",
"@homarr/request-handler": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"dayjs": "^1.11.20",
"dotenv": "^17.3.1",
"fastify": "^5.8.2",
"superjson": "2.2.6",
"undici": "7.18.2"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/node": "^24.12.0",
"dotenv-cli": "^11.0.0",
"esbuild": "^0.27.4",
"eslint": "^9.39.4",
"prettier": "^3.8.1",
"tsx": "4.20.4",
"typescript": "^5.9.3"
}
}
+128
View File
@@ -0,0 +1,128 @@
import { schedule, validate as validateCron } from "node-cron";
import { createLogger } from "@homarr/core/infrastructure/logs";
import type { IJobManager } from "@homarr/cron-job-api";
import type { jobGroup as cronJobGroup, JobGroupKeys } from "@homarr/cron-jobs";
import type { Database, InferInsertModel } from "@homarr/db";
import { eq } from "@homarr/db";
import { cronJobConfigurations } from "@homarr/db/schema";
const logger = createLogger({ module: "jobManager" });
export class JobManager implements IJobManager {
constructor(
private db: Database,
private jobGroup: typeof cronJobGroup,
) {}
public async startAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.startAsync(name);
}
public async triggerAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.runManuallyAsync(name);
}
public async stopAsync(name: JobGroupKeys): Promise<void> {
await this.jobGroup.stopAsync(name);
}
public async updateIntervalAsync(name: JobGroupKeys, cron: string): Promise<void> {
logger.info("Updating cron job interval", { name, expression: cron });
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
if (!validateCron(cron)) {
throw new Error(`Invalid cron expression: ${cron}`);
}
if (job.preventCustomInterval && cron !== job.cronExpression) {
throw new Error(`Custom cron expressions are not allowed for job ${name}`);
}
await this.updateConfigurationAsync(name, { cronExpression: cron });
await this.jobGroup.getTask(name)?.destroy();
this.jobGroup.setTask(
name,
schedule(cron, () => void job.executeAsync(), {
name,
}),
);
logger.info("Cron job interval updated", { name, expression: cron });
}
public async disableAsync(name: JobGroupKeys): Promise<void> {
logger.info("Disabling cron job", { name });
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
await this.updateConfigurationAsync(name, { isEnabled: false });
await this.jobGroup.stopAsync(name);
logger.info("Cron job disabled", { name });
}
public async enableAsync(name: JobGroupKeys): Promise<void> {
logger.info("Enabling cron job", { name });
await this.updateConfigurationAsync(name, { isEnabled: true });
await this.jobGroup.startAsync(name);
logger.info("Cron job enabled", { name });
}
private async updateConfigurationAsync(
name: JobGroupKeys,
configuration: Omit<Partial<InferInsertModel<typeof cronJobConfigurations>>, "name">,
) {
const existingConfig = await this.db.query.cronJobConfigurations.findFirst({
where: (table, { eq }) => eq(table.name, name),
});
logger.debug("Updating cron job configuration", {
name,
configuration: JSON.stringify(configuration),
exists: Boolean(existingConfig),
});
if (existingConfig) {
await this.db
.update(cronJobConfigurations)
// prevent updating the name, as it is the primary key
.set({ ...configuration, name: undefined })
.where(eq(cronJobConfigurations.name, name));
logger.debug("Cron job configuration updated", {
name,
configuration: JSON.stringify(configuration),
});
return;
}
const job = this.jobGroup.getJobRegistry().get(name);
if (!job) throw new Error(`Job ${name} not found`);
await this.db.insert(cronJobConfigurations).values({
name,
cronExpression: configuration.cronExpression ?? job.cronExpression,
isEnabled: configuration.isEnabled ?? true,
});
logger.debug("Cron job configuration updated", {
name,
configuration: JSON.stringify(configuration),
});
}
public async getAllAsync(): Promise<
{
name: JobGroupKeys;
cron: string;
preventManualExecution: boolean;
preventCustomInterval: boolean;
isEnabled: boolean;
}[]
> {
const configurations = await this.db.query.cronJobConfigurations.findMany();
return [...this.jobGroup.getJobRegistry().entries()].map(([name, job]) => {
const config = configurations.find((config) => config.name === name);
return {
name,
cron: config?.cronExpression ?? job.cronExpression,
preventManualExecution: job.preventManualExecution,
preventCustomInterval: job.preventCustomInterval,
isEnabled: config?.isEnabled ?? true,
};
});
}
}
+52
View File
@@ -0,0 +1,52 @@
// This import has to be the first import in the file so that the agent is overridden before any other modules are imported.
import "./overrides";
import type { FastifyTRPCPluginOptions } from "@trpc/server/adapters/fastify";
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
import fastify from "fastify";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
import type { JobRouter } from "@homarr/cron-job-api";
import { jobRouter } from "@homarr/cron-job-api";
import { CRON_JOB_API_KEY_HEADER, CRON_JOB_API_PATH, CRON_JOB_API_PORT } from "@homarr/cron-job-api/constants";
import { jobGroup } from "@homarr/cron-jobs";
import { db } from "@homarr/db";
import { JobManager } from "./job-manager";
import { onStartAsync } from "./on-start";
const logger = createLogger({ module: "tasksMain" });
const server = fastify({
maxParamLength: 5000,
});
server.register(fastifyTRPCPlugin, {
prefix: CRON_JOB_API_PATH,
trpcOptions: {
router: jobRouter,
createContext: ({ req }) => ({
manager: new JobManager(db, jobGroup),
apiKey: req.headers[CRON_JOB_API_KEY_HEADER] as string | undefined,
}),
onError({ path, error }) {
logger.error(new ErrorWithMetadata("Error in tasks tRPC handler", { path }, { cause: error }));
},
} satisfies FastifyTRPCPluginOptions<JobRouter>["trpcOptions"],
});
void (async () => {
await onStartAsync();
await jobGroup.initializeAsync();
await jobGroup.startAllAsync();
try {
await server.listen({ port: CRON_JOB_API_PORT });
logger.info("Tasks web server started successfully", { port: CRON_JOB_API_PORT });
} catch (err) {
logger.error(
new ErrorWithMetadata("Failed to start tasks web server", { port: CRON_JOB_API_PORT }, { cause: err }),
);
process.exit(1);
}
})();
+7
View File
@@ -0,0 +1,7 @@
import { invalidateUpdateCheckerCacheAsync } from "./invalidate-update-checker-cache";
import { cleanupSessionsAsync } from "./session-cleanup";
export async function onStartAsync() {
await cleanupSessionsAsync();
await invalidateUpdateCheckerCacheAsync();
}
@@ -0,0 +1,18 @@
import { createLogger } from "@homarr/core/infrastructure/logs";
import { updateCheckerRequestHandler } from "@homarr/request-handler/update-checker";
const logger = createLogger({ module: "invalidateUpdateCheckerCache" });
/**
* Invalidates the update checker cache on startup to ensure fresh data.
* It is important as we want to avoid showing pending updates after the update to latest version.
*/
export async function invalidateUpdateCheckerCacheAsync() {
try {
const handler = updateCheckerRequestHandler.handler({});
await handler.invalidateAsync();
logger.debug("Update checker cache invalidated");
} catch (error) {
logger.error(new Error("Failed to invalidate update checker cache", { cause: error }));
}
}
@@ -0,0 +1,41 @@
import { env } from "@homarr/auth/env";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { db, eq, inArray } from "@homarr/db";
import { sessions, users } from "@homarr/db/schema";
import { supportedAuthProviders } from "@homarr/definitions";
const logger = createLogger({ module: "sessionCleanup" });
/**
* Deletes sessions for users that have inactive auth providers.
* Sessions from other providers are deleted so they can no longer be used.
*/
export async function cleanupSessionsAsync() {
try {
const currentAuthProviders = env.AUTH_PROVIDERS;
const inactiveAuthProviders = supportedAuthProviders.filter((provider) => !currentAuthProviders.includes(provider));
const subQuery = db
.select({ id: users.id })
.from(users)
.where(inArray(users.provider, inactiveAuthProviders))
.as("sq");
const sessionsWithInactiveProviders = await db
.select({ userId: sessions.userId })
.from(sessions)
.rightJoin(subQuery, eq(sessions.userId, subQuery.id));
const userIds = sessionsWithInactiveProviders.map(({ userId }) => userId).filter((value) => value !== null);
await db.delete(sessions).where(inArray(sessions.userId, userIds));
if (sessionsWithInactiveProviders.length > 0) {
logger.info("Deleted sessions for inactive providers", {
count: userIds.length,
});
} else {
logger.debug("No sessions to delete");
}
} catch (error) {
logger.error(new Error("Failed to clean up sessions", { cause: error }));
}
}
+5
View File
@@ -0,0 +1,5 @@
import { setGlobalDispatcher } from "undici";
import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
setGlobalDispatcher(new UndiciHttpAgent());
+13
View File
@@ -0,0 +1,13 @@
{
"extends": "@homarr/tsconfig/base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["src/*"],
"@homarr/node-unifi": ["../../node_modules/@types/node-unifi"]
},
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": ["."],
"exclude": ["node_modules"]
}
+9
View File
@@ -0,0 +1,9 @@
import baseConfig from "@homarr/eslint-config/base";
/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: ["wssServer.cjs"],
},
...baseConfig,
];
+42
View File
@@ -0,0 +1,42 @@
{
"name": "@homarr/websocket",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
"type": "module",
"main": "./src/main.ts",
"types": "./src/main.ts",
"scripts": {
"build": "esbuild src/main.ts --bundle --platform=node --outfile=wssServer.cjs --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
"clean": "rm -rf .turbo node_modules",
"dev": "pnpm with-env tsx ./src/main.ts",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/api": "workspace:^0.1.0",
"@homarr/auth": "workspace:^0.1.0",
"@homarr/common": "workspace:^0.1.0",
"@homarr/core": "workspace:^",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/redis": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"dotenv": "^17.3.1",
"tsx": "4.20.4",
"ws": "^8.19.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/ws": "^8.18.1",
"esbuild": "^0.27.4",
"eslint": "^9.39.4",
"prettier": "^3.8.1",
"typescript": "^5.9.3"
}
}
+66
View File
@@ -0,0 +1,66 @@
import { applyWSSHandler } from "@trpc/server/adapters/ws";
import { WebSocketServer } from "ws";
import { appRouter, createTRPCContext } from "@homarr/api/websocket";
import { getSessionFromToken, sessionTokenCookieName } from "@homarr/auth";
import { parseCookies } from "@homarr/common";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { db } from "@homarr/db";
const logger = createLogger({ module: "websocketMain" });
const wss = new WebSocketServer({
port: 3001,
});
const handler = applyWSSHandler({
wss,
router: appRouter,
// ignore error on next line because the createContext must be set with this name
// eslint-disable-next-line no-restricted-syntax
createContext: async ({ req }) => {
try {
const headers = Object.entries(req.headers).map(
([key, value]) => [key, typeof value === "string" ? value : value?.[0]] as [string, string],
);
const nextHeaders = new Headers(headers);
const store = parseCookies(nextHeaders.get("cookie") ?? "");
const sessionToken = store[sessionTokenCookieName];
const session = await getSessionFromToken(db, sessionToken);
return createTRPCContext({
headers: nextHeaders,
session,
});
} catch (error) {
logger.error(error);
return createTRPCContext({
headers: new Headers(),
session: null,
});
}
},
// Enable heartbeat messages to keep connection open (disabled by default)
keepAlive: {
enabled: true,
// server ping message interval in milliseconds
pingMs: 30000,
// connection is terminated if pong message is not received in this many milliseconds
pongWaitMs: 5000,
},
});
wss.on("connection", (websocket, incomingMessage) => {
logger.info(`➕ Connection (${wss.clients.size}) ${incomingMessage.method} ${incomingMessage.url}`);
websocket.once("close", (code, reason) => {
logger.info(`➖ Connection (${wss.clients.size}) ${code} ${reason.toString()}`);
});
});
logger.info("✅ WebSocket Server listening on ws://localhost:3001");
process.on("SIGTERM", () => {
logger.info("SIGTERM");
handler.broadcastReconnectNotification();
wss.close();
});
+13
View File
@@ -0,0 +1,13 @@
{
"extends": "@homarr/tsconfig/base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["src/*"],
"@homarr/node-unifi": ["../../node_modules/@types/node-unifi"]
},
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": ["."],
"exclude": ["node_modules"]
}
+2 -2
View File
@@ -4,10 +4,10 @@
"dependencies": {
"better-sqlite3": "^12.6.2"
},
"packageManager": "pnpm@10.32.0",
"packageManager": "pnpm@10.32.1",
"engines": {
"node": ">=24.14.0",
"pnpm": ">=10.32.0"
"pnpm": ">=10.32.1"
},
"pnpm": {
"onlyBuiltDependencies": [
+2 -2
View File
@@ -356,8 +356,8 @@
<br/>
<p align="center">Unifi<br/>Controller</p>
</a>
</td></tr>
<tr><td align="center">
</td>
<td align="center">
<a href="https://homarr.dev/docs/integrations/unraid" target="_blank" rel="noreferrer noopener">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg" alt="Unraid" width="90" height="90" />
<br/>
+2 -2
View File
@@ -7,9 +7,9 @@ http {
listen 7575;
listen [::]:7575;
# Route websockets traffic to port 3000 (integrated custom server)
# Route websockets traffic to port 3001
location /websockets {
proxy_pass http://${HOSTNAME}:3000;
proxy_pass http://${HOSTNAME}:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
+13 -16
View File
@@ -1,6 +1,6 @@
{
"name": "homarr",
"version": "1.56.0",
"version": "1.56.1",
"private": true,
"scripts": {
"build": "cross-env CI=true turbo build",
@@ -17,9 +17,6 @@
"db:studio": "pnpm -F db studio",
"dev": "turbo dev --parallel",
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
"docker:build": "docker build -t homarr:test .",
"docker:test": "bash scripts/docker-test.sh",
"docker:test:skip-build": "bash scripts/docker-test.sh --skip-build",
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
@@ -29,7 +26,7 @@
"release": "semantic-release",
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
"start": "pnpm -F nextjs start",
"start": "concurrently \"pnpm with-env node apps/tasks/tasks.cjs\" \"pnpm with-env node apps/websocket/wssServer.cjs\" \"pnpm -F nextjs start\"",
"test": "cross-env NODE_ENV=development CI=true vitest run --exclude e2e --coverage.enabled ",
"test:e2e": "cross-env NODE_ENV=development CI=true vitest e2e",
"test:ui": "cross-env NODE_ENV=development CI=true vitest --exclude e2e --ui --coverage.enabled",
@@ -46,10 +43,10 @@
"@semantic-release/npm": "^13.1.5",
"@semantic-release/release-notes-generator": "^14.1.0",
"@testcontainers/redis": "^11.12.0",
"@turbo/gen": "^2.8.15",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "^4.0.18",
"@turbo/gen": "^2.8.17",
"@vitejs/plugin-react": "^5.2.0",
"@vitest/coverage-v8": "^4.1.0",
"@vitest/ui": "^4.1.0",
"conventional-changelog-conventionalcommits": "^9.3.0",
"cross-env": "^10.1.0",
"jsdom": "^28.1.0",
@@ -57,15 +54,15 @@
"prettier": "^3.8.1",
"semantic-release": "^25.0.3",
"testcontainers": "^11.12.0",
"turbo": "^2.8.15",
"turbo": "^2.8.17",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.0.18"
"vitest": "^4.1.0"
},
"packageManager": "pnpm@10.32.0",
"packageManager": "pnpm@10.32.1",
"engines": {
"node": ">=24.14.0",
"pnpm": ">=10.32.0"
"pnpm": ">=10.32.1"
},
"pnpm": {
"onlyBuiltDependencies": [
@@ -85,9 +82,9 @@
"axios@>=1.0.0 <1.8.2": ">=1.13.6",
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.4",
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.4",
"esbuild@<=0.24.2": ">=0.27.3",
"esbuild@<=0.24.2": ">=0.27.4",
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
"hono@<4.6.5": ">=4.12.7",
"hono@<4.6.5": ">=4.12.8",
"linkifyjs@<4.3.2": ">=4.3.2",
"nanoid@>=4.0.0 <5.0.9": ">=5.1.6",
"prismjs@<1.30.0": ">=1.30.0",
@@ -98,7 +95,7 @@
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
"tmp@<=0.2.3": ">=0.2.5",
"vite@>=5.0.0 <=5.4.18": ">=7.3.1"
"vite@>=5.0.0 <=5.4.18": ">=8.0.0"
},
"patchedDependencies": {
"@types/node-unifi": "patches/@types__node-unifi.patch",
+5 -5
View File
@@ -42,12 +42,12 @@
"@homarr/validation": "workspace:^0.1.0",
"@kubernetes/client-node": "^1.4.0",
"@tanstack/react-query": "^5.90.21",
"@trpc/client": "^11.12.0",
"@trpc/react-query": "^11.12.0",
"@trpc/server": "^11.12.0",
"@trpc/tanstack-react-query": "^11.12.0",
"@trpc/client": "^11.13.4",
"@trpc/react-query": "^11.13.4",
"@trpc/server": "^11.13.4",
"@trpc/tanstack-react-query": "^11.13.4",
"lodash.clonedeep": "^4.5.0",
"next": "16.1.6",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"superjson": "2.2.6",
+1 -1
View File
@@ -34,7 +34,7 @@
"bcrypt": "^6.0.0",
"cookies": "^0.9.1",
"ldapts": "8.1.7",
"next": "16.1.6",
"next": "16.1.7",
"next-auth": "5.0.0-beta.30",
"react": "19.2.4",
"react-dom": "19.2.4",
+1 -1
View File
@@ -36,7 +36,7 @@
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"esbuild": "^0.27.3",
"esbuild": "^0.27.4",
"eslint": "^9.39.4",
"typescript": "^5.9.3"
}
+2 -2
View File
@@ -29,8 +29,8 @@
"@homarr/core": "workspace:^0.1.0",
"@paralleldrive/cuid2": "^3.3.0",
"cookie": "1.1.1",
"dayjs": "^1.11.19",
"next": "16.1.6",
"dayjs": "^1.11.20",
"next": "16.1.7",
"octokit": "^5.0.5",
"react": "19.2.4",
"react-dom": "19.2.4",
+3 -3
View File
@@ -29,9 +29,9 @@
"@homarr/core": "workspace:^0.1.0",
"@homarr/cron-jobs": "workspace:^0.1.0",
"@tanstack/react-query": "^5.90.21",
"@trpc/client": "^11.12.0",
"@trpc/server": "^11.12.0",
"@trpc/tanstack-react-query": "^11.12.0",
"@trpc/client": "^11.13.4",
"@trpc/server": "^11.13.4",
"@trpc/tanstack-react-query": "^11.13.4",
"node-cron": "^4.2.1",
"react": "19.2.4",
"zod": "^4.2.1"
+2 -2
View File
@@ -47,7 +47,7 @@
"@homarr/core": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/core": "^8.3.17",
"@paralleldrive/cuid2": "^3.3.0",
"@testcontainers/mysql": "^11.12.0",
"@testcontainers/postgresql": "^11.12.0",
@@ -67,7 +67,7 @@
"@types/better-sqlite3": "7.6.13",
"@types/pg": "^8.18.0",
"dotenv-cli": "^11.0.0",
"esbuild": "^0.27.3",
"esbuild": "^0.27.4",
"eslint": "^9.39.4",
"prettier": "^3.8.1",
"tsx": "4.20.4",
+1 -1
View File
@@ -24,7 +24,7 @@
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/common": "workspace:^0.1.0",
"fast-xml-parser": "^5.4.2",
"fast-xml-parser": "^5.5.5",
"zod": "^4.2.1"
},
"devDependencies": {
+1 -1
View File
@@ -26,7 +26,7 @@
"@homarr/common": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/form": "^8.3.16",
"@mantine/form": "^8.3.17",
"mantine-form-zod-resolver": "^1.3.0",
"zod": "^4.2.1"
},
+1 -1
View File
@@ -30,7 +30,7 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/core": "^8.3.17",
"react": "19.2.4",
"zod": "^4.2.1"
},
+3 -3
View File
@@ -33,10 +33,10 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/core": "^8.3.17",
"@tabler/icons-react": "^3.40.0",
"dayjs": "^1.11.19",
"next": "16.1.6",
"dayjs": "^1.11.20",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"zod": "^4.2.1"
+2 -2
View File
@@ -24,8 +24,8 @@
"dependencies": {
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/core": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"react": "19.2.4"
},
"devDependencies": {
+1 -1
View File
@@ -24,7 +24,7 @@
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/ui": "workspace:^0.1.0",
"@mantine/notifications": "^8.3.16",
"@mantine/notifications": "^8.3.17",
"@tabler/icons-react": "^3.40.0"
},
"devDependencies": {
+3 -3
View File
@@ -37,10 +37,10 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/core": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"adm-zip": "0.5.16",
"next": "16.1.6",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"superjson": "2.2.6",
+1 -12
View File
@@ -1,6 +1,6 @@
import type { LogLevel } from "@homarr/core/infrastructure/logs/constants";
import { createCacheChannel, createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
import { createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
export {
createCacheChannel,
@@ -40,14 +40,3 @@ export interface LoggerMessage {
}
export const loggingChannel = createSubPubChannel<LoggerMessage>("logging");
/**
* POC: Redis cache for widget prefetch data.
* Caches serialized query data per widget kind to avoid database queries on every page load.
* Default TTL: 5 minutes (matches existing cron job intervals).
*
* Usage: see packages/widgets/src/prefetch.ts
* This can be reverted by reverting this commit.
*/
export const createWidgetPrefetchCache = (widgetKind: string) =>
createCacheChannel<Record<string, unknown>>(`widget-prefetch:${widgetKind}`, 5 * 60 * 1000);
+1 -1
View File
@@ -30,7 +30,7 @@
"@homarr/docker": "workspace:^0.1.0",
"@homarr/integrations": "workspace:^0.1.0",
"@homarr/redis": "workspace:^0.1.0",
"dayjs": "^1.11.19",
"dayjs": "^1.11.20",
"octokit": "^5.0.5",
"superjson": "2.2.6",
"undici": "7.18.2",
+2 -2
View File
@@ -25,8 +25,8 @@
"dependencies": {
"@homarr/db": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@mantine/dates": "^8.3.16",
"next": "16.1.6",
"@mantine/dates": "^8.3.17",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4"
},
+4 -4
View File
@@ -33,12 +33,12 @@
"@homarr/settings": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/spotlight": "^8.3.16",
"@mantine/core": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"@mantine/spotlight": "^8.3.17",
"@tabler/icons-react": "^3.40.0",
"jotai": "^2.18.1",
"next": "16.1.6",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"use-deep-compare-effect": "^1.8.1"
+2 -2
View File
@@ -29,10 +29,10 @@
"dependencies": {
"@homarr/common": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"dayjs": "^1.11.19",
"dayjs": "^1.11.20",
"deepmerge": "4.3.1",
"mantine-react-table": "2.0.0-beta.9",
"next": "16.1.6",
"next": "16.1.7",
"next-intl": "4.8.3",
"react": "19.2.4",
"react-dom": "19.2.4"
+3 -3
View File
@@ -2001,7 +2001,7 @@
"description": "",
"option": {
"showStreams": {
"label": ""
"label": "Aktive Streams anzeigen"
},
"showStats": {
"label": ""
@@ -2014,7 +2014,7 @@
}
},
"stats": {
"activeStreams": "",
"activeStreams": "Aktive Streams",
"totalUsers": "",
"transcodes": "",
"bandwidth": ""
@@ -2151,7 +2151,7 @@
"description": "",
"option": {
"showUsers": {
"label": "",
"label": "Benutzer anzeigen",
"description": ""
},
"showPhotos": {
+18 -18
View File
@@ -1689,62 +1689,62 @@
"label": "3 Months"
},
"6mo": {
"label": ""
"label": "6 Months"
},
"ytd": {
"label": ""
"label": "Year to Date"
},
"1y": {
"label": ""
"label": "1 Year"
},
"2y": {
"label": ""
"label": "2 Years"
},
"5y": {
"label": ""
"label": "5 Years"
},
"10y": {
"label": ""
"label": "10 Years"
},
"max": {
"label": ""
"label": "Max"
}
}
},
"timeInterval": {
"label": "",
"label": "Time Interval",
"option": {
"5m": {
"label": ""
"label": "5 Minutes"
},
"15m": {
"label": ""
"label": "15 Minutes"
},
"30m": {
"label": ""
"label": "30 Minutes"
},
"1h": {
"label": ""
"label": "1 Hour"
},
"1d": {
"label": ""
"label": "1 Day"
},
"5d": {
"label": ""
"label": "5 Days"
},
"1wk": {
"label": ""
"label": "1 Week"
},
"1mo": {
"label": ""
"label": "1 Month"
}
}
}
}
},
"calendar": {
"name": "",
"description": "",
"name": "Calendar",
"description": "Display events from your integrations in a calendar view within a certain relative time period",
"duration": {
"allDay": ""
},
+1
View File
@@ -2033,6 +2033,7 @@
"directStream": "Direct Stream"
}
},
"recentActivity": {
"title": "Recent Activity",
"empty": "No recent activity",
+22 -22
View File
@@ -1997,46 +1997,46 @@
}
},
"tracearr": {
"name": "",
"description": "",
"name": "Tracearr",
"description": "Monitoraggio avanzato del server multimediale con dati dettagliati su streaming e transcodifica",
"option": {
"showStreams": {
"label": ""
"label": "Mostra stream attivo"
},
"showStats": {
"label": ""
"label": "Mostra riepilogo statistiche"
},
"showRecentActivity": {
"label": ""
"label": "Mostra attività recenti"
},
"showViolations": {
"label": ""
"label": "Visualizza violazioni"
}
},
"stats": {
"activeStreams": "",
"activeStreams": "Stream Attivi",
"totalUsers": "Utenti Totali",
"transcodes": "",
"bandwidth": ""
"transcodes": "Transcodifiche",
"bandwidth": "Larghezza banda"
},
"streams": {
"empty": "",
"empty": "Nessun stream attivo",
"user": "Utente",
"media": "",
"state": "",
"quality": "",
"media": "Multimedia",
"state": "Stato",
"quality": "Qualità",
"device": "Dispositivo",
"progress": "Avanzamento",
"videoDecision": {
"directPlay": "",
"transcode": "",
"directStream": ""
"directPlay": "Riproduzione diretta",
"transcode": "Transcodifica",
"directStream": "Streaming Diretto"
}
},
"recentActivity": {
"title": "",
"empty": "",
"watched": "",
"title": "Attività recenti",
"empty": "Nessuna attività recente",
"watched": "Guardato",
"partial": "Parziale"
},
"violations": {
@@ -2047,8 +2047,8 @@
},
"noSectionsEnabled": "Nessuna sezione abilitata",
"error": {
"noIntegration": "",
"internalServerError": ""
"noIntegration": "Nessuna integrazione Tracearr configurata",
"internalServerError": "Impossibile recuperare i dati di Tracearr"
}
},
"common": {
@@ -3575,7 +3575,7 @@
"label": "Meteo"
},
"tracearr": {
"label": ""
"label": "Tracearr"
}
},
"interval": {
+1 -1
View File
@@ -764,7 +764,7 @@
"expired": "Het certificaat is verlopen.",
"notYetValid": "Het certificaat is nog niet geldig.",
"untrusted": "Het certificaat wordt niet vertrouwd.",
"hostnameMismatch": ""
"hostnameMismatch": "Het certificaat hostname komt niet overeen met de URL."
},
"alert": {
"permission": {
+32 -32
View File
@@ -1997,58 +1997,58 @@
}
},
"tracearr": {
"name": "",
"description": "",
"name": "Tracearr",
"description": "Мониторинг медиасервера с детальной информацией о потоках и транскодировании",
"option": {
"showStreams": {
"label": ""
"label": "Показать активные потоки"
},
"showStats": {
"label": ""
"label": "Показать сводку статистики"
},
"showRecentActivity": {
"label": ""
"label": "Показать недавнюю активность"
},
"showViolations": {
"label": ""
"label": "Показать нарушения"
}
},
"stats": {
"activeStreams": "",
"totalUsers": "",
"transcodes": "",
"bandwidth": ""
"activeStreams": "Активные потоки",
"totalUsers": "Всего пользователей",
"transcodes": "Транскодирования",
"bandwidth": "Пропускная способность"
},
"streams": {
"empty": "",
"user": "",
"media": "",
"state": "",
"quality": "",
"device": "",
"progress": "",
"empty": "Нет активных потоков",
"user": "Пользователь",
"media": "Медиа",
"state": "Состояние",
"quality": "Качество",
"device": "Устройство",
"progress": "Прогресс",
"videoDecision": {
"directPlay": "",
"transcode": "",
"directStream": ""
"directPlay": "Прямое воспроизведение",
"transcode": "Транскодирование",
"directStream": "Прямой поток"
}
},
"recentActivity": {
"title": "",
"empty": "",
"watched": "",
"partial": ""
"title": "Недавняя активность",
"empty": "Нет недавней активности",
"watched": "Просмотрено",
"partial": "Частично"
},
"violations": {
"title": "",
"empty": "",
"rule": "",
"user": ""
"title": "Нарушения",
"empty": "Нет недавних нарушений",
"rule": "Правило",
"user": "Пользователь"
},
"noSectionsEnabled": "",
"noSectionsEnabled": "Секции не включены",
"error": {
"noIntegration": "",
"internalServerError": ""
"noIntegration": "Интеграция Tracearr не настроена",
"internalServerError": "Не удалось получить данные Tracearr"
}
},
"common": {
@@ -3575,7 +3575,7 @@
"label": "Погода"
},
"tracearr": {
"label": ""
"label": "Tracearr"
}
},
"interval": {
+4 -4
View File
@@ -30,13 +30,13 @@
"@homarr/settings": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^8.3.16",
"@mantine/dates": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/core": "^8.3.17",
"@mantine/dates": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"@tabler/icons-react": "^3.40.0",
"crypto-js": "^4.2.0",
"mantine-react-table": "2.0.0-beta.9",
"next": "16.1.6",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"svgson": "^5.3.1"
+21 -21
View File
@@ -48,31 +48,31 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/charts": "^8.3.16",
"@mantine/core": "^8.3.16",
"@mantine/hooks": "^8.3.16",
"@mantine/charts": "^8.3.17",
"@mantine/core": "^8.3.17",
"@mantine/hooks": "^8.3.17",
"@tabler/icons-react": "^3.40.0",
"@tiptap/extension-color": "3.20.1",
"@tiptap/extension-highlight": "3.20.1",
"@tiptap/extension-image": "3.20.1",
"@tiptap/extension-link": "^3.20.1",
"@tiptap/extension-placeholder": "^3.20.1",
"@tiptap/extension-table": "3.20.1",
"@tiptap/extension-table-cell": "3.20.1",
"@tiptap/extension-table-header": "3.20.1",
"@tiptap/extension-table-row": "3.20.1",
"@tiptap/extension-task-item": "3.20.1",
"@tiptap/extension-task-list": "3.20.1",
"@tiptap/extension-text-align": "3.20.1",
"@tiptap/extension-text-style": "3.20.1",
"@tiptap/extension-underline": "3.20.1",
"@tiptap/react": "^3.20.1",
"@tiptap/starter-kit": "^3.20.1",
"@tiptap/extension-color": "3.20.2",
"@tiptap/extension-highlight": "3.20.2",
"@tiptap/extension-image": "3.20.2",
"@tiptap/extension-link": "^3.20.2",
"@tiptap/extension-placeholder": "^3.20.2",
"@tiptap/extension-table": "3.20.2",
"@tiptap/extension-table-cell": "3.20.2",
"@tiptap/extension-table-header": "3.20.2",
"@tiptap/extension-table-row": "3.20.2",
"@tiptap/extension-task-item": "3.20.2",
"@tiptap/extension-task-list": "3.20.2",
"@tiptap/extension-text-align": "3.20.2",
"@tiptap/extension-text-style": "3.20.2",
"@tiptap/extension-underline": "3.20.2",
"@tiptap/react": "^3.20.2",
"@tiptap/starter-kit": "^3.20.2",
"clsx": "^2.1.1",
"dayjs": "^1.11.19",
"dayjs": "^1.11.20",
"mantine-form-zod-resolver": "^1.3.0",
"mantine-react-table": "2.0.0-beta.9",
"next": "16.1.6",
"next": "16.1.7",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-markdown": "^10.1.0",
-49
View File
@@ -1,11 +1,9 @@
import { cache } from "react";
import type { QueryClient } from "@tanstack/react-query";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { db } from "@homarr/db";
import { getServerSettingsAsync } from "@homarr/db/queries";
import type { WidgetKind } from "@homarr/definitions";
import { createWidgetPrefetchCache } from "@homarr/redis";
import { createSettings } from "@homarr/settings/creator";
import { reduceWidgetOptionsWithDefaultValues } from ".";
@@ -14,7 +12,6 @@ import prefetchForBookmarks from "./bookmarks/prefetch";
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
import type { inferOptionsFromCreator } from "./options";
const logger = createLogger({ module: "widgetPrefetch" });
const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);
const prefetchCallbacks: Partial<{
@@ -24,16 +21,6 @@ const prefetchCallbacks: Partial<{
app: prefetchForApps,
};
/**
* POC: Try to read widget prefetch data from Redis cache first.
* Falls back to the original database-backed prefetch on cache miss.
*
* When Redis has cached data (populated by cron jobs or previous page loads),
* this avoids database queries entirely — estimated 2-5x faster TTFB.
*
* The cache is populated after a successful database prefetch (write-through).
* TTL is 5 minutes to match cron job intervals.
*/
export const prefetchForKindAsync = async <TKind extends WidgetKind>(
kind: TKind,
queryClient: QueryClient,
@@ -54,41 +41,5 @@ export const prefetchForKindAsync = async <TKind extends WidgetKind>(
options: reduceWidgetOptionsWithDefaultValues(kind, createSettings({ user: null, serverSettings }), item.options),
}));
// POC: Try Redis cache first for widget prefetch data
try {
const cacheChannel = createWidgetPrefetchCache(kind);
const cached = await cacheChannel.getAsync();
if (cached) {
// Cache hit: populate query client from Redis instead of database
for (const [key, value] of Object.entries(cached.data)) {
queryClient.setQueryData(JSON.parse(key), value);
}
logger.debug(`Widget prefetch cache hit for kind '${kind}'`);
return;
}
} catch (error) {
// Redis unavailable or parse error — fall through to database
logger.debug(`Widget prefetch cache miss/error for kind '${kind}', falling back to database`);
}
// Cache miss: prefetch from database (original path)
await callback(queryClient, itemsWithDefaultOptions as never[]);
// POC: Write-through — cache the prefetched data for next request
try {
const cacheChannel = createWidgetPrefetchCache(kind);
const queryCache = queryClient.getQueryCache().getAll();
const cacheData: Record<string, unknown> = {};
for (const query of queryCache) {
if (query.state.data !== undefined) {
cacheData[JSON.stringify(query.queryKey)] = query.state.data;
}
}
if (Object.keys(cacheData).length > 0) {
await cacheChannel.setAsync(cacheData);
logger.debug(`Widget prefetch cache populated for kind '${kind}' (${Object.keys(cacheData).length} entries)`);
}
} catch {
// Non-critical: cache write failure doesn't affect the user
}
};
+1252 -1291
View File
File diff suppressed because it is too large. Load diff
-148
View File
@@ -1,148 +0,0 @@
#!/usr/bin/env bash
# Benchmark memory usage: separate ws server vs integrated custom Next.js server
# Usage: ./scripts/benchmark-memory.sh [approach] [wait_seconds]
# approach: "separate" | "integrated" | "both" (default: both)
set -e
APPROACH="${1:-both}"
WAIT_SECONDS="${2:-15}"
measure_process_tree_memory() {
local root_pid=$1
local label=$2
local total_rss=0
if [ -z "$root_pid" ] || ! kill -0 "$root_pid" 2>/dev/null; then
echo "$label: not running"
return
fi
# Measure root process
local root_rss
root_rss=$(grep VmRSS /proc/$root_pid/status 2>/dev/null | awk '{print $2}')
root_rss=${root_rss:-0}
total_rss=$root_rss
local root_mb
root_mb=$(echo "scale=2; $root_rss / 1024" | bc)
echo " $label (PID $root_pid): ${root_mb} MB"
# Measure child processes recursively
for cpid in $(pgrep -P "$root_pid" 2>/dev/null); do
if kill -0 "$cpid" 2>/dev/null; then
local child_rss
child_rss=$(grep VmRSS /proc/$cpid/status 2>/dev/null | awk '{print $2}')
child_rss=${child_rss:-0}
total_rss=$((total_rss + child_rss))
local child_mb
child_mb=$(echo "scale=2; $child_rss / 1024" | bc)
local child_cmd
child_cmd=$(cat /proc/$cpid/cmdline 2>/dev/null | tr '\0' ' ' | head -c 60)
echo " Child (PID $cpid): ${child_mb} MB - $child_cmd"
# Grandchildren
for gpid in $(pgrep -P "$cpid" 2>/dev/null); do
if kill -0 "$gpid" 2>/dev/null; then
local gchild_rss
gchild_rss=$(grep VmRSS /proc/$gpid/status 2>/dev/null | awk '{print $2}')
gchild_rss=${gchild_rss:-0}
total_rss=$((total_rss + gchild_rss))
local gchild_mb
gchild_mb=$(echo "scale=2; $gchild_rss / 1024" | bc)
local gchild_cmd
gchild_cmd=$(cat /proc/$gpid/cmdline 2>/dev/null | tr '\0' ' ' | head -c 60)
echo " Grandchild (PID $gpid): ${gchild_mb} MB - $gchild_cmd"
fi
done
fi
done
local total_mb
total_mb=$(echo "scale=2; $total_rss / 1024" | bc)
echo " Subtotal: ${total_mb} MB"
# Export for caller
eval "${label}_TOTAL_RSS=$total_rss"
}
cleanup_pids() {
for pid in "$@"; do
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
kill "$pid" 2>/dev/null || true
fi
done
wait 2>/dev/null || true
}
run_separate() {
echo "============================================"
echo "SEPARATE APPROACH (Current: WS + Next.js)"
echo "============================================"
# Start WS server
node apps/websocket/wssServer.cjs &
WS_PID=$!
sleep 5
WS_LISTEN_PID=$(lsof -i :3001 -t 2>/dev/null | head -1)
echo "WS server listening PID: $WS_LISTEN_PID"
WS_RSS=$(grep VmRSS /proc/${WS_LISTEN_PID}/status 2>/dev/null | awk '{print $2}')
WS_RSS=${WS_RSS:-0}
WS_MB=$(echo "scale=2; $WS_RSS / 1024" | bc)
echo " WebSocket Server: ${WS_MB} MB"
echo ""
echo "TOTAL (Separate WS only): ${WS_MB} MB"
echo "Note: Next.js dev server not included (would add ~1.5-2.5 GB)"
echo "============================================"
cleanup_pids "$WS_PID"
SEPARATE_RSS=$WS_RSS
}
run_integrated() {
echo "============================================"
echo "INTEGRATED APPROACH (Custom Next.js Server)"
echo "============================================"
cd apps/nextjs
node customServer.cjs &
CUSTOM_PID=$!
cd ../..
echo "Waiting ${WAIT_SECONDS}s for server to stabilize..."
sleep "$WAIT_SECONDS"
measure_process_tree_memory "$CUSTOM_PID" "CustomServer"
echo ""
INTEGRATED_RSS=${CustomServer_TOTAL_RSS:-0}
INTEGRATED_MB=$(echo "scale=2; $INTEGRATED_RSS / 1024" | bc)
echo "TOTAL (Integrated): ${INTEGRATED_MB} MB"
echo "============================================"
cleanup_pids "$CUSTOM_PID"
}
if [ "$APPROACH" = "separate" ] || [ "$APPROACH" = "both" ]; then
run_separate
echo ""
fi
if [ "$APPROACH" = "integrated" ] || [ "$APPROACH" = "both" ]; then
# Clean up lock from previous run
rm -rf apps/nextjs/.next/dev/lock
run_integrated
echo ""
fi
if [ "$APPROACH" = "both" ]; then
echo "============================================"
echo "COMPARISON"
echo "============================================"
SEP_MB=$(echo "scale=2; ${SEPARATE_RSS:-0} / 1024" | bc)
INT_MB=$(echo "scale=2; ${INTEGRATED_RSS:-0} / 1024" | bc)
echo "Separate WS server only: ${SEP_MB} MB"
echo "Integrated custom server: ${INT_MB} MB"
echo "(The integrated server includes both Next.js AND WebSocket)"
echo "============================================"
fi
-129
View File
@@ -1,129 +0,0 @@
#!/usr/bin/env bash
# Docker build + run integration test
# Tests that the Docker image builds and starts successfully on the current architecture.
# Works on both x86_64 and arm64 without requiring multi-platform builders.
#
# Usage: ./scripts/docker-test.sh [--skip-build]
set -euo pipefail
IMAGE_NAME="homarr:test"
CONTAINER_NAME="homarr-docker-test"
PORT=7575
HEALTH_ENDPOINT="/api/health/ready"
MAX_WAIT=60
POLL_INTERVAL=3
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
cleanup() {
if docker ps -q --filter "name=${CONTAINER_NAME}" | grep -q .; then
echo -e "${YELLOW}Cleaning up container...${NC}"
docker stop "${CONTAINER_NAME}" 2>/dev/null || true
fi
docker rm -f "${CONTAINER_NAME}" 2>/dev/null || true
}
trap cleanup EXIT
# Detect architecture
ARCH=$(uname -m)
echo "🏗️ Architecture: ${ARCH}"
# Step 1: Build
if [ "${1:-}" != "--skip-build" ]; then
echo "🔨 Building Docker image..."
docker build -t "${IMAGE_NAME}" . || {
echo -e "${RED}❌ Docker build failed${NC}"
exit 1
}
echo -e "${GREEN}✅ Docker build succeeded${NC}"
else
echo "⏭️ Skipping build (--skip-build)"
fi
# Step 2: Start container
echo "🚀 Starting container..."
cleanup
docker run --rm -d \
--name "${CONTAINER_NAME}" \
-p "${PORT}:7575" \
-e SECRET_ENCRYPTION_KEY="$(head -c 32 /dev/urandom | xxd -p | tr -d '\n')" \
"${IMAGE_NAME}"
# Step 3: Wait for health endpoint
echo "⏳ Waiting for health endpoint (max ${MAX_WAIT}s)..."
ELAPSED=0
while [ $ELAPSED -lt $MAX_WAIT ]; do
if curl -sf "http://localhost:${PORT}${HEALTH_ENDPOINT}" > /dev/null 2>&1; then
echo -e "${GREEN}✅ Health check passed after ${ELAPSED}s${NC}"
break
fi
sleep $POLL_INTERVAL
ELAPSED=$((ELAPSED + POLL_INTERVAL))
done
if [ $ELAPSED -ge $MAX_WAIT ]; then
echo -e "${RED}❌ Health check failed after ${MAX_WAIT}s${NC}"
echo "--- Container logs ---"
docker logs "${CONTAINER_NAME}" 2>&1 | tail -50
exit 1
fi
# Step 4: Verify key endpoints
echo "🔍 Verifying endpoints..."
# Home page
HOME_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/")
if [ "$HOME_STATUS" = "200" ]; then
echo -e "${GREEN} ✅ Home page: ${HOME_STATUS}${NC}"
else
echo -e "${RED} ❌ Home page: ${HOME_STATUS}${NC}"
docker logs "${CONTAINER_NAME}" 2>&1 | tail -30
exit 1
fi
# Health live
LIVE_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/api/health/live")
if [ "$LIVE_STATUS" = "200" ]; then
echo -e "${GREEN} ✅ Health live: ${LIVE_STATUS}${NC}"
else
echo -e "${RED} ❌ Health live: ${LIVE_STATUS}${NC}"
exit 1
fi
# Health ready
READY_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/api/health/ready")
if [ "$READY_STATUS" = "200" ]; then
echo -e "${GREEN} ✅ Health ready: ${READY_STATUS}${NC}"
else
echo -e "${RED} ❌ Health ready: ${READY_STATUS}${NC}"
exit 1
fi
# Step 5: Verify WebSocket upgrade is possible (should get 426 without proper headers, or 101 with them)
WS_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Upgrade: websocket" \
-H "Connection: Upgrade" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
-H "Sec-WebSocket-Version: 13" \
"http://localhost:${PORT}/websockets" 2>/dev/null || echo "000")
if [ "$WS_STATUS" = "101" ] || [ "$WS_STATUS" = "426" ] || [ "$WS_STATUS" = "400" ]; then
echo -e "${GREEN} ✅ WebSocket endpoint reachable: ${WS_STATUS}${NC}"
else
echo -e "${YELLOW} ⚠️ WebSocket endpoint status: ${WS_STATUS} (may be expected behind nginx)${NC}"
fi
# Step 6: Print container info
echo ""
echo "📊 Container info:"
docker inspect "${CONTAINER_NAME}" --format=' Image: {{.Config.Image}}' 2>/dev/null || true
docker inspect "${CONTAINER_NAME}" --format=' Platform: {{.Platform}}' 2>/dev/null || true
echo " Architecture: ${ARCH}"
echo ""
echo -e "${GREEN}✅ All Docker tests passed!${NC}"
+8 -3
View File
@@ -45,14 +45,19 @@ fi
# Tasks/cron and WebSocket servers are now integrated into the custom Next.js server
node apps/nextjs/customServer.cjs &
node apps/tasks/tasks.cjs &
TASKS_PID=$!
node apps/websocket/wssServer.cjs &
WSS_PID=$!
node apps/nextjs/server.js &
NEXTJS_PID=$!
# Function to handle SIGTERM and shut down services
terminate() {
echo "Received SIGTERM. Shutting down..."
kill -TERM $NGINX_PID $NEXTJS_PID 2>/dev/null
kill -TERM $NGINX_PID $TASKS_PID $WSS_PID $NEXTJS_PID 2>/dev/null
wait
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
if [ -n "$REDIS_PID" ]; then
+1 -1
View File
@@ -19,7 +19,7 @@
"dependencies": {
"@next/eslint-plugin-next": "16.1.6",
"eslint-config-prettier": "^10.1.8",
"eslint-config-turbo": "^2.8.15",
"eslint-config-turbo": "^2.8.17",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",