Compare commits

...
Author SHA1 Message Date
zacharyandClaude Opus 5 a029760f66 chore(ops): move instance state to /var/lib/homarr without touching the image
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:43:37 +02:00
zacharyandClaude Opus 5 34d45d7448 chore(ops): create only the state directories the instance uses
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:39:22 +02:00
zacharyandClaude Opus 5 db558990a0 chore(ops): write the deploy plan before truncating it
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:44 +02:00
zacharyandClaude Opus 5 8ffae729cc chore(ops): itemize the dry-run so it actually shows the plan
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:44 +02:00
zacharyandClaude Opus 5 fbebe31ef3 chore(ops): fail early on a stale Node and compare migrations per dialect
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 0a94110a67 chore(ops): add LXC deploy script and fork maintenance notes
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 04069610fa refactor(widgets): let the UniFi OS chart fill the tile
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 f2572bdeef fix(integrations): end the health window on the last measured hour
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 d08bc942a2 feat(widgets): show WAN uptime in the UniFi site table
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 e505e94644 feat(integrations): fill the recent hours from the 5-minute ISP metrics
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 e32b956385 fix(widgets): make the UniFi site table sortable and fill the tile
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zachary 5e02ad4e78 Revert "fix(integrations): label sites with the console name Site Manager shows"
This reverts commit 12db2c0677.
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 8bdbc30376 fix(integrations): label sites with the console name Site Manager shows
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 44e9c22092 docs(integrations): say what a null SD-WAN status does not tell us
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 d2912c5e31 fix(integrations): treat an unstated console update state as unknown
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 e3e077fcb8 fix(widgets): hide the decorative health bar from assistive technology
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 ca298cd688 fix(widgets): report every health state in the UniFi site summary
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 ce886f7ca1 fix(widgets): omit packet loss when the cloud did not measure it
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 b39e27fd3b feat(widgets): add UniFi Site Manager overview widget
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 74ff68993e fix(widgets): remove out-of-scope UniFi Site Manager widget stub
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 9a7915d230 feat(api): expose unifiSiteManager overview query
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 4b7b7c5d1c fix(integrations): type the Site Manager transport boundary and guard it
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 c3633e7834 docs: plan — annotate test fixture arrays and require typecheck per task
Le fixture déclarait warnings: [], inféré never[], alors que le test lui
assigne un tableau de chaînes. tsc refuse ; vitest ne le voit pas.

Ajouté à la vérification de chaque tâche : pnpm turbo typecheck, pas
seulement pnpm test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 3d31ce8eec feat(integrations): add UnifiSiteManagerIntegration
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 58e7fe730a docs: plan — the SD-WAN dash means unknown, not 'no configuration'
Constat de revue : un échec total des appels de statut produit le même
tableau vide qu'un compte sans configuration. Le rendu reste honnête —
le tiret n'affirme rien — mais le commentaire, lui, tranchait à tort.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 92b949c47f feat(integrations): add UniFi Site Manager cloud client
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 3ef0b68112 feat(integrations): add UniFi Site Manager schemas and pure mappers
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 ba3a060b06 feat(definitions): declare unifiSiteManager integration and widget kinds
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 974bf83bde docs: plan — ESM-safe guard test and the .spec.ts inclusion constraint
Scan pré-vol. Le test de garde du bundle client lisait son source via
__dirname, qui n'existe pas en ESM et n'est utilisé par aucun autre spec
du dépôt. Remplacé par import.meta.url, avec la directive d'environnement
node puisqu'il lit le disque et que le défaut est jsdom.

Ajouté aux contraintes globales : vitest n'inclut que **/*.spec.ts, donc
un fichier .spec.tsx ne serait jamais exécuté et son absence passerait
pour un succès.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 896c60df55 docs: plan — add per-site SD-WAN tunnel status
L'état des tunnels entre dans quatre des sept tâches : schémas et index
par site (tâche 2), deux méthodes de client bornées (tâche 3),
orchestration en enrichissement non fatal (tâche 4), colonne et
traductions (tâche 6), et une étape de vérification dédiée (tâche 7).

Deux points de justesse portés par des tests :
- `ping: 0` devient `pingMs: null`. Relevé sur un tunnel connecté entre
  deux sites distants, où une latence nulle est physiquement
  impossible : le champ veut dire « non mesuré ».
- le nombre de configurations interrogées est borné à cinq. Le statut
  étant indexé par configuration, un compte à dix produirait onze
  requêtes par rafraîchissement.

La topologie reste hors périmètre : une liste de quinze réseaux n'a pas
sa place dans une ligne de tableau.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 9d1465c4fc docs: spec — add per-site SD-WAN tunnel status
Ajout demandé après validation : l'état des tunnels, indexé par siteId,
se greffe sur les lignes existantes. La topologie reste hors v1 — une
liste de quinze réseaux n'a pas sa place dans une ligne de tableau.

Relevé au passage : ping vaut 0 sur un tunnel connecté entre deux sites
distants, où une latence nulle est physiquement impossible. Le champ
signifie « non mesuré » et le contrat le traduit en null, plutôt que de
propager un zéro que l'interface afficherait comme une performance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 7b443c9da3 docs: spec — health states are a status palette, with a mandatory text summary
Le validateur de palette ne couvre que les palettes catégorielles. Sain,
dégradé et coupé sont des statuts : palette réservée et fixe, assortie de
la règle qu'ils ne voyagent jamais sans icône ni libellé.

Une icône par segment étant impossible sur vingt-quatre segments, la
bande est doublée d'un résumé textuel. Mesuré : un vert/orange/rouge
classique donne un ΔE de 2,9 entre orange et vert en vision protanope.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 64beae817d docs: spec — back to a table, health bar as a column
L'utilisateur revient sur la forme liste et retient la proposition
initiale : tableau HomarrDataTable avec la bande de santé en colonne.

La bande reste dans la v1 (D4 inchangée) — c'est la forme qui change,
pas le périmètre. Le tableau rend le tri et la visibilité responsive,
absorbe la croissance du nombre de sites, et correspond à ce que fait
l'interface Ubiquiti.

Contrepartie consignée : dans une colonne la bande est étroite, ce qui
fait de l'infobulle par segment le moyen principal de lire une tranche
plutôt qu'un confort.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 a3b7ca9a8c docs: spec — merge ISP metrics into the site health list
Proposition de l'utilisateur, retenue : fusionner les métriques ISP avec
la barre « Internet Health » pour une liste d'état rapide des sites.

Elle inverse la décision D4. La barre avait été écartée au motif que
`internetIssues` est un tableau creux dont il faudrait reconstituer les
périodes saines — vrai de cette source, mais `isp-metrics` fournit la
même information déjà dense, une entrée par site, vérifié. La barre
coûte alors une boucle de coloration, pas un moteur de graphe.

D3 change aussi : liste d'état plutôt que tableau, la bande au centre
plutôt qu'en colonne. HomarrDataTable n'a donc plus lieu d'être, et le
tri disparaît. Limite assumée et consignée : au-delà de cinq ou six
sites la forme tableau redeviendrait préférable.

Point de justesse ajouté au contrat : une tranche horaire sans mesure
vaut "unknown" et jamais "healthy". Un site enregistré depuis douze
heures n'a que douze tranches sur vingt-quatre ; les peindre en vert
affirmerait un bon fonctionnement jamais mesuré.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 1c602a305b docs: design for UniFi Site Manager integration
Nouvelle intégration cloud-only, distincte de unifiOs, remontant une vue
multi-sites. Premier des trois projets identifiés à partir des captures
du Site Manager ; il construit aussi le socle des deux suivants.

Constat notable : il n'existe pas d'API cachée. /ea/* est un alias
complet de /v1/*, et une trentaine d'autres chemins plausibles
renvoient 404. La surface documentée est toute la surface.

La séparation types / parse est imposée dès la conception par le défaut
rencontré sur l'intégration précédente, où un import serveur dans un
module réexporté côté client empêchait l'application de démarrer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 ff24a5b009 feat(widgets): 5s refresh, download first, chart from the first reading
Trois demandes utilisateur, plus une adaptation rendue nécessaire par la
première.

- Ordre inversé : descendant avant montant.
- Rafraîchissement porté de 60 s à 5 s. Il fallait le faire sur les DEUX
  couches locales : l'intervalle client seul aurait relu la même entrée
  de cache serveur douze fois. Le cache cloud reste à 5 min, ses
  métriques n'évoluant que par tranches de 5 min.
- Le graphe est rendu dès la première mesure : vide plutôt qu'absent,
  ce qui évite un saut de mise en page et n'affirme rien de faux.

Adaptation : la console ne rafraîchit ses statistiques que toutes les
30 s (mesuré — `lastHeartbeatAt` avance par pas de 30 s exacts, valeurs
identiques entre deux battements). Interroger toutes les 5 s renvoie
donc six fois la même mesure. Sans filtrage, le graphe deviendrait un
escalier et 60 points ne couvriraient plus que 5 minutes. Une lecture
identique à la précédente n'est donc pas enregistrée.

Seuil de péremption locale recalibré de 150 s à 30 s : l'ancien était
dimensionné pour 60 s + 60 s et ne signalait plus rien d'utile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 d5ae666c41 feat(widgets): chart WAN throughput instead of static figures
L'API UniFi ne fournit que l'instantané et Homarr ne stocke aucun
historique : la série est accumulée côté client, comme le fait déjà le
widget systemResources. Elle repart donc vide à chaque rechargement.

Deux décisions d'honnêteté, dans la ligne du reste du widget :
- une lecture en échec est ignorée, jamais enregistrée comme un zéro,
  qui dessinerait une chute à la ligne de base n'ayant pas eu lieu ;
- sous deux points, on affiche les chiffres seuls : une ligne plate
  tracée sur un point unique se lit comme un réseau au repos alors
  qu'on n'a rien mesuré.

Couleurs validées par le validateur de palette (bande de luminosité,
chroma, séparation daltonisme et vision normale, contraste) en thème
clair ET sombre. La paire orange.5/yellow.5 du widget systemResources
n'a délibérément pas été reprise : son ΔE en vision normale est de
12,1, sous le plancher de lisibilité de 15.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 b29d4f5445 fix(nextjs): register the unifiOs category translation key
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 4c04f91c17 fix(integrations): keep unifi-os-types client-safe
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 d0865c3b15 fix: address final review — cloud TLS, MAC guard, honest ISP metrics
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 367eb82db5 docs: spec — make ISP metrics nullable, they are absent during a WAN outage
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 731d63c19c fix(widgets): stop asserting a gateway that does not exist, label the ISP gap
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 a81894dd8a feat(widgets): add UniFi OS widget
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 99282742c6 fix(widgets): remove out-of-scope UniFi OS widget stub from task 6
The widget stub (packages/widgets/src/unifi-os/) was incorrectly added in
Task 6 and belongs to Task 7. Its removal confirms the type system does not
require it, and prevents inconsistencies: the stub declares IconWifi while
Task 7 specifies IconRouter, and it is not registered in manifest.ts,
catalog.ts or refetch-intervals.ts.

- Delete packages/widgets/src/unifi-os/ directory entirely
- Revert packages/widgets/src/index.tsx to commit 57286d83d

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 31781d25ad feat(api): expose unifiOs widget summary query through tRPC router and request handler
Create unifiOs request handler with 60s cache and stale-on-error fallback, and tRPC router exposing clientApi.widget.unifiOs.summary query. Include minimal widget stub for type system.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 c9b3611b77 fix(integrations): make client/device counts nullable and test real degradation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zachary d156d70b31 docs: spec — drop unused VPN servers call, make client/device counts nullable 2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 67c3cba167 feat(integrations): add UnifiOsIntegration with optional cloud enrichment
Introduces UnifiOsIntegration, orchestrating UnifiOsApi (local) and
UnifiSmApi (optional cloud) to build the UnifiOsSummary. Local endpoint
calls degrade independently via Promise.allSettled; the cloud client is
never instantiated without a configured siteManagerApiKey secret.
Registers the unifiOs kind in the integration creator, index, and types
barrels, resolving the previously-failing typecheck.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 67ec3cab3d fix(integrations): select newest ISP metric period explicitly
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 eed8c5fe91 fix(integrations): type unifi-os test fetch mocks for tsc
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 3ce3eefa5e feat(integrations): add optional UniFi Site Manager client with 5min cache
Task 4 of the UniFi OS integration: an optional cloud client for
Ubiquiti's Site Manager API that enriches the local console with ISP
latency data. Instantiated only when a cloud API key is configured
(Task 5). Every failure path (bad key, non-ok status, parse error,
unmatched gateway MAC) returns null rather than throwing, since the
cloud is a pure enrichment. Metrics are cached 5 minutes, keyed by
gateway MAC, to respect the ~27 min publication lag and avoid rate
limiting; the query window is 3 hours because a 15-minute window
returns an empty array on the real API.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 6f9a30799e feat(integrations): add UniFi OS local API client
Implements HTTP client for UniFi OS console integration API with support for
fetching site information, client counts, device statistics, and VPN server
configs. Includes pagination handling with filter-based fallback when client
count exceeds API limit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 d33f2155a7 fix(integrations): make unifi-os test invocation-independent with vi.hoisted()
Guarded environment validation with SKIP_ENV_VALIDATION and SECRET_ENCRYPTION_KEY
set in vi.hoisted() so that tests pass both with 'pnpm test' (NODE_ENV=development)
and bare 'pnpm vitest run' (no env override).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zachary 957211164f docs: fix test command in plan (pnpm test, not pnpm vitest run) 2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 84498d4e7b feat(integrations): add UniFi OS schemas and pure mappers
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 a6e4df0460 feat(definitions): declare unifiOs integration kind, category and widget kind
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 503735bc0d docs: implementation plan for UniFi OS integration
Plan en 9 tâches avec cycle TDD par étape, du vocabulaire dans
@homarr/definitions jusqu'au déploiement sur le LXC.

Corrige aussi la spec sur deux points relevés en écrivant le plan :
- catalog.ts (widgetCatalogIcons) est un cinquième point d'enregistrement,
  vérifié par manifest.spec.ts et absent du §5.2
- le §9 décrivait un test d'agrégation multi-site devenu sans objet depuis
  la décision de ne pas agréger

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
zacharyandClaude Opus 5 c47be12e69 docs: design for UniFi OS integration
Conception validée pour une intégration UniFi OS en complément de
unifiController, basée sur l'API d'intégration officielle (clé X-API-KEY)
plutôt que sur l'ancienne API du Network Controller.

Toutes les capacités et limites de l'API ont été mesurées sur une console
réelle en 10.6.102, pas déduites de la documentation publiée (qui s'arrête
à 10.4.57 et est déjà en retard sur les consoles).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:21:43 +02:00
Releases Homarr 7859faaa1d chore(release): 1.77.1 [skip ci] 2026-09-11 19:22:36 +00:00
homarr-releases[bot] bff6ec735e chore(release): automatic release v1.77.1 2026-09-11 19:21:19 +00:00
Thomas 1fbe844598 fix(settings): move board access control out of the nested form (#6662) 2026-09-10 18:13:56 +02:00
Thomas 365ef7f02b Revert "feat: announce Homarr v2 beta" (#6813) 2026-09-10 16:36:54 +02:00
homarr-releases[bot] 2b1a03849d chore: update bug report template (#6798) 2026-09-06 22:31:26 +02:00
Releases Homarr 4c243bc374 chore(release): 1.77.0 [skip ci] 2026-09-06 19:31:37 +00:00
homarr-releases[bot] ecd02f73c0 chore(release): automatic release v1.77.0 2026-09-06 19:30:29 +00:00
Thomas cd23b36f3c fix(ci): use pinned pnpm for releases (#6796) 2026-09-06 21:18:30 +02:00
homarr-releases[bot] f7f29eade9 chore(release): automatic release v1.77.0 2026-09-06 18:47:01 +00:00
Thomas 32a51c1e60 feat: announce Homarr v2 beta (#6793)
* feat: announce Homarr v2 beta

* chore: refine v2 beta announcement

* feat: expand v2 beta guidance

* chore: refine v2 beta resources

* chore: simplify v2 beta modal

* chore: improve v2 beta feedback links

* fix: keep v2 modal above header

* chore: sharpen v2 beta message

* fix: clear header for v2 modal
2026-09-06 20:36:04 +02:00
homarr-crowdin[bot] da32acb4f0 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>
2026-09-06 01:52:04 +00:00
homarr-update-contributors[bot] 1da13d9bb3 chore: update contributors (#6767)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-09-04 15:58:09 +00:00
homarr-crowdin[bot] cb0fec088f 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-09-03 02:05:21 +00:00
homarr-crowdin[bot] a2fe8dd461 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-09-01 02:36:36 +00:00
homarr-update-contributors[bot] b6dfcd69ba chore: update contributors (#6735)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-08-28 21:54:00 +00:00
homarr-crowdin[bot]andThomas a38b0ef71d chore(lang): updated translations from crowdin (#6732)
Co-authored-by: Thomas <thomas@ajnart.fr>
2026-08-28 14:07:42 +02:00
Thomas 2cf3027eeb Merge pull request #6720 from homarr-labs/docs/update-helm-docs
docs(helm): update chart installation page
2026-08-28 08:32:40 +02:00
homarr-releases[bot] fa18f6fc71 chore: update bug report template (#6724) 2026-08-28 08:32:03 +02:00
Releases Homarr 331925c197 chore(release): 1.76.2 [skip ci] 2026-08-27 20:09:22 +00:00
Thomas 0e51f745d3 Merge pull request #6723 from homarr-labs/dev
chore(release): automatic release v1.76.2
2026-08-27 22:08:05 +02:00
Thomas d6f720d0e6 Revert "feat(http): set custom User-Agent on outbound integration requests (#6606)" (#6722)
This reverts commit ddbf05524b.
2026-08-27 22:00:23 +02:00
Thomas 5324bf12d4 fix(startup): use stable internal service addresses (#6721) 2026-08-27 21:52:54 +02:00
github-actions[bot] 2922a02ecf docs(helm): update chart installation page 2026-08-27 17:09:27 +00:00
Thomas 87cdcf28e0 fix(mcp): return valid string for void tool results (#6703) 2026-08-27 11:10:37 +02:00
homarr-releases[bot] 441b181e79 chore: update bug report template (#6716)
Co-authored-by: Releases Homarr <175486441+homarr-releases[bot]@users.noreply.github.com>
2026-08-27 11:08:43 +02:00
Releases Homarr eba639b59c chore(release): 1.76.1 [skip ci] 2026-08-26 16:43:52 +00:00
Thomas Camlong da36283ad1 chore(release): retrigger release pipeline 2026-08-26 18:30:12 +02:00
Thomas Camlong c050368782 chore(release): trigger release pipeline 2026-08-26 18:16:26 +02:00
homarr-releases[bot] 82b50f0fd7 chore(release): automatic release v1.76.1 2026-08-26 15:50:55 +00:00
Thomas a0149d5894 Merge pull request #6673 from homarr-labs/investigate-6672-immich-401 2026-08-22 19:44:03 +02:00
ajnart 8579fcbfc2 test(http,immich): address CodeRabbit review
- guarantee server teardown via try/finally in both wire-level tests
- add tuple-array HeadersInit coverage to the helper suite
2026-08-22 17:21:38 +02:00
ajnart b6f3aba23e test(http,immich): prove User-Agent fix at the wire level
Add two regression tests that fail on v1.76.0 and pass with the fix:
- wire-level test: a Headers instance (the shape @immich/sdk hands over)
  must reach the remote server with all headers intact
- real-SDK e2e: getServerStatistics through fetchWithTrustedCertificatesAsync
  against a live local server must deliver x-api-key
2026-08-22 17:16:31 +02:00
ajnart 31e218295d fix(http): preserve SDK headers when injecting User-Agent
The v1.76.0 User-Agent injection object-spread `fetchOptions.headers`, which
silently drops all headers when the value is a Headers instance. The Immich
SDK passes a Headers object with the merged x-api-key header, so requests
lost their API key and returned 401 (issue #6672). Build a real Headers
instance instead, keeping case-insensitive user-agent handling.
2026-08-22 17:12:43 +02:00
Thomas aca3b5d861 fix: correct Unraid CPU, link context menus, and board resizing (#6510)
Fix Unraid logical CPU averaging, preserve native context menus for app and bookmark widgets in view mode, and prevent scrollbar-width GridStack resize oscillation.
2026-08-22 10:53:26 +02:00
homarr-crowdin[bot] a7a2f0223a chore(lang): updated translations from crowdin (#6596)
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2026-08-22 08:49:51 +02:00
homarr-releases[bot] 7773fdc10b chore: update bug report template (#6655) 2026-08-21 22:14:45 +02:00
Thomas 7019a1d0a4 Merge pull request #6656 from homarr-labs/docs/update-helm-docs 2026-08-21 22:14:26 +02:00
github-actions[bot] 2d535caeac docs(helm): update chart installation page 2026-08-21 17:41:09 +00:00
Releases Homarr 2013fbe80d chore(release): 1.76.0 [skip ci] 2026-08-21 17:20:50 +00:00
homarr-releases[bot] 219ef58926 chore(release): automatic release v1.76.0 2026-08-21 17:19:40 +00:00
homarr-update-contributors[bot] 97195bc463 chore: update contributors (#6649)
Co-authored-by: Homarr Update Contributors <210161987+homarr-update-contributors[bot]@users.noreply.github.com>
2026-08-21 12:53:40 +00:00
Danura30082 73a742154e docs: Proxmox certificate obtention instructions (#6613) 2026-08-20 18:51:58 +02:00
Afonso Jorge Ramos 993a267e0c fix(truenas): keep reporting pools without usable dataset space (#6635) 2026-08-20 15:37:10 +02:00
Thomas f1c49d1fbf fix(startup): only chown runtime paths for custom PUID/PGID (#6598) 2026-08-19 08:29:17 +02:00
Thomas 95c66c61eb fix(widgets): stop Health Monitoring system tab firing NOT_FOUND when Proxmox is mixed in (#6623) 2026-08-18 19:56:47 +02:00
Thomas ec2f8c6c2c fix(widgets): match OMV disk temperature via normalized partition names (#6615) (#6619)
OMV reports filesystem devices (sda1) without the /dev/ prefix, so the
partition-suffix normalization never applied and filesystem-to-SMART
matching returned no temperature. Strip partition suffixes from
unprefixed sd/vd, nvme and mmcblk names, and use the shared normalized
matcher in both the health monitoring and system disks widgets.
2026-08-18 19:39:27 +02:00
Thomas 05ba57c2fa chore: migrate cursor rules to portable agent skills + mantine MCP guidance
* chore: migrate cursor rules to portable agent skills and add mantine MCP guidance

Replace Cursor-only .cursor/rules/*.mdc with Agent Skills open-standard
SKILL.md files in .agents/skills/ (canonical), mirrored to .cursor/skills/
and .claude/skills/ so they work across Claude Code, Cursor, Codex, and
OpenCode. Add mantine MCP server guidance to AGENTS.md and un-ignore
.agents/skills/ in .gitignore.

* refactor: single-source agent skills at .agents/skills

Cursor, Codex, and OpenCode all read .agents/skills/ natively, so the
.cursor/skills/ mirror was redundant. Claude Code reads .claude/skills/,
which is now a symlink back to .agents/skills/ so the content lives once.
Deletes .cursor/skills/ and converts .claude/skills/ to a symlink.

* chore: ship mantine MCP server via project-scoped .mcp.json

Declares the keyless @mantine/mcp-server in .mcp.json (Claude Code
project-scope standard, committable) and documents MCP server setup and
the mantine entry in AGENTS.md.

* chore: address coderabbit security-review and markdown lint findings

Add explicit security-review guidance before exposing MCP tools and label
plain-text code fences to satisfy markdownlint MD040.
2026-08-16 16:27:51 +02:00
Thomas ddbf05524b feat(http): set custom User-Agent on outbound integration requests (#6606)
* feat(http): set custom User-Agent on outbound integration requests

Set a default 'User-Agent: Homarr/<version> (+https://homarr.dev)' header
on all outbound HTTP requests made via fetchWithTrustedCertificatesAsync,
so Homarr's integration traffic is distinguishable in reverse-proxy,
WAF, and security-monitoring logs instead of appearing as generic undici.

Closes #6604

* refactor(version): centralize Homarr version in @homarr/version package

Replace fragile deep-relative 'package.json' imports across the monorepo
with a single source of truth: the new @homarr/version leaf package reads
the version once from the root package.json and exports it as VERSION.

Consumers now import by package name incl. the new User-Agent header in
fetchWithTrustedCertificatesAsync (packages/core):
  - core, api (info router), analytics, request-handler (update checker)
This also removes all manually-maintained relative version imports.

* fix(http): normalize User-Agent injection with Headers

Object-spreading fetchOptions.headers breaks when callers pass a Headers
instance (spread yields no entries) or a tuple array (numeric keys), and is
case-sensitive. Build a Headers instance and set the default User-Agent only
when no case-insensitive User-Agent entry exists, via a shared helper in both
fetch paths.

Adds unit tests covering record, Headers, tuple-array, and casing variants.

* revert(version): undo version refactor and tests, keep single-file change

Keep the User-Agent change as a single edit to
packages/core/src/infrastructure/http/request.ts. Remove the @homarr/version
package, the consumer migrations, and the unit tests.
2026-08-16 16:09:15 +02:00
Thomas df438b4cd2 Merge pull request #6571 from homarr-labs/feat/fix-home-assistant-actions 2026-08-16 00:23:14 +02:00
Thomas a1f91eb385 Merge pull request #6567 from homarr-labs/feat/fix-truenas-free-space 2026-08-15 20:20:35 +02:00
Thomas 8d5ffb2dd9 feat(paseo): add worktree install script (#6599)
* feat(paseo): add worktree install script

* feat(paseo): inline worktree setup in paseo.json

* feat(paseo): add scripts and teardown to paseo.json

* feat(paseo): expand workspace scripts catalog

* feat(paseo): reset encryption key in worktree env
2026-08-15 12:29:52 +02:00
Thomas Camlong 56e6b23af6 test(e2e): remove flaky credentials onboarding test 2026-08-15 11:05:06 +02:00
Thomas Camlong 5488bf4d18 fix(truenas): use lowercase in operator for dataset query 2026-08-15 01:33:20 +02:00
homarr-crowdin[bot] 621ea07549 chore(lang): updated translations from crowdin (#6553) 2026-08-14 20:39:02 +02:00
homarr-update-contributors[bot] f64c01456b chore: update contributors (#6588) 2026-08-14 20:38:42 +02:00
homarr-releases[bot] 56198c3f02 chore: update bug report template (#6591) 2026-08-14 20:38:26 +02:00
Thomas ca1bb6f341 Merge pull request #6592 from homarr-labs/docs/update-helm-docs
docs(helm): update chart installation page
2026-08-14 20:38:10 +02:00
github-actions[bot] bf6b6663cd docs(helm): update chart installation page 2026-08-14 18:25:32 +00:00
Releases Homarr 5c2d86767f chore(release): 1.75.0 [skip ci] 2026-08-14 17:45:24 +00:00
homarr-releases[bot] 7c75642d4d chore(release): automatic release v1.75.0 2026-08-14 17:43:56 +00:00
Thomas Camlong 7652eb8c1c preserve smart home toggle response 2026-08-13 17:04:00 +02:00
Thomas Camlong e761c10f32 fix Home Assistant widget actions 2026-08-13 16:21:48 +02:00
ajnart f6137b2dcc fix(truenas): guard empty dataset percentage 2026-08-12 18:24:33 +02:00
ajnart 425dd90871 fix(truenas): report usable dataset space 2026-08-12 18:19:07 +02:00
139 changed files with 38058 additions and 26364 deletions

No files matched your search

@@ -1,6 +1,6 @@
---
description: Comprehensive Homarr codebase architecture and conventions reference
alwaysApply: true
name: codebase-context
description: Comprehensive Homarr codebase architecture and conventions reference. Use when orienting in the monorepo, understanding package dependency layers, the three runtime services and ports, tRPC router structure, multi-database support, widget/integration/cron system architecture, routing, auth providers, env vars, or key patterns before writing code.
---
# Homarr Codebase Context
@@ -27,7 +27,7 @@ Homarr is an open-source, self-hosted dashboard for managing homelab services. I
## Repository Structure
```
```text
homarr/
├── apps/
│ ├── nextjs/ # Main Next.js application (port 3000)
@@ -66,8 +66,6 @@ homarr/
│ ├── analytics/ # Server-side analytics (Umami)
│ ├── server-settings/ # Server setting keys/types
│ ├── settings/ # User-facing settings UI context
│ ├── old-import/ # Legacy Homarr import
│ ├── old-schema/ # Legacy Homarr zod schemas
│ └── cli/ # Node CLI for ops (brocli)
├── tooling/
│ ├── typescript/ # Base tsconfig
@@ -79,11 +77,11 @@ homarr/
## Three Runtime Services
| Service | Port | Role |
|---------|------|------|
| Next.js | 3000 | Main web app (SSR + API routes) |
| WebSocket | 3001 | tRPC subscriptions via `ws` |
| Tasks | 3002 | Cron job runner + management API via Fastify |
| Service | Port | Role |
| --------- | ---- | -------------------------------------------- |
| Next.js | 3000 | Main web app (SSR + API routes) |
| WebSocket | 3001 | tRPC subscriptions via `ws` |
| Tasks | 3002 | Cron job runner + management API via Fastify |
In Docker, nginx listens on **7575** and proxies to all three. The tasks service authenticates via `CRON_JOB_API_KEY` header.
@@ -112,6 +110,7 @@ In Docker, nginx listens on **7575** and proxies to all three. The tasks service
### Multi-Database Support
Drizzle schemas exist in three parallel implementations:
- `packages/db/schema/sqlite.ts`
- `packages/db/schema/mysql.ts`
- `packages/db/schema/postgresql.ts`
@@ -121,6 +120,7 @@ Selected at runtime via `DB_DRIVER` env (`better-sqlite3` | `mysql2` | `node-pos
### Widget System
Widgets are registered in `packages/widgets/src/index.tsx` as `widgetImports` (must satisfy `Record<WidgetKind, ...>`). Each widget:
- Has a `definition` created via `createWidgetDefinition(kind, { icon, createOptions, supportedIntegrations? })`
- Uses `optionsBuilder.from(factory => ({ ... }))` for typed options
- Loads dynamically via `next/dynamic`
@@ -133,6 +133,7 @@ Integrations are defined in `packages/definitions/src/integration.ts` (`integrat
### Cron Job System
Jobs defined in `packages/cron-jobs/src/jobs/`. Each job:
- Uses `createCronJob` with a cron expression
- Publishes results to Redis channels
- Widget subscriptions consume those channels via tRPC subscriptions
@@ -160,6 +161,7 @@ Configured via `AUTH_PROVIDERS` env. Supports: `credentials` (local), `ldap`, `o
## Environment Variables
Key env vars (from `.env.example`):
- `DB_DRIVER`: `better-sqlite3` | `mysql2` | `node-postgres`
- `DB_URL`: Database connection string
- `AUTH_SECRET`: NextAuth secret
@@ -191,16 +193,3 @@ Key env vars (from `.env.example`):
- Drag-and-drop via `@dnd-kit/*`
- `typescript.ignoreBuildErrors: true` in next.config (types checked separately via `typecheck`)
- `serverExternalPackages`: `dockerode`, `isomorphic-dompurify`, `jsdom`
## Documentation (`apps/docs`)
Docusaurus 3 site at `apps/docs/`, package name `@homarr/docs`.
- Run with `pnpm dev:docs` from root
- Build with `pnpm turbo build --filter=@homarr/docs`
- Uses Tailwind CSS 3 for custom pages (not Mantine)
- Imports `@homarr/definitions` for type-safe integration/widget metadata
- When adding or modifying widgets, integrations, cron jobs, API routes, env vars, or user-facing features, you MUST also update corresponding docs in `apps/docs/docs/`
- Integration docs: `apps/docs/docs/integrations/<slug>/index.mdx` + `index.ts`
- Widget docs: `apps/docs/docs/widgets/<slug>/index.mdx` + `index.ts`
- Strict link checking: broken links/anchors cause build failure
@@ -1,3 +1,8 @@
---
name: datatable-migration
description: Playbook for migrating tables from mantine-react-table (MRT) to mantine-datatable. Use when converting any table component from mantine-react-table to mantine-datatable, working on DataTable column/sort/expansion/context-menu code, or implementing responsive column visibility, column persistence, or transparent tables in widgets.
---
# Migrating Tables from mantine-react-table to mantine-datatable
This document captures every pattern, fix, and decision from the downloads widget rework (PR #6430). Use it as a playbook when porting other tables.
@@ -7,10 +12,12 @@ This document captures every pattern, fix, and decision from the downloads widge
Current `mantine-react-table` consumers that could be migrated:
**Widgets (in `packages/widgets/`):**
- `docker/component.tsx` — Docker container table
- `media-server/component.tsx` — Media server sessions
**Admin pages (in `apps/nextjs/src/app/[locale]/manage/`):**
- `tools/docker/docker-table.tsx`
- `tools/tasks/_components/tasks-table.tsx`
- `tools/api/components/api-keys.tsx`
@@ -19,12 +26,12 @@ Current `mantine-react-table` consumers that could be migrated:
- `tools/kubernetes/` — 8 Kubernetes resource tables
**Modals:**
- `packages/modals-collection/src/search-engines/request-media-modal.tsx`
**Shared hook to remove once all migrated:**
- `packages/ui/src/hooks/use-translated-mantine-react-table.ts`
---
- `packages/ui/src/hooks/use-translated-mantine-react-table.ts`
## 1. Core Migration: mantine-react-table → mantine-datatable
@@ -67,6 +74,7 @@ const columns: DataTableColumn<MyRow>[] = [
```
Key differences:
- `accessorKey` → `accessor`
- `header` → `title`
- `size` → `width`
@@ -118,8 +126,6 @@ const sortedData = useMemo(() => {
<DataTable records={sortedData} sortStatus={sortStatus} onSortStatusChange={setSortStatus} />
```
---
## 2. Making Tables Transparent (Widget Context)
Widgets sit inside board cards that have user-controlled opacity. The table must be fully transparent so the card background shows through. mantine-datatable defaults to `var(--mantine-color-body)` which is opaque.
@@ -144,13 +150,21 @@ Create a CSS file alongside the component:
/* Hover: translucent instead of opaque */
.my-table .mantine-datatable-table tbody tr:hover {
background-color: color-mix(in srgb, var(--mantine-color-default-hover) 40%, transparent) !important;
background-color: color-mix(
in srgb,
var(--mantine-color-default-hover) 40%,
transparent
) !important;
}
/* Headers: frosted glass effect */
.my-table th {
white-space: nowrap;
background-color: color-mix(in srgb, var(--mantine-color-body) 60%, transparent) !important;
background-color: color-mix(
in srgb,
var(--mantine-color-body) 60%,
transparent
) !important;
backdrop-filter: blur(8px);
}
@@ -172,14 +186,16 @@ Create a CSS file alongside the component:
/* Row expansion area */
.my-table .mantine-datatable-row-expansion-cell {
background-color: color-mix(in srgb, var(--mantine-color-body) 40%, transparent) !important;
background-color: color-mix(
in srgb,
var(--mantine-color-body) 40%,
transparent
) !important;
}
```
Import it: `import "./styles.css";` and apply via `className="my-table"`.
---
## 3. Responsive Column Visibility
Use a lookup table of width breakpoints instead of media queries. The widget receives `width` as a prop.
@@ -195,11 +211,38 @@ interface SizeConfig {
}
const SIZE_BREAKPOINTS: { maxWidth: number; config: SizeConfig }[] = [
{ maxWidth: 300, config: { fontSize: "xs", iconSize: 12, cellPadding: 2, showSpeedColumns: false, showTimeColumn: false, showStateColumn: false } },
{ maxWidth: 500, config: { fontSize: "xs", iconSize: 14, cellPadding: 4, showSpeedColumns: false, showTimeColumn: true, showStateColumn: false } },
{
maxWidth: 300,
config: {
fontSize: "xs",
iconSize: 12,
cellPadding: 2,
showSpeedColumns: false,
showTimeColumn: false,
showStateColumn: false,
},
},
{
maxWidth: 500,
config: {
fontSize: "xs",
iconSize: 14,
cellPadding: 4,
showSpeedColumns: false,
showTimeColumn: true,
showStateColumn: false,
},
},
];
const DEFAULT_SIZE_CONFIG: SizeConfig = { fontSize: "sm", iconSize: 14, cellPadding: 4, showSpeedColumns: true, showTimeColumn: true, showStateColumn: true };
const DEFAULT_SIZE_CONFIG: SizeConfig = {
fontSize: "sm",
iconSize: 14,
cellPadding: 4,
showSpeedColumns: true,
showTimeColumn: true,
showStateColumn: true,
};
function getSizeConfig(width: number): SizeConfig {
for (const { maxWidth, config } of SIZE_BREAKPOINTS) {
@@ -215,7 +258,9 @@ const size = useMemo(() => getSizeConfig(width), [width]);
Then use a visibility check lookup table for columns:
```typescript
const columnVisibilityChecks: Partial<Record<string, (ctx: ColumnContext) => boolean>> = {
const columnVisibilityChecks: Partial<
Record<string, (ctx: ColumnContext) => boolean>
> = {
upSpeed: (ctx) => ctx.hasTorrents && ctx.size.showSpeedColumns,
downSpeed: (ctx) => ctx.size.showSpeedColumns,
time: (ctx) => ctx.size.showTimeColumn,
@@ -230,8 +275,6 @@ function shouldIncludeColumn(accessor: string, ctx: ColumnContext): boolean {
}
```
---
## 4. Column Persistence (Drag/Resize → Server)
`useDataTableColumns` stores column order and widths in localStorage by default. For widgets, this must persist server-side so it works across devices.
@@ -263,15 +306,6 @@ Even hidden options need translation keys or the translation test fails:
"widget.mywidget.option.columnWidths.label": "Column widths"
```
### Old-import mappings
Add to `packages/old-import/src/widgets/options.ts`:
```typescript
columnOrder: () => undefined,
columnWidths: () => undefined,
```
### Dynamic storeKey
Use a key that includes `itemId` and sorted column names. This prevents cross-widget localStorage bleeding:
@@ -285,8 +319,13 @@ const storeKey = `mytable-${itemId ?? "preview"}-${[...options.columns].toSorted
On mount, seed `useDataTableColumns` with server-persisted values. Use a `hydrated` ref to prevent the persist effect from immediately writing defaults back:
```typescript
const { effectiveColumns, columnsOrder, columnsWidth, setColumnsOrder, setMultipleColumnWidths } =
useDataTableColumns<MyRow>({ key: storeKey, columns });
const {
effectiveColumns,
columnsOrder,
columnsWidth,
setColumnsOrder,
setMultipleColumnWidths,
} = useDataTableColumns<MyRow>({ key: storeKey, columns });
const lastStoreKey = useRef(storeKey);
const hydrated = useRef(false);
@@ -300,11 +339,22 @@ useEffect(() => {
if (savedOrder.length > 0) setColumnsOrder(savedOrder);
if (Object.keys(savedWidths).length > 0) {
setMultipleColumnWidths(
Object.entries(savedWidths).map(([accessor, w]) => ({ accessor, width: w })),
Object.entries(savedWidths).map(([accessor, w]) => ({
accessor,
width: w,
})),
);
}
requestAnimationFrame(() => { hydrated.current = true; });
}, [storeKey, savedOrder, savedWidths, setColumnsOrder, setMultipleColumnWidths]);
requestAnimationFrame(() => {
hydrated.current = true;
});
}, [
storeKey,
savedOrder,
savedWidths,
setColumnsOrder,
setMultipleColumnWidths,
]);
```
### Persist localStorage → server
@@ -317,22 +367,26 @@ const prevWidths = useRef(columnsWidth);
useEffect(() => {
if (!hydrated.current) return;
const orderChanged = JSON.stringify(columnsOrder) !== JSON.stringify(prevOrder.current);
const widthsChanged = JSON.stringify(columnsWidth) !== JSON.stringify(prevWidths.current);
const orderChanged =
JSON.stringify(columnsOrder) !== JSON.stringify(prevOrder.current);
const widthsChanged =
JSON.stringify(columnsWidth) !== JSON.stringify(prevWidths.current);
prevOrder.current = columnsOrder;
prevWidths.current = columnsWidth;
if (!orderChanged && !widthsChanged) return;
if (orderChanged) persistOption({ columnOrder: JSON.stringify(columnsOrder) });
if (orderChanged)
persistOption({ columnOrder: JSON.stringify(columnsOrder) });
if (widthsChanged) {
const widthMap: Record<string, number> = {};
for (const entry of columnsWidth) {
const key = Object.keys(entry)[0];
if (!key) continue;
const w = entry[key as keyof typeof entry];
if (typeof w === "number") widthMap[key] = w;
else if (typeof w === "string" && w.endsWith("px")) widthMap[key] = parseInt(w, 10);
const v = entry[key as keyof typeof entry];
if (typeof v === "number") widthMap[key] = v;
else if (typeof v === "string" && v.endsWith("px"))
widthMap[key] = parseInt(v, 10);
}
persistOption({ columnWidths: JSON.stringify(widthMap) });
}
@@ -341,8 +395,6 @@ useEffect(() => {
The `persistOption` helper calls both `setOptions` (local state) and `saveItemOptions` (server mutation).
---
## 5. Context Menu (Right-Click)
Do NOT install `mantine-contextmenu`. Use Mantine's `Menu` + `Portal` directly:
@@ -374,15 +426,41 @@ const handleContextMenu = useCallback(
The menu component uses `Portal` for correct z-index:
```tsx
function RowContextMenu({ state, onClose }: { state: ContextMenuState; onClose: () => void }) {
function RowContextMenu({
state,
onClose,
}: {
state: ContextMenuState;
onClose: () => void;
}) {
return (
<Portal>
<Menu opened onClose={onClose} closeOnItemClick={false} position="right-start" offset={0}>
<Menu
opened
onClose={onClose}
closeOnItemClick={false}
position="right-start"
offset={0}
>
<Menu.Target>
<Box style={{ position: "fixed", left: state.x, top: state.y, width: 0, height: 0 }} />
<Box
style={{
position: "fixed",
left: state.x,
top: state.y,
width: 0,
height: 0,
}}
/>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item onClick={() => { /* action */ onClose(); }}>Action</Menu.Item>
<Menu.Item
onClick={() => {
/* action */ onClose();
}}
>
Action
</Menu.Item>
</Menu.Dropdown>
</Menu>
</Portal>
@@ -392,8 +470,6 @@ function RowContextMenu({ state, onClose }: { state: ContextMenuState; onClose:
**Key fix:** Use `closeOnItemClick={false}` if any menu item needs a two-step confirmation (like delete → confirm). Close the menu on scroll: `onScroll={() => { if (contextMenu) closeContextMenu(); }}`.
---
## 6. Row Expansion
```typescript
@@ -413,8 +489,6 @@ function RowContextMenu({ state, onClose }: { state: ContextMenuState; onClose:
**Critical:** Do NOT set `onRowClick` when using `rowExpansion` with `trigger: "click"`. They conflict and the expansion won't work.
---
## 7. Common Pitfalls & Fixes
### Status indicator dots
@@ -475,8 +549,11 @@ Always wrap in try/catch:
```typescript
function parseJsonOption<T>(value: string | undefined, fallback: T): T {
if (!value) return fallback;
try { return JSON.parse(value) as T; }
catch { return fallback; }
try {
return JSON.parse(value) as T;
} catch {
return fallback;
}
}
```
@@ -494,20 +571,19 @@ If the widget has configurable default sort, sync it:
```typescript
useEffect(() => {
setSortStatus({ columnAccessor: options.defaultSort, direction: defaultSortDirection });
setSortStatus({
columnAccessor: options.defaultSort,
direction: defaultSortDirection,
});
}, [options.defaultSort, defaultSortDirection]);
```
---
## 8. Accessibility
- All `ActionIcon` components need `aria-label`
- Filter toggles (client badges, status badges) need `aria-pressed={isActive}`
- `textSelectionDisabled` on DataTable prevents accidental text selection during drag/resize
---
## 9. Error Handling
- Every mutation needs an `onError` callback with `showErrorNotification`
@@ -518,12 +594,14 @@ useEffect(() => {
```typescript
const mutationOptions = {
onSettled: () => void utils.myQuery.invalidate(),
onError: () => showErrorNotification({ title: t("errors.actionFailed"), message: t("errors.actionFailedMessage") }),
onError: () =>
showErrorNotification({
title: t("errors.actionFailed"),
message: t("errors.actionFailedMessage"),
}),
};
```
---
## 10. i18n
- No hardcoded strings. Every user-visible string goes through `useScopedI18n`
@@ -534,8 +612,6 @@ const mutationOptions = {
- Errors: `t("errors.{errorKey}")`
- Hidden options still need `.label` translation keys
---
## 11. Edit Mode
Disable pointer events on the table during edit mode to prevent conflicts with the board's drag-and-drop:
@@ -550,8 +626,6 @@ if (isEditMode) rowContextMenuHandler = undefined;
<DataTable style={{ pointerEvents: tablePointerEvents }} />
```
---
## 12. DataTable Props Reference (Commonly Used)
```typescript
@@ -590,8 +664,6 @@ if (isEditMode) rowContextMenuHandler = undefined;
/>
```
---
## 13. Layout Stability
- Don't use `table-layout: fixed` — it fights mantine-datatable's resize logic
@@ -600,8 +672,6 @@ if (isEditMode) rowContextMenuHandler = undefined;
- Names should truncate at the cell boundary, not a character count, so the layout is stable regardless of content length
- `flexShrink: 0` on badges/icons prevents them from being squeezed by long names
---
## 14. Checklist for Each Migration
1. Replace imports (`mantine-react-table` → `mantine-datatable`)
@@ -610,13 +680,12 @@ if (isEditMode) rowContextMenuHandler = undefined;
4. Add CSS file for transparent backgrounds (if widget context)
5. Add responsive column visibility (if widget context)
6. Add hidden options + hydration logic (if column persistence needed)
7. Add old-import mappings for new options
8. Add translation keys (including hidden option labels)
9. Add context menu if row actions exist
10. Add row expansion if detail view exists
11. Add error handling on all mutations
12. Add accessibility attributes
13. Test at multiple widget widths
14. Update docs in `apps/docs/docs/widgets/` if applicable
15. Run `pnpm turbo typecheck` — catches old-import mismatches
16. Run translation spec — catches missing keys
7. Add translation keys (including hidden option labels)
8. Add context menu if row actions exist
9. Add row expansion if detail view exists
10. Add error handling on all mutations
11. Add accessibility attributes
12. Test at multiple widget widths
13. Update docs in `apps/docs/docs/widgets/` if applicable
14. Run `pnpm turbo typecheck`
15. Run translation spec — catches missing keys
@@ -0,0 +1,44 @@
---
name: documentation-sync
description: Keep Homarr documentation in sync with code changes. Use when modifying code that affects user-facing behavior, or when adding/modifying widgets, integrations, cron jobs, API routes, env vars, permissions, auth providers, or UI in apps/docs. Covers the docs/ mapping table, integration doc pattern, and widget doc pattern.
---
# Documentation Sync
When modifying code that affects user-facing behavior, you MUST also update the documentation in `apps/docs/`.
## What triggers a doc update
| Code change | Doc location |
| ---------------------- | ----------------------------------------------------------- |
| New integration | `apps/docs/docs/integrations/<slug>/index.mdx` + `index.ts` |
| New widget | `apps/docs/docs/widgets/<slug>/index.mdx` + `index.ts` |
| Changed API surface | `apps/docs/docs/management/api.mdx` |
| New/changed env vars | `apps/docs/docs/advanced/` |
| New CLI commands | `apps/docs/docs/advanced/command-line/` |
| Changed auth providers | `apps/docs/docs/advanced/` SSO pages |
| UI/UX changes | Relevant getting-started or management pages |
| New cron job | `apps/docs/docs/management/tasks.mdx` |
| Changed permissions | `apps/docs/docs/management/users.mdx` |
## Integration doc pattern
Each integration has a folder under `apps/docs/docs/integrations/<slug>/`:
- `index.ts` — exports a typed `IntegrationDefinition` with name, description, iconUrl, path
- `index.mdx` — uses shared components: `IntegrationHeader`, `IntegrationCapabilites`, `IntegrationSecrets`
- Import metadata from `@homarr/definitions` where possible
## Widget doc pattern
Each widget has a folder under `apps/docs/docs/widgets/<slug>/`:
- `index.ts` — exports a typed `WidgetDefinition` with icon, name, description, path, configuration
- `index.mdx` — uses shared components: `WidgetHeader`, `WidgetConfig`, `WidgetAdding`
## Development
- Run docs locally: `pnpm dev:docs` from root
- Build docs: `pnpm turbo build --filter=@homarr/docs`
- The docs app can import from `@homarr/definitions` for type-safe integration/widget metadata
- Docusaurus strict mode throws on broken links — fix any broken references before committing
@@ -1,13 +1,14 @@
---
description: How to expose tRPC procedures as MCP tools for AI clients
globs: packages/api/src/router/**/*.ts
alwaysApply: false
name: mcp-integration
description: Expose tRPC procedures as MCP tools for AI clients. Use when modifying procedures in packages/api/src/router, adding a new tRPC procedure or router, or deciding what to expose via Homarr's MCP interface. Covers .meta({ mcp }), router registration in packages/api/src/mcp.ts, input schema rules, and what to expose vs skip.
---
# MCP Integration Guide
# MCP Integration
Every new tRPC procedure that provides useful functionality should be exposed as an MCP tool so AI assistants (Claude, Cursor, etc.) can use it. This is a first-class feature of Homarr.
Exposing a procedure makes it callable by any AI client with an API key. Before adding `.meta({ mcp })`, review what the tool exposes: authorization requirements, sensitive data, tenant isolation, auditability, and whether the action is destructive. Prefer exposing read-only queries over mutations unless the mutation is safe and permission-scoped. When in doubt, ask for a security review before shipping a new MCP tool.
## Adding MCP to a procedure
Add `.meta({ mcp: { enabled: true, description: "..." } })` to the procedure chain:
@@ -16,7 +17,7 @@ Add `.meta({ mcp: { enabled: true, description: "..." } })` to the procedure cha
// Read-only tool (query)
myProcedure: protectedProcedure
.meta({ mcp: { enabled: true, description: "Get all items with their status and metadata" } })
.input(z.object({ limit: z.number().default(50) }))
.input(z.object({ limit: z.number().default(10) }))
.query(async ({ ctx, input }) => { ... })
// Write tool (mutation)
@@ -38,23 +39,27 @@ The `.meta()` call must come **before** `.input()` and `.query()`/`.mutation()`
The description is the **only thing** an AI sees to decide when and how to use the tool. Write it like you're explaining to a colleague who has never used Homarr.
**Must include:**
- What the tool returns or does
- Which integrations/services it works with (if applicable)
- How to get required IDs (e.g., "Use integration_all to get the integrationId")
- Permission requirements (if non-obvious)
**Good:**
```
```text
"Get calendar events for upcoming and recent media releases. Fetches from all connected Sonarr (TV), Radarr (movies), Lidarr (music), and Readarr (books) integrations. Requires integrationIds from integration_all"
```
**Bad:**
```
```text
"Get calendar events"
```
**For tools that return permission fields**, explain what they mean:
```
```text
"List all integrations. Returns permissions.hasUseAccess (read) and permissions.hasInteractAccess (actions) — false means the API key lacks that permission, not an error"
```
@@ -77,11 +82,13 @@ export const mcpRouter = createTRPCRouter({
## What to expose vs. what to skip
**Expose:**
- Data queries (list, search, get by ID)
- Actions users would ask an AI to do (toggle, create, delete, approve)
- Status checks (health, stats, summaries)
**Skip:**
- Subscriptions (WebSocket-only, not supported by MCP)
- Internal procedures (session management, onboarding steps)
- File upload/download procedures
+1
View File
@@ -0,0 +1 @@
../.agents/skills
-50
View File
@@ -1,50 +0,0 @@
---
description: Keep documentation in sync with code changes
globs:
- packages/definitions/src/**
- packages/widgets/src/**
- packages/integrations/src/**
- packages/api/src/**
- apps/nextjs/src/**
- apps/docs/**
---
# Documentation Sync Rule
When modifying code that affects user-facing behavior, you MUST also update the documentation in `apps/docs/`.
## What triggers a doc update
| Code change | Doc location |
|---|---|
| New integration | `apps/docs/docs/integrations/<slug>/index.mdx` + `index.ts` |
| New widget | `apps/docs/docs/widgets/<slug>/index.mdx` + `index.ts` |
| Changed API surface | `apps/docs/docs/management/api.mdx` |
| New/changed env vars | `apps/docs/docs/advanced/` |
| New CLI commands | `apps/docs/docs/advanced/command-line/` |
| Changed auth providers | `apps/docs/docs/advanced/` SSO pages |
| UI/UX changes | Relevant getting-started or management pages |
| New cron job | `apps/docs/docs/management/tasks.mdx` |
| Changed permissions | `apps/docs/docs/management/users.mdx` |
## Integration doc pattern
Each integration has a folder under `apps/docs/docs/integrations/<slug>/`:
- `index.ts` — exports a typed `IntegrationDefinition` with name, description, iconUrl, path
- `index.mdx` — uses shared components: `IntegrationHeader`, `IntegrationCapabilites`, `IntegrationSecrets`
- Import metadata from `@homarr/definitions` where possible
## Widget doc pattern
Each widget has a folder under `apps/docs/docs/widgets/<slug>/`:
- `index.ts` — exports a typed `WidgetDefinition` with icon, name, description, path, configuration
- `index.mdx` — uses shared components: `WidgetHeader`, `WidgetConfig`, `WidgetAdding`
## Development
- Run docs locally: `pnpm dev:docs` from root
- Build docs: `pnpm turbo build --filter=@homarr/docs`
- The docs app can import from `@homarr/definitions` for type-safe integration/widget metadata
- Docusaurus strict mode throws on broken links — fix any broken references before committing
+5
View File
@@ -33,6 +33,11 @@ body:
options:
# The below comment is used to insert a new version with on-release.yml
#NEXT_VERSION#
- 1.77.0
- 1.76.2
- 1.76.1
- 1.76.0
- 1.75.0
- 1.74.0
- 1.73.0
- 1.72.0
@@ -68,8 +68,6 @@ jobs:
with:
node-version: 24.18.0
package-manager-cache: false
- run: npm i -g pnpm
if: env.SKIP_RELEASE == 'false'
- name: Install dependencies
if: env.SKIP_RELEASE == 'false'
run: |
+2 -1
View File
@@ -71,7 +71,8 @@ apps/nextjs/public/images/background.png
# personal agent config
.opencode
.agents/
.agents/*
!.agents/skills/
skills-lock.json
# docusaurus
+8
View File
@@ -0,0 +1,8 @@
{
"mcpServers": {
"mantine": {
"command": "npx",
"args": ["-y", "@mantine/mcp-server"]
}
}
}
+10
View File
@@ -84,6 +84,16 @@ When modifying user-facing code, you MUST also update the corresponding document
- Lint: oxlint (not ESLint)
- Format: oxfmt (not Prettier)
- UI: Mantine (not Tailwind) — Tailwind is only used in docs app
- Mantine: use the `mantine` MCP server (configured in `.mcp.json`; tools `get_item_doc` / `get_item_props` / `search_docs`) for current v9 APIs before writing component code. Prefer built-in primitives (`Combobox`/`useCombobox` for selects, the polymorphic `component` prop, `@mantine/hooks`) over hand-rolled equivalents. Check `packages/ui/` for existing conventions first.
## MCP servers
`.mcp.json` at the repo root declares project-scoped MCP servers (the standard Claude Code layout; other tools can import the same `mcpServers` block). See the `mantine` entry there for the Mantine v9 server, and the upstream docs at https://mantine.dev/guides/llms/ for per-tool setup (OpenCode: `.opencode/opencode.json`, Codex: `.codex/config.toml`). Only keyless server definitions belong in `.mcp.json`; anything needing secrets stays in local dotfiles.
## Agent Skills
Portable agent skills live in `.agents/skills/` (the Agent Skills open standard). Cursor, Codex, and OpenCode read `.agents/skills/` natively. Claude Code does not scan it, so `.claude/skills/` is a symlink back to `.agents/skills/`. Install skills at `.agents/skills/<name>/SKILL.md` — that single copy is used everywhere. See `.agents/skills/` for available skills (documentation-sync, mcp-integration, codebase-context, datatable-migration).
- Icons: @tabler/icons-react
- Docs app can import from `@homarr/definitions` for shared types
- Run `pnpm dev:cli -- dev` to browse local `homarr:*` images and remote PR images.
+12
View File
@@ -1,3 +1,15 @@
## [1.77.1](https://github.com/homarr-labs/homarr/compare/v1.77.0...v1.77.1) (2026-09-11)
## [1.77.0](https://github.com/homarr-labs/homarr/compare/v1.76.2...v1.77.0) (2026-09-06)
## [1.76.2](https://github.com/homarr-labs/homarr/compare/v1.76.1...v1.76.2) (2026-08-27)
## [1.76.1](https://github.com/homarr-labs/homarr/compare/v1.76.0...v1.76.1) (2026-08-26)
## [1.76.0](https://github.com/homarr-labs/homarr/compare/v1.75.0...v1.76.0) (2026-08-21)
## [1.75.0](https://github.com/homarr-labs/homarr/compare/v1.74.0...v1.75.0) (2026-08-14)
## [1.74.0](https://github.com/homarr-labs/homarr/compare/v1.73.0...v1.74.0) (2026-08-07)
## [1.73.0](https://github.com/homarr-labs/homarr/compare/v1.72.0...v1.73.0) (2026-07-31)
@@ -2,9 +2,9 @@
<img src="https://raw.githubusercontent.com/homarr-labs/charts/refs/heads/main/charts/homarr/icon.svg" align="right" width="92" alt="homarr logo">
![Version: 8.26.0](https://img.shields.io/badge/Version-8.26.0-informational?style=flat)
![Version: 8.28.1](https://img.shields.io/badge/Version-8.28.1-informational?style=flat)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat)
![AppVersion: v1.74.0](https://img.shields.io/badge/AppVersion-v1.74.0-informational?style=flat)
![AppVersion: v1.76.1](https://img.shields.io/badge/AppVersion-v1.76.1-informational?style=flat)
A Helm chart to deploy homarr for Kubernetes
@@ -429,7 +429,7 @@ All available values are listed on the [artifacthub](https://artifacthub.io/pack
| httproute.rules[0].matches[0].path.value | string | `"/"` | Path value to match |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.repository | string | `"ghcr.io/homarr-labs/homarr"` | Image repository |
| image.tag | string | `"v1.74.0"` | Overrides the image tag whose default is the chart appVersion |
| image.tag | string | `"v1.76.1"` | Overrides the image tag whose default is the chart appVersion |
| imagePullSecrets | list | `[]` | Secrets for Docker registry |
| ingress.annotations | object | `{}` | Ingress annotations |
| ingress.enabled | bool | `false` | Enable ingress |
@@ -27,6 +27,8 @@ import Alert from '@theme/Admonition';
]}
/>
The storage values shown by these widgets come from each pool's root ZFS dataset, so they already account for RAIDZ parity overhead and dataset limits and match what `zfs list` and the TrueNAS web interface report. When a pool cannot report its dataset space, Homarr falls back to the pool's physical values, which read higher on RAIDZ.
### Adding the integration
<AddingIntegration />
@@ -52,14 +52,21 @@ The certificates are stored in the `/appdata/trusted-certificates` directory whi
This means you can automate the update of the certificates by simply replacing or adding a new file in the directory.
## Obtaining certificates
Every integration has its own way of obtaining certificates.
Generally it is recommended to search for the documentation of the integration you are using.
Most of the time you can find the certificate in the file system of the integration.
The certificate file needs to be uploaded to Homarr. To first get the file on your computer you can either:
- use `scp user@host:/path/to/file ./certificate.pem`
- use `cat /path/to/file` to print the certificate. Then recreate the file on your machine.
Below you can find instructions for some of the integrations.
### Pi-hole (v6)
Since version 6 of Pi-hole, the web interface can be accessed through HTTPS.
The certificate can be found in the path `/etc/pihole/tls_ca.crt`. To add the certificate, this file needs to be copied and uploaded to Homarr.
You can find more details regarding SSL / TLS for Pi-hole [here](https://docs.pi-hole.net/api/tls/).
The certificate can be found in the path `/etc/pihole/tls_ca.crt`.
You can find more details regarding SSL / TLS for Pi-hole [here](https://docs.pi-hole.net/api/tls/).
### Proxmox
By default, Proxmox VE uses a node certificate signed by the cluster. You only need to configure Homarr with the certificate of a single node.
The certificate can be found in any node on the path `/etc/pve/pve-root-ca.pem`.
You can learn more about certificate management in Proxmox [here](https://pve.proxmox.com/wiki/Certificate_Management).
+13 -15
View File
@@ -1,30 +1,27 @@
---
title: 'App'
description: 'Embeds an app into the board.'
title: "App"
description: "Embeds an app into the board."
hide_title: true
---
import { AddingWidget } from '@site/src/components/widgets/adding';
import { WidgetConfig } from '@site/src/components/widgets/configuration';
import { WidgetHeader } from '@site/src/components/widgets/header';
import { appWidget } from '.';
import { AddingWidget } from "@site/src/components/widgets/adding";
import { WidgetConfig } from "@site/src/components/widgets/configuration";
import { WidgetHeader } from "@site/src/components/widgets/header";
import { appWidget } from ".";
<WidgetHeader
widget={appWidget}
categories={['Links', 'Apps']}
/>
<WidgetHeader widget={appWidget} categories={["Links", "Apps"]} />
The app widget allows you to add a link to an application or a website that you want to access quickly from your Homarr board.
It also supports a status check to indicate whether Homarr can reach the application or website.
In view mode, right-clicking uses the browser's link menu. Homarr's widget menu remains available in edit mode.
### Screenshots
import githubApp from './img/github.png';
import jellyseerrApp from './img/jellyseerr-description-tooltip.png';
import piHoleApp from './img/pi-hole-ping-icon.png';
import githubApp from "./img/github.png";
import jellyseerrApp from "./img/jellyseerr-description-tooltip.png";
import piHoleApp from "./img/pi-hole-ping-icon.png";
<div className='flex gap-1'>
<div className="flex gap-1">
<img src={githubApp} alt="app github with-status-check" width={128 * 1.5} height={128 * 1.5} />
<img src={piHoleApp} alt="app pi-hole with-status-check status-check-icon" width={128 * 1.5} height={128 * 1.5} />
<img src={jellyseerrApp} alt="app jellyseerr with-description-tooltip" height={128 * 1.5} />
@@ -34,4 +31,5 @@ import piHoleApp from './img/pi-hole-ping-icon.png';
<AddingWidget />
### Configuration
<WidgetConfig configuration={appWidget.configuration} />
+14 -16
View File
@@ -1,29 +1,26 @@
---
title: 'Bookmarks'
description: 'Displays multiple app links'
title: "Bookmarks"
description: "Displays multiple app links"
hide_title: true
---
import { AddingWidget } from '@site/src/components/widgets/adding';
import { WidgetConfig } from '@site/src/components/widgets/configuration';
import { WidgetHeader } from '@site/src/components/widgets/header';
import { bookmarksWidget } from '.';
import { AddingWidget } from "@site/src/components/widgets/adding";
import { WidgetConfig } from "@site/src/components/widgets/configuration";
import { WidgetHeader } from "@site/src/components/widgets/header";
import { bookmarksWidget } from ".";
<WidgetHeader
widget={bookmarksWidget}
categories={['Links', 'Apps']}
/>
<WidgetHeader widget={bookmarksWidget} categories={["Links", "Apps"]} />
The bookmarks widget allows you to display multiple app links in a single widget.
You can add links to your favorite applications, websites, or any other resources you want quick access to.
In view mode, right-clicking uses the browser's link menu. Homarr's widget menu remains available in edit mode.
### Screenshots
import gridIconsOnly from './img/grid-icons-only.png';
import gridWithTitle from './img/grid-with-title.png';
import verticalListAll from './img/vertical-list-all.png';
import vericalListSimple from './img/vertical-list-simple.png';
import gridIconsOnly from "./img/grid-icons-only.png";
import gridWithTitle from "./img/grid-with-title.png";
import verticalListAll from "./img/vertical-list-all.png";
import vericalListSimple from "./img/vertical-list-simple.png";
<div className='flex gap-1'>
<div className='flex flex-col gap-1'>
@@ -33,12 +30,13 @@ import vericalListSimple from './img/vertical-list-simple.png';
<img src={gridWithTitle} alt="bookmarks grid with-title" width={256 + 4} height={256 + 4} />
<img src={verticalListAll} alt="bookmarks vertical-list all-elements" width={128} height={256 + 4} />
</div>
</div>
### Adding the widget
<AddingWidget />
### Configuration
<WidgetConfig configuration={bookmarksWidget.configuration} />
@@ -43,6 +43,7 @@ import temperature from './img/temperature.png';
### Interactions
- Toggle entity state by clicking on the entity (only when clickable enabled).
- After a successful toggle, the displayed state refreshes immediately.
### Adding the widget
@@ -64,4 +65,4 @@ import retrieveEntityId from './img/retrieve-entity-id.png';
<div>
<img src={retrieveEntityId} alt="homeassistant retrieve-entity-id" width={256 * 2} />
</div>
</div>
@@ -47,4 +47,7 @@ import withDisplayname from './img/with-displayname.png';
<AddingWidget />
### Configuration
Use the Home Assistant entity ID (for example, `automation.turn_on_lights`) in the **Automation ID** field, not the automation's internal ID.
<WidgetConfig configuration={smartHomeExecuteAutomationWidget.configuration} />
@@ -178,35 +178,37 @@ export const BoardSettingsForm = ({ board, permissions, hasFullAccess, hideVisib
const isPending = savePartialSettings.isPending || saveLayouts.isPending;
return (
<form onSubmit={form.onSubmit((values) => void handleSubmitAsync(values))}>
<Stack gap="xl">
<GeneralSettingsContent board={board} form={form} />
<LayoutSettingsContent form={form} />
<BackgroundSettingsContent form={form} />
<ColorSettingsContent form={form} />
<CustomCssSettingsContent form={form} />
<BehaviorSettingsContent form={form} />
<Stack gap="xl">
<form onSubmit={form.onSubmit((values) => void handleSubmitAsync(values))}>
<Stack gap="xl">
<GeneralSettingsContent board={board} form={form} />
<LayoutSettingsContent form={form} />
<BackgroundSettingsContent form={form} />
<ColorSettingsContent form={form} />
<CustomCssSettingsContent form={form} />
<BehaviorSettingsContent form={form} />
{hasFullAccess && (
<SectionCard title={tSection("access.title")}>
<BoardAccessSettings board={board} initialPermissions={permissions} />
</SectionCard>
)}
{form.isDirty() && (
<UnsavedChangesBar>
<Button type="button" disabled={isPending} variant="default" onClick={handleDiscard}>
{t("common.action.discard")}
</Button>
<Button loading={isPending} type="submit" disabled={!form.isValid()}>
{t("common.action.saveChanges")}
</Button>
</UnsavedChangesBar>
)}
</Stack>
</form>
{hasFullAccess && <DangerZoneSettingsContent hideVisibility={hideVisibility} />}
{hasFullAccess && (
<SectionCard title={tSection("access.title")}>
<BoardAccessSettings board={board} initialPermissions={permissions} />
</SectionCard>
)}
{form.isDirty() && (
<UnsavedChangesBar>
<Button type="button" disabled={isPending} variant="default" onClick={handleDiscard}>
{t("common.action.discard")}
</Button>
<Button loading={isPending} type="submit" disabled={!form.isValid()}>
{t("common.action.saveChanges")}
</Button>
</UnsavedChangesBar>
)}
</Stack>
</form>
{hasFullAccess && <DangerZoneSettingsContent hideVisibility={hideVisibility} />}
</Stack>
);
};
@@ -28,6 +28,7 @@ export const integrationSecretIcons = {
opnsenseApiSecret: IconPassword,
patchmonApiKey: IconKey,
patchmonApiSecret: IconPassword,
siteManagerApiKey: IconKey,
githubAppId: IconCode,
githubInstallationId: IconPlug,
privateKey: IconKey,
@@ -14,6 +14,7 @@ import { db } from "@homarr/db";
import { getPackageVersion } from "~/versions/package-reader";
import { extractMcpTools } from "../_extract-tools";
import { serializeMcpToolResult } from "../_serialize-result";
const logger = createLogger({ module: "mcpRoute" });
@@ -203,7 +204,7 @@ const mcpHandler = createMcpHandler(
const input = args && Object.keys(args).length > 0 ? args : undefined;
const result = await procedure(input);
return {
content: [{ type: "text" as const, text: JSON.stringify(result) }],
content: [{ type: "text" as const, text: serializeMcpToolResult(result) }],
};
} catch (error) {
const message = sanitizeErrorMessage(error);
@@ -0,0 +1,23 @@
import { describe, expect, it } from "vitest";
import { serializeMcpToolResult } from "./_serialize-result";
describe("serializeMcpToolResult", () => {
it("serializes objects as JSON strings", () => {
expect(serializeMcpToolResult({ boardId: "1" })).toBe('{"boardId":"1"}');
});
it("serializes primitive values", () => {
expect(serializeMcpToolResult("hello")).toBe('"hello"');
expect(serializeMcpToolResult(42)).toBe("42");
expect(serializeMcpToolResult(true)).toBe("true");
});
it("serializes null as the string null", () => {
expect(serializeMcpToolResult(null)).toBe("null");
});
it("serializes void results as the string null so MCP content text is always a string", () => {
expect(serializeMcpToolResult(undefined)).toBe("null");
});
});
@@ -0,0 +1,3 @@
export function serializeMcpToolResult(result: unknown): string {
return JSON.stringify(result) ?? "null";
}
@@ -44,9 +44,13 @@ interface WidgetContextMenuProps {
export const WidgetContextMenu = ({ item, definition, widgetStateRef, children }: WidgetContextMenuProps) => {
const { data: session } = useSession();
const [isEditMode] = useEditMode();
const settings = useSettings();
if (!session || !settings.enableRightClickOnWidgets) return <>{children}</>;
const isLinkWidget = item.kind === "app" || item.kind === "bookmarks";
// Keep the Homarr menu in edit mode so these widgets can still be edited or removed.
if (isLinkWidget && !isEditMode) return <>{children}</>;
return (
<WidgetContextMenuInner item={item} definition={definition} widgetStateRef={widgetStateRef} settings={settings}>
@@ -301,6 +301,8 @@ interface UseCssVariableConfiguration {
isDynamic: boolean;
}
const minimumResizeWidthDelta = 20;
/**
* This hook is used to configure the css variables for the gridstack
* Those css variables are used to define the size of the gridstack items
@@ -319,9 +321,30 @@ const useCssVariableConfiguration = ({
columnCount,
isDynamic,
}: UseCssVariableConfiguration) => {
const prevSizeRef = useRef<{ width: number; height: number } | null>(null);
const onResize = useCallback(() => {
if (!wrapperRef.current) return;
if (!gridRef.current) return;
const currentWidth = wrapperRef.current.clientWidth;
const currentHeight = wrapperRef.current.clientHeight;
const prevSize = prevSizeRef.current;
// Only skip recalculation when the width change is insignificant
// and, for dynamic sections, the height is unchanged. This prevents infinite
// feedback loops when the vertical scrollbar appears/disappears, causing
// clientWidth to oscillate by ~15px, while still reacting to height changes.
if (
prevSize !== null &&
Math.abs(currentWidth - prevSize.width) < minimumResizeWidthDelta &&
(!isDynamic || currentHeight === prevSize.height)
) {
return;
}
prevSizeRef.current = { width: currentWidth, height: currentHeight };
handleResizeChange(
wrapperRef.current,
gridRef.current,
@@ -36,6 +36,8 @@ export const categoryTranslationKeys: Record<string, string> = {
documents: "integration.category.documents",
mediaLibrary: "integration.category.mediaLibrary",
uptimeMonitoring: "integration.category.uptimeMonitoring",
unifiOs: "integration.category.unifiOs",
unifiSiteManager: "integration.category.unifiSiteManager",
};
export interface IntegrationGridItem {
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,474 @@
# Intégration UniFi OS pour Homarr — conception
**Date :** 2026-09-08
**Base :** homarr-labs/homarr `2b1a03849` (v1.77.0)
**Branche :** `feat/unifi-os-integration`
**Statut :** conception validée, prête pour le plan d'implémentation
> ⚠️ Aucune clé d'API ne figure dans ce document. Les clés utilisées pendant la
> conception ont été fournies hors dépôt et doivent être révoquées en fin de projet.
---
## 1. Objectif
Ajouter à Homarr une intégration **UniFi OS**, en complément — et non en
remplacement — de l'intégration `unifiController` existante.
L'intégration existante s'authentifie par identifiant/mot de passe et lit
`/api/s/{site}/stat/sites`, l'API interne de l'ancien Network Controller.
UniFi OS expose depuis la version 9 une **API d'intégration officielle**,
authentifiée par clé d'API, stable et documentée. C'est celle que cible ce
projet.
L'intégration existante n'est pas touchée. Les deux coexistent.
## 2. Décisions cadrées
| # | Décision | Justification |
|---|---|---|
| D1 | **Fork personnel**, pas de PR upstream | Choix de l'auteur. L'issue upstream [#4703](https://github.com/homarr-labs/homarr/issues/4703) demandait cette fonctionnalité et a été fermée par triage automatique, pas par refus technique : la porte reste ouverte pour plus tard. |
| D2 | **Hybride local + cloud optionnel** | L'API locale ne fournit ni latence ni perte de paquets. L'API cloud Site Manager les fournit. Le cloud reste facultatif pour que l'intégration fonctionne sans compte UI ni accès Internet. |
| D3 | **Widget dédié**, pas de réutilisation des widgets `networkController*` | Le contrat `NetworkControllerSummary` est taillé pour l'ancienne API. S'y conformer obligerait à inventer des valeurs. Un contrat propre évite ça. |
| D4 | **Déploiement par rsync du build standalone** | Le LXC exécute déjà un build standalone piloté par systemd. C'est le changement le plus petit possible, donc le plus facile à annuler. |
| D5 | **Structure client / mapping / orchestration séparés** | Modèle TrueNAS et Synology déjà présents dans le dépôt. Isole le cloud, optionnel et lent, de la partie locale, obligatoire et rapide. |
**Conséquence de D3 :** on ne modifie pas `NetworkControllerSummary`. Les champs
`latency` / `ping` restent `number` obligatoires pour `unifiController` et
`opnsense`. **Aucune régression possible sur les intégrations existantes.**
## 3. Constatations vérifiées sur l'API
Toutes les valeurs ci-dessous ont été relevées sur une console réelle
(UniFi Network **10.6.102**) le 2026-09-08, et non déduites de la documentation.
### 3.1 API locale — `{url}/proxy/network/integration/v1`
Authentification : en-tête `X-API-KEY`, clé générée **dans l'application Network**
(Paramètres → Control Plane → Integrations). Une clé du Site Manager cloud est
refusée avec un `401` sur cette API — les deux systèmes de clés sont distincts.
| Endpoint | Renvoie | Relevé |
|---|---|---|
| `GET /info` | `applicationVersion` | `10.6.102` |
| `GET /sites` | `id`, `internalReference`, `name` — **aucune statistique** | 1 site |
| `GET /sites/{id}/clients` | `type`, `access.type`, `name`, `ipAddress`, `macAddress`, `uplinkDeviceId`, `connectedAt` | 51 clients |
| — | **`limit` est plafonné à 200.** Une demande à 1000 renvoie `limit: 200`. | mesuré |
| `GET /sites/{id}/devices` | `state`, `model`, `macAddress`, `firmwareVersion`, `firmwareUpdatable`, `features` | 6 équipements |
| `GET /sites/{id}/devices/{id}/statistics/latest` | `uptimeSec`, `cpuUtilizationPct`, `memoryUtilizationPct`, `uplink.{tx,rx}RateBps` | — |
| `GET /sites/{id}/vpn/servers` | `type`, `enabled` | 1 serveur WireGuard actif — **non consommé en v1**, voir §12 |
| `GET /sites/{id}/wans` | `id`, `name` **uniquement** — inexploitable pour l'état | 2 WAN |
**Types de clients** (discriminant `type`) : `WIRED`, `WIRELESS`, `VPN`,
`TELEPORT`. Sous-objet `access.type` : `DEFAULT`, `GUEST`.
**Filtrage.** Supporté, avec une syntaxe **préfixe** :
```
✅ and(type.eq('WIRED'),access.type.eq('DEFAULT'))
❌ type.eq('WIRED') and access.type.eq('DEFAULT') → 400 invalid-filter
❌ type.eq('WIRED') & access.type.eq('DEFAULT') → 400 invalid-filter
❌ type.eq('WIRED'),access.type.eq('DEFAULT') → 400 invalid-filter
```
Combiné à `limit=1`, il permet d'obtenir un `totalCount` sans rapatrier les
enregistrements. Utilisé uniquement au-delà de 200 clients (voir §7).
**Écart avec la documentation.** Ubiquiti ne publie l'OpenAPI que pour
`v10.4.57`. La console en `10.6.102` renvoie des champs absents de ce spec
(`macAddress`, `uplinkDeviceId` sur les clients). **Corollaire : on code contre
les réponses réelles, validées par des schémas zod tolérants (`passthrough`),
et on ne génère pas de client depuis le spec publié.**
### 3.2 API cloud Site Manager — `https://api.ui.com`
Authentification : en-tête `X-API-KEY`, clé générée sur `unifi.ui.com`.
| Endpoint | Utilité |
|---|---|
| `GET /v1/sites` | Corrélation (`meta.gatewayMac`), `ispInfo`, IP publique par WAN, `percentages.wanUptime` |
| `POST /v1/isp-metrics/5m/query` | `avgLatency`, `maxLatency`, `packetLoss`, `uptime`, débits |
**Deux contraintes mesurées :**
1. `GET /v1/isp-metrics/5m` sans filtre renvoie **133 Ko** (288 points sur 24 h).
Il faut passer par `POST .../query` borné dans le temps.
2. Une fenêtre de 15 min renvoie un tableau **vide**. Une fenêtre de **3 h**
fonctionne. Le point le plus récent accuse un retard mesuré de **~27 minutes**.
Ces deux faits pilotent le design du cache (§7) et l'affichage de la fraîcheur (§8).
### 3.3 Corrélation locale ↔ cloud
Une clé Site Manager donne accès à **tous** les sites du compte UI, y compris des
consoles dont l'utilisateur n'est pas propriétaire. Le compte de référence en
exposait deux. Prendre les métriques cloud sans discriminer afficherait la
latence d'un autre réseau.
**Clé de jointure retenue : le MAC du gateway.**
```
LOCAL devices[] → gateway.macAddress aa:bb:cc:11:22:33
CLOUD sites[] → meta.gatewayMac aa:bb:cc:11:22:33 ✅ correspondance
CLOUD sites[] → meta.gatewayMac dd:ee:ff:44:55:66 ✗ autre console du compte
```
*(adresses anonymisées ; la correspondance a été vérifiée sur la console réelle)*
Retenu plutôt que le nom du site : un nom se renomme, un MAC non. **En l'absence
de correspondance, `unifi-sm-api.ts` renvoie `null` et n'essaie aucune
approximation.** Un manque visible vaut mieux qu'une donnée silencieusement fausse.
## 4. Contrat de données
```ts
export interface UnifiOsSummary {
site: {
id: string;
name: string;
applicationVersion: string;
};
wan: {
/** Dérivé de l'état du gateway côté local. */
state: "online" | "offline" | "unknown";
/** Débit temps réel de l'uplink du gateway, en bits/s. Local. */
throughput: { txBps: number; rxBps: number } | null;
/** Bloc cloud. `null` si la clé Site Manager n'est pas configurée
* ou si aucun site cloud ne correspond au MAC du gateway. */
isp: {
name: string;
externalIp: string | null;
/** Nullables : le cloud omet ces mesures pour les périodes où le WAN
* était coupé. Un `0` fabriqué s'afficherait comme « 0 ms » à côté d'un
* voyant vert, au moment précis où la connexion est tombée. */
latencyMs: number | null;
maxLatencyMs: number | null;
packetLossPct: number | null;
uptimePct: number | null;
/** Horodatage de la mesure. Rendu obligatoire : toute donnée cloud
* voyage avec sa fraîcheur. */
measuredAt: Date;
} | null;
};
/** `null` si l'appel a échoué. Surtout pas un compteur à zéro : le lecteur
* ne pourrait pas distinguer « échec » de « aucun client connecté ». */
clients: {
total: number;
wired: number;
wireless: number;
vpn: number; // VPN + TELEPORT
guests: number; // access.type === "GUEST", tous types confondus
} | null;
/** `null` si l'appel a échoué, pour la même raison. */
devices: {
total: number;
online: number;
offline: number;
firmwareUpdatable: number;
} | null;
gateway: {
name: string;
model: string;
macAddress: string;
uptimeSec: number | null;
cpuPct: number | null;
memoryPct: number | null;
} | null;
}
```
**`measuredAt` est obligatoire dans le bloc `isp`.** Le type impose que la
fraîcheur accompagne la donnée cloud : il devient impossible d'afficher une
latence sans savoir de quand elle date.
## 5. Architecture
### 5.1 Nouveaux fichiers
```
packages/integrations/src/unifi-os/
├── unifi-os-integration.ts # extends Integration — orchestre, mappe, dégrade
├── unifi-os-api.ts # client HTTP local
├── unifi-sm-api.ts # client HTTP cloud, optionnel, cache interne
├── unifi-os-types.ts # schémas zod + mappers purs
└── test/
├── unifi-os-types.spec.ts
└── unifi-os-integration.spec.ts
```
Chaque unité répond à une question unique :
- `unifi-os-api.ts` — *comment parler à la console locale ?* Endpoints,
pagination, résolution du `siteId`. Ne connaît pas Homarr.
- `unifi-sm-api.ts` — *comment parler au cloud ?* Fenêtre glissante de 3 h,
corrélation par MAC, cache interne. **Instancié uniquement si la clé cloud
est présente.**
- `unifi-os-types.ts` — *comment valider et transformer ?* Schémas zod et
fonctions pures. Aucun accès réseau, donc testable sans mock.
- `unifi-os-integration.ts` — *comment Homarr consomme tout ça ?* La seule
unité qui connaît la classe `Integration`.
### 5.2 Points d'attache dans le monorepo
| Fichier | Modification |
|---|---|
| `packages/definitions/src/integration.ts` | Ajouter le secret `siteManagerApiKey` à `integrationSecretKindObject` ; ajouter `"unifiOs"` à `integrationCategories` ; ajouter le kind `unifiOs` avec `secretKinds: [["apiKey"], ["apiKey", "siteManagerApiKey"]]`, `category: ["unifiOs"]`, `defaultPort: 443` |
| `packages/definitions/src/widget.ts` | Ajouter le `WidgetKind` `unifiOs` |
| `packages/integrations/src/base/creator.ts` | Enregistrer `unifiOs: UnifiOsIntegration` |
| `packages/integrations/src/types.ts` | Exporter `./unifi-os/unifi-os-types` |
| `packages/integrations/src/interfaces/unifi-os-summary/` | Interface `UnifiOsSummaryIntegration` |
| `packages/request-handler/src/unifi-os.ts` | `createIntegrationRequestHandler` |
| `packages/api/src/router/widgets/unifi-os.ts` + `index.ts` | Routeur tRPC |
| `packages/widgets/src/unifi-os/{index.ts,component.tsx}` | Définition + composant |
| `packages/widgets/src/{manifest.ts,index.tsx,refetch-intervals.ts}` | Enregistrement |
| `packages/translation/src/lang/en.json` | Libellés du widget + clé `integration.category.unifiOs` |
### 5.3 Pourquoi une catégorie dédiée, et pas `networkController`
`integrationCategories` n'est pas une étiquette de présentation, c'est un
mécanisme de câblage. `getIntegrationKindsByCategory("networkController")`
alimente trois endroits :
```
widget-integration-map.ts → intégrations proposées par les widgets networkController*
router/widgets/network-controller.ts → middleware tRPC
request-handler/network-controller.ts → typé IntegrationKindByCategory<"networkController">,
appelle getNetworkSummaryAsync()
```
Déclarer `unifiOs` dans cette catégorie la rendrait sélectionnable dans les
widgets de l'ancienne intégration **et** exigerait qu'elle implémente
`getNetworkSummaryAsync()` — l'interface que la décision D3 écarte
explicitement. Le typage `IntegrationKindByCategory` transforme cette
contradiction en erreur de compilation, pas en défaut silencieux.
On ajoute donc une catégorie `unifiOs`. Le dépôt a déjà un précédent de
catégorie mono-intégration : `beszel`. Une catégorie sans traduction ne casse
rien — `beszel` n'en a pas — mais on ajoute quand même
`integration.category.unifiOs`.
**Base d'URL.** L'utilisateur saisit l'origine de la console
(`https://console.exemple.tld`). Le client local préfixe systématiquement
`/proxy/network/integration/v1`. Ce préfixe appartient au client, pas à la
configuration : l'utilisateur n'a pas à le connaître.
**Précédent de conception validé :** le champ `secretKinds` accepte plusieurs
jeux alternatifs, et la classe de base expose `hasSecretValue()`. L'intégration
`ntfy` utilise déjà exactement ce motif (`[["topic"], ["topic", "apiKey"]]`).
La clé cloud optionnelle ne demande donc aucun mécanisme nouveau.
**Note TLS.** La classe de base `Integration` applique les certificats de
confiance de Homarr à l'URL de l'intégration uniquement. L'appel vers
`api.ui.com` sort de ce périmètre : c'est du HTTPS public à certificat valide,
un `fetch` standard suffit. Il ne doit **pas** passer par
`fetchWithTrustedCertificatesAsync`, pour ne pas laisser croire que les deux
appels partagent la même configuration.
## 6. Séquence d'un rafraîchissement
```
1. GET /info → applicationVersion
2. GET /sites → siteId, name
3. Promise.allSettled([
GET /sites/{id}/clients?limit=200 → comptage par type (voir §7)
GET /sites/{id}/devices → états, firmwares, gateway
])
4. GET /sites/{id}/devices/{gatewayId}/statistics/latest (si gateway trouvé)
5. si clé cloud présente :
unifi-sm-api.getIspMetricsAsync(gatewayMac) → cache 5 min
```
**`Promise.allSettled`, pas `Promise.all`.** Un endpoint en échec dégrade son
bloc à `null` ; il ne fait pas tomber le widget entier. L'étape 4 dépend de
l'étape 3 : sans gateway identifié, `gateway` et `wan.throughput` valent `null`
et le reste s'affiche normalement.
## 7. Cache et gestion d'erreurs
**Deux caches de rythmes différents**, parce que les deux sources n'évoluent pas
à la même vitesse :
| Couche | TTL | Motif |
|---|---|---|
| `createIntegrationRequestHandler` | 60 s | Les compteurs locaux sont vivants |
| Cache interne de `unifi-sm-api.ts`, clé = MAC gateway | 5 min | La donnée cloud ne change que toutes les 5 min et arrive avec ~27 min de retard |
Sans le second cache, on émettrait ~120 appels/h vers `api.ui.com` pour ~12
valeurs distinctes, avec un risque de limitation de débit. Le motif du cache
statique par instance est déjà utilisé par `TrueNasClient`.
**`fallbackToStaleOnError: true`** sur le handler. Une console injoignable
pendant quelques secondes affiche la dernière valeur connue au lieu d'une tuile
d'erreur — à condition que l'interface signale que la donnée est périmée (§8).
**Comptage des clients — règle explicite.** L'API plafonne `limit` à 200
(mesuré). Le comportement est donc conditionné par `totalCount`, renvoyé dès la
première page :
| Condition | Stratégie | Coût |
|---|---|---|
| `totalCount ≤ 200` | La première page contient tout. Comptage en mémoire par `type` et `access.type`. | 1 requête |
| `totalCount > 200` | Bascule sur des requêtes filtrées `limit=1`, dont on ne lit que `totalCount`. | 5 requêtes de taille fixe |
La seconde branche utilise la syntaxe préfixe du §3.1, par exemple
`and(type.eq('WIRELESS'),access.type.eq('GUEST'))`.
On ne pagine **pas** en boucle : au-delà de 200 clients, rapatrier tous les
enregistrements pour n'en garder que des compteurs coûte plus cher que cinq
requêtes bornées, et la charge croîtrait avec la taille du réseau.
*Écrire les deux branches maintenant est justifié : ce n'est pas de
l'optimisation spéculative mais la gestion d'une limite d'API mesurée, qui
produirait sinon des compteurs silencieusement faux au-delà de 200 clients.*
## 8. Widget
**Disposition retenue : bandeau WAN dominant + lignes** (option B des maquettes).
```
┌────────────────────────────────────────────────┐
│ ● Nom du site │
│ ┌────────────────────────────────────────────┐ │
│ │ ● Internet ↑14,1 ↓3,3 Mb/s │ │
│ │ Nom FAI · 203.0.113.10 │ │
│ │ 11 ms · 0 % perte [27min]│ │
│ └────────────────────────────────────────────┘ │
│ Clients 51 · 44 filaire · 7 Wi-Fi │
│ Équipements 6 / 6 en ligne │
│ ● Firmware 3 à mettre à jour │
│ Network 10.6.102 Gateway up 11 j 16 h │
└────────────────────────────────────────────────┘
```
Justification : la hiérarchie visuelle suit l'ordre de consultation réel — on
regarde d'abord si Internet fonctionne, ensuite le détail.
**Le badge de fraîcheur n'est pas cosmétique.** Il porte deux rôles distincts :
signaler le retard structurel des métriques cloud, et signaler une donnée servie
depuis le cache périmé après une erreur. Sans lui, le widget juxtaposerait des
données de fraîcheurs très différentes sans le dire.
**Comportement dégradé :**
| Situation | Rendu |
|---|---|
| Clé cloud absente | Bloc ISP masqué. Le bandeau garde l'état WAN et le débit. |
| Cloud injoignable | Idem, plus un indicateur discret. |
| Aucune correspondance de MAC | Bloc ISP masqué. Jamais la latence d'un autre site. |
| Gateway introuvable | `throughput`, `uptime`, CPU/RAM masqués ; clients et équipements affichés. |
| Console injoignable | Dernière valeur connue + badge périmé, puis tuile d'erreur au-delà du TTL. |
**Taille.** `WidgetDefinition` n'expose aucune contrainte de taille minimale :
l'adaptation est une affaire de CSS dans le composant. Le bandeau passe en deux
lignes en tuile étroite, et les lignes de détail se réduisent à leurs chiffres.
**Rafraîchissement.** Entrée dans `widgetQueryRefetchIntervals` avec
`intervalSeconds: 60`. Les widgets `networkController` sont à `null` — pas de
rafraîchissement automatique — mais les compteurs de clients ont une valeur
d'usage qui justifie l'écart.
## 9. Tests
| Niveau | Fichier | Couvre | Réseau |
|---|---|---|---|
| Unitaire | `unifi-os-types.spec.ts` | Comptage par type et par `access.type`, agrégation d'états, conversion bps, corrélation par MAC **y compris le cas sans correspondance**, tolérance aux champs inconnus | Non |
| Intégration | `unifi-os-integration.spec.ts` | Séquence complète sur fixtures capturées, dégradation par bloc, absence de clé cloud, endpoint en échec | Mocké |
| Manuel | script hors CI | Vérification contre une console réelle | Oui |
Le niveau unitaire est le plus important : c'est là que vivent les erreurs de
comptage, et c'est le seul qui reste valable si Ubiquiti fait évoluer ses
endpoints.
**Fixtures.** Capturées depuis la console réelle, puis **anonymisées** —
adresses MAC, IP publique, noms de clients et identifiants de site remplacés.
Un dépôt ne doit pas porter la cartographie d'un réseau privé.
**Multi-site.** Une URL locale désigne une console, et l'intégration se limite au
premier site qu'elle expose. Une console peut techniquement en héberger
plusieurs : le widget affiche donc le **nom du site** retenu, pour que ce choix
soit visible plutôt que subi. Deux tests couvrent les bornes — une console sans
aucun site renvoie une erreur explicite au test de connexion, et le nom du site
figure dans le contrat.
L'ancienne intégration agrégeait tous les sites, ce qui avait produit l'issue
[#3222](https://github.com/homarr-labs/homarr/issues/3222) (valeurs nulles en
multi-site). Ne pas agréger supprime la classe de défaut plutôt que de la
tester.
## 10. Phasage
Chaque phase se vérifie seule. C'est ce qui permet de savoir de quel côté
chercher quand quelque chose casse.
| Phase | Contenu | Critère de validation |
|---|---|---|
| 0 | Fork, `corepack enable`, `pnpm docker:dev:up`, `pnpm dev` | Homarr démarre en local |
| 1 | `unifi-os-api.ts`, `unifi-sm-api.ts`, types et mappers, tests unitaires | `pnpm test` vert, sans réseau |
| 2 | `UnifiOsIntegration` + enregistrement | Le test de connexion Homarr passe dans l'interface |
| 3 | request-handler + routeur tRPC | La query renvoie les vraies valeurs |
| 4 | Widget + traductions `en` | Le widget s'affiche sur un board local |
| 5 | Build standalone + rsync vers le LXC | Le widget s'affiche en production |
À l'issue de la phase 2, toute la plomberie est prouvée. Une panne en phase 4
est donc nécessairement côté interface.
## 11. Déploiement
Cible : LXC Ubuntu 24.04, `10.70.1.13`, 2 vCPU / 2 Go. Homarr y tourne en build
standalone sous systemd (`/opt/homarr`, `homarr.service`,
`EnvironmentFile=/etc/homarr/homarr.env`), avec nginx et Redis embarqués par
`run.sh`.
**Le build se fait sur le poste de développement** (16 cœurs, 60 Go). Le LXC ne
peut pas compiler ce monorepo Next.js.
Procédure :
1. `tar` de `/opt/homarr` **et** dump de la base.
2. `systemctl stop homarr`.
3. `rsync` du build standalone.
4. `systemctl start homarr`, puis vérification des logs.
Rollback : restauration de l'archive et redémarrage.
**Contrôle préalable obligatoire :** comparer les migrations de
`packages/db/migrations/` avec `/opt/homarr/db/migrations/`. Elles sont
alignées à `0041_add_right_click_preference.sql` au 2026-09-08. Une divergence
rendrait le rollback nettement plus complexe qu'une restauration d'archive.
**`SECRET_ENCRYPTION_KEY`** dans `/etc/homarr/homarr.env` chiffre les secrets
d'intégration en base. Le rsync ne touche pas ce fichier, mais toute
modification rendrait les intégrations existantes illisibles.
## 12. Hors périmètre
Volontairement exclus de cette spec :
- **Widget cloud multi-site** (SD-WAN, fabric, vue consolidée de plusieurs
consoles). Idée retenue pour un projet ultérieur, qui réutilisera
`unifi-sm-api.ts`. Sa mention ici sert à ne pas le construire maintenant.
- **État des serveurs VPN.** L'endpoint existe et fonctionne, mais le contrat §4
n'expose pas de champ pour lui et la disposition retenue au §8 ne l'affiche pas.
Le collecter sans l'afficher serait du code mort.
- **Actions d'écriture** (adoption d'équipement, redémarrage de port, gestion de
vouchers). L'API les expose ; l'intégration reste en lecture seule.
- **Traduction au-delà de l'anglais.** Conséquence de D1.
- **Documentation Docusaurus.** Conséquence de D1.
- **Pull request upstream.** Conséquence de D1 ; la structure du code ne
l'interdit pas plus tard.
- **Modification de l'intégration `unifiController`.** Elle reste en l'état.
## 13. Risques
| Risque | Portée | Traitement |
|---|---|---|
| L'OpenAPI publié (`10.4.57`) est en retard sur les consoles | Élevée — déjà constaté | Schémas zod tolérants, code écrit contre les réponses réelles |
| La clé Site Manager donne accès à tout le compte UI | Sécurité | Cloud optionnel ; corrélation stricte par MAC ; clé de conception à révoquer |
| Retard de ~27 min sur les métriques cloud | Interface | `measuredAt` obligatoire dans le contrat, badge de fraîcheur dans le widget |
| Un fork diverge à chaque version de Homarr | Maintenance | Modifications concentrées dans un dossier neuf ; seuls les points d'attache du §5.2 touchent l'existant |
| Limitation de débit sur `api.ui.com` | Fiabilité | Cache interne 5 min |
| Le déploiement casse l'instance de production | Exploitation | Sauvegarde avant rsync, contrôle des migrations, rollback par restauration |
@@ -0,0 +1,399 @@
# Intégration UniFi Site Manager pour Homarr — conception
**Date :** 2026-09-09
**Base :** homarr-labs/homarr `2b1a03849` (v1.77.0)
**Statut :** conception validée, prête pour le plan d'implémentation
**Précède :** `2026-09-08-unifi-os-integration-design.md` (intégration mono-site, locale + cloud optionnel)
> ⚠️ Aucune clé d'API, adresse MAC réelle, IP publique ou nom de site réel ne
> figure dans ce document.
---
## 1. Objectif
Ajouter une intégration **UniFi Site Manager**, distincte de `unifiOs`, lisant
**uniquement** l'API cloud `https://api.ui.com`, et un widget affichant une vue
d'ensemble **multi-sites**.
C'est ce que `unifiOs` ne peut structurellement pas faire : son URL désigne une
console, donc un site. Le Site Manager voit tous les sites d'un compte.
## 2. Décisions cadrées
| # | Décision | Justification |
|---|---|---|
| D1 | **Deux intégrations indépendantes** | `unifiOs` garde sa clé cloud optionnelle pour son bloc ISP ; `unifiSiteManager` a la sienne. Chacune reste installable et supprimable seule. Coût accepté : la clé est saisie deux fois si l'utilisateur emploie les deux, et deux appelants interrogent le cloud. |
| D2 | **Vue d'ensemble des sites d'abord** | Les captures fournies montrent trois vues — liste des sites, métriques ISP historisées, topologie SD-WAN. Ce sont trois projets. Celui-ci construit aussi le socle (intégration, client, routeur) dont les deux autres dépendront. |
| D3 | **Tableau, la bande en colonne** | Réutilise `HomarrDataTable`, le composant partagé déjà employé par les widgets beszel, docker et downloads. Tri par colonne gratuit, visibilité responsive documentée par la skill `datatable-migration` du dépôt, et lisible bien au-delà de dix sites. C'est aussi la forme qu'emploie l'interface Ubiquiti. La bande devient une colonne parmi d'autres : elle ne domine plus la lecture, mais elle reste présente et le widget tient à l'échelle. |
| D4 | **La bande « Internet Health » EST dans la v1** | Décision inversée en cours de conception. Elle avait été écartée au motif que `internetIssues` est un tableau creux dont il faudrait reconstituer les périodes saines. C'est vrai de cette source — mais `isp-metrics` fournit la même information **déjà dense** (§3.3). La bande coûte alors une boucle de coloration, pas un moteur de graphe. |
| D6 | **État SD-WAN par site, sans la topologie** | Ajouté après coup à la demande de l'utilisateur. L'état des tunnels — connecté, hors ligne, ping, erreurs — est indexé par `siteId` et se greffe donc sur les lignes existantes. La topologie (réseaux nommés, sous-réseaux) reste hors v1 : une liste de quinze réseaux n'a pas sa place dans une ligne de tableau. |
| D5 | **Rafraîchissement 5 min** | Les compteurs cloud n'évoluent pas plus vite. À contraster avec `unifiOs`, dont la source locale a justifié 5 s. |
## 3. Constatations vérifiées sur l'API
Relevées le 2026-09-09 contre `https://api.ui.com` avec une clé réelle.
### 3.1 Il n'existe pas d'API cachée
Une trentaine de chemins plausibles ont été sondés :
- **`/ea/*` est un alias complet de `/v1/*`** — mêmes payloads, mêmes tailles à
l'octet près. C'est le namespace « early access », pas une surface parallèle.
- `/v1/organizations`, `/orgs`, `/users`, `/me`, `/subscriptions`, `/licenses`,
`/backups`, `/tasks`, `/events`, `/topology`, `/clients`, `/networks`, `/wifi`,
`/health`, `/status`, `/version` : **tous 404**.
- `/v1/isp-metrics/{type}` n'accepte que `5m` et `1h`. `1d` et `24h` → 400.
**La surface documentée est toute la surface.** Aucune requête cachée à exploiter.
### 3.2 Ce que la v1 consomme
| Endpoint | Champs retenus |
|---|---|
| `GET /v1/sites` | `siteId`, `hostId`, `meta.desc`, `meta.name`, `statistics.percentages.wanUptime`, `statistics.ispInfo.name`, `statistics.wans[*].externalIp`, `statistics.counts.{totalDevice,offlineDevice,pendingUpdateDevice}` |
| `GET /v1/hosts` | `id`, `reportedState.deviceState`, `reportedState.firmwareUpdate` |
| `GET /v1/sd-wan-configs` | `id`, `name` — nécessaire pour atteindre le statut, qui est indexé par configuration |
| `GET /v1/sd-wan-configs/{id}/status` | `status.connections[].sites[]` → `siteId`, `status.{connected,offline,ping,errors}` ; `status.sites[]` → `siteId`, `errors`, `warnings` |
Corrélation site ↔ host par `hostId`, présent des deux côtés. Contrairement à
l'intégration `unifiOs`, aucune ruse par adresse MAC n'est nécessaire ici : la
clé de jointure est explicite.
### 3.3 Deux sources pour la santé, une seule utilisable
L'interface Ubiquiti affiche une barre « Internet Health ». Deux champs peuvent
la produire, et le choix entre eux décide du coût de la fonctionnalité.
**`statistics.internetIssues` — écarté.** Un tableau **creux** d'anomalies,
chacune portant un `index` de tranche de 5 min, et soit `highLatency` avec
`latencyAvgMs`/`latencyMaxMs`, soit `notReported` avec un `count`. L'index se
convertit par `index × 300` secondes — vérifié. Mais les périodes **saines** n'y
sont pas : il faudrait les reconstituer par différence avec la fenêtre.
**`GET /v1/isp-metrics/{5m|1h}` — retenu.** Vérifié : renvoie **une entrée par
site** (`hostId`, `siteId`) avec une série **dense**, chaque période portant
`downtime`, `packetLoss`, `avgLatency`, `maxLatency`, `uptime` et `ispName`.
Granularité `1h` : 30 jours d'historique disponible. Granularité `5m` : environ
24 h.
La v1 consomme donc `isp-metrics` en `1h` sur une fenêtre de 24 h, soit
**24 segments par site**. Rien à reconstituer, rien à décoder.
**Taille.** Le `GET` non borné pèse 216 Ko en `1h` et 133 Ko en `5m`. La v1 passe
par `POST /v1/isp-metrics/1h/query`, qui accepte plusieurs sites et une fenêtre
bornée dans une seule requête.
Reste hors v1 : `/v1/sd-wan-configs` (projet 3), données vérifiées complètes.
## 4. Contrat de données
```ts
export interface UnifiSiteManagerSite {
siteId: string;
/** `meta.desc` s'il existe, sinon `meta.name`. */
name: string;
/** `null` quand le cloud ne rapporte pas d'uptime pour ce site. */
wanUptimePct: number | null;
ispName: string | null;
/** Une entrée par WAN configuré ; vide si aucune IP publique n'est rapportée. */
externalIps: string[];
deviceCount: number;
offlineDeviceCount: number;
/** Firmwares d'ÉQUIPEMENTS en attente — distinct de la mise à jour de console. */
pendingUpdateCount: number;
/** Mise à jour de la CONSOLE. `null` si aucun host ne correspond au site. */
consoleUpdateAvailable: boolean | null;
/** 24 tranches horaires, la plus ancienne en premier. Toujours 24 entrées :
* une tranche sans mesure vaut `"unknown"`, jamais `"healthy"`. */
health: UnifiSiteHealthSegment[];
/** Dernière mesure de la fenêtre. `null` si le cloud n'en rapporte aucune. */
latencyMs: number | null;
packetLossPct: number | null;
/** `null` si le site n'appartient à aucune configuration SD-WAN. */
sdWan: UnifiSiteSdWanStatus | null;
}
export interface UnifiSiteSdWanStatus {
configName: string;
connected: boolean;
offline: boolean;
/** `null` quand le cloud rapporte `0` — voir la note ci-dessous. */
pingMs: number | null;
errorCount: number;
warningCount: number;
}
export type UnifiSiteHealthState = "healthy" | "degraded" | "down" | "unknown";
export interface UnifiSiteHealthSegment {
/** Début de la tranche horaire. */
at: Date;
state: UnifiSiteHealthState;
}
export interface UnifiSiteManagerOverview {
sites: UnifiSiteManagerSite[];
}
```
**`consoleUpdateAvailable` est nullable et ce n'est pas un détail.** `null`
signifie « aucun host ne correspond à ce site », ce qui n'est pas la même chose
que `false` (« la console est à jour »). Le widget doit les distinguer, comme il
distingue partout ailleurs l'inconnu du connu.
**Dérivation de `state`, par ordre de gravité décroissante :** `downtime > 0`
→ `"down"` ; sinon `packetLoss > 0` → `"degraded"` ; sinon `"healthy"`. Une
tranche de la fenêtre pour laquelle le cloud ne rapporte rien → `"unknown"`.
**Cette dernière règle est le point délicat.** Un site enregistré depuis douze
heures n'a que douze tranches sur vingt-quatre. Les remplir en vert affirmerait
douze heures de bon fonctionnement qui n'ont jamais été mesurées. Le gris dit
« on ne sait pas », ce qui est la vérité — même principe que le tiret cadratin
ailleurs dans ces widgets.
**`ping: 0` ne veut pas dire zéro milliseconde.** Relevé sur un tunnel
`connected: true` reliant deux sites géographiquement distants — une latence
nulle y est physiquement impossible. Le champ signifie donc « non mesuré », et le
contrat le traduit par `pingMs: null` plutôt que de propager un zéro que
l'interface afficherait comme une performance.
**Un site peut appartenir à plusieurs configurations SD-WAN.** Le contrat n'en
porte qu'une : on retient la première configuration où le site apparaît, et le
nom de celle-ci accompagne l'état pour que la ligne reste interprétable. Si le
besoin de plusieurs se présente, c'est un élargissement du contrat, pas un
correctif.
**`pendingUpdateCount` et `consoleUpdateAvailable` ne mesurent pas la même
chose.** Le premier compte les équipements réseau dont le firmware est en
retard ; le second dit si UniFi OS lui-même a une version disponible. L'interface
L'interface Ubiquiti les sépare ; le contrat fait de même.
## 5. Architecture
### 5.1 Nouveaux fichiers
```
packages/integrations/src/unifi-site-manager/
├── unifi-site-manager-integration.ts # classe Integration : orchestre et mappe
├── unifi-site-manager-api.ts # client HTTP cloud
├── unifi-site-manager-types.ts # schémas zod + mappers purs
├── unifi-site-manager-parse.ts # parsing, dépend de @homarr/common/server
└── test/
```
**La séparation `types` / `parse` est imposée par un défaut rencontré sur
l'intégration précédente**, pas par goût. `packages/integrations/src/types.ts`
est importé par des composants **client** (la spotlight, entre autres). Tout
module qu'il réexporte doit donc être client-safe. `unifi-os-types.ts` importait
`ParseError` depuis `@homarr/common/server`, ce qui a traîné `ioredis` — et donc
`node:dns` — dans le bundle navigateur et **empêché l'application de démarrer**.
Ni le typecheck, ni 703 tests, ni cinq revues ne l'avaient vu : seul le
lancement de l'application l'a révélé.
Le module de types de cette intégration ne contiendra donc que zod et des
fonctions pures, et un test de garde vérifiera l'absence de cet import.
### 5.2 Points d'attache
Seize entrées, tous identifiés. L'entrée 14 en couvre quatre fichiers à elle
seule, soit dix-neuf fichiers touchés au total.
| # | Fichier | Ajout |
|---|---|---|
| 1 | `definitions/src/integration.ts` | catégorie `unifiSiteManager` ; kind avec `secretKinds: [["siteManagerApiKey"]]`, `defaultUrl: "https://api.ui.com"`, `documentationUrl: null` |
| 2 | `definitions/src/widget.ts` | `WidgetKind` `unifiSiteManager` |
| 3 | `definitions/src/widget-integration-map.ts` | `unifiSiteManager: ["unifiSiteManager"]` |
| 4 | `definitions/src/docs/integration-doc-slugs.ts` | `unifiSiteManager: null` |
| 5 | `definitions/src/docs/widget-doc-slugs.ts` | `unifiSiteManager: null` |
| 6 | `integrations/src/base/creator.ts` | enregistrement de la classe |
| 7 | `integrations/src/index.ts` | export de la classe |
| 8 | `integrations/src/types.ts` | export des types **client-safe uniquement** |
| 9 | `integrations/src/interfaces/unifi-site-manager/` | interface consommée par le handler |
| 10 | `request-handler/src/unifi-site-manager.ts` | handler de cache |
| 11 | `api/src/router/widgets/unifi-site-manager.ts` | routeur tRPC |
| 12 | `api/src/router/widgets/index.ts` | enregistrement du routeur |
| 13 | `widgets/src/unifi-site-manager/` | définition + composant |
| 14 | `widgets/src/{manifest.ts,index.tsx,catalog.ts,refetch-intervals.ts}` | quatre enregistrements ; l'icône du catalogue doit être **la même référence** que celle de la définition, `manifest.spec.ts` compare par identité |
| 15 | `apps/nextjs/.../integration-grid-shared.ts` | `unifiSiteManager: "integration.category.unifiSiteManager"` — table typée `Record<string, string>`, donc **non vérifiée par le compilateur** : une omission passe le typecheck et affiche la clé brute |
| 16 | `translation/src/lang/en.json` | libellés du widget + `integration.category.unifiSiteManager` |
**Un point d'attache en moins qu'`unifiOs` :** le secret `siteManagerApiKey`
existe déjà, ainsi que son icône et ses libellés. On le réutilise tel quel.
**URL fixe.** `defaultUrl: "https://api.ui.com"`, sur le modèle de l'intégration
`umami` (`https://api.umami.is/v1`). Le champ `url` est `notNull` en base, d'où
le recours à une valeur par défaut plutôt qu'à son absence.
## 6. Séquence d'un rafraîchissement
```
const [sites, hosts] = await Promise.allSettled([
GET /v1/sites, // source obligatoire
GET /v1/hosts, // enrichissement
]);
if (sites.status === "rejected") throw sites.reason; // pas de liste sans sites
// Séquentiel : la requête bornée exige les hostId/siteId de l'étape précédente.
const [metrics, sdWan] = await Promise.allSettled([
POST /v1/isp-metrics/1h/query, // fenêtre 24 h, tous les sites
GET /v1/sd-wan-configs // puis /{id}/status pour chacune
]);
// Les deux sont des enrichissements : leur échec n'est jamais fatal.
```
Quatre à cinq appels selon le nombre de configurations SD-WAN, deux niveaux de
criticité.
`/v1/sites` porte la liste : son échec doit remonter, sinon le widget afficherait
« aucun site » alors qu'il n'a rien pu lire.
`/v1/hosts`, `isp-metrics` et le SD-WAN sont des enrichissements. Leur échec met
leur part à l'inconnu — `consoleUpdateAvailable` à `null`, les vingt-quatre
tranches à `"unknown"`, `sdWan` à `null` — et laisse le reste affiché.
`Promise.allSettled` plutôt que `Promise.all` sert exactement cette asymétrie.
Le SD-WAN coûte deux appels : la liste des configurations, puis le statut de
chacune. Avec une seule configuration — le cas courant — cela fait deux requêtes.
Le plan borne ce nombre pour qu'un compte à dix configurations ne produise pas
onze requêtes par rafraîchissement.
L'appel aux métriques est **séquentiel** et non parallèle : la requête bornée a
besoin des identifiants renvoyés par `/v1/sites`. C'est le prix de ne pas
rapatrier les 216 Ko de la variante non bornée.
## 7. Cache et gestion d'erreurs
| Couche | Valeur | Motif |
|---|---|---|
| `createIntegrationRequestHandler` | 5 min | Les compteurs cloud n'évoluent pas plus vite ; interroger davantage expose à une limitation de débit sans rien gagner |
| Rafraîchissement du widget | 5 min | Aligné : un intervalle plus court relirait la même entrée de cache |
| `fallbackToStaleOnError` | activé, fenêtre 30 min | Sert la dernière valeur connue plutôt qu'une tuile d'erreur pour une coupure passagère |
**Différence de fond avec `unifiOs`.** Là-bas, le cloud était un enrichissement
optionnel : son indisponibilité vidait un bloc et le widget continuait. Ici le
cloud **est** la source. Un échec est un vrai échec, et le widget doit afficher
une erreur — jamais une liste vide, qui se lirait comme « aucun site », c'est-à-dire
comme une information alors qu'il n'y en a aucune.
Un compte réellement sans site est un cas distinct et légitime : il affiche un
état vide explicite, pas une erreur.
## 8. Widget
`HomarrDataTable`, une ligne par site.
| Colonne | Source | Rendu |
|---|---|---|
| Site | `name` | toujours visible, jamais masquée en responsive |
| Santé | `health` | bande de 24 segments d'une heure, du plus ancien au plus récent |
| Latence | `latencyMs`, `packetLossPct` | `11 ms · 0 %` ; `—` si aucune mesure |
| ISP | `ispName` | `—` si `null` |
| IP publique | `externalIps` | joint par ` · ` ; `—` si vide |
| Équipements | `deviceCount`, `offlineDeviceCount` | `en ligne / total`, en rouge si des équipements sont hors ligne |
| Mises à jour | `pendingUpdateCount` | en jaune si > 0 ; `0` affiché normalement, c'est une vraie mesure |
| Console | `consoleUpdateAvailable` | `—` si `null` — l'absence de host correspondant n'est pas « à jour » |
| SD-WAN | `sdWan` | `—` si le site n'est dans aucune configuration ; sinon état du tunnel, en rouge si hors ligne, en jaune s'il porte des erreurs. Le ping n'apparaît que s'il est mesuré |
Colonnes triables. Visibilité responsive selon la largeur de tuile, suivant la
convention documentée par la skill `datatable-migration` : les colonnes les moins
essentielles disparaissent en premier, `Site` et `Santé` jamais.
**La bande de santé.** Vingt-quatre segments jointifs séparés par un filet, pour
qu'on distingue deux tranches consécutives de même couleur. Vert sain, orange
dégradé, rouge coupé, gris inconnu. Dans une colonne de tableau elle sera étroite :
c'est le prix de la forme tableau, et c'est ce qui rend l'infobulle nécessaire
plutôt que confortable.
**Couleurs : palette de statut, pas palette catégorielle.** Distinction établie
en cours de conception, après avoir échoué à faire passer un jeu vert/orange/rouge
au validateur — lequel ne couvre que les palettes **catégorielles**. Sain,
dégradé et coupé sont des **statuts**, qui relèvent d'une palette réservée et
fixe, non thémée :
| État | Couleur | Origine |
|---|---|---|
| `healthy` | `#0ca30c` | statut *good* |
| `degraded` | `#fab219` | statut *warning* |
| `down` | `#d03b3b` | statut *critical* |
| `unknown` | gris neutre de la surface | ce n'est pas un statut, c'est une absence |
Mesuré au passage : un vert/orange/rouge classique donne un ΔE de **2,9** entre
l'orange et le vert en vision protanope — indistinguables. La palette de statut
ne prétend pas résoudre cela, elle impose une contrepartie.
**La contrepartie est obligatoire, et plus forte qu'une infobulle.** La règle
attachée aux couleurs de statut est qu'elles ne voyagent jamais seules : icône
et libellé les accompagnent. Une icône par segment étant impossible sur
vingt-quatre segments, la bande est **doublée d'un résumé textuel** — par exemple
`22 h saines · 2 h dégradées` — placé à côté d'elle dans la même colonne. Ce
résumé n'est pas décoratif : c'est le canal qui porte l'information quand la
couleur ne passe pas.
**Infobulle par segment** : heure de la tranche, latence moyenne, perte. Elle
complète le résumé pour qui veut le détail d'une heure précise.
**Badge de fraîcheur** en tête de widget, alimenté par `updatedAt`, comme sur le
widget `unifiOs`.
## 9. Tests
| Niveau | Couvre | Réseau |
|---|---|---|
| Unitaire, mappers | mapping d'un site complet ; site sans WAN ; site sans `hostId` ; host absent → `consoleUpdateAvailable` à `null` et non `false` ; compte sans aucun site | Non |
| Unitaire, SD-WAN | site absent de toute configuration → `sdWan` à `null` ; **`ping: 0` → `pingMs: null` et non `0`** ; erreurs et avertissements comptés ; site présent dans plusieurs configurations → la première est retenue | Non |
| Unitaire, santé | dérivation `down` > `degraded` > `healthy` ; **fenêtre incomplète → tranches `"unknown"`, jamais `"healthy"`** ; fenêtre toujours longue de 24 ; métriques absentes → 24 tranches `"unknown"` | Non |
| Unitaire, garde | **`unifi-site-manager-types.ts` n'importe pas `@homarr/common/server`** — la seule forme de test qui aurait attrapé le défaut de l'intégration précédente | Non |
| Intégration | séquence complète sur fixtures anonymisées ; `/v1/hosts` en échec laisse le tableau affiché ; `/v1/sites` en échec propage l'erreur | Mocké |
| Manuel | vérification contre le compte réel, hors CI | Oui |
Fixtures **anonymisées** : identifiants, noms de sites, IP publiques et adresses
MAC remplacés. Un dépôt ne porte pas la cartographie d'un réseau privé.
## 10. Phasage
| Phase | Contenu | Critère de validation |
|---|---|---|
| 1 | types + mappers + tests unitaires | `pnpm test` vert, sans réseau |
| 2 | client cloud + tests | idem |
| 3 | classe d'intégration + enregistrements (points 1 à 8) | `pnpm turbo typecheck` propre |
| 4 | request-handler + routeur tRPC (9 à 12) | typecheck propre |
| 5 | widget + enregistrements + traductions (13 à 16) | `manifest.spec.ts` vert, typecheck **global** propre |
| 6 | vérification contre le compte réel | Les valeurs correspondent à l'interface Site Manager |
**La phase 6 n'est pas optionnelle.** Sur l'intégration précédente, elle a
révélé deux défauts que le typecheck, 703 tests et cinq revues avaient laissés
passer — dont un qui empêchait l'application de démarrer.
## 11. Hors périmètre
- **Vue d'analyse ISP** — projet 2. La v1 consomme déjà `isp-metrics` pour la
bande de santé ; ce qui reste hors périmètre est l'**outil d'analyse** de la
seconde capture : sélecteur de fenêtre 1D à 1M, courbes de latence superposées
par site, filtres par ISP, par perte et par uptime. Un résumé et un instrument
d'analyse ne sont pas deux tailles du même widget.
- **Topologie SD-WAN** — l'**état** des tunnels entre dans la v1 (D6) ; la
topologie n'y entre pas. `/v1/sd-wan-configs/{id}` porte les sites, réseaux
nommés, sous-réseaux et l'état `paused` — vérifié complet — mais une liste de
quinze réseaux n'a pas sa place dans une ligne de tableau. Un widget dédié
reste possible et réutilisera le client de cette intégration.
- **Écriture** — l'API expose des mutations ; l'intégration reste en lecture seule.
- **Documentation Docusaurus et traductions au-delà de l'anglais** — fork
personnel, même décision que l'intégration précédente.
- **Mutualisation de la clé cloud avec `unifiOs`** — écartée par D1.
## 12. Risques
| Risque | Portée | Traitement |
|---|---|---|
| Un module de types non client-safe casse le build | Élevée — déjà survenu | Séparation `types` / `parse` dès le départ, plus un test de garde |
| Une omission dans `categoryTranslationKeys` passe le typecheck | Moyenne — déjà survenu | Point d'attache 15 explicite ; vérification visuelle en phase 6 |
| La clé cloud voit tous les sites du compte, y compris non possédés | Sécurité | Assumé et **voulu** ici : c'est une vue multi-sites. Contrairement à `unifiOs`, aucun filtrage n'est souhaitable — mais la documentation du widget doit dire ce qu'il expose |
| Limitation de débit sur `api.ui.com` | Fiabilité | Cadence 5 min, deux appels par cycle |
| Deux intégrations interrogent le cloud en parallèle | Fiabilité | Conséquence acceptée de D1 ; caches indépendants, ~24 requêtes/heure au total |
| `ping: 0` interprété comme une latence nulle | Justesse | Traduit en `pingMs: null` au contrat, testé. Relevé sur un tunnel connecté entre deux sites distants, où zéro est physiquement impossible |
| Un compte à nombreuses configurations SD-WAN multiplie les requêtes | Fiabilité | Nombre de configurations interrogées borné par le plan ; au-delà, les sites concernés ont `sdWan` à `null` plutôt qu'une rafale de requêtes |
| Le nombre de sites croît | Interface | Le tableau absorbe la croissance là où des cartes ou une liste se dégraderaient ; visibilité responsive des colonnes, `Site` et `Santé` toujours conservées |
| La bande est étroite dans une colonne | Lisibilité | Conséquence directe de D3. L'infobulle par segment n'est donc pas un confort mais le moyen principal de lire une tranche |
| Quatre états de santé distingués par la seule couleur | Accessibilité | Palette validée avant écriture ; infobulle par segment rendue obligatoire si le jeu à quatre états ne passe pas les contrôles de vision déficiente |
| Une tranche sans mesure affichée comme saine | Justesse | État `"unknown"` explicite au contrat, testé ; la fenêtre porte toujours 24 entrées |
-36
View File
@@ -7,42 +7,6 @@ import { createHomarrContainer } from "./shared/create-homarr-container";
import { createSqliteDbFileAsync } from "./shared/e2e-db";
describe("Onboarding", () => {
test("Credentials onboarding should be successful", async () => {
// Arrange
const { db, localMountPath } = await createSqliteDbFileAsync();
const homarrContainer = await createHomarrContainer({
mounts: {
"/appdata": localMountPath,
},
}).start();
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
const actions = new OnboardingActions(page, db);
const assertions = new OnboardingAssertions(page, db);
try {
// Act
await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);
await actions.startOnboardingAsync("scratch");
await actions.processUserStepAsync({
username: "admin",
password: "Comp(exP4sswOrd",
confirmPassword: "Comp(exP4sswOrd",
});
await actions.processSettingsStepAsync();
await actions.processIntegrationsStepAsync();
// Assert
await assertions.assertFinishStepVisibleAsync();
await assertions.assertUserAndAdminGroupInsertedAsync("admin");
await assertions.assertDbOnboardingStepAsync("finish");
} finally {
await Promise.all([browser.close(), homarrContainer.stop()]);
}
}, 60_000);
test("External provider onboarding setup should be successful", async () => {
// Arrange
const { db, localMountPath } = await createSqliteDbFileAsync();
+2 -2
View File
@@ -9,7 +9,7 @@ http {
# Route websockets traffic to port 3001
location /websockets {
proxy_pass http://${HOSTNAME}:3001;
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
@@ -18,7 +18,7 @@ http {
# Route all other traffic to port 3000
location / {
proxy_pass http://${HOSTNAME}:3000;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+140
View File
@@ -0,0 +1,140 @@
# Fork personnel — exploitation
Ce dossier n'existe pas en amont. Il ne créera donc jamais de conflit lors d'un
rebase, ce qui est exactement pourquoi les fichiers d'exploitation vivent ici et
pas dans `scripts/`.
## Déployer
```bash
ops/deploy-lxc.sh --dry-run # montre ce qui serait écrit, sans rien toucher
ops/deploy-lxc.sh
```
Le script exige un arbre propre, construit, compare les migrations et l'ABI Node
avant de toucher quoi que ce soit, sauvegarde `/opt/homarr` **et** la base, arrête
le service, synchronise, redémarre, puis affiche les journaux. La commande de
retour arrière est imprimée à la fin, horodatage compris.
Ce qu'il ne remplace jamais : `/etc/homarr/homarr.env`, `run.sh`, `entrypoint.sh`,
`nginx.conf`, `redis.conf` — ils appartiennent à l'installation du LXC, pas au
build — ni `/var/lib/homarr/db.sqlite`, qui est sauvegardée mais laissée en place.
Après déploiement, le contrôle qui compte n'est pas que le nouveau widget
s'affiche : c'est que les intégrations **préexistantes** fonctionnent encore.
C'est la seule preuve que `SECRET_ENCRYPTION_KEY` n'a pas bougé.
## Déplacer l'état hors de /appdata
`/appdata` vient de l'image Docker, où c'est un point de montage. Sur une
machine, il ne suit aucune convention : l'état d'un service se range sous
`/var/lib`. La correction se fait sur l'**instance installée**, jamais dans le
dépôt — ni le code ni le Dockerfile ne sont touchés, sans quoi chaque rebase sur
l'amont rouvrirait le sujet.
```bash
sudo ops/use-var-lib-homarr.sh /opt/homarr # ou /opt/homarr-dev
```
Le script réécrit `/appdata` en `/var/lib/homarr` dans le `run.sh` et le
`redis.conf` de l'instance, sauvegarde chaque fichier avant de le toucher, et
ajoute `LOCAL_CERTIFICATE_PATH` au démarrage. Cette dernière ligne n'est pas
cosmétique : le chemin des certificats n'est pas lu par `run.sh` mais par
l'application, qui retombe sur le dossier de l'image dès qu'il manque — elle
recréerait donc `/appdata` au premier certificat chargé.
Le script ne déplace **pas** les données ; il imprime les commandes à passer une
fois, service arrêté. Sur cette installation, `/appdata` ne contient qu'un
fichier : le certificat racine qui valide la console UniFi locale. Le contrôle
d'après-déplacement est donc tout trouvé — si le widget UniFi OS répond encore,
le certificat a suivi.
À relancer après chaque assemblage : `ops/assemble-standalone.sh` recopie le
`run.sh` du dépôt quand l'instance n'en a pas, et celui-là parle de `/appdata`.
## Suivre les mises à jour d'Homarr
Aujourd'hui `origin` pointe sur le dépôt d'Homarr lui-même et **aucune copie
distante de ce travail n'existe** : une panne de disque effacerait la branche.
Premier geste, avant tout le reste :
```bash
git remote rename origin upstream
git remote add origin <url-de-ton-Gitea>/homarr.git
git push -u origin feat/unifi-os-integration
```
### Le cycle de montée de version
Homarr publie souvent. Se caler sur une **étiquette de version** plutôt que sur
`dev` évite de rebaser sur du code en cours :
```bash
git fetch upstream --tags
git log --oneline dev..upstream/dev | head # ce qui est arrivé
git rebase v1.78.0 feat/unifi-os-integration # remplace par la version visée
```
Puis, dans cet ordre — chaque étape a déjà attrapé quelque chose :
```bash
pnpm install # le lockfile bouge presque à chaque version
pnpm turbo typecheck # les 37 paquets
pnpm test packages/integrations/ packages/widgets/
pnpm test packages/widgets/src/manifest.spec.ts # les points d'enregistrement
ops/deploy-lxc.sh --dry-run
```
`manifest.spec.ts` mérite sa ligne à part : il compare l'icône du catalogue à
celle de la définition **par identité**, et c'est le seul test qui détecte un
point d'enregistrement perdu dans un conflit.
### Où les conflits vont tomber
Le gros du travail vit dans des dossiers neufs — `packages/integrations/src/unifi-os/`,
`unifi-site-manager/`, `packages/widgets/src/unifi-*/` — qui ne peuvent pas
entrer en conflit. Les points de friction sont les fichiers partagés où ce fork
ajoute une ligne dans une liste que l'amont fait vivre aussi :
| Fichier | Ce qu'on y ajoute |
|---|---|
| `packages/definitions/src/integration.ts` | les deux genres d'intégration |
| `packages/definitions/src/widget.ts` | les deux genres de widget |
| `packages/definitions/src/widget-integration-map.ts` | l'association widget ↔ intégration |
| `packages/definitions/src/docs/integration-doc-slugs.ts` | les slugs de documentation |
| `packages/definitions/src/docs/widget-doc-slugs.ts` | idem, côté widgets |
| `packages/integrations/src/base/creator.ts` | la construction des classes |
| `packages/integrations/src/index.ts` | les exports |
| `packages/integrations/src/types.ts` | les types réexportés **côté client** |
| `packages/api/src/router/widgets/index.ts` | les routeurs tRPC |
| `packages/widgets/src/manifest.ts` | deux cartes distinctes, module et composant |
| `packages/widgets/src/index.tsx` | l'import et l'entrée |
| `packages/widgets/src/catalog.ts` | l'icône |
| `packages/widgets/src/refetch-intervals.ts` | l'intervalle de rafraîchissement |
| `apps/nextjs/src/components/integration/integration-grid-shared.ts` | le libellé de catégorie |
| `apps/nextjs/src/app/[locale]/manage/integrations/_components/secrets/integration-secret-icons.ts` | l'icône du secret |
| `packages/translation/src/lang/en.json` | tous les libellés |
Deux de ces lignes ne sont vérifiées par **aucun** compilateur, et les perdre
dans un conflit passerait tous les tests :
- `integration-grid-shared.ts` est typé `Record<string, string>` : une entrée
manquante affiche `UNIFISITEMANAGER` en majuscules collées au lieu du nom.
- `en.json` n'est pas typé du tout : une clé perdue affiche son chemin brut.
Les deux se voient d'un coup d'œil sur la page « New integration » — c'est le
contrôle visuel à faire après chaque montée de version.
### Rejouer les résolutions de conflit
Les mêmes conflits reviendront à chaque version, au même endroit. Git sait les
rejouer tout seul :
```bash
git config rerere.enabled true
```
À activer **avant** le premier rebase : Git n'enregistre que ce qu'il voit
résoudre. Une fois qu'une résolution est connue, les suivantes sont
automatiques — à relire quand même, l'amont peut avoir changé la forme de la
liste autour.
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
#
# Assemble l'arborescence d'exécution à partir d'un dépôt déjà construit.
#
# Le dépôt et l'instance qui tourne n'ont PAS la même forme : le clone contient
# des sources et un `apps/nextjs/.next/standalone` ; l'instance attend
# `apps/nextjs/server.js`, `db/migrations/`, `build/better_sqlite3.node` à sa
# racine. Ce script fait la conversion — les mêmes COPY que le stage `runner`
# du Dockerfile officiel, d'où vient la disposition de /opt/homarr.
#
# Usage : ops/assemble-standalone.sh <destination>
#
# Construire d'abord :
# pnpm turbo build --filter=@homarr/nextjs... --filter=@homarr/cli
#
set -euo pipefail
DEST="${1:?usage: ops/assemble-standalone.sh <destination>}"
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO"
[ -d apps/nextjs/.next/standalone ] || {
echo "apps/nextjs/.next/standalone absent — construis d'abord :" >&2
echo " pnpm turbo build --filter=@homarr/nextjs... --filter=@homarr/cli" >&2
exit 1
}
mkdir -p "$DEST"
# L'ordre suit le Dockerfile : le standalone d'abord, le reste par-dessus.
cp -a apps/nextjs/.next/standalone/. "$DEST/"
mkdir -p "$DEST/apps/nextjs/.next"
cp -a apps/nextjs/.next/static "$DEST/apps/nextjs/.next/static"
cp -a apps/nextjs/public "$DEST/apps/nextjs/public"
cp -a apps/nextjs/next.config.ts apps/nextjs/package.json pnpm-workspace.yaml "$DEST/"
mkdir -p "$DEST/apps/cli"
cp -a packages/cli/cli.cjs "$DEST/apps/cli/cli.cjs"
# Binaire natif : lié à l'architecture et à l'ABI Node de la machine qui a
# construit. Assembler et exécuter sur la même machine rend la question sans
# objet ; c'est le déploiement à distance qui doit la poser.
mkdir -p "$DEST/build"
cp -a node_modules/better-sqlite3/build/Release/better_sqlite3.node "$DEST/build/"
mkdir -p "$DEST/db"
rm -rf "$DEST/db/migrations"
cp -a packages/db/migrations "$DEST/db/migrations"
# run.sh n'est copié que s'il manque, jamais écrasé. Sur le LXC, l'installateur
# a adapté le sien — il annonce le port 80 là où celui du dépôt annonce 7575 —
# et l'écraser ferait écouter nginx sur deux ports différents selon la famille
# d'adresses. Même raison pour entrypoint.sh, nginx.conf et redis.conf, qui
# appartiennent à l'installation et ne sont pas copiés du tout.
if [ -f "$DEST/run.sh" ]; then
echo "run.sh déjà présent — laissé tel quel (il peut être adapté à cette installation)."
if ! diff -q scripts/run.sh "$DEST/run.sh" > /dev/null; then
echo " il diffère de scripts/run.sh : \`diff scripts/run.sh $DEST/run.sh\` pour voir quoi."
fi
else
cp -a scripts/run.sh "$DEST/run.sh"
chmod +x "$DEST/run.sh"
fi
echo "Assemblé dans $DEST ($(du -sh "$DEST" | cut -f1))"
+163
View File
@@ -0,0 +1,163 @@
#!/usr/bin/env bash
#
# Déploie le build standalone de ce dépôt sur le LXC Homarr.
#
# Reproduit la disposition que le Dockerfile officiel assemble (ses COPY du
# stage `runner`), parce que l'installation du LXC en vient : /opt/homarr a la
# même forme qu'une image, sans le conteneur autour.
#
# Ce que le script NE touche PAS, volontairement :
# - /etc/homarr/homarr.env : secrets et configuration de l'instance
# - run.sh, entrypoint.sh, nginx.conf, redis.conf : modifiés par l'installateur
# du LXC, ils appartiennent à l'installation et non au build
# - /var/lib/homarr/db.sqlite : la base, sauvegardée mais jamais remplacée
#
# Usage : ops/deploy-lxc.sh [--dry-run]
#
set -euo pipefail
HOST="${HOMARR_HOST:-zachary@10.70.1.13}"
REMOTE_DIR="${HOMARR_REMOTE_DIR:-/opt/homarr}"
REMOTE_DB="${HOMARR_REMOTE_DB:-/var/lib/homarr/db.sqlite}"
SERVICE="${HOMARR_SERVICE:-homarr}"
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DRY_RUN=""
[ "${1:-}" = "--dry-run" ] && DRY_RUN="--dry-run"
say() { printf '\n\033[1m==> %s\033[0m\n' "$1"; }
# ---------------------------------------------------------------------------
say "Contrôles préalables"
cd "$REPO"
[ -z "$(git status --porcelain)" ] || {
echo "Arbre de travail sale. Committe ou remise avant de déployer." >&2
exit 1
}
echo "Commit déployé : $(git log --oneline -1)"
# Le dépôt exige un Node récent (champ engines.node). Le Node par défaut du poste
# est plus ancien que ça : sans ce contrôle, l'échec surviendrait au milieu du
# build, avec un message de pnpm qui ne dit pas quoi faire.
required_node="$(grep -oP '^node = "\K[^"]+' "$REPO/mise.toml" 2>/dev/null || echo '24.18.0')"
if ! node -e "process.exit(process.versions.node.localeCompare('$required_node', undefined, { numeric: true }) < 0 ? 1 : 0)"; then
echo "Node $(node -v) est trop ancien — il en faut au moins v$required_node." >&2
echo "Par exemple : export PATH=\"\$HOME/.local/share/nvm/v24.20.0/bin:\$PATH\"" >&2
exit 1
fi
# Une migration présente ici et absente en prod n'est pas bloquante — Homarr les
# applique au démarrage — mais elle rend le rollback non trivial : restaurer
# l'archive ne défait pas un schéma déjà migré. On veut le savoir AVANT.
#
# Comparaison par dialecte : la prod embarque les migrations de tous les moteurs,
# et prendre le maximum toutes dialectes confondues masquerait une divergence
# propre à celui qui tourne réellement.
DIALECT="${HOMARR_DB_DIALECT:-sqlite}"
local_migration="$(find "packages/db/migrations/$DIALECT" -name '*.sql' -printf '%f\n' | sort | tail -1)"
remote_migration="$(ssh "$HOST" "find $REMOTE_DIR/db/migrations/$DIALECT -name '*.sql' -printf '%f\n' | sort | tail -1")"
echo "Dernière migration — locale : $local_migration | prod : $remote_migration"
if [ "$local_migration" != "$remote_migration" ]; then
echo
echo "!! Les migrations divergent. Le rollback ne sera PAS une simple restauration."
echo " Sauvegarde la base avant de continuer, puis relance en connaissance de cause."
read -r -p " Continuer quand même ? [oui/NON] " answer
[ "$answer" = "oui" ] || exit 1
fi
# ---------------------------------------------------------------------------
say "Build"
pnpm turbo build --filter=@homarr/nextjs... --filter=@homarr/cli
# ---------------------------------------------------------------------------
say "Assemblage de l'arborescence à envoyer"
STAGE="$(mktemp -d)"
trap 'rm -rf "$STAGE"' EXIT
# Même assemblage que pour une installation construite sur place : un seul
# endroit décrit la disposition d'exécution, et les deux chemins ne peuvent pas
# diverger. `run.sh` en fait partie, mais il est exclu du rsync plus bas —
# celui de l'installation est adapté à son port.
"$REPO/ops/assemble-standalone.sh" "$STAGE"
# ---------------------------------------------------------------------------
say "Contrôle de compatibilité du binaire natif"
local_abi="$(node -p 'process.versions.modules')"
remote_abi="$(ssh "$HOST" 'node -p "process.versions.modules"')"
local_arch="$(uname -m)"
remote_arch="$(ssh "$HOST" 'uname -m')"
echo "ABI Node — local : $local_abi | prod : $remote_abi"
echo "Arch — local : $local_arch | prod : $remote_arch"
if [ "$local_abi" != "$remote_abi" ] || [ "$local_arch" != "$remote_arch" ]; then
echo "!! better_sqlite3.node ne se chargera pas en prod. Build sur le LXC, ou aligne Node." >&2
exit 1
fi
if [ -n "$DRY_RUN" ]; then
say "Mode --dry-run : arrêt avant toute modification de la prod"
# -i sans quoi rsync ne dit rien du tout en mode simulation.
rsync -ain --delete --rsync-path="sudo rsync" \
--exclude 'run.sh' --exclude 'entrypoint.sh' \
--exclude 'nginx.conf' --exclude 'redis.conf' \
"$STAGE/" "$HOST:$REMOTE_DIR/" > /tmp/homarr-deploy-plan.txt
# Écrit d'abord, tronqué ensuite : un `| head` ferme le tuyau et rsync s'arrête
# sur SIGPIPE au bout de trente lignes, ce qui donnerait un plan mensonger.
head -30 /tmp/homarr-deploy-plan.txt
echo
echo "$(grep -c '^\*deleting' /tmp/homarr-deploy-plan.txt) suppressions, \
$(grep -vc '^\*deleting' /tmp/homarr-deploy-plan.txt) écritures. Plan complet : /tmp/homarr-deploy-plan.txt"
exit 0
fi
# ---------------------------------------------------------------------------
say "Sauvegarde"
stamp="$(date +%F-%H%M)"
ssh -t "$HOST" "sudo tar czf /root/homarr-backup-$stamp.tar.gz $REMOTE_DIR \
&& sudo cp $REMOTE_DB /root/homarr-db-$stamp.sqlite \
&& sudo ls -lh /root/homarr-backup-$stamp.tar.gz /root/homarr-db-$stamp.sqlite"
# ---------------------------------------------------------------------------
say "Arrêt du service"
# Jamais de rsync sur un Next.js en cours d'exécution : il lit ses chunks à la
# demande et servirait des morceaux de deux builds différents.
ssh -t "$HOST" "sudo systemctl stop $SERVICE && ! systemctl is-active --quiet $SERVICE && echo arrêté"
# ---------------------------------------------------------------------------
say "Envoi"
# --delete retire ce que le build ne produit plus ; les quatre fichiers exclus
# sont protégés de cette suppression par leur exclusion même.
rsync -a --delete --rsync-path="sudo rsync" \
--exclude 'run.sh' --exclude 'entrypoint.sh' \
--exclude 'nginx.conf' --exclude 'redis.conf' \
"$STAGE/" "$HOST:$REMOTE_DIR/"
# ---------------------------------------------------------------------------
say "Redémarrage"
ssh -t "$HOST" "sudo systemctl start $SERVICE"
sleep 10
ssh "$HOST" "systemctl is-active $SERVICE; curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1/"
say "Journaux (40 dernières lignes)"
ssh -t "$HOST" "sudo journalctl -u $SERVICE -n 40 --no-pager"
cat <<EOF
Déployé. Vérifie dans le navigateur que les intégrations PRÉEXISTANTES
fonctionnent encore — c'est ce qui prouve que SECRET_ENCRYPTION_KEY est intact.
Retour arrière :
ssh $HOST 'sudo systemctl stop $SERVICE \\
&& sudo rm -rf $REMOTE_DIR \\
&& sudo tar xzf /root/homarr-backup-$stamp.tar.gz -C / \\
&& sudo systemctl start $SERVICE'
La base n'a pas été remplacée ; sa copie est dans /root/homarr-db-$stamp.sqlite.
EOF
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env bash
#
# Fait pointer une instance Homarr installée sur /var/lib/homarr au lieu de
# /appdata.
#
# `/appdata` vient de l'image Docker, où c'est un point de montage. Sur une
# machine, il ne suit aucune convention : l'état d'un service se range sous
# /var/lib. Ce script agit sur l'INSTANCE INSTALLÉE — son `run.sh`, son
# `redis.conf` — et jamais sur le dépôt : ni le code source ni le Dockerfile ne
# sont touchés, pour que le fork reste rebasable sur l'amont.
#
# Idempotent : le relancer ne fait rien de plus.
#
# Usage : ops/use-var-lib-homarr.sh <répertoire de l'instance>
# ex. : sudo ops/use-var-lib-homarr.sh /opt/homarr
# sudo ops/use-var-lib-homarr.sh /opt/homarr-dev
#
set -euo pipefail
DIR="${1:?usage: ops/use-var-lib-homarr.sh <dossier-instance>}"
STATE="${HOMARR_STATE_DIR:-/var/lib/homarr}"
stamp="$(date +%F-%H%M%S)"
[ -d "$DIR" ] || { echo "$DIR n'existe pas." >&2; exit 1; }
[ -f "$DIR/run.sh" ] || { echo "$DIR/run.sh introuvable — est-ce bien une instance assemblée ?" >&2; exit 1; }
changed=0
for file in run.sh redis.conf; do
target="$DIR/$file"
[ -f "$target" ] || continue
grep -q '/appdata' "$target" || continue
cp -a "$target" "$target.bak-$stamp"
sed -i "s#/appdata#$STATE#g" "$target"
echo "== $file"
diff -u "$target.bak-$stamp" "$target" | sed -n '4,$p' || true
changed=1
done
# Le chemin des certificats n'est pas lu par run.sh mais par l'application, qui
# retombe sur /appdata/trusted-certificates quand la variable est absente.
# Réécrire les `mkdir` ne suffit donc pas : sans cette ligne, Homarr créerait à
# nouveau /appdata au premier chargement de certificat.
if ! grep -q 'LOCAL_CERTIFICATE_PATH' "$DIR/run.sh"; then
[ -f "$DIR/run.sh.bak-$stamp" ] || cp -a "$DIR/run.sh" "$DIR/run.sh.bak-$stamp"
awk -v value="$STATE/trusted-certificates" '
NR == 1 {
print
print ""
print "# Chemin des certificats de confiance. Sans cette ligne, l'\''application"
print "# retombe sur le dossier de l'\''image et le recrée au premier certificat lu."
print "export LOCAL_CERTIFICATE_PATH=\"${LOCAL_CERTIFICATE_PATH:-" value "}\""
next
}
{ print }
' "$DIR/run.sh" > "$DIR/run.sh.new"
cat "$DIR/run.sh.new" > "$DIR/run.sh" # préserve les droits et le propriétaire
rm -f "$DIR/run.sh.new"
echo "== run.sh : LOCAL_CERTIFICATE_PATH ajouté ($STATE/trusted-certificates)"
changed=1
fi
if [ "$changed" -eq 0 ]; then
echo "Rien à faire : $DIR ne référence déjà plus /appdata."
exit 0
fi
mkdir -p "$STATE/trusted-certificates"
cat <<EOF
Instance $DIR réglée sur $STATE. Sauvegardes : *.bak-$stamp
Il reste les DONNÉES, que ce script ne déplace pas — c'est à faire une fois,
service arrêté, et c'est irréversible sans sauvegarde :
sudo systemctl stop homarr
sudo mv /appdata/trusted-certificates/*.pem $STATE/trusted-certificates/ 2>/dev/null || true
sudo find /appdata -type f # doit ne RIEN afficher avant la suite
sudo rm -rf /appdata
sudo systemctl start homarr
Le contrôle qui compte ensuite : l'intégration UniFi OS doit toujours répondre.
C'est elle qui valide son certificat avec le CA déplacé — si elle fonctionne,
le déplacement a réussi.
EOF
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "homarr",
"version": "1.74.0",
"version": "1.77.1",
"private": true,
"scripts": {
"build": "cross-env CI=true turbo build",
+2
View File
@@ -31,6 +31,8 @@ export const widgetRouter = createTRPCRouter({
options: lazy(() => import("./options").then((mod) => mod.optionsRouter)),
releases: lazy(() => import("./releases").then((mod) => mod.releasesRouter)),
networkController: lazy(() => import("./network-controller").then((mod) => mod.networkControllerRouter)),
unifiOs: lazy(() => import("./unifi-os").then((mod) => mod.unifiOsRouter)),
unifiSiteManager: lazy(() => import("./unifi-site-manager").then((mod) => mod.unifiSiteManagerRouter)),
firewall: lazy(() => import("./firewall").then((mod) => mod.firewallRouter)),
notifications: lazy(() => import("./notifications").then((mod) => mod.notificationsRouter)),
timetable: lazy(() => import("./timetable").then((mod) => mod.timetableRouter)),
+16 -1
View File
@@ -1,3 +1,4 @@
import { TRPCError } from "@trpc/server";
import { z } from "zod/v4";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
@@ -41,6 +42,13 @@ export const smartHomeRouter = createTRPCRouter({
const client = await createIntegrationAsync(integration);
const success = await client.triggerToggleAsync(input.entityId);
if (!success) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "Home Assistant failed to toggle the entity",
});
}
return success;
}),
executeAutomation: protectedProcedure
@@ -55,6 +63,13 @@ export const smartHomeRouter = createTRPCRouter({
.input(z.object({ automationId: z.string() }))
.mutation(async ({ ctx: { integration }, input }) => {
const client = await createIntegrationAsync(integration);
await client.triggerAutomationAsync(input.automationId);
const success = await client.triggerAutomationAsync(input.automationId);
if (!success) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "Home Assistant failed to trigger the automation",
});
}
}),
});
@@ -0,0 +1,24 @@
import { unifiOsRequestHandler } from "@homarr/request-handler/unifi-os";
import { createManyIntegrationMiddleware } from "../../middlewares/integration";
import { settleIntegrationQueries } from "../../settle-integrations";
import { createTRPCRouter, publicProcedure } from "../../trpc";
export const unifiOsRouter = createTRPCRouter({
summary: publicProcedure.concat(createManyIntegrationMiddleware("query", "unifiOs")).query(async ({ ctx }) => {
return await settleIntegrationQueries(ctx.integrations, async (integration) => {
const innerHandler = unifiOsRequestHandler.handler(integration, {});
const { data, timestamp } = await innerHandler.getDataAsync();
return {
integration: {
id: integration.id,
name: integration.name,
kind: integration.kind,
},
summary: data,
updatedAt: timestamp,
};
});
}),
});
@@ -0,0 +1,22 @@
import { unifiSiteManagerRequestHandler } from "@homarr/request-handler/unifi-site-manager";
import { createManyIntegrationMiddleware } from "../../middlewares/integration";
import { settleIntegrationQueries } from "../../settle-integrations";
import { createTRPCRouter, publicProcedure } from "../../trpc";
export const unifiSiteManagerRouter = createTRPCRouter({
overview: publicProcedure
.concat(createManyIntegrationMiddleware("query", "unifiSiteManager"))
.query(async ({ ctx }) => {
return await settleIntegrationQueries(ctx.integrations, async (integration) => {
const innerHandler = unifiSiteManagerRequestHandler.handler(integration, {});
const { data, timestamp } = await innerHandler.getDataAsync();
return {
integration: { id: integration.id, name: integration.name, kind: integration.kind },
overview: data,
updatedAt: timestamp,
};
});
}),
});
+1 -1
View File
@@ -43,7 +43,7 @@ async function importCookiesAsync() {
function getBaseUrl() {
if (typeof window !== "undefined") return window.location.origin;
return `http://${process.env.HOSTNAME ?? "localhost"}:3000`;
return "http://127.0.0.1:3000";
}
export const trpcPath = "/api/trpc";
@@ -13,7 +13,6 @@ import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
import type { TrustedCertificateHostname } from "../certificates/hostnames";
import { withTimeoutAsync } from "./timeout";
export const createCustomCheckServerIdentity = (
trustedHostnames: TrustedCertificateHostname[],
): typeof checkServerIdentity => {
@@ -31,6 +31,8 @@ export const integrationDocSlugs: Record<IntegrationKind, string | null> = {
proxmox: "proxmox",
nextcloud: "nextcloud",
unifiController: "unifi-controller",
unifiOs: null,
unifiSiteManager: null,
opnsense: "opnsense",
ntfy: "ntfy",
gotify: "gotify",
@@ -23,6 +23,8 @@ export const widgetDocSlugs: Record<WidgetKind, string | null> = {
minecraftServerStatus: "minecraft-server-status",
networkControllerSummary: "network-controller-summary",
networkControllerStatus: "network-controller-status",
unifiOs: null,
unifiSiteManager: null,
rssFeed: "rss-feed",
bookmarks: "bookmarks",
indexerManager: "indexer-manager",
+19
View File
@@ -5,6 +5,7 @@ import { createDocumentationLink } from "./docs";
export const integrationSecretKindObject = {
apiKey: { isPublic: false, multiline: false },
siteManagerApiKey: { isPublic: false, multiline: false },
username: { isPublic: true, multiline: false },
password: { isPublic: false, multiline: false },
tokenId: { isPublic: true, multiline: false },
@@ -286,6 +287,22 @@ export const integrationDefs = {
documentationUrl: createDocumentationLink("/docs/integrations/unifi-controller"),
defaultPort: 8443,
},
unifiOs: {
name: "UniFi OS",
secretKinds: [["apiKey"], ["apiKey", "siteManagerApiKey"]],
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/unifi.png",
category: ["unifiOs"],
documentationUrl: null,
defaultPort: 443,
},
unifiSiteManager: {
name: "UniFi Site Manager",
secretKinds: [["siteManagerApiKey"]],
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/unifi.png",
category: ["unifiSiteManager"],
documentationUrl: null,
defaultUrl: "https://api.ui.com",
},
opnsense: {
name: "OPNsense",
secretKinds: [["opnsenseApiKey", "opnsenseApiSecret"]],
@@ -593,6 +610,8 @@ export const integrationCategories = [
"uptimeMonitoring",
"subtitleManager",
"reverseProxy",
"unifiOs",
"unifiSiteManager",
] as const;
export type IntegrationCategory = (typeof integrationCategories)[number];
@@ -23,6 +23,8 @@ export const widgetIntegrationSupport: Partial<Record<WidgetKind, readonly Integ
mediaMissing: getIntegrationKindsByCategory("mediaOrganizer"),
networkControllerSummary: getIntegrationKindsByCategory("networkController"),
networkControllerStatus: getIntegrationKindsByCategory("networkController"),
unifiOs: ["unifiOs"],
unifiSiteManager: ["unifiSiteManager"],
indexerManager: getIntegrationKindsByCategory("indexerManager"),
healthMonitoring: getIntegrationKindsByCategory("healthMonitoring").filter(
(kind) => kind !== "patchmon" && kind !== "wud",
+2
View File
@@ -21,6 +21,8 @@ export const widgetKinds = [
"minecraftServerStatus",
"networkControllerSummary",
"networkControllerStatus",
"unifiOs",
"unifiSiteManager",
"rssFeed",
"bookmarks",
"indexerManager",
@@ -53,6 +53,8 @@ import { TrueNasIntegration } from "../truenas/truenas-integration";
import { UmamiIntegration } from "../umami/umami-integration";
import { UptimeKumaIntegration } from "../uptime-kuma/uptime-kuma-integration";
import { UnifiControllerIntegration } from "../unifi-controller/unifi-controller-integration";
import { UnifiOsIntegration } from "../unifi-os/unifi-os-integration";
import { UnifiSiteManagerIntegration } from "../unifi-site-manager/unifi-site-manager-integration";
import { UnraidIntegration } from "../unraid/unraid-integration";
import { WudIntegration } from "../wud/wud-integration";
import type { Integration, IntegrationInput } from "./integration";
@@ -109,6 +111,8 @@ export const integrationCreators = {
emby: EmbyIntegration,
nextcloud: NextcloudIntegration,
unifiController: UnifiControllerIntegration,
unifiOs: UnifiOsIntegration,
unifiSiteManager: UnifiSiteManagerIntegration,
opnsense: OPNsenseIntegration,
ical: ICalIntegration,
ntfy: NTFYIntegration,
@@ -134,7 +134,10 @@ export class HomeAssistantIntegration extends Integration implements ISmartHomeI
*/
private async postAsync(path: `/api/${string}`, body: Record<string, string>) {
return await fetchWithTrustedCertificatesAsync(this.url(path), {
headers: this.getAuthHeaders(),
headers: {
...this.getAuthHeaders(),
"Content-Type": "application/json",
},
body: JSON.stringify(body),
method: "POST",
});
+3
View File
@@ -99,5 +99,8 @@ export { anchorNotesListInputSchema } from "./anchor/anchor-types";
export { anchorNoteUpdateInputSchema } from "./anchor/anchor-types";
export { downloadClientItemSchema } from "./interfaces/downloads/download-client-items";
export { UnifiOsIntegration } from "./unifi-os/unifi-os-integration";
export { UnifiSiteManagerIntegration } from "./unifi-site-manager/unifi-site-manager-integration";
// Helpers
export { createIntegrationAsync } from "./base/creator";
@@ -0,0 +1,5 @@
import type { UnifiOsSummary } from "../../unifi-os/unifi-os-types";
export interface UnifiOsSummaryIntegration {
getUnifiOsSummaryAsync(): Promise<UnifiOsSummary>;
}
@@ -0,0 +1,5 @@
import type { UnifiSiteManagerOverview } from "../../unifi-site-manager/unifi-site-manager-types";
export interface UnifiSiteManagerIntegration {
getSiteOverviewAsync(): Promise<UnifiSiteManagerOverview>;
}
@@ -59,10 +59,12 @@ const ws = vi.hoisted(() => {
}
const result = responder(payload.method as string, (payload.params as unknown[] | undefined) ?? []);
// A responder returning an Error mimics a method the server rejects, e.g. an unsupported filter.
const body = result instanceof Error ? { error: { message: result.message } } : { result };
const envelope =
payload.jsonrpc === "2.0"
? { jsonrpc: "2.0", id: payload.id, result }
: { msg: "result", id: payload.id, result };
? { jsonrpc: "2.0", id: payload.id, ...body }
: { msg: "result", id: payload.id, ...body };
this.respond(JSON.stringify(envelope));
}
@@ -91,7 +93,10 @@ const ws = vi.hoisted(() => {
};
});
const logs = vi.hoisted(() => ({ debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() }));
vi.mock("ws", () => ({ WebSocket: ws.FakeWebSocket }));
vi.mock("@homarr/core/infrastructure/logs", () => ({ createLogger: () => logs }));
vi.mock("@homarr/core/infrastructure/certificates", () => ({
getAllTrustedCertificatesAsync: vi.fn().mockResolvedValue([]),
getTrustedCertificateHostnamesAsync: vi.fn().mockResolvedValue([]),
@@ -148,6 +153,14 @@ const happyResponder = (method: string) => {
];
case "pool.query":
return [{ name: "tank", status: "ONLINE", healthy: true, free: 500, size: 1000, allocated: 500 }];
case "pool.dataset.query":
return [
{
id: "tank",
used: { parsed: 200 },
available: { parsed: 300 },
},
];
case "interface.query":
return [{ id: "eth0", name: "eth0" }];
case "reporting.netdata_get_data":
@@ -159,6 +172,11 @@ const happyResponder = (method: string) => {
const emptyAggregations = () => ({ min: {}, mean: {}, max: {} });
// `pool.query` reports 500 allocated of a 1000 byte pool, leaving 500 free.
const physicalFallbackFileSystem = [{ deviceName: "tank", available: "500", used: "500", percentage: 50 }];
const ERROR_MESSAGE_LIMIT = 200;
let integrationCounter = 0;
const createIntegration = (decryptedSecrets: IntegrationSecret[]) =>
new TrueNasIntegration({
@@ -180,6 +198,7 @@ describe("TrueNasIntegration", () => {
ws.constructedUrls.length = 0;
ws.failures.length = 0;
ws.setResponder(happyResponder);
logs.warn.mockClear();
});
test("fetches and maps system info over the JSON-RPC API", async () => {
@@ -191,6 +210,18 @@ describe("TrueNasIntegration", () => {
// JSON-RPC does not use the legacy "connect" session handshake.
expect(ws.sentPayloads.some((payload) => payload.msg === "connect")).toBe(false);
const datasetPayload = ws.sentPayloads.find((payload) => payload.method === "pool.dataset.query");
expect(datasetPayload).toMatchObject({
params: [
[["id", "in", ["tank"]]],
{
extra: {
properties: ["used", "available"],
},
},
],
});
expect(result).toMatchObject({
version: "TrueNAS-SCALE-24.10",
cpuModelName: "Intel Xeon",
@@ -204,12 +235,131 @@ describe("TrueNasIntegration", () => {
loadAverage: null,
gpu: [],
network: { up: 20_000, down: 10_000 },
// `available` is the free space left on the pool (free = 500), not its total size.
fileSystem: [{ deviceName: "tank", available: "500", used: "500", percentage: 50 }],
// `available` and `used` come from the root dataset, not the physical pool.
fileSystem: [{ deviceName: "tank", available: "300", used: "200", percentage: 40 }],
smart: [{ deviceName: "tank", healthy: true, overallStatus: "ONLINE", temperature: null }],
});
});
test("falls back to physical pool space when the root dataset is not returned", async () => {
ws.setResponder((method) => (method === "pool.dataset.query" ? [] : happyResponder(method)));
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem).toMatchObject(physicalFallbackFileSystem);
// Dropping the pool would also hide its health status.
expect(result.smart).toMatchObject([{ deviceName: "tank", healthy: true, overallStatus: "ONLINE" }]);
});
test("falls back to physical pool space when the root dataset reports no usable values", async () => {
ws.setResponder((method) =>
method === "pool.dataset.query"
? [{ id: "tank", used: { parsed: null }, available: null }]
: happyResponder(method),
);
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem).toMatchObject(physicalFallbackFileSystem);
});
test("falls back to physical pool space when the root dataset omits the requested properties", async () => {
// Datasets that cannot report space, e.g. while locked, come back without `used` and `available`.
ws.setResponder((method) =>
method === "pool.dataset.query" ? [{ id: "tank", locked: true }] : happyResponder(method),
);
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem).toMatchObject(physicalFallbackFileSystem);
});
test("falls back to physical pool space when the dataset response fails schema validation", async () => {
ws.setResponder((method) =>
method === "pool.dataset.query" ? { unexpected: "not an array" } : happyResponder(method),
);
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem).toMatchObject(physicalFallbackFileSystem);
// A malformed payload must not take the rest of the system info down with it.
expect(result).toMatchObject({ cpuTemp: 45, memAvailableInBytes: 6_000_000_000, uptime: 3600 });
});
test("falls back to physical pool space when the dataset query is rejected", async () => {
ws.setResponder((method) =>
method === "pool.dataset.query"
? new Error("[EINVAL] filters: Value error, Invalid operation: in")
: happyResponder(method),
);
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem).toMatchObject(physicalFallbackFileSystem);
// A rejected dataset query must not take the rest of the system info down with it.
expect(result).toMatchObject({ cpuTemp: 45, memAvailableInBytes: 6_000_000_000, uptime: 3600 });
});
test("logs the truncated rejection reason rather than the generic wrapper message", async () => {
// TrueNAS answers a rejected method with its Python traceback, which runs to several kilobytes.
ws.setResponder((method) =>
method === "pool.dataset.query"
? new Error(`[EINVAL] query-filters ${"x".repeat(5000)}`)
: happyResponder(method),
);
const integration = createIntegration(credentials);
await integration.getSystemInfoAsync();
const logged = logs.warn.mock.calls.find(([message]) => String(message).includes("Could not retrieve"));
const reason = String((logged?.[1] as { error?: string } | undefined)?.error);
// The decorator would otherwise surface only "An unknown error occured while executing Integration method".
expect(reason).toContain("[EINVAL] query-filters");
expect(reason).toHaveLength(ERROR_MESSAGE_LIMIT + 1); // truncated, plus the ellipsis
});
test("keeps reporting a pool that is unhealthy but has no usable dataset space", async () => {
ws.setResponder((method) => {
if (method === "pool.query")
return [
{ name: "tank", status: "ONLINE", healthy: true, free: 500, size: 1000, allocated: 500 },
{ name: "backup", status: "DEGRADED", healthy: false, free: 10, size: 100, allocated: 90 },
];
if (method === "pool.dataset.query") return [{ id: "tank", used: { parsed: 200 }, available: { parsed: 300 } }];
return happyResponder(method);
});
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.smart).toMatchObject([
{ deviceName: "tank", healthy: true, overallStatus: "ONLINE" },
{ deviceName: "backup", healthy: false, overallStatus: "DEGRADED" },
]);
expect(result.fileSystem).toMatchObject([
{ deviceName: "tank", available: "300", used: "200", percentage: 40 },
{ deviceName: "backup", available: "10", used: "90", percentage: 90 },
]);
});
test("reports zero usage for an empty root dataset", async () => {
ws.setResponder((method) =>
method === "pool.dataset.query"
? [{ id: "tank", used: { parsed: 0 }, available: { parsed: 0 } }]
: happyResponder(method),
);
const integration = createIntegration(credentials);
const result = await integration.getSystemInfoAsync();
expect(result.fileSystem[0]?.percentage).toBe(0);
});
test("authenticates with an API key when one is configured", async () => {
const integration = createIntegration([{ kind: "apiKey", value: "api-key-123" }]);
@@ -15,6 +15,20 @@ const logger = createLogger({ module: "trueNasIntegration" });
const NETWORK_MULTIPLIER = 100;
const ERROR_MESSAGE_LIMIT = 200;
/**
* The error decorator replaces a rejected request with a generic message and moves the actionable
* reason to `cause`. TrueNAS puts its middleware traceback in there, several kilobytes of it, so the
* reason is truncated before it reaches a log line that repeats on every poll.
*/
const describeRequestError = (error: unknown) => {
const cause = error instanceof Error ? error.cause : undefined;
const reason = cause instanceof Error ? cause.message : error instanceof Error ? error.message : String(error);
return reason.length > ERROR_MESSAGE_LIMIT ? `${reason.slice(0, ERROR_MESSAGE_LIMIT)}…` : reason;
};
export class TrueNasIntegration extends Integration implements ISystemHealthMonitoringIntegration {
private client?: TrueNasClient;
@@ -49,9 +63,10 @@ export class TrueNasIntegration extends Integration implements ISystemHealthMoni
memUsedInBytes,
fileSystem: datasets.map((dataset) => ({
deviceName: dataset.name,
available: `${dataset.free}`, // free space left on the pool
used: `${dataset.allocated}`,
percentage: (dataset.allocated / dataset.size) * 100,
available: `${dataset.available}`,
used: `${dataset.used}`,
percentage:
dataset.used + dataset.available === 0 ? 0 : (dataset.used / (dataset.used + dataset.available)) * 100,
})),
availablePkgUpdates: 0,
network: {
@@ -107,9 +122,10 @@ export class TrueNasIntegration extends Integration implements ISystemHealthMoni
.map((pool) => {
if (pool.allocated !== null && pool.size !== null && pool.free !== null) {
return {
...pool,
name: pool.name,
status: pool.status,
healthy: pool.healthy,
allocated: pool.allocated,
size: pool.size,
free: pool.free,
};
}
@@ -117,12 +133,76 @@ export class TrueNasIntegration extends Integration implements ISystemHealthMoni
return null;
})
.filter((pool) => pool !== null);
logger.debug("Retrieved pools", {
url: this.integration.url,
totalCount: result.length,
activeCount: activePools.length,
});
return activePools;
if (activePools.length === 0) return [];
const usableSpaceByPool = await this.getUsableSpaceByPoolAsync(activePools.map((pool) => pool.name));
return activePools.map((pool) => {
const usableSpace = usableSpaceByPool.get(pool.name);
if (!usableSpace) {
logger.warn("Falling back to physical pool space, the root dataset reported no usable space", {
url: this.integration.url,
pool: pool.name,
});
}
return {
name: pool.name,
status: pool.status,
healthy: pool.healthy,
used: usableSpace?.used ?? pool.allocated,
available: usableSpace?.available ?? pool.free,
};
});
}
/**
* Returns the usable space of each pool's root ZFS dataset, keyed by pool name. Unlike the physical
* `pool.query` values, these account for RAIDZ parity overhead and dataset limits, matching `zfs list`.
* See https://github.com/homarr-labs/homarr/issues/6566
*
* A pool is left out when its usable space is unavailable, so the caller keeps reporting the pool with
* its physical values instead of dropping it, which would also hide its health status:
* - request rejected → method or `extra.properties` unsupported, or the API key lacks the dataset role
* - response rejected → the payload does not match the expected shape
* - dataset missing → the pool's root dataset was not returned by the query
* - property absent → the dataset does not report `used` / `available`, e.g. while locked
*/
private async getUsableSpaceByPoolAsync(poolNames: string[]) {
const usableSpaceByPool = new Map<string, { used: number; available: number }>();
try {
const datasets = await this.requestAsync("pool.dataset.query", [
[["id", "in", poolNames]],
{
extra: {
properties: ["used", "available"],
},
},
]);
for (const dataset of await poolDatasetSchema.parseAsync(datasets)) {
const used = dataset.used?.parsed;
const available = dataset.available?.parsed;
if (typeof used !== "number" || typeof available !== "number") continue;
usableSpaceByPool.set(dataset.id, { used, available });
}
} catch (error) {
logger.warn("Could not retrieve root dataset space, continuing with physical pool space", {
url: this.integration.url,
error: describeRequestError(error),
});
}
return usableSpaceByPool;
}
/**
@@ -263,6 +343,19 @@ const poolSchema = z.array(
}),
);
// Properties are absent or unparsed for datasets that do not report them, e.g. while locked,
// so they are optional here and the pool falls back to its physical values instead of failing
// the whole request, which would also drop cpu, memory and network data
const poolDatasetPropertySchema = z.object({ parsed: z.number().min(0).nullish() }).nullish();
const poolDatasetSchema = z.array(
z.object({
id: z.string(),
used: poolDatasetPropertySchema,
available: poolDatasetPropertySchema,
}),
);
const reportingNetDataSchema = z.array(
z.object({
name: z.string(),
+4
View File
@@ -13,6 +13,10 @@ export * from "./base/searchable-integration";
export * from "./homeassistant/homeassistant-types";
export * from "./proxmox/proxmox-types";
export * from "./unifi-controller/unifi-controller-types";
export * from "./unifi-os/unifi-os-types";
export * from "./interfaces/unifi-os-summary/unifi-os-summary-integration";
export * from "./unifi-site-manager/unifi-site-manager-types";
export * from "./interfaces/unifi-site-manager/unifi-site-manager-integration";
export * from "./opnsense/opnsense-types";
export * from "./interfaces/media-releases";
export * from "./coolify/coolify-types";
@@ -0,0 +1,123 @@
// @vitest-environment node
import { Response, type RequestInit } from "undici";
import { describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import { ResponseError } from "@homarr/common/server";
import { UnifiOsApi } from "../unifi-os-api";
const ORIGIN = "https://console.example.test";
const API_KEY = "test-key";
const jsonResponse = (body: unknown, status = 200) =>
new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } }) as never;
const page = (data: unknown[], totalCount = data.length, limit = 200) => ({
offset: 0,
limit,
count: data.length,
totalCount,
data,
});
const createApi = (handler: (url: string) => Promise<Response>) => {
const fetchAsync = vi.fn(async (url: string) => await handler(url));
return { api: new UnifiOsApi(ORIGIN, API_KEY, fetchAsync as never), fetchAsync };
};
describe("UnifiOsApi request shape", () => {
test("prefixes the integration path and sends the API key header", async () => {
const fetchAsync = vi.fn(async (_url: string, _init?: RequestInit) =>
jsonResponse({ applicationVersion: "10.6.102" }),
);
const api = new UnifiOsApi(ORIGIN, API_KEY, fetchAsync as never);
await api.getInfoAsync();
expect(fetchAsync).toHaveBeenCalledWith(
`${ORIGIN}/proxy/network/integration/v1/info`,
expect.objectContaining({ headers: expect.objectContaining({ "X-API-KEY": API_KEY }) }),
);
});
test("does not double a slash when the origin has a trailing one", async () => {
const fetchAsync = vi.fn(async (_url: string, _init?: RequestInit) =>
jsonResponse({ applicationVersion: "10.6.102" }),
);
const api = new UnifiOsApi(`${ORIGIN}/`, API_KEY, fetchAsync as never);
await api.getInfoAsync();
expect(fetchAsync.mock.calls[0]?.[0]).toBe(`${ORIGIN}/proxy/network/integration/v1/info`);
});
test("throws ResponseError on a non-ok status instead of parsing the body", async () => {
const { api } = createApi(async () => jsonResponse({ error: { code: 401 } }, 401));
await expect(api.getInfoAsync()).rejects.toBeInstanceOf(ResponseError);
});
});
describe("UnifiOsApi getClientCountsAsync", () => {
test("counts from a single page when totalCount fits under the API limit", async () => {
const { api, fetchAsync } = createApi(async () =>
jsonResponse(
page([
{ id: "1", name: "a", type: "WIRED", access: { type: "DEFAULT" } },
{ id: "2", name: "b", type: "WIRELESS", access: { type: "GUEST" } },
]),
),
);
const counts = await api.getClientCountsAsync("site-1");
expect(counts).toEqual({ total: 2, wired: 1, wireless: 1, vpn: 0, guests: 1 });
expect(fetchAsync).toHaveBeenCalledTimes(1);
});
test("switches to filtered count queries when the site exceeds the 200 limit", async () => {
const requested: string[] = [];
const { api } = createApi(async (url) => {
requested.push(url);
if (!url.includes("filter=")) return jsonResponse(page([], 512));
if (url.includes("WIRED")) return jsonResponse(page([], 400, 1));
if (url.includes("WIRELESS")) return jsonResponse(page([], 100, 1));
if (url.includes("TELEPORT")) return jsonResponse(page([], 2, 1));
if (url.includes("VPN")) return jsonResponse(page([], 10, 1));
return jsonResponse(page([], 5, 1));
});
const counts = await api.getClientCountsAsync("site-1");
expect(counts).toEqual({ total: 512, wired: 400, wireless: 100, vpn: 12, guests: 5 });
expect(requested.some((url) => url.includes("and("))).toBe(false);
expect(requested.filter((url) => url.includes("filter=")).length).toBe(5);
});
test("uses the prefix filter syntax the API actually accepts", async () => {
const requested: string[] = [];
const { api } = createApi(async (url) => {
requested.push(url);
return jsonResponse(page([], url.includes("filter=") ? 1 : 512, 1));
});
await api.getClientCountsAsync("site-1");
const guestQuery = requested.find((url) => url.includes("GUEST"));
expect(decodeURIComponent(guestQuery ?? "")).toContain("access.type.eq('GUEST')");
expect(decodeURIComponent(guestQuery ?? "")).not.toContain(" and ");
});
});
describe("UnifiOsApi getFirstSiteAsync", () => {
test("returns null for a console exposing no site rather than throwing", async () => {
const { api } = createApi(async () => jsonResponse(page([])));
expect(await api.getFirstSiteAsync()).toBeNull();
});
});
@@ -0,0 +1,255 @@
// @vitest-environment node
import { fetch as platformFetch, Response } from "undici";
import { beforeEach, describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
import type { IntegrationSecret } from "../../base/types";
import { UnifiSmApi } from "../unifi-sm-api";
import { UnifiOsIntegration } from "../unifi-os-integration";
vi.mock("@homarr/core/infrastructure/http", () => ({
fetchWithTrustedCertificatesAsync: vi.fn(),
}));
// Les deux transports sont mockés séparément parce qu'ils *doivent* rester
// séparés : le local passe par les certificats de confiance de Homarr, le cloud
// par le `fetch` de la plateforme. Mocker les deux permet d'affirmer qu'aucune
// requête vers api.ui.com n'emprunte le transport local — la garantie du §5.3.
vi.mock("undici", async (importOriginalAsync) => {
const actual = await importOriginalAsync<typeof import("undici")>();
return { ...actual, fetch: vi.fn() };
});
/** Transport local : certificats de confiance, console auto-signée. */
const mockFetch = vi.mocked(fetchWithTrustedCertificatesAsync);
/** Transport cloud : `fetch` de la plateforme, certificat public ordinaire. */
const mockCloudFetch = vi.mocked(platformFetch);
const CLOUD_ORIGIN = "https://api.ui.com";
const GATEWAY_MAC = "aa:bb:cc:11:22:33";
const jsonResponse = (body: unknown, status = 200) =>
new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } }) as never;
const page = (data: unknown[]) => ({ offset: 0, limit: 200, count: data.length, totalCount: data.length, data });
const localRoutes: Record<string, unknown> = {
"/info": { applicationVersion: "10.6.102" },
"/sites": page([{ id: "site-1", name: "Example site", internalReference: "default" }]),
"/sites/site-1/clients": page([
{ id: "c1", name: "a", type: "WIRED", access: { type: "DEFAULT" } },
{ id: "c2", name: "b", type: "WIRELESS", access: { type: "DEFAULT" } },
]),
"/sites/site-1/devices": page([
{
id: "gw",
name: "Gateway",
model: "UXG Pro",
macAddress: GATEWAY_MAC,
state: "ONLINE",
firmwareUpdatable: true,
features: ["gateway"],
},
{
id: "sw",
name: "Switch",
model: "USW Lite 8",
macAddress: "aa:bb:cc:99:88:77",
state: "OFFLINE",
firmwareUpdatable: false,
features: ["switching"],
},
]),
"/sites/site-1/devices/gw/statistics/latest": {
uptimeSec: 1009049,
cpuUtilizationPct: 19.1,
memoryUtilizationPct: 63.1,
uplink: { txRateBps: 14140912, rxRateBps: 3346784 },
},
};
const routeLocal = (rawUrl: string): Response | null => {
const path = new URL(rawUrl).pathname.replace("/proxy/network/integration/v1", "");
const body = localRoutes[path];
return body === undefined ? null : jsonResponse(body);
};
const createIntegration = (decryptedSecrets: IntegrationSecret[]) =>
new UnifiOsIntegration({
id: "test-unifi-os",
name: "Test UniFi OS",
url: "https://console.example.test",
externalUrl: null,
decryptedSecrets,
});
const localOnlySecrets: IntegrationSecret[] = [{ kind: "apiKey", value: "local-key" }];
const hybridSecrets: IntegrationSecret[] = [
{ kind: "apiKey", value: "local-key" },
{ kind: "siteManagerApiKey", value: "cloud-key" },
];
/** Toute URL demandée au transport local, quel que soit l'appelant. */
const localTransportUrls = () => mockFetch.mock.calls.map(([url]) => String(url));
/** Toute URL demandée au transport cloud. */
const cloudTransportUrls = () => mockCloudFetch.mock.calls.map(([url]) => String(url));
beforeEach(() => {
mockFetch.mockReset();
mockCloudFetch.mockReset();
UnifiSmApi.clearCache();
});
describe("UnifiOsIntegration getUnifiOsSummaryAsync", () => {
test("builds the summary from the local API alone", async () => {
mockFetch.mockImplementation(async (url) => routeLocal(String(url)) ?? jsonResponse({}, 404));
const summary = await createIntegration(localOnlySecrets).getUnifiOsSummaryAsync();
expect(summary.site).toEqual({ id: "site-1", name: "Example site", applicationVersion: "10.6.102" });
expect(summary.clients).toEqual({ total: 2, wired: 1, wireless: 1, vpn: 0, guests: 0 });
expect(summary.devices).toEqual({ total: 2, online: 1, offline: 1, firmwareUpdatable: 1 });
expect(summary.wan.state).toBe("online");
expect(summary.wan.throughput).toEqual({ txBps: 14140912, rxBps: 3346784 });
expect(summary.gateway).toMatchObject({ name: "Gateway", uptimeSec: 1009049, cpuPct: 19.1 });
});
test("leaves the ISP block null and touches no transport at all without a Site Manager key", async () => {
mockFetch.mockImplementation(async (url) => routeLocal(String(url)) ?? jsonResponse({}, 404));
const summary = await createIntegration(localOnlySecrets).getUnifiOsSummaryAsync();
expect(summary.wan.isp).toBeNull();
// Le transport cloud est le seul chemin vers api.ui.com : ne pas l'appeler
// du tout prouve qu'aucune requête cloud n'a été émise.
expect(mockCloudFetch).not.toHaveBeenCalled();
expect(localTransportUrls().every((url) => !url.startsWith(CLOUD_ORIGIN))).toBe(true);
});
test("fills the ISP block from the cloud transport, never from the trusted-certificate one", async () => {
mockFetch.mockImplementation(async (url) => routeLocal(String(url)) ?? jsonResponse({}, 404));
mockCloudFetch.mockImplementation(async (url) => {
const raw = String(url);
if (raw.startsWith(`${CLOUD_ORIGIN}/v1/sites`)) {
return jsonResponse({
data: [
{
siteId: "cloud-1",
hostId: "host-1",
meta: { gatewayMac: GATEWAY_MAC },
statistics: { wans: { WAN: { externalIp: "203.0.113.10" } } },
},
],
});
}
if (raw.includes("isp-metrics")) {
return jsonResponse({
data: {
metrics: [
{
periods: [
{
metricTime: "2026-09-08T09:10:00Z",
data: {
wan: { avgLatency: 11, maxLatency: 12, packetLoss: 0, uptime: 100, ispName: "Example ISP" },
},
},
],
},
],
},
});
}
return jsonResponse({}, 404);
});
const summary = await createIntegration(hybridSecrets).getUnifiOsSummaryAsync();
expect(summary.wan.isp).toMatchObject({ name: "Example ISP", latencyMs: 11, externalIp: "203.0.113.10" });
expect(summary.wan.isp?.measuredAt).toEqual(new Date("2026-09-08T09:10:00Z"));
// Le bloc ISP n'a pu être rempli que par des réponses servies par le mock
// cloud : les deux appels y sont donc bien passés.
expect(cloudTransportUrls()).toEqual([`${CLOUD_ORIGIN}/v1/sites`, `${CLOUD_ORIGIN}/v1/isp-metrics/5m/query`]);
// Le cœur du §5.3 : la clé Site Manager ne voyage jamais sur le transport
// qui embarque les autorités personnalisées de l'administrateur.
expect(localTransportUrls().every((url) => url.startsWith("https://console.example.test"))).toBe(true);
});
test("never sends the Site Manager key through the trusted-certificate transport", async () => {
mockFetch.mockImplementation(async (url) => routeLocal(String(url)) ?? jsonResponse({}, 404));
mockCloudFetch.mockImplementation(async () => jsonResponse({}, 500));
await createIntegration(hybridSecrets).getUnifiOsSummaryAsync();
const localKeys = mockFetch.mock.calls.map(
([, init]) => (init?.headers as Record<string, string> | undefined)?.["X-API-KEY"],
);
expect(localKeys.every((key) => key === "local-key")).toBe(true);
expect(localKeys).not.toContain("cloud-key");
});
test("degrades only the clients block when the clients endpoint fails", async () => {
mockFetch.mockImplementation(async (url) => {
const raw = String(url);
if (raw.includes("/clients")) return jsonResponse({ error: "boom" }, 500);
return routeLocal(raw) ?? jsonResponse({}, 404);
});
const summary = await createIntegration(localOnlySecrets).getUnifiOsSummaryAsync();
expect(summary.clients).toBeNull();
expect(summary.devices).toEqual({ total: 2, online: 1, offline: 1, firmwareUpdatable: 1 });
expect(summary.gateway).not.toBeNull();
});
test("degrades only the devices block when the devices endpoint fails", async () => {
mockFetch.mockImplementation(async (url) => {
const raw = String(url);
if (raw.includes("/devices") && !raw.includes("/statistics")) return jsonResponse({ error: "boom" }, 500);
return routeLocal(raw) ?? jsonResponse({}, 404);
});
const summary = await createIntegration(localOnlySecrets).getUnifiOsSummaryAsync();
expect(summary.devices).toBeNull();
expect(summary.clients).toEqual({ total: 2, wired: 1, wireless: 1, vpn: 0, guests: 0 });
});
test("keeps clients and devices when the gateway cannot be identified", async () => {
mockFetch.mockImplementation(async (url) => {
const raw = String(url);
if (raw.endsWith("/devices?limit=200")) {
return jsonResponse(
page([
{
id: "sw",
name: "Switch",
model: "USW Lite 8",
macAddress: "aa:bb:cc:99:88:77",
state: "ONLINE",
firmwareUpdatable: false,
features: ["switching"],
},
]),
);
}
return routeLocal(raw) ?? jsonResponse({}, 404);
});
const summary = await createIntegration(localOnlySecrets).getUnifiOsSummaryAsync();
expect(summary.gateway).toBeNull();
expect(summary.wan.throughput).toBeNull();
expect(summary.wan.state).toBe("unknown");
expect(summary.clients).toEqual({ total: 2, wired: 1, wireless: 1, vpn: 0, guests: 0 });
});
});
@@ -0,0 +1,182 @@
// @vitest-environment node
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import type { UnifiOsClient, UnifiOsDevice } from "../unifi-os-types";
import {
countClients,
findGateway,
matchCloudSite,
normalizeMacAddress,
summarizeDevices,
unifiOsClientSchema,
} from "../unifi-os-types";
const client = (type: string, accessType = "DEFAULT"): UnifiOsClient => ({
id: `client-${type}-${accessType}-${Math.random()}`,
name: "client",
type,
access: { type: accessType },
});
const device = (overrides: Partial<UnifiOsDevice> = {}): UnifiOsDevice => ({
id: "device-1",
name: "device",
model: "USW Lite 8",
macAddress: "aa:bb:cc:11:22:33",
state: "ONLINE",
firmwareUpdatable: false,
features: ["switching"],
...overrides,
});
describe("normalizeMacAddress", () => {
test("lowercases and strips separators so both APIs compare equal", () => {
expect(normalizeMacAddress("AA:BB:CC:11:22:33")).toBe("aabbcc112233");
expect(normalizeMacAddress("aa-bb-cc-11-22-33")).toBe("aabbcc112233");
expect(normalizeMacAddress("AABBCC112233")).toBe("aabbcc112233");
});
});
describe("countClients", () => {
test("counts each connection type separately", () => {
const counts = countClients([
client("WIRED"),
client("WIRED"),
client("WIRELESS"),
client("VPN"),
client("TELEPORT"),
]);
expect(counts).toEqual({ total: 5, wired: 2, wireless: 1, vpn: 2, guests: 0 });
});
test("folds TELEPORT into vpn because both are remote access", () => {
expect(countClients([client("TELEPORT")]).vpn).toBe(1);
});
test("counts guests across every connection type", () => {
const counts = countClients([client("WIRELESS", "GUEST"), client("WIRED", "GUEST"), client("WIRED")]);
expect(counts.guests).toBe(2);
expect(counts.wired).toBe(2);
});
test("treats an unknown connection type as counted but unclassified", () => {
const counts = countClients([client("SOMETHING_NEW")]);
expect(counts.total).toBe(1);
expect(counts.wired + counts.wireless + counts.vpn).toBe(0);
});
test("tolerates a client without an access block", () => {
const counts = countClients([{ id: "x", name: "x", type: "WIRED" }]);
expect(counts).toEqual({ total: 1, wired: 1, wireless: 0, vpn: 0, guests: 0 });
});
});
describe("summarizeDevices", () => {
test("splits online from everything else and counts pending firmware", () => {
const counts = summarizeDevices([
device({ id: "a", state: "ONLINE", firmwareUpdatable: true }),
device({ id: "b", state: "OFFLINE" }),
device({ id: "c", state: "UPDATING", firmwareUpdatable: true }),
]);
expect(counts).toEqual({ total: 3, online: 1, offline: 2, firmwareUpdatable: 2 });
});
test("returns zeroes for an empty site rather than throwing", () => {
expect(summarizeDevices([])).toEqual({ total: 0, online: 0, offline: 0, firmwareUpdatable: 0 });
});
});
describe("findGateway", () => {
test("prefers the device advertising the gateway feature", () => {
const gateway = device({ id: "gw", features: ["gateway"], model: "UXG Pro" });
expect(findGateway([device(), gateway])?.id).toBe("gw");
});
test("falls back to a gateway-looking model when features are empty", () => {
const gateway = device({ id: "gw", features: [], model: "Gateway Pro" });
expect(findGateway([device(), gateway])?.id).toBe("gw");
});
test("returns null when no gateway is present instead of picking any device", () => {
expect(findGateway([device()])).toBeNull();
});
});
describe("matchCloudSite", () => {
const siteA = { siteId: "a", meta: { gatewayMac: "AA:BB:CC:11:22:33" } };
const siteB = { siteId: "b", meta: { gatewayMac: "dd:ee:ff:44:55:66" } };
test("matches on the gateway MAC regardless of formatting", () => {
expect(matchCloudSite("aa-bb-cc-11-22-33", [siteB, siteA])?.siteId).toBe("a");
});
test("returns null rather than another account site when nothing matches", () => {
expect(matchCloudSite("11:22:33:44:55:66", [siteA, siteB])).toBeNull();
});
test("returns null when the local gateway is unknown", () => {
expect(matchCloudSite(null, [siteA, siteB])).toBeNull();
});
// `normalizeMacAddress` réduit "", "unknown" et "null" à la même chaîne vide.
// Sans garde, ces valeurs se correspondraient entre elles et le widget
// afficherait le réseau d'un autre compte comme celui de l'utilisateur.
test("returns null when the local MAC normalizes to nothing", () => {
const placeholder = { siteId: "placeholder", meta: { gatewayMac: "unknown" } };
for (const localMac of ["", "unknown", "null"]) {
expect(matchCloudSite(localMac, [placeholder, siteA, siteB])).toBeNull();
}
});
test("skips cloud sites whose gateway MAC normalizes to nothing", () => {
const placeholder = { siteId: "placeholder", meta: { gatewayMac: "unknown" } };
expect(matchCloudSite("aa:bb:cc:11:22:33", [placeholder, siteA])?.siteId).toBe("a");
expect(matchCloudSite("11:22:33:44:55:66", [placeholder])).toBeNull();
});
});
describe("client-safety", () => {
// `unifi-os-types.ts` is re-exported by `packages/integrations/src/types.ts`,
// which client components import (e.g. via the spotlight search group). An
// import of `@homarr/common/server` here drags `ioredis` — and transitively
// Node's `dns` module — into the browser bundle and breaks `pnpm dev`/build.
// Only a source-text check catches this: a type-only "does it compile" check
// would not, since the breakage is a bundler resolution failure, not a type
// error. This regression guard is what would have caught the original bug.
test("does not import @homarr/common/server", () => {
const path = fileURLToPath(new URL("../unifi-os-types.ts", import.meta.url));
const source = readFileSync(path, "utf-8");
expect(source).not.toContain("@homarr/common/server");
});
});
describe("unifiOsClientSchema", () => {
test("keeps fields the published OpenAPI does not document", () => {
const parsed = unifiOsClientSchema.parse({
id: "1",
name: "n",
type: "WIRED",
access: { type: "DEFAULT" },
macAddress: "aa:bb:cc:11:22:33",
uplinkDeviceId: "u1",
});
expect(parsed).toMatchObject({ macAddress: "aa:bb:cc:11:22:33", uplinkDeviceId: "u1" });
});
});
@@ -0,0 +1,201 @@
// @vitest-environment node
import { Response, type RequestInit } from "undici";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import { UnifiSmApi } from "../unifi-sm-api";
const GATEWAY_MAC = "aa:bb:cc:11:22:33";
const OTHER_MAC = "dd:ee:ff:44:55:66";
const jsonResponse = (body: unknown, status = 200) =>
new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } }) as never;
const sitesBody = {
data: [
{
siteId: "mine",
meta: { desc: "Mine", gatewayMac: GATEWAY_MAC },
statistics: { wans: { WAN: { externalIp: "203.0.113.10" } } },
},
{ siteId: "theirs", meta: { desc: "Theirs", gatewayMac: OTHER_MAC } },
],
};
const metricsBody = (metricTime: string) => ({
data: {
metrics: [
{
periods: [
{
metricTime: "2026-09-08T08:00:00Z",
data: { wan: { avgLatency: 99, maxLatency: 99, packetLoss: 5, uptime: 90, ispName: "Old" } },
},
{
metricTime,
data: { wan: { avgLatency: 11, maxLatency: 12, packetLoss: 0, uptime: 100, ispName: "Example ISP" } },
},
],
},
],
},
});
const createApi = () => {
const fetchAsync = vi.fn(async (url: string, _init?: RequestInit) =>
url.includes("isp-metrics") ? jsonResponse(metricsBody("2026-09-08T09:10:00Z")) : jsonResponse(sitesBody),
);
return { api: new UnifiSmApi("cloud-key", fetchAsync as never), fetchAsync };
};
beforeEach(() => {
UnifiSmApi.clearCache();
vi.useFakeTimers();
vi.setSystemTime(new Date("2026-09-08T09:37:00Z"));
});
afterEach(() => {
vi.useRealTimers();
});
describe("UnifiSmApi getIspMetricsAsync", () => {
test("returns the newest period of the site matching the gateway MAC", async () => {
const { api } = createApi();
const metrics = await api.getIspMetricsAsync(GATEWAY_MAC);
expect(metrics).toEqual({
name: "Example ISP",
externalIp: "203.0.113.10",
latencyMs: 11,
maxLatencyMs: 12,
packetLossPct: 0,
uptimePct: 100,
measuredAt: new Date("2026-09-08T09:10:00Z"),
});
});
test("returns the newest period by metricTime even when periods arrive out of order", async () => {
const fetchAsync = vi.fn(async (url: string, _init?: RequestInit) => {
if (!url.includes("isp-metrics")) return jsonResponse(sitesBody);
return jsonResponse({
data: {
metrics: [
{
periods: [
{
metricTime: "2026-09-08T09:10:00Z",
data: {
wan: { avgLatency: 11, maxLatency: 12, packetLoss: 0, uptime: 100, ispName: "Example ISP" },
},
},
{
metricTime: "2026-09-08T08:00:00Z",
data: { wan: { avgLatency: 99, maxLatency: 99, packetLoss: 5, uptime: 90, ispName: "Old" } },
},
],
},
],
},
});
});
const api = new UnifiSmApi("cloud-key", fetchAsync as never);
const metrics = await api.getIspMetricsAsync(GATEWAY_MAC);
expect(metrics?.latencyMs).toBe(11);
expect(metrics?.measuredAt).toEqual(new Date("2026-09-08T09:10:00Z"));
});
// Ubiquiti omet la latence pour les périodes où le WAN était coupé. Un `0`
// fabriqué s'afficherait comme « 0 ms » au pire moment possible.
test("passes missing cloud measurements through as null instead of zero", async () => {
const fetchAsync = vi.fn(async (url: string, _init?: RequestInit) => {
if (!url.includes("isp-metrics")) return jsonResponse(sitesBody);
return jsonResponse({
data: {
metrics: [
{
periods: [{ metricTime: "2026-09-08T09:10:00Z", data: { wan: { ispName: "Example ISP" } } }],
},
],
},
});
});
const api = new UnifiSmApi("cloud-key", fetchAsync as never);
const metrics = await api.getIspMetricsAsync(GATEWAY_MAC);
expect(metrics).toMatchObject({
latencyMs: null,
maxLatencyMs: null,
packetLossPct: null,
uptimePct: null,
});
});
test("returns null when no cloud site matches, never another account site", async () => {
const { api } = createApi();
expect(await api.getIspMetricsAsync("11:22:33:44:55:66")).toBeNull();
});
test("returns null when the local gateway could not be identified", async () => {
const { api, fetchAsync } = createApi();
expect(await api.getIspMetricsAsync(null)).toBeNull();
expect(fetchAsync).not.toHaveBeenCalled();
});
test("queries a window wide enough for the cloud lag", async () => {
const { api, fetchAsync } = createApi();
await api.getIspMetricsAsync(GATEWAY_MAC);
const body = JSON.parse(
String(fetchAsync.mock.calls.find(([url]) => String(url).includes("isp-metrics"))?.[1]?.body),
);
const begin = new Date(body.sites[0].beginTimestamp).getTime();
const end = new Date(body.sites[0].endTimestamp).getTime();
// Une fenêtre de 15 min renvoie un tableau vide sur l'API réelle.
expect(end - begin).toBeGreaterThanOrEqual(3 * 60 * 60 * 1000);
});
test("serves a second call from cache instead of hitting the cloud again", async () => {
const { api, fetchAsync } = createApi();
await api.getIspMetricsAsync(GATEWAY_MAC);
const callsAfterFirst = fetchAsync.mock.calls.length;
await api.getIspMetricsAsync(GATEWAY_MAC);
expect(fetchAsync.mock.calls.length).toBe(callsAfterFirst);
});
test("refetches once the cache entry has expired", async () => {
const { api, fetchAsync } = createApi();
await api.getIspMetricsAsync(GATEWAY_MAC);
const callsAfterFirst = fetchAsync.mock.calls.length;
vi.setSystemTime(new Date("2026-09-08T09:43:00Z"));
await api.getIspMetricsAsync(GATEWAY_MAC);
expect(fetchAsync.mock.calls.length).toBeGreaterThan(callsAfterFirst);
});
test("returns null when the cloud rejects the key rather than propagating", async () => {
const fetchAsync = vi.fn(async (_url: string, _init?: RequestInit) =>
jsonResponse({ message: "unauthorized" }, 401),
);
const api = new UnifiSmApi("bad-key", fetchAsync as never);
expect(await api.getIspMetricsAsync(GATEWAY_MAC)).toBeNull();
});
});
@@ -0,0 +1,118 @@
import { ResponseError } from "@homarr/common/server";
import type { RequestInit, Response } from "undici";
import type { z } from "zod/v4";
import { parseUnifiOsAsync } from "./unifi-os-parse";
import type { UnifiOsClientCounts, UnifiOsDevice, UnifiOsDeviceStatistics, UnifiOsSite } from "./unifi-os-types";
import {
countClients,
createUnifiOsPageSchema,
unifiOsClientSchema,
unifiOsDeviceSchema,
unifiOsDeviceStatisticsSchema,
unifiOsInfoSchema,
unifiOsSiteSchema,
} from "./unifi-os-types";
/**
* Déclaré sur les types d'undici, pas sur ceux du DOM : le dépôt n'utilise que
* `undici` côté serveur. Aligner les deux évite les `as unknown as` qui
* désactivaient le contrôle de type à la frontière du transport.
*/
export type UnifiOsFetch = (url: string, init?: RequestInit & { timeout?: number }) => Promise<Response>;
const INTEGRATION_PATH = "/proxy/network/integration/v1";
const REQUEST_TIMEOUT_MS = 10_000;
/** Plafond imposé par l'API : demander davantage renvoie quand même 200. */
const MAX_PAGE_LIMIT = 200;
const PARSE_ERROR_MESSAGE = "Invalid UniFi OS response";
const clientPageSchema = createUnifiOsPageSchema(unifiOsClientSchema);
const devicePageSchema = createUnifiOsPageSchema(unifiOsDeviceSchema);
const sitePageSchema = createUnifiOsPageSchema(unifiOsSiteSchema);
/**
* Client de l'API d'intégration locale d'UniFi OS.
*
* Ne connaît ni Homarr ni la notion d'intégration : il ne sait que parler à une
* console. Le `fetch` est injecté pour que les tests n'aient pas à mocker un module.
*/
export class UnifiOsApi {
private readonly baseUrl: string;
constructor(
origin: string,
private readonly apiKey: string,
private readonly fetchAsync: UnifiOsFetch,
) {
this.baseUrl = `${origin.replace(/\/+$/, "")}${INTEGRATION_PATH}`;
}
public async getInfoAsync(): Promise<{ applicationVersion: string }> {
return await this.requestAsync("/info", unifiOsInfoSchema);
}
public async getFirstSiteAsync(): Promise<UnifiOsSite | null> {
const page = await this.requestAsync("/sites", sitePageSchema);
return page.data[0] ?? null;
}
public async getDevicesAsync(siteId: string): Promise<UnifiOsDevice[]> {
const page = await this.requestAsync(
`/sites/${encodeURIComponent(siteId)}/devices?limit=${MAX_PAGE_LIMIT}`,
devicePageSchema,
);
return page.data;
}
public async getDeviceStatisticsAsync(siteId: string, deviceId: string): Promise<UnifiOsDeviceStatistics> {
return await this.requestAsync(
`/sites/${encodeURIComponent(siteId)}/devices/${encodeURIComponent(deviceId)}/statistics/latest`,
unifiOsDeviceStatisticsSchema,
);
}
/**
* Sous le plafond de 200 clients, une seule page suffit et le comptage se fait
* en mémoire. Au-delà, rapatrier tous les enregistrements pour n'en tirer que
* des compteurs coûterait plus cher que cinq requêtes bornées.
*/
public async getClientCountsAsync(siteId: string): Promise<UnifiOsClientCounts> {
const path = `/sites/${encodeURIComponent(siteId)}/clients`;
const firstPage = await this.requestAsync(`${path}?limit=${MAX_PAGE_LIMIT}`, clientPageSchema);
if (firstPage.totalCount <= MAX_PAGE_LIMIT) {
return countClients(firstPage.data);
}
const countByFilterAsync = async (filter: string) => {
const page = await this.requestAsync(`${path}?limit=1&filter=${encodeURIComponent(filter)}`, clientPageSchema);
return page.totalCount;
};
const [wired, wireless, vpn, teleport, guests] = await Promise.all([
countByFilterAsync("type.eq('WIRED')"),
countByFilterAsync("type.eq('WIRELESS')"),
countByFilterAsync("type.eq('VPN')"),
countByFilterAsync("type.eq('TELEPORT')"),
countByFilterAsync("access.type.eq('GUEST')"),
]);
return { total: firstPage.totalCount, wired, wireless, vpn: vpn + teleport, guests };
}
private async requestAsync<TOutput>(path: string, schema: z.ZodType<TOutput>): Promise<TOutput> {
const response = await this.fetchAsync(`${this.baseUrl}${path}`, {
headers: { "X-API-KEY": this.apiKey, Accept: "application/json" },
timeout: REQUEST_TIMEOUT_MS,
});
if (!response.ok) {
throw new ResponseError(response);
}
return await parseUnifiOsAsync(await response.json(), schema, PARSE_ERROR_MESSAGE);
}
}
@@ -0,0 +1,137 @@
import { fetch as platformFetch } from "undici";
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
import type { IntegrationTestingInput } from "../base/integration";
import { Integration } from "../base/integration";
import { TestConnectionError } from "../base/test-connection/test-connection-error";
import type { TestingResult } from "../base/test-connection/test-connection-service";
import type { UnifiOsSummaryIntegration } from "../interfaces/unifi-os-summary/unifi-os-summary-integration";
import type { UnifiOsFetch } from "./unifi-os-api";
import { UnifiOsApi } from "./unifi-os-api";
import { UnifiSmApi } from "./unifi-sm-api";
import type { UnifiOsDeviceStatistics, UnifiOsSummary } from "./unifi-os-types";
import { findGateway, summarizeDevices } from "./unifi-os-types";
/**
* Transport du cloud Site Manager (§5.3).
*
* `fetchWithTrustedCertificatesAsync` ajoute **toutes** les autorités
* personnalisées téléversées par l'administrateur Homarr, et installe un
* `checkServerIdentity` qui saute la vérification du nom d'hôte pour les
* empreintes épinglées. Une autorité ajoutée pour faire accepter le certificat
* auto-signé de la console deviendrait alors une ancre de confiance valable
* pour `api.ui.com` aussi : son détenteur pourrait intercepter l'appel cloud et
* récupérer la clé Site Manager, qui lit tous les sites du compte Ubiquiti.
*
* `api.ui.com` présente un certificat public ordinaire : le `fetch` de la
* plateforme suffit, et c'est le seul qui soit sûr ici. Le `timeout` du client
* est traduit en `AbortSignal`, `fetch` ne connaissant pas cette option.
*/
const fetchCloudAsync: UnifiOsFetch = async (url, init) => {
const { timeout, ...requestInit } = init ?? {};
return await platformFetch(url, {
...requestInit,
...(timeout === undefined ? {} : { signal: AbortSignal.timeout(timeout) }),
});
};
export class UnifiOsIntegration extends Integration implements UnifiOsSummaryIntegration {
public async getUnifiOsSummaryAsync(): Promise<UnifiOsSummary> {
return await this.buildSummaryAsync(fetchWithTrustedCertificatesAsync);
}
protected async testingAsync({ fetchAsync }: IntegrationTestingInput): Promise<TestingResult> {
const api = this.createLocalApi(fetchAsync);
try {
await api.getInfoAsync();
} catch (error) {
return TestConnectionError.UnknownResult(error);
}
const site = await api.getFirstSiteAsync();
if (site === null) {
// Une clé valide sur une console sans site est configurable mais inutile :
// mieux vaut le dire au moment du test que laisser un widget vide.
return TestConnectionError.UnknownResult(new Error("The UniFi OS console exposes no site"));
}
return { success: true };
}
private createLocalApi(fetchAsync: UnifiOsFetch) {
return new UnifiOsApi(this.integration.url, this.getSecretValue("apiKey"), fetchAsync);
}
private async buildSummaryAsync(fetchAsync: UnifiOsFetch): Promise<UnifiOsSummary> {
const api = this.createLocalApi(fetchAsync);
const [info, site] = await Promise.all([api.getInfoAsync(), api.getFirstSiteAsync()]);
if (site === null) {
throw new Error("The UniFi OS console exposes no site");
}
const [clientsResult, devicesResult] = await Promise.allSettled([
api.getClientCountsAsync(site.id),
api.getDevicesAsync(site.id),
]);
// `null` marks a failed call so the UI never mistakes it for a real zero
// count (a site with genuinely no clients or devices).
const clients = clientsResult.status === "fulfilled" ? clientsResult.value : null;
const devices = devicesResult.status === "fulfilled" ? devicesResult.value : [];
const gatewayDevice = findGateway(devices);
// Les statistiques dépendent du gateway : sans gateway identifié, il n'y a
// rien à demander. Un échec ici ne doit vider que le débit et l'uptime.
let statistics: UnifiOsDeviceStatistics | null = null;
if (gatewayDevice !== null) {
try {
statistics = await api.getDeviceStatisticsAsync(site.id, gatewayDevice.id);
} catch {
statistics = null;
}
}
const isp = await this.readIspMetricsAsync(gatewayDevice?.macAddress ?? null);
return {
site: { id: site.id, name: site.name, applicationVersion: info.applicationVersion },
wan: {
state: gatewayDevice === null ? "unknown" : gatewayDevice.state === "ONLINE" ? "online" : "offline",
throughput:
statistics?.uplink === undefined
? null
: { txBps: statistics.uplink.txRateBps, rxBps: statistics.uplink.rxRateBps },
isp,
},
clients,
devices: devicesResult.status === "fulfilled" ? summarizeDevices(devices) : null,
gateway:
gatewayDevice === null
? null
: {
name: gatewayDevice.name,
model: gatewayDevice.model,
macAddress: gatewayDevice.macAddress,
uptimeSec: statistics?.uptimeSec ?? null,
cpuPct: statistics?.cpuUtilizationPct ?? null,
memoryPct: statistics?.memoryUtilizationPct ?? null,
},
};
}
/**
* Le cloud n'est jamais interrogé sans clé configurée : le module n'est même
* pas instancié, ce qui rend impossible un appel réseau accidentel. Il reçoit
* `fetchCloudAsync`, jamais le transport à certificats de confiance du local.
*/
private async readIspMetricsAsync(gatewayMac: string | null) {
if (!this.hasSecretValue("siteManagerApiKey")) return null;
const smApi = new UnifiSmApi(this.getSecretValue("siteManagerApiKey"), fetchCloudAsync);
return await smApi.getIspMetricsAsync(gatewayMac);
}
}
@@ -0,0 +1,20 @@
import { ParseError } from "@homarr/common/server";
import type { z } from "zod/v4";
/**
* Server-only: pulled out of `unifi-os-types.ts` because `ParseError` comes
* from `@homarr/common/server`, which drags in `ioredis` and Node's `dns`.
* `unifi-os-types.ts` is re-exported by `packages/integrations/src/types.ts`,
* which client components import, so it must stay free of server-only code.
*/
export const parseUnifiOsAsync = async <TOutput>(
value: unknown,
schema: z.ZodType<TOutput>,
message: string,
): Promise<TOutput> => {
const result = await schema.safeParseAsync(value);
if (!result.success) {
throw new ParseError(message, { cause: result.error });
}
return result.data;
};
@@ -0,0 +1,228 @@
import { z } from "zod/v4";
/**
* Ubiquiti ne publie l'OpenAPI que pour la 10.4.57 alors que les consoles sont
* en 10.6.x et renvoient déjà des champs absents du spec. Tous les objets sont
* donc « loose » : un champ inattendu ne doit jamais faire échouer un widget.
*/
export const unifiOsInfoSchema = z.looseObject({
applicationVersion: z.string(),
});
export const unifiOsSiteSchema = z.looseObject({
id: z.string(),
name: z.string(),
internalReference: z.string().optional(),
});
export const unifiOsClientSchema = z.looseObject({
id: z.string(),
name: z.string(),
type: z.string(),
access: z.looseObject({ type: z.string() }).optional(),
});
export const unifiOsDeviceSchema = z.looseObject({
id: z.string(),
name: z.string(),
model: z.string(),
macAddress: z.string(),
state: z.string(),
firmwareUpdatable: z.boolean().optional(),
features: z.array(z.string()).default([]),
});
export const unifiOsDeviceStatisticsSchema = z.looseObject({
uptimeSec: z.number().optional(),
cpuUtilizationPct: z.number().optional(),
memoryUtilizationPct: z.number().optional(),
uplink: z.looseObject({ txRateBps: z.number(), rxRateBps: z.number() }).optional(),
});
/** Enveloppe de pagination commune à tous les endpoints de liste. */
export const createUnifiOsPageSchema = <TItem extends z.ZodType>(item: TItem) =>
z.looseObject({
offset: z.number(),
limit: z.number(),
count: z.number(),
totalCount: z.number(),
data: z.array(item),
});
export const unifiSmSiteSchema = z.looseObject({
siteId: z.string(),
hostId: z.string().optional(),
meta: z.looseObject({
desc: z.string().optional(),
name: z.string().optional(),
gatewayMac: z.string().optional(),
}),
statistics: z
.looseObject({
ispInfo: z.looseObject({ name: z.string().optional() }).optional(),
percentages: z.looseObject({ wanUptime: z.number().optional() }).optional(),
wans: z.record(z.string(), z.looseObject({ externalIp: z.string().optional() })).optional(),
})
.optional(),
});
const unifiSmWanMetricsSchema = z.looseObject({
avgLatency: z.number().optional(),
maxLatency: z.number().optional(),
packetLoss: z.number().optional(),
uptime: z.number().optional(),
ispName: z.string().optional(),
});
export const unifiSmIspMetricsResponseSchema = z.looseObject({
data: z.looseObject({
metrics: z.array(
z.looseObject({
periods: z.array(
z.looseObject({
metricTime: z.string(),
data: z.looseObject({ wan: unifiSmWanMetricsSchema.optional() }),
}),
),
}),
),
}),
});
export type UnifiOsClient = z.infer<typeof unifiOsClientSchema>;
export type UnifiOsDevice = z.infer<typeof unifiOsDeviceSchema>;
export type UnifiOsSite = z.infer<typeof unifiOsSiteSchema>;
export type UnifiOsDeviceStatistics = z.infer<typeof unifiOsDeviceStatisticsSchema>;
export interface UnifiOsClientCounts {
total: number;
wired: number;
wireless: number;
vpn: number;
guests: number;
}
export interface UnifiOsDeviceCounts {
total: number;
online: number;
offline: number;
firmwareUpdatable: number;
}
export interface UnifiOsGateway {
name: string;
model: string;
macAddress: string;
uptimeSec: number | null;
cpuPct: number | null;
memoryPct: number | null;
}
export interface UnifiOsIspMetrics {
name: string;
externalIp: string | null;
/** Nullables : le cloud omet ces mesures pour les périodes où le WAN
* était coupé. Un `0` fabriqué s'afficherait comme « 0 ms » à côté d'un
* voyant vert, au moment précis où la connexion est tombée. */
latencyMs: number | null;
maxLatencyMs: number | null;
packetLossPct: number | null;
uptimePct: number | null;
/** Horodatage de la mesure : la donnée cloud accuse ~27 min de retard. */
measuredAt: Date;
}
export interface UnifiOsSummary {
site: {
id: string;
name: string;
applicationVersion: string;
};
wan: {
state: "online" | "offline" | "unknown";
throughput: { txBps: number; rxBps: number } | null;
isp: UnifiOsIspMetrics | null;
};
/** `null` when the call failed — never a zero count, which the UI could not
* tell apart from a site with genuinely no clients. */
clients: UnifiOsClientCounts | null;
/** `null` when the call failed, for the same reason. */
devices: UnifiOsDeviceCounts | null;
gateway: UnifiOsGateway | null;
}
/**
* L'API locale renvoie `aa:bb:cc:11:22:33`, le cloud peut renvoyer une autre
* casse ou d'autres séparateurs. La comparaison se fait sur une forme canonique.
*/
export const normalizeMacAddress = (mac: string): string => mac.toLowerCase().replace(/[^0-9a-f]/g, "");
const VPN_CLIENT_TYPES = new Set(["VPN", "TELEPORT"]);
export const countClients = (clients: UnifiOsClient[]): UnifiOsClientCounts => {
const counts: UnifiOsClientCounts = { total: 0, wired: 0, wireless: 0, vpn: 0, guests: 0 };
for (const client of clients) {
counts.total += 1;
if (client.type === "WIRED") counts.wired += 1;
else if (client.type === "WIRELESS") counts.wireless += 1;
else if (VPN_CLIENT_TYPES.has(client.type)) counts.vpn += 1;
if (client.access?.type === "GUEST") counts.guests += 1;
}
return counts;
};
export const summarizeDevices = (devices: UnifiOsDevice[]): UnifiOsDeviceCounts => {
const online = devices.filter((device) => device.state === "ONLINE").length;
return {
total: devices.length,
online,
// Tout ce qui n'est pas ONLINE est indisponible du point de vue du dashboard,
// qu'il s'agisse d'OFFLINE, d'UPDATING ou d'un état futur inconnu.
offline: devices.length - online,
firmwareUpdatable: devices.filter((device) => device.firmwareUpdatable === true).length,
};
};
const GATEWAY_MODEL_HINT = /gateway|udm|uxg|ucg|usg/i;
export const findGateway = (devices: UnifiOsDevice[]): UnifiOsDevice | null =>
devices.find((device) => device.features.includes("gateway")) ??
devices.find((device) => GATEWAY_MODEL_HINT.test(device.model)) ??
null;
/**
* Une clé Site Manager voit tous les sites du compte, y compris ceux d'autres
* consoles. Sans correspondance stricte sur le MAC du gateway, on afficherait
* la latence d'un autre réseau. Renvoyer null est le seul comportement sûr.
*
* `normalizeMacAddress` retire tout caractère hors `[0-9a-f]` : `""`,
* `"unknown"` et `"null"` se réduisent donc à la même chaîne vide. Sans les deux
* gardes ci-dessous, un gateway local sans MAC exploitable correspondrait à
* n'importe quel site cloud dont le `gatewayMac` est un marqueur de la même
* forme — et le widget afficherait le FAI, l'IP publique et la latence du réseau
* d'un voisin de compte comme s'ils étaient ceux de l'utilisateur.
*/
export const matchCloudSite = <TSite extends { meta: { gatewayMac?: string } }>(
gatewayMac: string | null,
sites: TSite[],
): TSite | null => {
if (gatewayMac === null) return null;
const normalized = normalizeMacAddress(gatewayMac);
if (normalized === "") return null;
return (
sites.find((site) => {
if (site.meta.gatewayMac === undefined) return false;
const candidate = normalizeMacAddress(site.meta.gatewayMac);
return candidate !== "" && candidate === normalized;
}) ?? null
);
};
@@ -0,0 +1,139 @@
import { createLogger } from "@homarr/core/infrastructure/logs";
import type { UnifiOsFetch } from "./unifi-os-api";
import { parseUnifiOsAsync } from "./unifi-os-parse";
import type { UnifiOsIspMetrics } from "./unifi-os-types";
import { matchCloudSite, unifiSmIspMetricsResponseSchema, unifiSmSiteSchema } from "./unifi-os-types";
import { z } from "zod/v4";
const logger = createLogger({ module: "unifiSmApi" });
const BASE_URL = "https://api.ui.com";
const REQUEST_TIMEOUT_MS = 15_000;
/**
* Les métriques cloud sont agrégées par tranches de 5 min et publiées avec un
* retard mesuré d'environ 27 min. Les rafraîchir plus souvent que le cache
* n'apporterait aucune donnée nouvelle et rapprocherait d'une limitation de débit.
*/
const CACHE_TTL_MS = 5 * 60 * 1000;
/** Une fenêtre de 15 min renvoie un tableau vide sur l'API réelle ; 3 h fonctionne. */
const QUERY_WINDOW_MS = 3 * 60 * 60 * 1000;
const siteListSchema = z.looseObject({ data: z.array(unifiSmSiteSchema) });
interface CacheEntry {
expiresAt: number;
value: UnifiOsIspMetrics | null;
}
/**
* Client de l'API cloud Site Manager. Entièrement optionnel : il n'est instancié
* que lorsqu'une clé Site Manager est configurée.
*
* Toute erreur est absorbée et convertie en `null`. Le cloud est un enrichissement ;
* son indisponibilité ne doit jamais faire tomber le widget.
*/
export class UnifiSmApi {
private static readonly cache = new Map<string, CacheEntry>();
constructor(
private readonly apiKey: string,
private readonly fetchAsync: UnifiOsFetch,
) {}
/** Réservé aux tests : le cache est statique et survivrait d'un cas à l'autre. */
public static clearCache(): void {
UnifiSmApi.cache.clear();
}
public async getIspMetricsAsync(gatewayMac: string | null): Promise<UnifiOsIspMetrics | null> {
if (gatewayMac === null) return null;
const cached = UnifiSmApi.cache.get(gatewayMac);
if (cached !== undefined && cached.expiresAt > Date.now()) {
return cached.value;
}
let value: UnifiOsIspMetrics | null = null;
try {
value = await this.fetchIspMetricsAsync(gatewayMac);
} catch (error) {
logger.warn("Failed to read UniFi Site Manager metrics", { error });
}
UnifiSmApi.cache.set(gatewayMac, { expiresAt: Date.now() + CACHE_TTL_MS, value });
return value;
}
private async fetchIspMetricsAsync(gatewayMac: string): Promise<UnifiOsIspMetrics | null> {
const sitesResponse = await this.fetchAsync(`${BASE_URL}/v1/sites`, {
headers: { "X-API-KEY": this.apiKey, Accept: "application/json" },
timeout: REQUEST_TIMEOUT_MS,
});
if (!sitesResponse.ok) return null;
const sites = await parseUnifiOsAsync(
await sitesResponse.json(),
siteListSchema,
"Invalid Site Manager sites response",
);
const site = matchCloudSite(gatewayMac, sites.data);
if (site === null) return null;
const end = new Date();
const begin = new Date(end.getTime() - QUERY_WINDOW_MS);
const metricsResponse = await this.fetchAsync(`${BASE_URL}/v1/isp-metrics/5m/query`, {
method: "POST",
headers: { "X-API-KEY": this.apiKey, Accept: "application/json", "Content-Type": "application/json" },
timeout: REQUEST_TIMEOUT_MS,
body: JSON.stringify({
sites: [
{
hostId: site.hostId,
siteId: site.siteId,
beginTimestamp: begin.toISOString(),
endTimestamp: end.toISOString(),
},
],
}),
});
if (!metricsResponse.ok) return null;
const parsed = await parseUnifiOsAsync(
await metricsResponse.json(),
unifiSmIspMetricsResponseSchema,
"Invalid Site Manager ISP metrics response",
);
const periods = parsed.data.metrics[0]?.periods ?? [];
const latest = periods.reduce<(typeof periods)[number] | undefined>((newest, period) => {
if (newest === undefined) return period;
return new Date(period.metricTime).getTime() > new Date(newest.metricTime).getTime() ? period : newest;
}, undefined);
const wan = latest?.data.wan;
if (latest === undefined || wan === undefined) return null;
const externalIp = Object.values(site.statistics?.wans ?? {})
.map((entry) => entry.externalIp)
.find((ip) => ip !== undefined);
// Ubiquiti omet ces mesures pour les périodes où le WAN était coupé. Les
// remplacer par `0` fabriquerait un « 0 ms » rassurant à l'instant précis où
// la connexion est tombée : on laisse passer `null`, que le widget affiche
// comme une absence.
return {
name: wan.ispName ?? site.statistics?.ispInfo?.name ?? "",
externalIp: externalIp ?? null,
latencyMs: wan.avgLatency ?? null,
maxLatencyMs: wan.maxLatency ?? null,
packetLossPct: wan.packetLoss ?? null,
uptimePct: wan.uptime ?? site.statistics?.percentages?.wanUptime ?? null,
measuredAt: new Date(latest.metricTime),
};
}
}
@@ -0,0 +1,274 @@
// @vitest-environment node
/* eslint-disable @typescript-eslint/no-non-null-assertion -- Style des specs du dépôt : voir packages/integrations/test/nextcloud.spec.ts. */
import type { RequestInit } from "undici";
import { Response } from "undici";
import { describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import { ResponseError } from "@homarr/common/server";
import { MAX_SD_WAN_CONFIGS, RECENT_METRICS_WINDOW_HOURS, UnifiSiteManagerApi } from "../unifi-site-manager-api";
const API_KEY = "cloud-key";
const NOW = new Date("2026-09-09T20:00:00Z");
const jsonResponse = (body: unknown, status = 200) =>
new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } }) as never;
const createApi = (handler: (url: string, init?: RequestInit) => Promise<Response>) => {
const fetchAsync = vi.fn(async (url: string, init?: RequestInit) => await handler(url, init));
return { api: new UnifiSiteManagerApi(API_KEY, fetchAsync as never), fetchAsync };
};
describe("UnifiSiteManagerApi request shape", () => {
test("calls the cloud host and sends the API key", async () => {
const { api, fetchAsync } = createApi(async () => jsonResponse({ data: [] }));
await api.getSitesAsync();
expect(fetchAsync).toHaveBeenCalledWith(
"https://api.ui.com/v1/sites",
expect.objectContaining({ headers: expect.objectContaining({ "X-API-KEY": API_KEY }) }),
);
});
test("throws ResponseError on a non-ok status instead of parsing the body", async () => {
const { api } = createApi(async () => jsonResponse({ message: "unauthorized" }, 401));
await expect(api.getSitesAsync()).rejects.toBeInstanceOf(ResponseError);
});
});
describe("UnifiSiteManagerApi getSdWanStatusesAsync", () => {
const emptyStatus = { data: { status: { connections: [], sites: [] } } };
test("fetches the status of every configuration it lists", async () => {
const requested: string[] = [];
const { api } = createApi(async (url) => {
requested.push(url);
if (url.endsWith("/v1/sd-wan-configs")) {
return jsonResponse({
data: [
{ id: "c1", name: "First" },
{ id: "c2", name: "Second" },
],
});
}
return jsonResponse(emptyStatus);
});
const statuses = await api.getSdWanStatusesAsync();
expect(statuses.map((entry) => entry.configName)).toEqual(["First", "Second"]);
expect(requested).toContain("https://api.ui.com/v1/sd-wan-configs/c1/status");
expect(requested).toContain("https://api.ui.com/v1/sd-wan-configs/c2/status");
});
/** Sans borne, un compte à dix configurations produirait onze requêtes par cycle. */
test("stops after MAX_SD_WAN_CONFIGS configurations", async () => {
const { api, fetchAsync } = createApi(async (url) =>
url.endsWith("/v1/sd-wan-configs")
? jsonResponse({
data: Array.from({ length: 9 }, (_, index) => ({ id: `c${index}`, name: `Config ${index}` })),
})
: jsonResponse(emptyStatus),
);
const statuses = await api.getSdWanStatusesAsync();
expect(statuses).toHaveLength(MAX_SD_WAN_CONFIGS);
expect(fetchAsync).toHaveBeenCalledTimes(MAX_SD_WAN_CONFIGS + 1);
});
test("skips a configuration whose status call fails rather than losing the others", async () => {
const { api } = createApi(async (url) => {
if (url.endsWith("/v1/sd-wan-configs")) {
return jsonResponse({
data: [
{ id: "c1", name: "First" },
{ id: "c2", name: "Second" },
],
});
}
return url.includes("/c1/") ? jsonResponse({}, 500) : jsonResponse(emptyStatus);
});
const statuses = await api.getSdWanStatusesAsync();
expect(statuses.map((entry) => entry.configName)).toEqual(["Second"]);
});
test("returns an empty list when the account has no configuration", async () => {
const { api } = createApi(async () => jsonResponse({ data: [] }));
expect(await api.getSdWanStatusesAsync()).toEqual([]);
});
});
interface IspMetricsRequestBody {
sites: { siteId: string; hostId?: string; beginTimestamp: string; endTimestamp: string }[];
}
/** Les corps envoyés, indexés par granularité — l'URL seule ne dit rien de la fenêtre. */
const collectIspMetricsRequests = (handler?: (granularity: string) => Promise<Response>) => {
const bodies = new Map<string, IspMetricsRequestBody>();
const { api, fetchAsync } = createApi(async (url, init) => {
const granularity = url.includes("/5m/") ? "5m" : "1h";
bodies.set(granularity, JSON.parse(String(init?.body)) as IspMetricsRequestBody);
return handler === undefined ? jsonResponse({ data: { metrics: [] } }) : await handler(granularity);
});
return { api, fetchAsync, bodies };
};
const spanHoursOf = (site: { beginTimestamp: string; endTimestamp: string }) =>
(new Date(site.endTimestamp).getTime() - new Date(site.beginTimestamp).getTime()) / 3_600_000;
const metricsEntry = (siteId: string, metricTimes: string[]) => ({
siteId,
periods: metricTimes.map((metricTime) => ({ metricTime, data: { wan: { downtime: 0, packetLoss: 0 } } })),
});
describe("UnifiSiteManagerApi getIspMetricsAsync", () => {
test("asks for every site in a single bounded query", async () => {
const { api, bodies } = collectIspMetricsRequests();
await api.getIspMetricsAsync(
[
{ siteId: "a", hostId: "h1" },
{ siteId: "b", hostId: "h2" },
],
NOW,
);
const hourly = bodies.get("1h");
expect(hourly!.sites).toHaveLength(2);
expect(spanHoursOf(hourly!.sites[0]!)).toBeGreaterThanOrEqual(24);
});
test("returns an empty list rather than calling the cloud when there is no site", async () => {
const { api, fetchAsync } = createApi(async () => jsonResponse({ data: { metrics: [] } }));
expect(await api.getIspMetricsAsync([], NOW)).toEqual([]);
expect(fetchAsync).not.toHaveBeenCalled();
});
/**
* La granularité horaire est en retard de près de quatre heures sur le compte
* réel : la requête à 5 minutes remplit ces heures-là, et rien qu'elles.
* Vérifier les CORPS et pas seulement les chemins — deux fenêtres identiques
* passeraient un test qui ne regarde que l'URL.
*/
test("queries both granularities, the five-minute one only over the recent hours", async () => {
const { api, fetchAsync, bodies } = collectIspMetricsRequests();
await api.getIspMetricsAsync([{ siteId: "a", hostId: "h1" }], NOW);
const requested = fetchAsync.mock.calls.map((call) => String(call[0]));
expect(requested).toContain("https://api.ui.com/v1/isp-metrics/1h/query");
expect(requested).toContain("https://api.ui.com/v1/isp-metrics/5m/query");
const hourly = bodies.get("1h")!.sites[0]!;
const recent = bodies.get("5m")!.sites[0]!;
expect(spanHoursOf(hourly)).toBe(24);
expect(spanHoursOf(recent)).toBe(RECENT_METRICS_WINDOW_HOURS);
// Même bord droit : les deux fenêtres s'arrêtent à l'instant demandé.
expect(recent.endTimestamp).toBe(hourly.endTimestamp);
expect(new Date(recent.beginTimestamp).getTime()).toBeGreaterThan(new Date(hourly.beginTimestamp).getTime());
// Le site est demandé à l'identique aux deux granularités.
expect(recent.siteId).toBe("a");
expect(recent.hostId).toBe("h1");
});
test("issues the two queries concurrently rather than one after the other", async () => {
const started: string[] = [];
let releaseHourly: (() => void) | undefined;
const { api } = collectIspMetricsRequests(async (granularity) => {
started.push(granularity);
// La requête horaire ne rend la main qu'une fois la seconde partie : en
// séquence, ce test se bloquerait au lieu de passer.
if (granularity === "1h") {
await new Promise<void>((resolve) => {
releaseHourly = resolve;
});
} else {
releaseHourly?.();
}
return jsonResponse({ data: { metrics: [] } });
});
await api.getIspMetricsAsync([{ siteId: "a" }], NOW);
expect(started).toEqual(["1h", "5m"]);
});
test("merges the periods of both granularities into one entry per site", async () => {
const { api } = collectIspMetricsRequests(async (granularity) =>
jsonResponse({
data: {
metrics: [
granularity === "1h"
? metricsEntry("a", ["2026-09-09T17:00:00Z", "2026-09-09T18:00:00Z"])
: metricsEntry("a", ["2026-09-09T19:30:00Z", "2026-09-09T19:35:00Z"]),
],
},
}),
);
const metrics = await api.getIspMetricsAsync([{ siteId: "a" }], NOW);
expect(metrics).toHaveLength(1);
expect(metrics[0]!.periods.map((period) => period.metricTime)).toEqual([
"2026-09-09T17:00:00Z",
"2026-09-09T18:00:00Z",
"2026-09-09T19:30:00Z",
"2026-09-09T19:35:00Z",
]);
});
test("keeps a site reported by only one of the two granularities", async () => {
const { api } = collectIspMetricsRequests(async (granularity) =>
jsonResponse({
data: {
metrics:
granularity === "1h"
? [metricsEntry("only-hourly", ["2026-09-09T17:00:00Z"])]
: [metricsEntry("only-recent", ["2026-09-09T19:30:00Z"])],
},
}),
);
const metrics = await api.getIspMetricsAsync([{ siteId: "only-hourly" }, { siteId: "only-recent" }], NOW);
expect(metrics.map((metric) => metric.siteId).toSorted()).toEqual(["only-hourly", "only-recent"]);
expect(metrics.find((metric) => metric.siteId === "only-recent")!.periods).toHaveLength(1);
});
/** La fraîcheur est un enrichissement : la perdre ne doit pas emporter la bande. */
test("still returns the hourly window when the five-minute query fails", async () => {
const { api } = collectIspMetricsRequests(async (granularity) =>
granularity === "5m"
? jsonResponse({ message: "rate limited" }, 429)
: jsonResponse({ data: { metrics: [metricsEntry("a", ["2026-09-09T18:00:00Z"])] } }),
);
const metrics = await api.getIspMetricsAsync([{ siteId: "a" }], NOW);
expect(metrics.map((metric) => metric.siteId)).toEqual(["a"]);
expect(metrics[0]!.periods).toHaveLength(1);
});
/** L'inverse n'est pas vrai : sans la fenêtre horaire, il n'y a pas de bande. */
test("throws when the hourly query fails, even if the five-minute one succeeded", async () => {
const { api } = collectIspMetricsRequests(async (granularity) =>
granularity === "1h"
? jsonResponse({ message: "unauthorized" }, 401)
: jsonResponse({ data: { metrics: [metricsEntry("a", ["2026-09-09T19:30:00Z"])] } }),
);
await expect(api.getIspMetricsAsync([{ siteId: "a" }], NOW)).rejects.toBeInstanceOf(ResponseError);
});
});
@@ -0,0 +1,191 @@
// @vitest-environment node
/* eslint-disable @typescript-eslint/no-non-null-assertion -- Style des specs du dépôt : voir packages/integrations/test/nextcloud.spec.ts. */
import { Response } from "undici";
import { beforeEach, describe, expect, test, vi } from "vitest";
vi.hoisted(() => {
process.env.SKIP_ENV_VALIDATION = "true";
process.env.SECRET_ENCRYPTION_KEY = "ff3f4f7ce30e870c9630de9e5d244ffa81101a24ed0dfe5f064beb53a7e684f1";
});
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
import * as undici from "undici";
import type { IntegrationTestingInput } from "../../base/integration";
import type { IntegrationSecret } from "../../base/types";
import { UnifiSiteManagerIntegration } from "../unifi-site-manager-integration";
vi.mock("undici", async (importOriginal) => ({
...(await importOriginal<typeof undici>()),
fetch: vi.fn(),
}));
// Mocked separately from `undici` on purpose: `fetchWithTrustedCertificatesAsync`
// also calls undici's `fetch` underneath, so mocking `undici` alone would
// intercept both transports and hide a regression that routes the Site
// Manager key through the trusted-certificate (admin CA bundle) transport.
vi.mock("@homarr/core/infrastructure/http", () => ({
fetchWithTrustedCertificatesAsync: vi.fn(),
}));
const mockFetch = vi.mocked(undici.fetch);
const mockTrustedFetch = vi.mocked(fetchWithTrustedCertificatesAsync);
const jsonResponse = (body: unknown, status = 200) =>
new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } }) as never;
const SITES = {
data: [
{
siteId: "site-1",
hostId: "host-1",
meta: { desc: "Example site" },
statistics: {
percentages: { wanUptime: 99.5 },
ispInfo: { name: "Example ISP" },
wans: { WAN: { externalIp: "203.0.113.10" } },
counts: { totalDevice: 6, offlineDevice: 0, pendingUpdateDevice: 1 },
},
},
],
};
const HOSTS = { data: [{ id: "host-1", reportedState: { deviceState: "updateAvailable" } }] };
const METRICS = { data: { metrics: [{ siteId: "site-1", periods: [] }] } };
const SD_WAN_CONFIGS = { data: [{ id: "config-1", name: "Example mesh" }] };
const SD_WAN_STATUS = {
data: {
status: {
connections: [
{ sites: [{ siteId: "site-1", status: { connected: true, offline: false, ping: 12, errors: [] } }] },
],
sites: [{ siteId: "site-1", errors: [], warnings: [] }],
},
},
};
const route = (url: string) => {
if (url.endsWith("/v1/sites")) return jsonResponse(SITES);
if (url.endsWith("/v1/hosts")) return jsonResponse(HOSTS);
if (url.includes("isp-metrics")) return jsonResponse(METRICS);
if (url.endsWith("/v1/sd-wan-configs")) return jsonResponse(SD_WAN_CONFIGS);
if (url.includes("/sd-wan-configs/")) return jsonResponse(SD_WAN_STATUS);
return jsonResponse({}, 404);
};
const createIntegration = () =>
new UnifiSiteManagerIntegration({
id: "test-site-manager",
name: "Test Site Manager",
url: "https://api.ui.com",
externalUrl: null,
decryptedSecrets: [{ kind: "siteManagerApiKey", value: "cloud-key" }] as IntegrationSecret[],
});
beforeEach(() => {
mockFetch.mockReset();
mockTrustedFetch.mockReset();
});
describe("UnifiSiteManagerIntegration getSiteOverviewAsync", () => {
test("builds one entry per site", async () => {
mockFetch.mockImplementation(async (url) => route(String(url)));
const overview = await createIntegration().getSiteOverviewAsync();
expect(overview.sites).toHaveLength(1);
expect(overview.sites[0]).toMatchObject({
siteId: "site-1",
name: "Example site",
ispName: "Example ISP",
consoleUpdateAvailable: true,
});
expect(overview.sites[0]!.sdWan).toMatchObject({ configName: "Example mesh", connected: true, pingMs: 12 });
});
/** /v1/sites porte la liste : sans elle il n'y a rien à afficher, pas « aucun site ». */
test("propagates a failure of the sites call", async () => {
mockFetch.mockImplementation(async (url) =>
String(url).endsWith("/v1/sites") ? jsonResponse({}, 500) : route(String(url)),
);
await expect(createIntegration().getSiteOverviewAsync()).rejects.toThrow();
});
test("keeps the sites when the hosts call fails, with console state unknown", async () => {
mockFetch.mockImplementation(async (url) =>
String(url).endsWith("/v1/hosts") ? jsonResponse({}, 500) : route(String(url)),
);
const overview = await createIntegration().getSiteOverviewAsync();
expect(overview.sites).toHaveLength(1);
expect(overview.sites[0]!.consoleUpdateAvailable).toBeNull();
});
test("keeps the sites when the metrics call fails, with the window unknown", async () => {
mockFetch.mockImplementation(async (url) =>
String(url).includes("isp-metrics") ? jsonResponse({}, 500) : route(String(url)),
);
const overview = await createIntegration().getSiteOverviewAsync();
expect(overview.sites).toHaveLength(1);
expect(overview.sites[0]!.summary.unknown).toBe(24);
});
test("keeps the sites when the SD-WAN calls fail, with sdWan null", async () => {
mockFetch.mockImplementation(async (url) =>
String(url).includes("sd-wan") ? jsonResponse({}, 500) : route(String(url)),
);
const overview = await createIntegration().getSiteOverviewAsync();
expect(overview.sites).toHaveLength(1);
expect(overview.sites[0]!.sdWan).toBeNull();
});
test("returns an empty site list for an account with no sites, without erroring", async () => {
mockFetch.mockImplementation(async (url) =>
String(url).endsWith("/v1/sites") ? jsonResponse({ data: [] }) : route(String(url)),
);
await expect(createIntegration().getSiteOverviewAsync()).resolves.toEqual({ sites: [] });
});
});
describe("UnifiSiteManagerIntegration cloud-only transport", () => {
type TestingFn = (input: IntegrationTestingInput) => Promise<{ success: boolean }>;
/**
* `testingAsync` is protected; this bypasses that at runtime the same way
* the wud/gluetun specs do, so the test can call it directly instead of
* going through the DB-backed certificate lookup in `testConnectionAsync`.
*/
const invokeTesting = (integration: UnifiSiteManagerIntegration, input: IntegrationTestingInput) => {
const testing = (integration as unknown as { testingAsync: TestingFn }).testingAsync.bind(integration);
return testing(input);
};
/**
* Regression guard for the vulnerability this integration exists to avoid:
* if a future edit makes `testingAsync` destructure and use `fetchAsync`
* from its input (as the sibling `unifi-os` integration legitimately does),
* that `fetchAsync` is built from Homarr's trusted-certificate transport —
* the one that trusts every admin-uploaded CA — and this test catches it.
*/
test("never routes the Site Manager key through the trusted-certificate transport", async () => {
mockFetch.mockImplementation(async (url) => route(String(url)));
await createIntegration().getSiteOverviewAsync();
// Stand-in for the real `input.fetchAsync`, which in production is built
// on top of `fetchWithTrustedCertificatesAsync`. If `testingAsync` used
// it, this mock would record the call.
const input = { fetchAsync: mockTrustedFetch } as unknown as IntegrationTestingInput;
const result = await invokeTesting(createIntegration(), input);
expect(result.success).toBe(true);
expect(mockTrustedFetch).not.toHaveBeenCalled();
});
});
@@ -0,0 +1,412 @@
// @vitest-environment node
/* eslint-disable @typescript-eslint/no-non-null-assertion -- Style des specs du dépôt : voir packages/integrations/test/nextcloud.spec.ts. */
import { readFileSync } from "node:fs";
import { describe, expect, test } from "vitest";
import {
buildHealthWindow,
buildSdWanIndex,
deriveHealthState,
HEALTH_WINDOW_HOURS,
mapSites,
resolveHealthWindowEnd,
summariseHealth,
} from "../unifi-site-manager-types";
const hoursBefore = (reference: Date, hours: number) => new Date(reference.getTime() - hours * 3_600_000);
const NOW = new Date("2026-09-09T20:00:00Z");
const period = (at: Date, wan: Record<string, number>) => ({
metricTime: at.toISOString(),
data: { wan },
});
describe("deriveHealthState", () => {
test("ranks an outage above packet loss", () => {
expect(deriveHealthState({ downtime: 60, packetLoss: 5 })).toBe("down");
});
test("reports packet loss as degraded", () => {
expect(deriveHealthState({ downtime: 0, packetLoss: 2 })).toBe("degraded");
});
test("reports a clean period as healthy", () => {
expect(deriveHealthState({ downtime: 0, packetLoss: 0 })).toBe("healthy");
});
/** Champs absents : le cloud les omet parfois. Absent n'est pas zéro. */
test("treats a period with no measurements as unknown", () => {
expect(deriveHealthState({})).toBe("unknown");
});
});
describe("buildHealthWindow", () => {
test("always returns one segment per hour of the window", () => {
expect(buildHealthWindow([], NOW)).toHaveLength(HEALTH_WINDOW_HOURS);
});
/**
* Le cas central. Une fenêtre de 24 h dont le cloud ne rapporte que 16 heures
* a été observée sur l'API réelle : les trous sont au milieu, pas seulement au
* début. Les peindre en vert affirmerait un bon fonctionnement jamais mesuré.
*/
test("fills hours the cloud did not report with unknown, never healthy", () => {
const window = buildHealthWindow([period(hoursBefore(NOW, 2), { downtime: 0, packetLoss: 0 })], NOW);
expect(window.filter((segment) => segment.state === "healthy")).toHaveLength(1);
expect(window.filter((segment) => segment.state === "unknown")).toHaveLength(HEALTH_WINDOW_HOURS - 1);
});
test("orders segments oldest first", () => {
const window = buildHealthWindow([], NOW);
expect(window.at(0)!.at.getTime()).toBeLessThan(window.at(-1)!.at.getTime());
});
test("ignores periods that fall outside the window", () => {
const window = buildHealthWindow([period(hoursBefore(NOW, 100), { downtime: 0, packetLoss: 0 })], NOW);
expect(window.every((segment) => segment.state === "unknown")).toBe(true);
});
test("keeps the worst state when several readings share an hour", () => {
const at = hoursBefore(NOW, 3);
const window = buildHealthWindow(
[period(at, { downtime: 0, packetLoss: 0 }), period(at, { downtime: 30, packetLoss: 0 })],
NOW,
);
expect(window.filter((segment) => segment.state === "down")).toHaveLength(1);
});
/**
* Ce qu'affirme la fusion des deux granularités du côté de l'API : les points
* de 5 minutes n'ont besoin d'aucun traitement propre. Douze points d'une même
* heure se replient sur UNE tranche, et le pire l'emporte — une coupure de
* cinq minutes ne se dilue pas dans onze relevés sains.
*/
test("collapses five-minute points onto the hour they belong to, worst first", () => {
const hour = hoursBefore(NOW, 1);
const fiveMinutePoints = Array.from({ length: 12 }, (_, index) =>
period(
new Date(hour.getTime() + index * 300_000),
index === 7 ? { downtime: 30 } : { downtime: 0, packetLoss: 0 },
),
);
const window = buildHealthWindow(fiveMinutePoints, NOW);
expect(window.filter((segment) => segment.state !== "unknown")).toHaveLength(1);
expect(window.filter((segment) => segment.state === "down")).toHaveLength(1);
});
});
/**
* Les métriques ISP du cloud arrivent avec 25 à 35 minutes de retard (mesuré sur
* le compte réel) : l'heure courante n'est pas encore mesurée. Une fenêtre
* finissant sur elle réservait donc sa dernière tranche à du gris permanent
* pendant la première moitié de chaque heure.
*/
describe("resolveHealthWindowEnd", () => {
test("ends on the freshest reported period instead of the wall clock", () => {
const freshest = hoursBefore(NOW, 1);
const end = resolveHealthWindowEnd(
[{ siteId: "site-1", periods: [period(hoursBefore(NOW, 3), {}), period(freshest, {})] }],
NOW,
);
expect(end.getTime()).toBe(freshest.getTime());
});
/**
* Le maximum est GLOBAL. Les lignes du tableau se lisent heure contre heure :
* une fin propre à chaque site ferait glisser sa fenêtre par rapport à celles
* de ses voisines, et la colonne cesserait de désigner la même heure.
*/
test("takes the maximum across every site rather than per site", () => {
const freshest = hoursBefore(NOW, 1);
const end = resolveHealthWindowEnd(
[
{ siteId: "site-1", periods: [period(hoursBefore(NOW, 6), {})] },
{ siteId: "site-2", periods: [period(freshest, {})] },
],
NOW,
);
expect(end.getTime()).toBe(freshest.getTime());
});
test("falls back to the current time when no site reported any period", () => {
expect(resolveHealthWindowEnd([], NOW)).toBe(NOW);
expect(resolveHealthWindowEnd([{ siteId: "site-1", periods: [] }], NOW)).toBe(NOW);
});
});
describe("summariseHealth", () => {
test("counts hours per state so the bar is readable without colour", () => {
const summary = summariseHealth([
{ at: NOW, state: "healthy" },
{ at: NOW, state: "healthy" },
{ at: NOW, state: "degraded" },
{ at: NOW, state: "unknown" },
]);
expect(summary).toEqual({ healthy: 2, degraded: 1, down: 0, unknown: 1 });
});
});
describe("buildSdWanIndex", () => {
const status = (siteId: string, overrides: Record<string, unknown> = {}) => ({
status: {
connections: [
{ sites: [{ siteId, status: { connected: true, offline: false, ping: 0, errors: [], ...overrides } }] },
],
sites: [{ siteId, errors: [] as unknown[], warnings: [] as string[] }],
},
});
test("indexes a site by its identifier", () => {
const index = buildSdWanIndex([{ configName: "Mesh", status: status("site-1").status }]);
expect(index.get("site-1")).toMatchObject({ configName: "Mesh", connected: true, offline: false });
});
/**
* Relevé sur un tunnel connecté entre deux sites distants : `ping: 0`. Une
* latence nulle y est physiquement impossible — le champ veut dire « non
* mesuré », et propager le zéro l'afficherait comme une performance.
*/
test("reads a ping of zero as unmeasured, not as zero milliseconds", () => {
const index = buildSdWanIndex([{ configName: "Mesh", status: status("site-1").status }]);
expect(index.get("site-1")!.pingMs).toBeNull();
});
test("keeps a measured ping", () => {
const index = buildSdWanIndex([{ configName: "Mesh", status: status("site-1", { ping: 12 }).status }]);
expect(index.get("site-1")!.pingMs).toBe(12);
});
test("counts errors and warnings", () => {
const raw = status("site-1", { errors: ["a", "b"] }).status;
raw.sites[0]!.warnings = ["w"];
const index = buildSdWanIndex([{ configName: "Mesh", status: raw }]);
expect(index.get("site-1")).toMatchObject({ errorCount: 2, warningCount: 1 });
});
test("keeps the first configuration when a site appears in several", () => {
const index = buildSdWanIndex([
{ configName: "First", status: status("site-1").status },
{ configName: "Second", status: status("site-1").status },
]);
expect(index.get("site-1")!.configName).toBe("First");
});
test("leaves a site absent from every configuration out of the index", () => {
expect(buildSdWanIndex([]).get("site-1")).toBeUndefined();
});
});
describe("mapSites", () => {
const site = {
siteId: "site-1",
hostId: "host-1",
meta: { desc: "Example site", name: "default" },
statistics: {
percentages: { wanUptime: 99.5 },
ispInfo: { name: "Example ISP" },
wans: { WAN: { externalIp: "203.0.113.10" }, WAN2: { externalIp: "203.0.113.11" } },
counts: { totalDevice: 6, offlineDevice: 1, pendingUpdateDevice: 3 },
},
};
const host = { id: "host-1", reportedState: { deviceState: "updateAvailable" } };
test("maps a complete site", () => {
const [mapped] = mapSites([site], [host], [], new Map(), NOW);
expect(mapped).toMatchObject({
siteId: "site-1",
name: "Example site",
wanUptimePct: 99.5,
ispName: "Example ISP",
externalIps: ["203.0.113.10", "203.0.113.11"],
deviceCount: 6,
offlineDeviceCount: 1,
pendingUpdateCount: 3,
consoleUpdateAvailable: true,
});
});
test("falls back to meta.name when there is no description", () => {
const [mapped] = mapSites([{ ...site, meta: { name: "default" } }], [], [], new Map(), NOW);
expect(mapped!.name).toBe("default");
});
/**
* `null` veut dire « aucun host ne correspond », ce qui n'est pas « la console
* est à jour ». Le widget doit pouvoir les distinguer.
*/
test("leaves consoleUpdateAvailable null when no host matches", () => {
const [mapped] = mapSites([site], [], [], new Map(), NOW);
expect(mapped!.consoleUpdateAvailable).toBeNull();
});
/**
* Ce test affirmait `false`. `deviceState` n'est pas un booléen : le compte
* réel renvoie `"setup"`, `"updateAvailable"`, et Ubiquiti en ajoutera
* d'autres. Tout ce qui n'est pas la chaîne magique tombait donc sur `false`,
* que le widget affiche « à jour » — une affirmation sur le firmware tirée
* d'un état qui n'en parle pas.
*/
test("treats a device state that says nothing about firmware as unknown, not as up to date", () => {
const [mapped] = mapSites(
[site],
[{ id: "host-1", reportedState: { deviceState: "connected" } }],
[],
new Map(),
NOW,
);
expect(mapped!.consoleUpdateAvailable).toBeNull();
});
/** Le cloud se prononce : aucune version disponible. C'est le seul « à jour ». */
test("reports a console as up to date when the cloud states no available version", () => {
const [mapped] = mapSites(
[site],
[{ id: "host-1", reportedState: { deviceState: "setup", firmwareUpdate: { latestAvailableVersion: null } } }],
[],
new Map(),
NOW,
);
expect(mapped!.consoleUpdateAvailable).toBe(false);
});
test("reports an available version as an update even without a device state", () => {
const [mapped] = mapSites(
[site],
[{ id: "host-1", reportedState: { firmwareUpdate: { latestAvailableVersion: "9.9.9" } } }],
[],
new Map(),
NOW,
);
expect(mapped!.consoleUpdateAvailable).toBe(true);
});
/**
* Le piège d'origine : `undefined === "updateAvailable"` vaut `false`, donc une
* absence totale d'information s'affichait comme une console à jour.
*/
test("leaves consoleUpdateAvailable null when the host reports neither field", () => {
const [mapped] = mapSites([site], [{ id: "host-1", reportedState: {} }], [], new Map(), NOW);
expect(mapped!.consoleUpdateAvailable).toBeNull();
});
test("yields an empty list for an account with no sites", () => {
expect(mapSites([], [], [], new Map(), NOW)).toEqual([]);
});
test("attaches the health window of the matching metrics entry", () => {
const [mapped] = mapSites(
[site],
[],
[{ siteId: "site-1", periods: [period(hoursBefore(NOW, 1), { downtime: 0, packetLoss: 0 })] }],
new Map(),
NOW,
);
expect(mapped!.health).toHaveLength(HEALTH_WINDOW_HOURS);
expect(mapped!.summary.healthy).toBe(1);
expect(mapped!.latencyMs).toBeNull();
});
test("takes latency and loss from the most recent period", () => {
const [mapped] = mapSites(
[site],
[],
[
{
siteId: "site-1",
periods: [
period(hoursBefore(NOW, 5), { downtime: 0, packetLoss: 9, avgLatency: 99 }),
period(hoursBefore(NOW, 1), { downtime: 0, packetLoss: 0, avgLatency: 11 }),
],
},
],
new Map(),
NOW,
);
expect(mapped!.latencyMs).toBe(11);
expect(mapped!.packetLossPct).toBe(0);
});
test("ends the health window on the freshest reported hour, not on the wall clock", () => {
const freshest = hoursBefore(NOW, 1);
const metrics = [{ siteId: "site-1", periods: [period(freshest, { downtime: 0, packetLoss: 0 })] }];
const [mapped] = mapSites([site], [], metrics, new Map(), resolveHealthWindowEnd(metrics, NOW));
expect(mapped!.health.at(-1)!.at.getTime()).toBe(freshest.getTime());
expect(mapped!.health.at(-1)!.state).toBe("healthy");
});
/**
* Une seule fin pour toutes les lignes : le site à jour remplit sa dernière
* tranche, celui qui retarde garde son gris à droite. C'est une information
* vraie — il n'a rien rapporté depuis — et non un artefact d'horloge.
*/
test("keeps the trailing grey of a site lagging the others, on one shared window", () => {
const metrics = [
{ siteId: "site-1", periods: [period(hoursBefore(NOW, 1), { downtime: 0, packetLoss: 0 })] },
{ siteId: "site-2", periods: [period(hoursBefore(NOW, 4), { downtime: 0, packetLoss: 0 })] },
];
const [current, lagging] = mapSites(
[site, { ...site, siteId: "site-2" }],
[],
metrics,
new Map(),
resolveHealthWindowEnd(metrics, NOW),
);
expect(current!.health.at(-1)!.state).toBe("healthy");
expect(lagging!.health.at(-1)!.state).toBe("unknown");
expect(lagging!.health.at(-1)!.at.getTime()).toBe(current!.health.at(-1)!.at.getTime());
});
test("keeps a window ending now when the account reported no period at all", () => {
const [mapped] = mapSites([site], [], [], new Map(), resolveHealthWindowEnd([], NOW));
expect(mapped!.summary.unknown).toBe(HEALTH_WINDOW_HOURS);
expect(mapped!.health.at(-1)!.at.getTime()).toBe(NOW.getTime());
});
});
/**
* Ce module est réexporté par packages/integrations/src/types.ts, lui-même
* importé par des composants client. Un import de @homarr/common/server y
* traîne ioredis puis node:dns dans le bundle navigateur et empêche
* l'application de démarrer — défaut réellement survenu sur l'intégration
* précédente, invisible au typecheck comme aux tests unitaires.
*/
describe("client bundle safety", () => {
test("the types module does not import server-only code", () => {
// `import.meta.url` plutôt que `__dirname` : ce dernier n'existe pas en ESM,
// et aucun autre spec du dépôt ne s'y fie.
const source = readFileSync(new URL("../unifi-site-manager-types.ts", import.meta.url), "utf8");
expect(source).not.toContain("@homarr/common/server");
});
});
@@ -0,0 +1,197 @@
import { ResponseError } from "@homarr/common/server";
import type { RequestInit, Response } from "undici";
import type { z } from "zod/v4";
import { parseSiteManagerAsync } from "./unifi-site-manager-parse";
import type { IspMetricsEntry, SdWanStatus, SiteManagerHost, SiteManagerSite } from "./unifi-site-manager-types";
import {
HEALTH_WINDOW_HOURS,
ispMetricsResponseSchema,
sdWanConfigListSchema,
sdWanStatusSchema,
siteManagerHostListSchema,
siteManagerSiteListSchema,
} from "./unifi-site-manager-types";
/** L'API cloud d'Ubiquiti. Jamais configurable : ce n'est pas une console locale. */
const BASE_URL = "https://api.ui.com";
const REQUEST_TIMEOUT_MS = 15_000;
/**
* Le statut SD-WAN est indexé par configuration : il faut d'abord les lister,
* puis interroger chacune. Sans borne, un compte à dix configurations
* produirait onze requêtes par rafraîchissement.
*/
export const MAX_SD_WAN_CONFIGS = 5;
/**
* Fenêtre de la requête à 5 minutes.
*
* Mesuré sur un compte réel : la dernière heure que rapporte `/1h/query` a 2 h 43
* et 3 h 43 de retard selon le site, là où `/5m/query` rapporte des points de 24
* et 34 minutes. Le bout droit de la bande était donc structurellement gris et la
* latence affichée vieille de trois heures. Quatre heures couvrent le pire retard
* observé sans rapatrier une fenêtre fine de 24 h.
*/
export const RECENT_METRICS_WINDOW_HOURS = 4;
/**
* Rassemble les deux granularités en une entrée par site.
*
* Les périodes des deux réponses sont concaténées sans déduplication : en aval,
* `buildHealthWindow` plaque chaque période sur son heure et garde le pire état
* quand plusieurs y tombent, et `latestPeriod` prend le maximum par
* `metricTime`. Les points de 5 minutes se replient donc d'eux-mêmes sur les
* tranches horaires, et la latence vient du point le plus frais.
*
* Un site présent dans une seule des deux réponses doit ressortir : la fusion
* part des deux listes, jamais de l'intersection.
*/
const mergeIspMetrics = (hourly: IspMetricsEntry[], recent: IspMetricsEntry[]): IspMetricsEntry[] => {
const bySite = new Map<string, IspMetricsEntry>();
for (const entry of [...hourly, ...recent]) {
const existing = bySite.get(entry.siteId);
// Copie des périodes : les tableaux viennent de la réponse analysée, et les
// concaténer en place muterait celle-ci sous les autres lecteurs.
if (existing === undefined) {
bySite.set(entry.siteId, { ...entry, periods: [...entry.periods] });
continue;
}
existing.periods.push(...entry.periods);
}
return Array.from(bySite.values());
};
/**
* Déclaré sur les types d'undici, pas sur ceux du DOM : le dépôt n'utilise que
* `undici` côté serveur. Aligner les deux évite les `as unknown as` qui
* désactivaient le contrôle de type à la frontière du transport.
*/
export type SiteManagerFetch = (url: string, init?: RequestInit & { timeout?: number }) => Promise<Response>;
export class UnifiSiteManagerApi {
constructor(
private readonly apiKey: string,
private readonly fetchAsync: SiteManagerFetch,
) {}
public async getSitesAsync(): Promise<SiteManagerSite[]> {
const parsed = await this.requestAsync(
"/v1/sites",
siteManagerSiteListSchema,
"Invalid Site Manager sites response",
);
return parsed.data;
}
public async getHostsAsync(): Promise<SiteManagerHost[]> {
const parsed = await this.requestAsync(
"/v1/hosts",
siteManagerHostListSchema,
"Invalid Site Manager hosts response",
);
return parsed.data;
}
/**
* Deux granularités pour une seule fenêtre.
*
* La requête horaire couvre les HEALTH_WINDOW_HOURS heures de la bande, tous
* les sites en une requête bornée — la variante non bornée pèse 216 Ko
* (mesuré). Elle rapporte cependant jusqu'à près de quatre heures de retard,
* d'où la seconde requête, à 5 minutes, sur les seules heures récentes.
*
* Les deux partent en parallèle : enchaînées, elles ajouteraient la latence de
* l'une à celle de l'autre à chaque rafraîchissement.
*/
public async getIspMetricsAsync(
sites: { siteId: string; hostId?: string }[],
endingAt: Date,
): Promise<IspMetricsEntry[]> {
if (sites.length === 0) return [];
const endTimestamp = endingAt.toISOString();
const beginTimestampOf = (hours: number) => new Date(endingAt.getTime() - hours * 3_600_000).toISOString();
const [hourlyResult, recentResult] = await Promise.allSettled([
this.queryIspMetricsAsync("1h", sites, beginTimestampOf(HEALTH_WINDOW_HOURS), endTimestamp),
this.queryIspMetricsAsync("5m", sites, beginTimestampOf(RECENT_METRICS_WINDOW_HOURS), endTimestamp),
]);
// La fenêtre horaire porte toute la bande : son échec doit remonter.
if (hourlyResult.status === "rejected") throw hourlyResult.reason;
// L'échec de la requête à 5 minutes est avalé À DESSEIN : elle n'apporte que
// la fraîcheur des dernières heures. Sans elle, ces heures retombent en gris
// — « non rapporté », ce qui est vrai — au lieu de perdre tout le widget
// pour un enrichissement. Ne pas propager ce rejet.
const recent = recentResult.status === "fulfilled" ? recentResult.value : [];
return mergeIspMetrics(hourlyResult.value, recent);
}
private async queryIspMetricsAsync(
granularity: "1h" | "5m",
sites: { siteId: string; hostId?: string }[],
beginTimestamp: string,
endTimestamp: string,
): Promise<IspMetricsEntry[]> {
const response = await this.fetchAsync(`${BASE_URL}/v1/isp-metrics/${granularity}/query`, {
method: "POST",
headers: { "X-API-KEY": this.apiKey, Accept: "application/json", "Content-Type": "application/json" },
timeout: REQUEST_TIMEOUT_MS,
body: JSON.stringify({
sites: sites.map((site) => ({ hostId: site.hostId, siteId: site.siteId, beginTimestamp, endTimestamp })),
}),
});
if (!response.ok) throw new ResponseError(response);
// Le schéma est identique aux deux granularités : `data.metrics[].periods[]`
// avec `metricTime` et `data.wan` — vérifié sur la réponse réelle à 5 min.
const parsed = await parseSiteManagerAsync(
await response.json(),
ispMetricsResponseSchema,
"Invalid Site Manager ISP metrics response",
);
return parsed.data.metrics;
}
public async getSdWanStatusesAsync(): Promise<{ configName: string; status: SdWanStatus["data"]["status"] }[]> {
const configs = await this.requestAsync(
"/v1/sd-wan-configs",
sdWanConfigListSchema,
"Invalid Site Manager SD-WAN configuration list",
);
const statuses: { configName: string; status: SdWanStatus["data"]["status"] }[] = [];
for (const config of configs.data.slice(0, MAX_SD_WAN_CONFIGS)) {
try {
const parsed = await this.requestAsync(
`/v1/sd-wan-configs/${encodeURIComponent(config.id)}/status`,
sdWanStatusSchema,
"Invalid Site Manager SD-WAN status",
);
statuses.push({ configName: config.name ?? config.id, status: parsed.data.status });
} catch {
// Une configuration illisible ne doit pas emporter les autres.
}
}
return statuses;
}
private async requestAsync<TOutput>(path: string, schema: z.ZodType<TOutput>, message: string): Promise<TOutput> {
const response = await this.fetchAsync(`${BASE_URL}${path}`, {
headers: { "X-API-KEY": this.apiKey, Accept: "application/json" },
timeout: REQUEST_TIMEOUT_MS,
});
if (!response.ok) throw new ResponseError(response);
return await parseSiteManagerAsync(await response.json(), schema, message);
}
}
@@ -0,0 +1,93 @@
import { fetch as platformFetch } from "undici";
import type { IntegrationTestingInput } from "../base/integration";
import { Integration } from "../base/integration";
import { TestConnectionError } from "../base/test-connection/test-connection-error";
import type { TestingResult } from "../base/test-connection/test-connection-service";
import type { UnifiSiteManagerIntegration as UnifiSiteManagerIntegrationInterface } from "../interfaces/unifi-site-manager/unifi-site-manager-integration";
import type { SiteManagerFetch } from "./unifi-site-manager-api";
import { UnifiSiteManagerApi } from "./unifi-site-manager-api";
import type {
IspMetricsEntry,
SiteManagerHost,
UnifiSiteManagerOverview,
UnifiSiteSdWanStatus,
} from "./unifi-site-manager-types";
import { buildSdWanIndex, mapSites, resolveHealthWindowEnd } from "./unifi-site-manager-types";
/**
* `api.ui.com` présente un certificat public valide. On n'utilise donc PAS le
* fetch à certificats de confiance de Homarr : il ajoute toutes les autorités
* personnalisées téléversées par l'administrateur, ce qui en ferait des
* ancrages valides pour le cloud d'Ubiquiti — et exposerait la clé, qui lit
* tous les sites du compte.
*/
const fetchCloudAsync: SiteManagerFetch = async (url, init) => {
const { timeout, ...rest } = init ?? {};
return await platformFetch(url, {
...rest,
signal: timeout === undefined ? undefined : AbortSignal.timeout(timeout),
});
};
const settled = <T>(result: PromiseSettledResult<T>, fallback: T): T =>
result.status === "fulfilled" ? result.value : fallback;
export class UnifiSiteManagerIntegration extends Integration implements UnifiSiteManagerIntegrationInterface {
public async getSiteOverviewAsync(): Promise<UnifiSiteManagerOverview> {
return await this.buildOverviewAsync(fetchCloudAsync);
}
// `input.fetchAsync` is ignored on purpose: it carries the administrator's
// trusted-certificate bundle, and using it here would let that CA vouch for
// `api.ui.com` — see the module-level comment on `fetchCloudAsync`.
protected async testingAsync(_input: IntegrationTestingInput): Promise<TestingResult> {
try {
await this.createApi(fetchCloudAsync).getSitesAsync();
} catch (error) {
return TestConnectionError.UnknownResult(error);
}
return { success: true };
}
private createApi(fetchAsync: SiteManagerFetch) {
return new UnifiSiteManagerApi(this.getSecretValue("siteManagerApiKey"), fetchAsync);
}
private async buildOverviewAsync(fetchAsync: SiteManagerFetch): Promise<UnifiSiteManagerOverview> {
const api = this.createApi(fetchAsync);
const now = new Date();
const [sitesResult, hostsResult] = await Promise.allSettled([api.getSitesAsync(), api.getHostsAsync()]);
// La liste des sites porte tout : son échec doit remonter, sinon le widget
// afficherait « aucun site » alors qu'il n'a rien pu lire.
if (sitesResult.status === "rejected") throw sitesResult.reason;
const sites = sitesResult.value;
const hosts = settled<SiteManagerHost[]>(hostsResult, []);
// Deux enrichissements, en parallèle. Leur échec laisse leur part à
// l'inconnu — la fenêtre à « inconnu » plutôt qu'à « sain », le SD-WAN à
// `null` — et n'emporte jamais la liste des sites.
const [metricsResult, sdWanResult] = await Promise.allSettled([
api.getIspMetricsAsync(
sites.map((site) => ({ siteId: site.siteId, hostId: site.hostId })),
now,
),
api.getSdWanStatusesAsync(),
]);
const metrics = settled<IspMetricsEntry[]>(metricsResult, []);
const sdWanBySite: Map<string, UnifiSiteSdWanStatus> = buildSdWanIndex(settled(sdWanResult, []));
// `now` drives the metrics REQUEST, but not the end of the health window:
// the cloud's ISP metrics lag 25 to 35 minutes, so the current hour has no
// measurement yet for the first half of every hour and its segment would be
// permanently grey. The window therefore ends on the freshest hour any site
// actually reported — one end for every row, so the table stays comparable
// hour against hour. See `resolveHealthWindowEnd`.
return { sites: mapSites(sites, hosts, metrics, sdWanBySite, resolveHealthWindowEnd(metrics, now)) };
}
}
@@ -0,0 +1,19 @@
import { ParseError } from "@homarr/common/server";
import type { z } from "zod/v4";
/**
* Séparé de `unifi-site-manager-types.ts` à dessein : ce module importe
* `@homarr/common/server`, qui atteint `ioredis` puis `node:dns`. Le module de
* types, lui, est réexporté vers des composants client et doit rester pur.
*/
export const parseSiteManagerAsync = async <TOutput>(
value: unknown,
schema: z.ZodType<TOutput>,
message: string,
): Promise<TOutput> => {
const result = await schema.safeParseAsync(value);
if (!result.success) {
throw new ParseError(message, { cause: result.error });
}
return result.data;
};
@@ -0,0 +1,371 @@
import { z } from "zod/v4";
/** Ubiquiti ajoute des champs sans prévenir : tous les objets d'API sont tolérants. */
const wanMetricsSchema = z.looseObject({
avgLatency: z.number().optional(),
maxLatency: z.number().optional(),
packetLoss: z.number().optional(),
downtime: z.number().optional(),
uptime: z.number().optional(),
ispName: z.string().optional(),
});
export const ispMetricsPeriodSchema = z.looseObject({
metricTime: z.string(),
data: z.looseObject({ wan: wanMetricsSchema.optional() }),
});
export const ispMetricsEntrySchema = z.looseObject({
siteId: z.string(),
hostId: z.string().optional(),
periods: z.array(ispMetricsPeriodSchema).default([]),
});
export const ispMetricsResponseSchema = z.looseObject({
data: z.looseObject({ metrics: z.array(ispMetricsEntrySchema).default([]) }),
});
export const siteManagerSiteSchema = z.looseObject({
siteId: z.string(),
hostId: z.string().optional(),
meta: z.looseObject({ desc: z.string().optional(), name: z.string().optional() }),
statistics: z
.looseObject({
percentages: z.looseObject({ wanUptime: z.number().optional() }).optional(),
ispInfo: z.looseObject({ name: z.string().optional() }).optional(),
wans: z.record(z.string(), z.looseObject({ externalIp: z.string().optional() })).optional(),
counts: z
.looseObject({
totalDevice: z.number().optional(),
offlineDevice: z.number().optional(),
pendingUpdateDevice: z.number().optional(),
})
.optional(),
})
.optional(),
});
export const siteManagerSiteListSchema = z.looseObject({ data: z.array(siteManagerSiteSchema).default([]) });
export const siteManagerHostSchema = z.looseObject({
id: z.string(),
reportedState: z
.looseObject({
deviceState: z.string().optional(),
/**
* `.nullable().optional()` et non `.nullish()` : « présent et explicitement
* `null` » — le cloud affirme qu'aucune version n'est disponible — doit
* rester distinguable de « absent », où il ne dit rien.
*/
firmwareUpdate: z.looseObject({ latestAvailableVersion: z.string().nullable().optional() }).optional(),
})
.optional(),
});
export const siteManagerHostListSchema = z.looseObject({ data: z.array(siteManagerHostSchema).default([]) });
export const sdWanConfigSchema = z.looseObject({ id: z.string(), name: z.string().optional() });
export const sdWanConfigListSchema = z.looseObject({ data: z.array(sdWanConfigSchema).default([]) });
const sdWanConnectionSiteSchema = z.looseObject({
siteId: z.string(),
status: z
.looseObject({
connected: z.boolean().optional(),
offline: z.boolean().optional(),
ping: z.number().optional(),
errors: z.array(z.unknown()).default([]),
})
.optional(),
});
export const sdWanStatusSchema = z.looseObject({
data: z.looseObject({
status: z.looseObject({
connections: z.array(z.looseObject({ sites: z.array(sdWanConnectionSiteSchema).default([]) })).default([]),
sites: z
.array(
z.looseObject({
siteId: z.string(),
errors: z.array(z.unknown()).default([]),
warnings: z.array(z.unknown()).default([]),
}),
)
.default([]),
}),
}),
});
export type SdWanStatus = z.infer<typeof sdWanStatusSchema>;
export type SiteManagerSite = z.infer<typeof siteManagerSiteSchema>;
export type SiteManagerHost = z.infer<typeof siteManagerHostSchema>;
export type IspMetricsEntry = z.infer<typeof ispMetricsEntrySchema>;
export type IspMetricsPeriod = z.infer<typeof ispMetricsPeriodSchema>;
export type UnifiSiteHealthState = "healthy" | "degraded" | "down" | "unknown";
export interface UnifiSiteHealthSegment {
/** Début de la tranche horaire. */
at: Date;
state: UnifiSiteHealthState;
}
export type UnifiSiteHealthSummary = Record<UnifiSiteHealthState, number>;
export interface UnifiSiteManagerSite {
siteId: string;
name: string;
wanUptimePct: number | null;
ispName: string | null;
externalIps: string[];
deviceCount: number;
offlineDeviceCount: number;
/** Firmwares d'ÉQUIPEMENTS en attente — distinct de la mise à jour de console. */
pendingUpdateCount: number;
/**
* Mise à jour de la CONSOLE. `null` quand aucun host ne correspond ou que le
* cloud ne se prononce pas — voir `resolveConsoleUpdate`.
*/
consoleUpdateAvailable: boolean | null;
/** Toujours HEALTH_WINDOW_HOURS entrées, la plus ancienne en premier. */
health: UnifiSiteHealthSegment[];
summary: UnifiSiteHealthSummary;
latencyMs: number | null;
packetLossPct: number | null;
/**
* `null` couvre DEUX cas que ce contrat ne distingue pas : le site n'appartient
* à aucune configuration SD-WAN, ou l'appel de statut a échoué. Ne pas en
* déduire l'un des deux à l'affichage — le tiret dit « on ne sait pas ».
*/
sdWan: UnifiSiteSdWanStatus | null;
}
export interface UnifiSiteSdWanStatus {
configName: string;
connected: boolean;
offline: boolean;
/** `null` quand le cloud rapporte `0` : « non mesuré », pas « zéro milliseconde ». */
pingMs: number | null;
errorCount: number;
warningCount: number;
}
export interface UnifiSiteManagerOverview {
sites: UnifiSiteManagerSite[];
}
export const HEALTH_WINDOW_HOURS = 24;
const HOUR_MS = 3_600_000;
/** Gravité décroissante. L'ordre compte : une coupure prime sur une perte. */
export const deriveHealthState = (
wan:
| {
downtime?: number;
packetLoss?: number;
}
| undefined,
): UnifiSiteHealthState => {
if (wan === undefined) return "unknown";
if (wan.downtime === undefined && wan.packetLoss === undefined) return "unknown";
if ((wan.downtime ?? 0) > 0) return "down";
if ((wan.packetLoss ?? 0) > 0) return "degraded";
return "healthy";
};
const SEVERITY: Record<UnifiSiteHealthState, number> = { unknown: 0, healthy: 1, degraded: 2, down: 3 };
const floorToHour = (value: number) => Math.floor(value / HOUR_MS) * HOUR_MS;
/**
* Reconstitue une fenêtre pleine de HEALTH_WINDOW_HOURS tranches.
*
* Le cloud ne rapporte pas toutes les heures : une fenêtre de 24 h n'en a
* renvoyé que 16 sur l'API réelle, avec des trous au milieu. Une tranche non
* rapportée vaut `"unknown"` et jamais `"healthy"` — la peindre en vert
* affirmerait un bon fonctionnement qui n'a pas été mesuré.
*
* `endingAt` est la dernière heure MESURÉE, pas maintenant : voir
* `resolveHealthWindowEnd`. Les périodes hors fenêtre étant écartées ci-dessous,
* reculer cette fin ne peut pas y faire entrer de données plus anciennes.
*/
export const buildHealthWindow = (periods: IspMetricsPeriod[], endingAt: Date): UnifiSiteHealthSegment[] => {
const lastHour = floorToHour(endingAt.getTime());
const firstHour = lastHour - (HEALTH_WINDOW_HOURS - 1) * HOUR_MS;
const byHour = new Map<number, UnifiSiteHealthState>();
for (const period of periods) {
const at = floorToHour(new Date(period.metricTime).getTime());
if (Number.isNaN(at) || at < firstHour || at > lastHour) continue;
const state = deriveHealthState(period.data.wan);
const existing = byHour.get(at);
// Plusieurs mesures dans la même heure : on garde la pire.
if (existing === undefined || SEVERITY[state] > SEVERITY[existing]) byHour.set(at, state);
}
return Array.from({ length: HEALTH_WINDOW_HOURS }, (_, offset) => {
const at = firstHour + offset * HOUR_MS;
return { at: new Date(at), state: byHour.get(at) ?? "unknown" };
});
};
/** Le canal qui porte l'information quand la couleur ne passe pas. */
export const summariseHealth = (segments: UnifiSiteHealthSegment[]): UnifiSiteHealthSummary => {
const summary: UnifiSiteHealthSummary = { healthy: 0, degraded: 0, down: 0, unknown: 0 };
for (const segment of segments) summary[segment.state] += 1;
return summary;
};
/**
* Fin de la fenêtre de santé : la dernière heure RÉELLEMENT rapportée, et non
* maintenant.
*
* Les métriques ISP du cloud arrivent avec 25 à 35 minutes de retard (mesuré sur
* le compte réel). Terminer la fenêtre sur l'heure courante réservait donc sa
* dernière tranche à une heure qu'aucune mesure ne couvre encore : elle restait
* grise pendant la première moitié de chaque heure. Honnêtement grise, et
* totalement inutile — un vingt-quatrième de la barre ne disait jamais rien.
*
* Le maximum est GLOBAL, pris sur les périodes de TOUS les sites, et non site par
* site : les lignes du tableau se lisent heure contre heure, et une fin propre à
* chaque site ferait glisser sa fenêtre par rapport à celles de ses voisines.
* Avec une fin unique, un site qui retarde vraiment sur les autres garde une
* tranche grise à droite — c'est une information vraie, pas un artefact.
*
* Sans aucune période (compte vide, ou appel de métriques en échec), on retombe
* sur `now` : la fenêtre reste pleine de HEALTH_WINDOW_HOURS tranches inconnues.
*/
export const resolveHealthWindowEnd = (metrics: IspMetricsEntry[], now: Date): Date => {
let newest: number | undefined;
for (const entry of metrics) {
for (const period of entry.periods) {
const at = new Date(period.metricTime).getTime();
if (Number.isNaN(at)) continue;
if (newest === undefined || at > newest) newest = at;
}
}
return newest === undefined ? now : new Date(newest);
};
const latestPeriod = (periods: IspMetricsPeriod[]): IspMetricsPeriod | undefined =>
periods.reduce<IspMetricsPeriod | undefined>((newest, period) => {
if (newest === undefined) return period;
return new Date(period.metricTime).getTime() > new Date(newest.metricTime).getTime() ? period : newest;
}, undefined);
/**
* Indexe l'état des tunnels par site.
*
* `ping: 0` a été relevé sur un tunnel `connected` reliant deux sites
* géographiquement distants — une latence nulle y est physiquement impossible.
* Le champ signifie donc « non mesuré », et il devient `null` plutôt que d'être
* propagé comme une performance.
*
* Un site peut apparaître dans plusieurs configurations : la première l'emporte,
* et son nom accompagne l'état pour que la ligne reste interprétable.
*/
export const buildSdWanIndex = (
configs: { configName: string; status: SdWanStatus["data"]["status"] }[],
): Map<string, UnifiSiteSdWanStatus> => {
const index = new Map<string, UnifiSiteSdWanStatus>();
for (const { configName, status } of configs) {
const warningsBySite = new Map(status.sites.map((site) => [site.siteId, site]));
for (const connection of status.connections) {
for (const site of connection.sites) {
if (index.has(site.siteId)) continue;
const reported = site.status;
const ping = reported?.ping ?? 0;
index.set(site.siteId, {
configName,
connected: reported?.connected ?? false,
offline: reported?.offline ?? false,
pingMs: ping > 0 ? ping : null,
errorCount: reported?.errors.length ?? 0,
warningCount: warningsBySite.get(site.siteId)?.warnings.length ?? 0,
});
}
}
}
return index;
};
/**
* `false` exige un signal positif du cloud.
*
* `deviceState` n'est pas un booléen : le compte réel renvoie `"setup"` sur une
* console et `"updateAvailable"` sur l'autre, et Ubiquiti peut en ajouter
* d'autres. Comparer à la chaîne magique repliait donc tout le reste — `"setup"`,
* une console hors ligne, un champ absent — sur `false`, que le widget affiche
* « à jour » : dire d'un état qui ne parle pas du firmware qu'il n'y a pas de
* mise à jour affirme une mesure qui n'a jamais été faite.
*
* Seul `firmwareUpdate.latestAvailableVersion` autorise `false` : explicitement
* `null` sur la console à jour, porteur d'une version sur celle qui ne l'est pas.
* Faute de l'un ou de l'autre, l'état reste inconnu.
*/
const resolveConsoleUpdate = (host: SiteManagerHost | undefined): boolean | null => {
if (host === undefined) return null;
const reported = host.reportedState;
if (reported?.deviceState === "updateAvailable") return true;
// `undefined` (champ ou objet absent) ne vaut pas `null` : seul `null` est une réponse.
const latestAvailableVersion = reported?.firmwareUpdate?.latestAvailableVersion;
if (typeof latestAvailableVersion === "string") return true;
if (latestAvailableVersion === null) return false;
return null;
};
export const mapSites = (
sites: SiteManagerSite[],
hosts: SiteManagerHost[],
metrics: IspMetricsEntry[],
sdWanBySite: Map<string, UnifiSiteSdWanStatus>,
/**
* Dernière heure de la fenêtre de santé, commune à toutes les lignes. Ce n'est
* PAS `now` : l'appelant la tient de `resolveHealthWindowEnd`, qui explique
* pourquoi.
*/
healthWindowEndsAt: Date,
): UnifiSiteManagerSite[] =>
sites.map((site) => {
const statistics = site.statistics;
const counts = statistics?.counts;
const host = site.hostId === undefined ? undefined : hosts.find((candidate) => candidate.id === site.hostId);
const entry = metrics.find((candidate) => candidate.siteId === site.siteId);
const periods = entry?.periods ?? [];
const health = buildHealthWindow(periods, healthWindowEndsAt);
const latest = latestPeriod(periods)?.data.wan;
return {
siteId: site.siteId,
name: site.meta.desc ?? site.meta.name ?? site.siteId,
wanUptimePct: statistics?.percentages?.wanUptime ?? null,
ispName: statistics?.ispInfo?.name ?? null,
externalIps: Object.values(statistics?.wans ?? {})
.map((wan) => wan.externalIp)
.filter((ip): ip is string => ip !== undefined),
deviceCount: counts?.totalDevice ?? 0,
offlineDeviceCount: counts?.offlineDevice ?? 0,
pendingUpdateCount: counts?.pendingUpdateDevice ?? 0,
consoleUpdateAvailable: resolveConsoleUpdate(host),
health,
summary: summariseHealth(health),
latencyMs: latest?.avgLatency ?? null,
packetLossPct: latest?.packetLoss ?? null,
sdWan: sdWanBySite.get(site.siteId) ?? null,
};
});
@@ -37,9 +37,16 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
const systemInfo = await this.getSystemInformationAsync();
const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0);
const cpuCount = systemInfo.info.cpu.cores;
const cpuCount = systemInfo.metrics.cpu.cpus.length;
// Each entry in cpus[] is one logical CPU (thread). Dividing the summed per-thread
// utilization by the thread count (not physical cores) gives the correct average and
// avoids over-reporting on SMT systems. Guard against zero to avoid Infinity/NaN.
let cpuUtilizationNormalized = 0;
if (cpuCount > 0) {
cpuUtilizationNormalized = cpuUtilization / cpuCount;
}
// We use "info" object instead of the stats since this is the exact amount the kernel sees, which is what Unraid displays.
const totalMemory = systemInfo.info.memory.layout.reduce((acc, layout) => layout.size + acc, 0);
const usedMemory = totalMemory * (systemInfo.metrics.memory.percentTotal / 100);
const uptime = dayjs(systemInfo.info.os.uptime);
@@ -47,7 +54,7 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
return {
version: systemInfo.info.os.release,
cpuModelName: systemInfo.info.cpu.brand,
cpuUtilization: cpuUtilization / cpuCount,
cpuUtilization: cpuUtilizationNormalized,
memUsedInBytes: usedMemory,
memAvailableInBytes: totalMemory - usedMemory,
uptime: dayjs().diff(uptime, "seconds"),
@@ -139,7 +146,7 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
},
memory {
layout {
size
size
}
}
}
@@ -0,0 +1,48 @@
// @vitest-environment node
import { beforeEach, describe, expect, test, vi } from "vitest";
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
import { HomeAssistantIntegration } from "../src";
vi.mock("@homarr/core/infrastructure/http", () => ({
fetchWithTrustedCertificatesAsync: vi.fn(),
}));
const mockFetch = vi.mocked(fetchWithTrustedCertificatesAsync);
const integration = new HomeAssistantIntegration({
id: "home-assistant",
name: "Home Assistant",
url: "http://home-assistant.local:8123",
externalUrl: null,
decryptedSecrets: [{ kind: "apiKey", value: "secret" }],
});
describe("HomeAssistantIntegration actions", () => {
beforeEach(() => {
mockFetch.mockReset();
mockFetch.mockResolvedValue({ ok: true } as never);
});
test.each([
["toggle", () => integration.triggerToggleAsync("light.desk"), "/api/services/homeassistant/toggle", "light.desk"],
[
"automation",
() => integration.triggerAutomationAsync("automation.turn_on_lights"),
"/api/services/automation/trigger",
"automation.turn_on_lights",
],
])("sends the %s service call as JSON", async (_action, trigger, path, entityId) => {
await expect(trigger()).resolves.toBe(true);
expect(mockFetch).toHaveBeenCalledWith(new URL(`http://home-assistant.local:8123${path}`), {
headers: {
Authorization: "Bearer secret",
"Content-Type": "application/json",
},
body: JSON.stringify({ entity_id: entityId }),
method: "POST",
});
});
});
@@ -0,0 +1,39 @@
// @vitest-environment node
import { createServer } from "node:http";
import type { AddressInfo } from "node:net";
import { getServerStatistics, init } from "@immich/sdk";
import { describe, expect, test, vi } from "vitest";
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
vi.mock("@homarr/core/infrastructure/certificates", () => ({
getAllTrustedCertificatesAsync: vi.fn(async () => []),
getTrustedCertificateHostnamesAsync: vi.fn(async () => []),
}));
describe("real @immich/sdk end-to-end through fetchWithTrustedCertificatesAsync", () => {
test("x-api-key set via init() reaches the server", async () => {
let receivedXApiKey: string | string[] | undefined;
const server = createServer((req, res) => {
receivedXApiKey = req.headers["x-api-key"];
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify({ usage: 1000, photos: 5, videos: 2 }));
});
await new Promise<void>((resolve) => server.listen(0, resolve));
const port = (server.address() as AddressInfo).port;
init({ baseUrl: `http://127.0.0.1:${port}/api`, apiKey: "sdk-configured-key" });
try {
const stats = await getServerStatistics({
fetch: fetchWithTrustedCertificatesAsync as unknown as typeof fetch,
});
expect(receivedXApiKey).toBe("sdk-configured-key");
expect(stats).toMatchObject({ usage: 1000, photos: 5, videos: 2 });
} finally {
server.close();
}
});
});
@@ -18,4 +18,6 @@ export const smartHomeEntityStateRequestHandler = createIntegrationRequestHandle
return result.data.state;
},
// The widget already polls every 30 seconds and refetches after toggles.
cacheTtlMs: 0,
});
+22
View File
@@ -0,0 +1,22 @@
import { createIntegrationAsync } from "@homarr/integrations";
import type { UnifiOsSummary } from "@homarr/integrations/types";
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
export const unifiOsRequestHandler = createIntegrationRequestHandler<UnifiOsSummary, "unifiOs", Record<string, never>>({
async requestAsync(integration, _input) {
const integrationInstance = await createIntegrationAsync(integration);
return await integrationInstance.getUnifiOsSummaryAsync();
},
cacheTtlMs: 5 * 1000,
// Aligné sur l'intervalle du widget : un cache plus long qu'elle rendrait le
// rafraîchissement rapide inopérant, la requête relisant la même entrée.
// La console ne rafraîchit ses statistiques que toutes les 30 s (mesuré), donc
// interroger plus vite gagne en réactivité, pas en résolution.
// Le cache cloud reste à 5 min dans unifi-sm-api.ts : ses métriques n'évoluent
// que par tranches de 5 min et accusent ~30 min de retard.
// Une console momentanément injoignable doit afficher la dernière valeur connue
// plutôt qu'une tuile d'erreur ; le widget signale la péremption.
fallbackToStaleOnError: true,
staleIfErrorTtlMs: 10 * 60 * 1000,
});
@@ -0,0 +1,20 @@
import { createIntegrationAsync } from "@homarr/integrations";
import type { UnifiSiteManagerOverview } from "@homarr/integrations/types";
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
export const unifiSiteManagerRequestHandler = createIntegrationRequestHandler<
UnifiSiteManagerOverview,
"unifiSiteManager",
Record<string, never>
>({
async requestAsync(integration, _input) {
const integrationInstance = await createIntegrationAsync(integration);
return await integrationInstance.getSiteOverviewAsync();
},
// Les compteurs cloud n'évoluent pas plus vite ; interroger davantage expose
// à une limitation de débit sans rien gagner. Aligné sur l'intervalle du widget.
cacheTtlMs: 5 * 60 * 1000,
fallbackToStaleOnError: true,
staleIfErrorTtlMs: 30 * 60 * 1000,
});
File diff suppressed because it is too large. Load diff
+191 -145
View File
@@ -1018,11 +1018,11 @@
"releasesProvider": "发布",
"notifications": "通知",
"firewall": "防火墙",
"timetable": "时刻表",
"timetable": "时间表",
"photoService": "照片",
"documents": "文档",
"notes": "笔记",
"mediaMonitoring": "监控",
"mediaMonitoring": "媒体监控",
"speedtest": "速度测试",
"analytics": "分析",
"vpn": "VPN",
@@ -1310,8 +1310,8 @@
"newLabel": "新建私钥"
},
"slug": {
"label": "状态页面标识",
"newLabel": "新的状态页面标识"
"label": "状态页标识",
"newLabel": "新状态页标识"
}
}
},
@@ -1322,7 +1322,7 @@
},
"audiobookshelf": {
"name": "Audiobookshelf",
"description": "自托管有声书和播客服务器"
"description": "自托管有声读物和播客服务器"
},
"navidrome": {
"name": "Navidrome",
@@ -1330,13 +1330,13 @@
},
"uptimeKuma": {
"name": "Uptime Kuma",
"description": "自托管运行时间监控,带有公开状态页",
"description": "自托管运行时间监控,支持公开状态页",
"secret": {
"slug": {
"description": "公开状态页的标识。如果未设置,默认为 \"default\"。"
"description": "您公开状态页的标识。如未设置,默认值为“default”。"
},
"apiKey": {
"description": "用于经过身份验证的 /metrics 访问的可选 API 密钥"
"description": "用于访问 /metrics 认证接口的可选 API 密钥"
}
}
},
@@ -1344,9 +1344,13 @@
"name": "Traefik",
"description": "云原生反向代理和负载均衡器"
},
"wud": {
"name": "What's Up Docker",
"description": "监控您哪些 Docker 容器有可用的镜像更新"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "用于归档和组织扫描文档的文档管理系统"
"description": "用于归档和整理扫描文档的文档管理系统"
},
"patchmon": {
"name": "PatchMon",
@@ -1398,7 +1402,7 @@
}
},
"noResults": {
"title": "未上传媒体"
"title": "暂无上传的媒体"
}
},
"common": {
@@ -1437,8 +1441,18 @@
"here": "这里",
"iconPicker": {
"label": "图标 URL",
"header": "输入名称或对象来筛选图标… Homarr 将为您搜索 {countIcons} 图标。",
"headerLoading": "输入以搜索图标…",
"description": "搜索库,粘贴图片URL,或上传文件。",
"header": "输入名称或对象来筛选图标… Homarr 将为您搜索 {countIcons} 图标",
"headerLoading": "按名称搜索图像",
"clear": "清除图像",
"uploadImage": "上传图片",
"results": "图像搜索结果",
"localImages": "你的映像",
"svgIcons": "SVG 图标",
"otherImages": "其他映像",
"urlLoading": "正在检查图片…",
"urlReady": "图像已准备好使用",
"urlError": "无法加载此图像。请检查URL,然后重试。",
"noResults": "没有与“{search}”匹配的图标。",
"error": "无法加载图标。"
},
@@ -1663,7 +1677,7 @@
"app": "编辑应用"
},
"app": {
"propagationNotice": "对此应用的更改将应用于所有面板中使用它的所有位置。"
"propagationNotice": "对此应用的更改将应用于所有面板中使用该应用的位置。"
},
"advancedOptions": {
"label": "高级选项",
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "What's Up Docker",
"description": "显示有多少个已监控的容器有可用更新。",
"title": "What's Up Docker",
"monitored": "已监控",
"updatesAvailable": "{count, plural, one {# 个更新可用} other {# 个更新可用}}",
"updateAvailable": "有可用更新",
"openReleaseNotes": "打开发布说明",
"option": {
"showTitle": {
"label": "显示标题"
},
"showRing": {
"label": "显示更新进度环"
},
"layout": {
"label": "布局",
"option": {
"horizontal": {
"label": "水平"
},
"vertical": {
"label": "垂直"
}
}
},
"showUpdateList": {
"label": "显示容器更新列表",
"description": "列出每个有镜像更新可用的已监控容器"
}
}
},
"dnsHoleSummary": {
"name": "DNS Hole 摘要",
"description": "显示 DNS Hole 的摘要",
@@ -2486,7 +2532,7 @@
},
"ups": {
"name": "UPS",
"description": "通过 NUT 服务器监控 UPS 设备的状态",
"description": "通过 NUT 服务器监控您的 UPS 设备状态",
"option": {
"showBattery": {
"label": "显示电量"
@@ -3784,35 +3830,35 @@
"option": {
"showArtists": {
"label": "显示艺术家",
"description": "显示音乐库中艺术家的总数 (Navidrome)"
"description": "显示音乐库中的艺术家总数(Navidrome)"
},
"showAlbums": {
"label": "显示专辑",
"description": "显示音乐库中专辑的总数 (Navidrome)"
"description": "显示音乐库中的专辑总数(Navidrome)"
},
"showSongs": {
"label": "显示歌曲",
"description": "显示音乐库中歌曲的总数 (Navidrome)"
"description": "显示音乐库中的歌曲总数(Navidrome)"
},
"showLibraryCount": {
"label": "显示库数量",
"description": "显示实例中的库数量 (Audiobookshelf)"
"label": "显示媒体库数量",
"description": "显示实例中的媒体库数量(Audiobookshelf)"
},
"showAudiobooks": {
"label": "显示有声书",
"description": "显示所有库中的有声书总数 (Audiobookshelf)"
"label": "显示有声读物",
"description": "显示所有媒体库中的有声读物总数(Audiobookshelf)"
},
"showPodcasts": {
"label": "显示播客",
"description": "显示所有库中的播客总数 (Audiobookshelf)"
"description": "显示所有媒体库中的播客总数(Audiobookshelf)"
},
"showListeningTime": {
"label": "显示收听时间",
"description": "显示您的总收听时间 (Audiobookshelf)"
"label": "显示收听时长",
"description": "显示总收听时长(Audiobookshelf)"
},
"showActiveSessions": {
"label": "显示活跃会话",
"description": "显示当前活跃的播放会话数量 (Audiobookshelf)"
"description": "显示当前活跃播放会话的数量(Audiobookshelf)"
},
"compactMode": {
"label": "紧凑模式",
@@ -3822,8 +3868,8 @@
"artists": "艺术家",
"albums": "专辑",
"songs": "歌曲",
"libraryCount": "库",
"audiobooks": "有声书",
"libraryCount": "媒体库",
"audiobooks": "有声读物",
"podcasts": "播客",
"listeningTime": "收听时长",
"activeSessions": "活跃会话",
@@ -3923,10 +3969,10 @@
},
"beszelSystemTable": {
"name": "Beszel 系统(表格)",
"description": "所有 Beszel 监控系统的表格视图,具有可排序列和状态指示器",
"description": "所有 Beszel 监控系统的表格视图,包含可排序列和状态指示器",
"option": {
"statusFilter": {
"label": "状态过滤器"
"label": "状态筛选"
},
"sortBy": {
"label": "排序方式"
@@ -4057,17 +4103,17 @@
}
},
"beszelAlerts": {
"name": "Beszel 警报",
"description": "查看 Beszel 警报配置和历史记录",
"name": "Beszel 告警",
"description": "查看 Beszel 告警配置和历史记录",
"option": {
"showHistory": {
"label": "显示警报历史"
"label": "显示告警历史"
},
"maxHistoryItems": {
"label": "最大历史记录条数"
}
},
"empty": "未配置警报",
"empty": "未配置告警",
"error": {
"internalServerError": "无法连接到 Beszel。请检查您的集成设置。"
},
@@ -4079,15 +4125,15 @@
}
},
"beszelSystemStats": {
"name": "Beszel 系统状态",
"description": "CPU、内存、磁盘、网络和 Docker 容器指标的时间序列图表",
"name": "Beszel 系统统计",
"description": "CPU、内存、磁盘、网络和 Docker 容器指标的时序图表",
"option": {
"systemId": {
"label": "系统",
"description": "选择要显示统计信息的 Beszel 系统"
},
"timePeriod": {
"label": "时间段"
"label": "时间范围"
},
"showCpu": {
"label": "显示 CPU 图表"
@@ -4127,12 +4173,12 @@
"chart": {
"cpu": {
"title": "CPU 使用率",
"subtitle": "平均系统 CPU 利用率",
"subtitle": "系统整体 CPU 平均使用率",
"series": "CPU"
},
"memory": {
"title": "内存使用率",
"subtitle": "记录时的精确利用率",
"subtitle": "记录时间点的精确使用率",
"series": "已用",
"cache": "缓存/缓冲区"
},
@@ -4154,17 +4200,17 @@
},
"network": {
"title": "带宽",
"subtitle": "公共接口的网络流量",
"sent": "已发送",
"subtitle": "公网接口的网络流量",
"sent": "发送",
"recv": "已接收"
},
"dockerCpu": {
"title": "Docker CPU 使用率",
"subtitle": "容器的平均 CPU 利用率"
"subtitle": "容器的平均 CPU 使用率"
},
"dockerMemory": {
"title": "Docker 内存使用率",
"subtitle": "Docker 容器的内存使用"
"subtitle": "Docker 容器的内存使用率"
},
"dockerNetwork": {
"title": "Docker 网络 I/O",
@@ -4572,7 +4618,7 @@
"docker": "Docker",
"kubernetes": "Kubernetes",
"logs": "日志",
"api": "API",
"api": "API 与 MCP",
"certificates": "证书",
"tasks": "任务",
"backup": "备份"
@@ -4690,19 +4736,19 @@
"firstDayOfWeek": "一周的第一天",
"accessibility": "无障碍服务",
"onboardingTours": {
"title": "入门指南",
"description": "重置入门指南,以便在下次访问管理中心或面板时再次看到它们。",
"reset": "重置入门指南",
"title": "新手指南",
"description": "重置新手指南,以便您下次访问管理区域或面板时再次看到它们。",
"reset": "重置新手指南",
"resetSuccess": {
"title": "指南已重置",
"message": "入门指南将在您下次访问时再次显示"
"title": "新手指南已重置",
"message": "新手指南将在您下次访问时再次显示"
},
"status": {
"completed": "已完成",
"notStarted": "未开始"
},
"name": {
"management": "管理中心",
"management": "管理",
"dashboard": "面板"
}
}
@@ -4829,7 +4875,7 @@
"analytics": {
"title": "分析",
"general": {
"title": "发送匿名分析",
"title": "协助我们改进 Homarr",
"text": "这有助于我们了解用户实际使用哪些功能,从而决定将开发精力投入到哪里。我们会收集诸如您拥有多少小组件或集成、Homarr 版本以及使用的数据库类型等信息。仅此而已——不包含个人信息、URL、名称,也不含任何可能识别您本人或您个人配置的内容。"
}
},
@@ -5033,84 +5079,84 @@
"mcp": {
"label": "AI / MCP",
"title": "AI 集成",
"subtitle": "模型上下文协议 (MCP) 服务器",
"description": "将 AI 助手连接到您的 Homarr 实例,通过自然语言控制整个家庭实验室。在 Overseerr 上搜索和请求媒体,管理 Docker 容器,切换 Pi-hole,检查服务器健康状况,控制 Home Assistant 设备等——一切通过您的 AI 助手完成。",
"noApiKey": "您需要一个 API 密钥来与 MCP 服务器进行身份验证。",
"subtitle": "模型上下文协议(MCP)服务器",
"description": "将 AI 助手连接到您的 Homarr 实例,通过自然语言控制您的整个家庭实验室。在 Overseerr 上搜索和请求媒体资源,管理 Docker 容器,切换 Pi-hole,检查服务器健康状态,控制 Home Assistant 设备等——全部通过您的 AI 助手完成。",
"noApiKey": "您需要 API 密钥才能通过 MCP 服务器进行认证。",
"createApiKeyButton": "创建 API 密钥",
"endpoint": {
"title": "MCP 端点"
},
"authentication": {
"title": "认证",
"intro": "您可以使用 API 密钥或 OAuth 与 MCP 服务器进行身份验证。两种方法授予相同的访问级别。",
"intro": "您可以使用 API 密钥或 OAuth 对 MCP 服务器进行认证。两种方法授予的访问权限级别相同。",
"apiKey": {
"title": "API 密钥 (手动)",
"description": "在 MCP 客户端配置中传递带有完整 API 密钥的 ApiKey 标头。"
"title": "API 密钥(手动)",
"description": "在 MCP 客户端配置中通过 ApiKey 标头传递您的完整 API 密钥。"
},
"oauth": {
"title": "OAuth (浏览器登录)",
"description": "支持 OAuth 的客户端(如 Claude Code、opencode 或 Cursor)可以通过打开浏览器窗口进行身份验证。在客户端中运行 auth 命令,在浏览器中登录 Homarr,即可连接——API 密钥会自动创建。",
"hint": "OAuth 令牌在身份验证选项卡中显示为常规 API 密钥。您可以随时撤销它们。"
"title": "OAuth(浏览器登录)",
"description": "支持 OAuth 的客户端(如 Claude Code、opencode 或 Cursor)可通过打开浏览器窗口进行认证。在客户端中运行 auth 命令,在浏览器中登录 Homarr,即可完成连接——API 密钥将自动创建。",
"hint": "OAuth 令牌在“认证”标签页中显示为常规 API 密钥。您可以随时撤销它们。"
},
"permissions": "API 密钥决定了 AI 可用的权限——它与密钥所有者具有相同的访问级别。"
"permissions": "PI 密钥决定了 AI 可用的权限——它的访问级别与密钥所有者相同。"
},
"clientConfig": {
"title": "客户端配置",
"streamableHttp": {
"recommended": "推荐",
"title": "可流式 HTTP",
"worksWith": "适用于: Cursor, Claude Desktop, VS Code Copilot, Windsurf, Claude Code",
"addToConfig": "添加到您的 MCP 客户端配置文件:",
"cursor": "{name}: 项目或全局设置中的 {file}",
"title": "可流式传输的 HTTP",
"worksWith": "适用于:Cursor、Claude Desktop、VS Code Copilot、Windsurf、Claude Code",
"addToConfig": "添加到您的 MCP 客户端配置文件中:",
"cursor": "{name}:项目或全局设置中的 {file}",
"claudeDesktop": "{name}: {file}",
"claudeCode": "{name}: {file} 或使用 {command}",
"vsCodeCopilot": "{name}: 工作区设置中的 {file}",
"claudeCode": "{name}:{file} 或使用 {command}",
"vsCodeCopilot": "{name}:工作区设置中的 {file}",
"replaceHint": "将占位符替换为您在创建时收到的 API 密钥。"
},
"stdio": {
"title": "stdio (通过 mcp-remote 桥接的旧客户端)",
"description": "仅支持 stdio 传输的客户端。需要本地安装 {dependency} (Node.js):"
"title": "stdio(通过 mcp-remote 桥接的旧版客户端)",
"description": "适用于仅支持 stdio 传输的客户端。需要本地安装 {dependency}(Node.js):"
}
},
"testConnection": {
"title": "测试您的连接",
"description": "在终端中运行此命令以验证端点是否可达以及 API 密钥是否有效:",
"hint": "成功响应将返回 MCP 服务器功能。如果出现错误,请检查 JSON 响应以获取提示。"
"description": "在终端中运行以下命令,以验证端点可访问且您的 API 密钥有效:",
"hint": "成功响应将返回 MCP 服务器的能力信息。如果看到错误,请检查 JSON 响应中的提示。"
},
"availableTools": {
"title": "可用工具",
"description": "{count} 个工具可用。展开类别以查看各个工具及其描述。",
"description": "{count} 个工具可用。展开分类可查看各个工具及其描述。",
"columnType": "类型",
"columnName": "工具",
"columnDescription": "描述"
},
"troubleshooting": {
"title": "故障排除",
"title": "故障排查",
"missingHeader": {
"title": "\"缺少 ApiKey 标头\"",
"description": "您的客户端未发送 {header} 标头。验证 MCP 配置中的 {section} 部分是否正确。某些客户端在配置更改后需要重启。"
"title": "“缺少 ApiKey 标头”",
"description": "您的客户端未发送 {header} 标头。请检查 MCP 配置中的 {section} 部分是否正确。某些客户端在更改配置后需要重启。"
},
"invalidFormat": {
"title": "\"无效的 ApiKey 格式\"",
"description": "确保您复制了完整的 API 密钥,而不仅仅是部分。"
"title": "“ApiKey 格式无效”",
"description": "请确保您复制了完整的 API 密钥,而非仅复制了其中一部分。"
},
"invalidKey": {
"title": "\"无效的 API 密钥\"",
"description": "找不到密钥 ID 或令牌错误。API 密钥仅在创建时可见一次。如果您丢失了它,请删除旧密钥并创建新密钥。"
"title": "“API 密钥无效”",
"description": "未找到该密钥 ID,或令牌有误。API 密钥仅在创建时可见一次。如已丢失,请删除旧密钥并创建新密钥。"
},
"connectionRefused": {
"title": "连接被拒绝 / 超时",
"description": "确保 URL 可从您的 AI 客户端访问。如果 Homarr 在反向代理或 Docker 后运行,请使用外部 URL (不是 {localhost})。验证端口是否正确 (默认: Docker 为 7575)。"
"description": "请确保您的 AI 客户端能够访问该 URL。如果 Homarr 运行在反向代理后或 Docker 中,请使用外部 URL(而非 {localhost})。请确认端口是否正确(Docker 默认端口为 7575)。"
},
"toolsNotAppearing": {
"title": "工具未出现",
"description": "某些工具需要配置特定的集成(例如 Docker、Overseerr)。工具列表取决于 Homarr 实例中的可用内容。"
"title": "工具未显示",
"description": "部分工具需要先配置特定的集成(例如 Docker、Overseerr)。工具列表取决于您的 Homarr 实例中可用的功能。"
}
},
"copy": "复制",
"oneClick": {
"title": "一键安装",
"subtitle": "使用 OAuth — 首次使用时在浏览器中进行身份验证",
"subtitle": "使用 OAuth 认证——首次使用时在浏览器中进行身份验证",
"vsCode": "在 VS Code 中安装",
"cursor": "在 Cursor 中安装",
"copyUrl": "复制 MCP URL",
@@ -5123,16 +5169,16 @@
},
"backup": {
"title": "完整数据库备份",
"metaTitle": "备份与恢复",
"metaTitle": "备份 & 恢复",
"export": {
"title": "导出数据库",
"description": "下载包含所有设置、用户、面板和加密集成密钥的 SQLite 数据库的完整备份。备份打包为 ZIP 文件,附带加密密钥和元数据。",
"button": "下载备份",
"description": "下载 SQLite 数据库的完整备份,包含所有设置、用户、面板和加密的集成密钥。备份文件以 ZIP 格式打包,内含加密密钥和元数据。",
"button": "备份下载",
"error": "导出失败",
"confirm": {
"title": "敏感数据导出",
"warningTitle": "此导出包含您的整个数据库。",
"warningBody": "备份包括所有用户、集成密钥(加密)、API 密钥、面板配置和应用数据。将导出的文件安全存储,不要分享。",
"warningTitle": "此导出包含您的完整数据库。",
"warningBody": "备份包含所有用户、集成密钥(已加密)、API 密钥、面板配置和应用数据。请妥善保管导出的文件,切勿分享。",
"typePrompt": "输入 \"{phrase}\" 以继续",
"submit": "导出数据库",
"cancel": "取消"
@@ -5140,23 +5186,23 @@
},
"import": {
"title": "恢复数据库",
"description": "上传先前导出的备份 ZIP 以恢复您的数据库。这将替换您的整个数据库。如果备份是使用不同的加密密钥创建的,密钥将自动重新加密。",
"warning": "恢复备份将完全替换您当前的数据库并重启应用程序。此操作无法撤销。",
"description": "上传之前导出的备份 ZIP 文件以恢复数据库。此操作将替换整个数据库。如果备份使用的加密密钥不同,密钥将自动重新加密。",
"warning": "恢复备份将完全替换当前数据库并重启应用。此操作不可撤销。",
"dropzone": {
"title": "将备份 ZIP 拖到此处或点击浏览",
"description": "仅接受 Homarr SQLite 备份的 .zip 文件"
"title": "将备份 ZIP 文件拖放到此处,或点击浏览",
"description": "仅接受来自 Homarr SQLite 备份的 .zip 文件"
},
"changeFile": "更改文件",
"button": "恢复数据库",
"success": {
"title": "恢复完成",
"message": "数据库已成功恢复。应用程序正在重启……"
"message": "数据库已成功恢复。应用正在重启……"
},
"error": "导入失败"
},
"preview": {
"title": "备份内容",
"exported": "导出时间:{date}",
"exported": "导出于 {date}",
"loading": "正在分析备份文件……",
"errorTitle": "预览错误",
"entity": "实体",
@@ -5172,13 +5218,13 @@
"search_engine": "搜索引擎"
},
"analyzeError": "分析备份文件失败",
"invalidMissingMetadata": "无效备份:缺少 metadata.json",
"invalidMissingDb": "无效备份:缺少 db.sqlite"
"invalidMissingMetadata": "备份无效:缺少 metadata.json 文件",
"invalidMissingDb": "备份无效:缺少 db.sqlite 文件"
},
"restore": {
"dropzone": {
"title": "将备份 ZIP 拖到此处",
"description": "接受 Homarr SQLite 备份的 .zip 文件(最大 256 MB)"
"title": "将备份 ZIP 文件拖放到此处",
"description": "仅接受来自 Homarr SQLite 备份的 .zip 文件(最大 256 MB)"
},
"analyzing": "正在分析备份……",
"changeFile": "更改文件",
@@ -5187,7 +5233,7 @@
"analysisError": "分析错误",
"preview": {
"title": "备份内容",
"exported": "导出时间:{date}",
"exported": "导出于 {date}",
"entity": "实体",
"count": "数量",
"boards": "面板",
@@ -5200,43 +5246,43 @@
"media": "媒体",
"search_engine": "搜索引擎"
},
"migrationsApplied": "已应用 {count} 个迁移",
"migrationsAppliedPlural": "已应用 {count} 个迁移",
"migrationsOlderVersion": "此备份来自较旧的 Homarr 版本。已应用 {count} 个架构迁移以使其更新。",
"migrationsOlderVersionPlural": "此备份来自较旧的 Homarr 版本。已应用 {count} 个架构迁移以使其更新。",
"migrationsUpToDate": "数据库架构已是最新(已应用 {count} 个迁移)",
"upToDate": "已更新",
"migrationsPending": "{count} 个待处理"
"migrationsApplied": "已应用 {count} 项迁移",
"migrationsAppliedPlural": "已应用 {count} 项迁移",
"migrationsOlderVersion": "此备份来自较旧版本的 Homarr。已应用 {count} 项数据库迁移以将其更新至最新版本。",
"migrationsOlderVersionPlural": "此备份来自较旧版本的 Homarr。已应用 {count} 项数据库迁移以将其更新至最新版本。",
"migrationsUpToDate": "数据库架构已为最新(已应用 {count} 项迁移)",
"upToDate": "已是最新",
"migrationsPending": "{count} 项待处理"
},
"migration": {
"title": "正在应用迁移 ({current}/{total})",
"title": "正在应用迁移({current}/{total})",
"migrationLabel": "迁移 {index}"
},
"confirm": {
"title": "破坏性操作",
"warningTitle": "这将永久替换您的整个数据库。",
"warningBody": "所有当前面板、用户、应用、集成、设置和会话都将丢失。此操作无法撤销。应用将在恢复后重启。",
"warningBody": "所有现有面板、用户、应用、集成、设置和会话都将丢失。此操作不可撤销。恢复完成后应用将重启。",
"typePrompt": "输入 \"{phrase}\" 以继续",
"cancel": "取消",
"submit": "恢复数据库"
},
"progress": {
"title": "正在恢复数据库……",
"extracting": "提取备份存档",
"migrating": "应用数据库迁移",
"encrypting": "重新加密集成密钥",
"swapping": "替换数据库文件",
"restarting": "重启服务器"
"extracting": "正在解压备份压缩包",
"migrating": "正在应用数据库迁移",
"encrypting": "正在重新加密集成密钥",
"swapping": "正在替换数据库文件",
"restarting": "正在重启服务器"
},
"complete": {
"title": "恢复完成",
"message": "数据库已成功恢复。服务器正在重启——请几秒钟后刷新页面。"
"message": "数据库已成功恢复。服务器正在重启——请稍后刷新页面。"
},
"failed": {
"title": "恢复失败"
},
"invalidMissingMetadata": "无效备份:缺少 metadata.json",
"invalidMissingDb": "无效备份:缺少 db.sqlite",
"invalidMissingMetadata": "备份无效:缺少 metadata.json 文件",
"invalidMissingDb": "备份无效:缺少 db.sqlite 文件",
"analyzeError": "分析备份失败"
}
}
@@ -5918,14 +5964,14 @@
"title": "偏好设置",
"children": {
"detail": {
"title": "选择要更改的偏好",
"backHint": "按 Backspace 或使用返回按钮返回",
"title": "选择要更改的偏好设置",
"backHint": "按 Backspace 键或使用返回按钮返回",
"backAction": "返回"
}
},
"notification": {
"error": {
"message": "无法更新偏好"
"message": "无法更新偏好设置"
}
},
"option": {
@@ -5938,11 +5984,11 @@
},
"board": {
"none": "无",
"unavailable": "当前选择(不可用)"
"unavailable": "当前已选(不可用)"
},
"searchEngine": {
"none": "无",
"unavailable": "当前选择(不可用)"
"unavailable": "当前已选(不可用)"
},
"colorScheme": {
"label": "配色方案",
@@ -5977,42 +6023,42 @@
}
},
"ddgBangs": {
"label": "启用 DuckDuckGo bangs",
"label": "启用 DuckDuckGo Bang 快捷搜索",
"children": {
"detail": {
"title": "启用 DuckDuckGo bangs"
"title": "启用 DuckDuckGo Bang 快捷搜索"
}
}
},
"firstDayOfWeek": {
"label": "一周的第一天",
"label": "每周的第一天",
"children": {
"detail": {
"title": "选择一周的第一天"
"title": "选择每周的第一天"
}
}
},
"homeBoardId": {
"label": "主面板",
"label": "默认面板",
"children": {
"detail": {
"title": "选择您的主面板"
"title": "选择您的默认面板"
}
}
},
"mobileHomeBoardId": {
"label": "移动端主面板",
"label": "移动端默认面板",
"children": {
"detail": {
"title": "选择您的移动端主面板"
"title": "选择您的移动端默认面板"
}
}
},
"pingIconsEnabled": {
"label": "为 ping 使用图标",
"label": "使用图标表示 ping 状态",
"children": {
"detail": {
"title": "为 ping 使用图标"
"title": "使用图标表示 ping 状态"
}
}
},
@@ -6032,16 +6078,16 @@
}
},
"media": {
"help": "搜索电影或节目以请求",
"help": "搜索要请求的电影或剧集",
"requestMovie": "请求电影",
"requestSeries": "请求电视节目",
"openIn": "在 {kind} 中打开",
"group": {
"title": "电影和节目"
"title": "电影和剧集"
},
"action": {
"search": {
"label": "搜索电影或节目",
"label": "搜索电影或剧集",
"description": "开始输入以搜索您的媒体请求集成",
"disabled": {
"noIntegration": "添加 Overseerr、Jellyseerr 或 Seerr 集成以启用媒体搜索。",
@@ -6456,39 +6502,39 @@
"manage": {
"welcome": {
"title": "欢迎使用 Homarr!",
"description": "这是您的控制中心。您可以在此管理面板、应用、集成、用户和服务器设置。让我们浏览每个部分。"
"description": "这是您的控制中心。您可以在这里管理面板、应用、集成、用户和服务器设置。让我们逐一了解每个部分。"
},
"boardsList": {
"title": "您的面板",
"description": "这里是您的所有面板。每个面板都有自己的布局、背景和访问设置。您可以查看每个面板的创建者以及它是公开的还是私有的。"
"description": "这里是您的所有面板。每个面板都有自己的布局、背景和访问设置。您可以查看每个面板的创建者以及它是公开还是私有的。"
},
"boardsCreate": {
"title": "创建面板",
"description": "点击此处创建新面板或从以前的 Homarr 安装中导入。每个面板都有自己可共享的 URL。"
"description": "点击此处创建新面板,或从之前的 Homarr 安装中导入。每个面板都有独立的可分享链接。"
},
"appsList": {
"title": "您的应用",
"description": "这些是您添加的所有应用——指向自托管服务的链接。每个应用都有图标、可选的健康检查和面板上的状态徽章。"
"description": "这些是您已添加的所有应用——指向您自托管服务的链接。每个应用都配有图标、可选的健康检查,并在面板上显示状态标记。"
},
"appsCreate": {
"title": "添加应用",
"description": "在此注册新服务。为其命名、URL 和图标——它将作为磁贴显示在您的面板上,并带有实时状态监控。"
"description": "在此处注册新服务。设置名称、URL 和图标后,它将以磁贴形式出现在您的面板上,并带有实时状态监控。"
},
"integrationsList": {
"title": "您的集成",
"description": "这些是连接到 Homarr 的服务——Sonarr、Radarr、Plex、Jellyfin 及 50 多种其他服务。所有凭据在静态时均加密。"
"description": "这些是已连接到 Homarr 的服务——Sonarr、Radarr、Plex、Jellyfin 以及 50 多种其他服务。所有凭证均以加密方式存储。"
},
"integrationsCreate": {
"title": "添加集成",
"description": "在此连接新服务。选择类型,输入 URL 和 API 密钥——Homarr 在保存前会验证连接。"
"description": "在此处连接新服务。选择类型,输入 URL 和 API 密钥——Homarr 会在保存前验证连接。"
},
"usersList": {
"title": "您的用户",
"description": "查看所有有访问权限的人员。将用户组织到组中,并控制谁可以查看或编辑每个面板。"
"description": "查看所有拥有访问权限的用户。将用户归入不同组别,并控制谁可以查看或编辑每个面板。"
},
"usersCreate": {
"title": "创建用户",
"description": "在此添加新用户账户。您也可以使用邀请链接方便地引入。导览到此结束——您已准备就绪!"
"description": "在此处添加新用户账号。您也可以使用邀请链接简化入门流程。导览已结束——您已准备就绪!"
}
},
"board": {
@@ -6502,15 +6548,15 @@
},
"settings": {
"title": "面板设置",
"description": "更改此面板的名称、列数、背景、颜色以及访问权限。每个面板可以是公开或私有的。"
"description": "更改此面板的名称、列数、背景、颜色以及访问权限。每个面板均可设为公开或私有。"
},
"switcher": {
"title": "切换面板",
"description": "在面板间跳转。为不同目的创建独立的面板——媒体、网络、按用户或任何您喜欢的。"
"description": "在不同面板之间跳转。您可以为不同用途创建独立的面板——媒体、网络、按用户划分,或任何您喜欢的分类。"
},
"userMenu": {
"title": "您的个人资料",
"description": "更改您的配色方案、语言、主面板和偏好。您也可以从此处跳转到管理中心。"
"description": "更改您的配色方案、语言、默认面板和偏好设置。您也可以从这里跳转到管理区域。"
}
}
}
+48 -2
View File
@@ -1344,6 +1344,10 @@
"name": "crwdns5753:0crwdne5753:0",
"description": "crwdns5755:0crwdne5755:0"
},
"wud": {
"name": "crwdns6193:0crwdne6193:0",
"description": "crwdns6195:0crwdne6195:0"
},
"paperlessNgx": {
"name": "crwdns5003:0crwdne5003:0",
"description": "crwdns5005:0crwdne5005:0"
@@ -1437,8 +1441,18 @@
"here": "crwdns552:0crwdne552:0",
"iconPicker": {
"label": "crwdns554:0crwdne554:0",
"header": "crwdns556:0{countIcons}crwdne556:0",
"headerLoading": "crwdns5681:0crwdne5681:0",
"description": "crwdns6225:0crwdne6225:0",
"header": "crwdns6227:0{countIcons}crwdne6227:0",
"headerLoading": "crwdns6229:0crwdne6229:0",
"clear": "crwdns6231:0crwdne6231:0",
"uploadImage": "crwdns6233:0crwdne6233:0",
"results": "crwdns6235:0crwdne6235:0",
"localImages": "crwdns6237:0crwdne6237:0",
"svgIcons": "crwdns6239:0crwdne6239:0",
"otherImages": "crwdns6241:0crwdne6241:0",
"urlLoading": "crwdns6243:0crwdne6243:0",
"urlReady": "crwdns6245:0crwdne6245:0",
"urlError": "crwdns6247:0crwdne6247:0",
"noResults": "crwdns5683:0{search}crwdne5683:0",
"error": "crwdns5685:0crwdne5685:0"
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "crwdns6197:0crwdne6197:0",
"description": "crwdns6199:0crwdne6199:0",
"title": "crwdns6201:0crwdne6201:0",
"monitored": "crwdns6203:0crwdne6203:0",
"updatesAvailable": "crwdns6205:0count={count}crwdne6205:0",
"updateAvailable": "crwdns6207:0crwdne6207:0",
"openReleaseNotes": "crwdns6209:0crwdne6209:0",
"option": {
"showTitle": {
"label": "crwdns6211:0crwdne6211:0"
},
"showRing": {
"label": "crwdns6213:0crwdne6213:0"
},
"layout": {
"label": "crwdns6215:0crwdne6215:0",
"option": {
"horizontal": {
"label": "crwdns6217:0crwdne6217:0"
},
"vertical": {
"label": "crwdns6219:0crwdne6219:0"
}
}
},
"showUpdateList": {
"label": "crwdns6221:0crwdne6221:0",
"description": "crwdns6223:0crwdne6223:0"
}
}
},
"dnsHoleSummary": {
"name": "crwdns768:0crwdne768:0",
"description": "crwdns770:0crwdne770:0",
File diff suppressed because it is too large. Load diff
+49 -3
View File
@@ -1344,6 +1344,10 @@
"name": "",
"description": ""
},
"wud": {
"name": "Hvad Er Opad Docker",
"description": "Overvåg hvilke af dine Docker-containere der er tilgængelige billedopdateringer"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "Dokumenthåndteringssystem til arkivering og organisering af scannede dokumenter"
@@ -1437,8 +1441,18 @@
"here": "her",
"iconPicker": {
"label": "Ikon-URL",
"header": "Indtast navn eller objekter for at filtrere for ikoner... Homarr vil søge gennem {countIcons} ikoner for dig.",
"headerLoading": "",
"description": "Søg i biblioteket, indsæt en billed-URL, eller upload en fil.",
"header": "Søg efter {countIcons} billeder efter navn",
"headerLoading": "Søg billeder efter navn",
"clear": "Ryd billede",
"uploadImage": "Upload billede",
"results": "Billede søgeresultater",
"localImages": "Dine billeder",
"svgIcons": "SVG ikoner",
"otherImages": "Andre billeder",
"urlLoading": "Kontrollerer billede…",
"urlReady": "Billedet er klar til brug",
"urlError": "Dette billede kunne ikke indlæses. Tjek URL'en og prøv igen.",
"noResults": "",
"error": ""
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "Hvad Er Opad Docker",
"description": "Vis hvor mange overvågede containere der er tilgængelige opdateringer.",
"title": "Hvad Er Opad Docker",
"monitored": "Overvåget",
"updatesAvailable": "{count, plural, one {# opdatering tilgængelig} other {# opdateringer tilgængelige}}",
"updateAvailable": "Opdatering tilgængelig",
"openReleaseNotes": "Åbn udgivelsesnoter",
"option": {
"showTitle": {
"label": "Vis titel"
},
"showRing": {
"label": "Vis opdateringsring"
},
"layout": {
"label": "Layout",
"option": {
"horizontal": {
"label": "Horisontal"
},
"vertical": {
"label": "Vertikal"
}
}
},
"showUpdateList": {
"label": "Vis liste over container-opdatering",
"description": "Lister hver overvåget beholder, der har en billedopdatering tilgængelig"
}
}
},
"dnsHoleSummary": {
"name": "DNS Hole Oversigt",
"description": "Viser oversigten over dit DNS-hul",
@@ -3047,7 +3093,7 @@
"option": {
"albumId": {
"label": "Album ID",
"description": "Dette er et unikt ID som refererer til dit Immich album. Du kan finde dette id ved at åbne et album og kopiere den unikke streng fra URL, for eksempel 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
"description": "Dette er et unikt ID som refererer til dit Immich album. Du kan finde dette id ved at åbne et album og kopiere den unikke streng fra URL, for eksempel 'a21aca09-9f05-47dc-b1a1-7b53c547226e'."
},
"rotationIntervalSeconds": {
"label": "Interval i sekunder",
File diff suppressed because it is too large. Load diff
+120 -74
View File
@@ -1344,6 +1344,10 @@
"name": "Traefik",
"description": "Cloud-nativer Reverse-Proxy und Lastverteiler"
},
"wud": {
"name": "Was ist Docker hoch",
"description": "Überwachen Sie, welche Docker-Container Bildupdates verfügbar sind"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "Dokumentenverwaltungssystem zum Archivieren und Organisieren gescannter Dokumente"
@@ -1437,8 +1441,18 @@
"here": "Hier",
"iconPicker": {
"label": "Icon URL",
"header": "Geben Sie Namen oder Objekte ein, um nach Symbolen zu filtern... Homarr sucht nach {countIcons} Icons für Sie.",
"headerLoading": "Tippe um die Symbole zu durchsuchen…",
"description": "Suchen Sie die Bibliothek, fügen Sie eine Bild-URL ein oder laden Sie eine Datei hoch.",
"header": "Suche {countIcons} Bilder nach Namen",
"headerLoading": "Bilder nach Namen suchen",
"clear": "Bild löschen",
"uploadImage": "Bild hochladen",
"results": "Bildsuchergebnisse",
"localImages": "Ihre Bilder",
"svgIcons": "SVG-Symbole",
"otherImages": "Andere Bilder",
"urlLoading": "Bild wird überprüft…",
"urlReady": "Bild ist bereit zur Verwendung",
"urlError": "Dieses Bild konnte nicht geladen werden. Überprüfen Sie die URL und versuchen Sie es erneut.",
"noResults": "Keine Symbole stimmen mit \"{search}\" überein.",
"error": "Konnte Symbole nicht laden."
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "Was ist Docker hoch",
"description": "Zeigt an, wie viele überwachte Container über Updates verfügen.",
"title": "Was ist Docker hoch",
"monitored": "Überwacht",
"updatesAvailable": "{count, plural, one {# Update verfügbar} other {# Updates verfügbar}}",
"updateAvailable": "Update verfügbar",
"openReleaseNotes": "Versionshinweise öffnen",
"option": {
"showTitle": {
"label": "Titel anzeigen"
},
"showRing": {
"label": "Update-Ring anzeigen"
},
"layout": {
"label": "Ansicht",
"option": {
"horizontal": {
"label": "Horizontal"
},
"vertical": {
"label": "Vertikal"
}
}
},
"showUpdateList": {
"label": "Container-Update-Liste anzeigen",
"description": "Listet jeden überwachten Container auf, der eine Bildaktualisierung zur Verfügung hat"
}
}
},
"dnsHoleSummary": {
"name": "DNS Hole Zusammenfassung",
"description": "Zeigt die Zusammenfassung deines DNS Holes an",
@@ -2329,7 +2375,7 @@
},
"visibleStorageVolumes": {
"label": "Sichtbare Speichervolumes",
"description": "Nur verfügbar, wenn alle Integrationen Synology betreffen. Nicht ausfüllen, um alle erkannten Speichervolumes zu zeigen. ",
"description": "Nur verfügbar, wenn alle ausgewählten Integrationen Synology betreffen. Nicht ausfüllen, um alle erkannten Speichervolumes anzuzeigen.",
"placeholder": "Speichervolumen auswählen"
},
"defaultTab": {
@@ -2439,7 +2485,7 @@
"error": {
"internalServerError": "Fehler beim Abrufen der Container Statistiken",
"layoutSaveTitle": "Tabellenlayout nicht gespeichert",
"layoutSaveMessage": "Die Docker-Tabelle konnte nicht gespeichert werden. Versuche die Spalte zu verschieben oder eine andere Spaltengröße zu verwenden. "
"layoutSaveMessage": "Das Docker-Tabellenlayout konnte nicht gespeichert werden. Versuche die Spalte zu verschieben oder eine andere Spaltengröße zu verwenden."
},
"empty": {
"noContainers": "Keine Docker-Container gefunden"
@@ -2739,10 +2785,10 @@
},
"showBitrate": {
"label": "Zeigt die Bitrate an",
"description": ""
"description": "Zeige die aktuelle Wiedergabe-Bitrate neben dem Ort an"
},
"showLocation": {
"label": "",
"label": "Standort anzeigen",
"description": "Zeigt an, ob der Stream über das LAN oder WAN läuft"
}
},
@@ -2758,8 +2804,8 @@
"status": "Status",
"directPlay": "Direkte Wiedergabe",
"directStream": "Direkter Stream",
"transcodeVideo": "",
"transcodeAudio": "",
"transcodeVideo": "Video wird transkodiert",
"transcodeAudio": "Audio wird transkodiert",
"transcoding": "Transkodierung",
"paused": "Pausiert",
"remaining": "{minutes} Min. verbleibend",
@@ -2966,8 +3012,8 @@
}
},
"showOsVersion": {
"label": "",
"description": ""
"label": "Betriebssystem-Version anzeigen",
"description": "Füge die Betriebssystemversion jedem Verteilungsetikett hinzu, sofern verfügbar"
},
"showComplianceHero": {
"label": "",
@@ -3047,7 +3093,7 @@
"option": {
"albumId": {
"label": "Album ID",
"description": "Dies ist eine eindeutige ID, die sich auf Ihr Immich Album bezieht. Sie können diese ID finden, indem Sie ein Album öffnen und die einzigartige Zeichenkette von der URL kopieren, zum Beispiel 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
"description": "Dies ist eine eindeutige ID, die sich auf Ihr Immich Album bezieht. Sie können diese ID finden, indem Sie ein Album öffnen und die einzigartige Zeichenkette von der URL kopieren, zum Beispiel 'a21aca09-9f05-47dc-b1a1-7b53c547226e'."
},
"rotationIntervalSeconds": {
"label": "Intervall in Sekunden",
@@ -3117,8 +3163,8 @@
"noColumns": "Spalten in Elementen auswählen",
"noCommunications": "Kann keine Daten von der Integration laden",
"noItems": "",
"actionFailed": "",
"actionFailedMessage": ""
"actionFailed": "Aktion fehlgeschlagen",
"actionFailedMessage": "Diese Aktion konnte nicht abgeschlossen werden. Bitte versuche es erneut."
},
"items": {
"actions": {
@@ -3406,7 +3452,7 @@
"queued": ""
},
"type": {
"movie": "",
"movie": "Film",
"episode": ""
},
"empty": {
@@ -3766,7 +3812,7 @@
},
"resource": {
"routers": "",
"services": "",
"services": "Dienste",
"middlewares": ""
},
"status": {
@@ -4052,16 +4098,16 @@
"temp": "",
"battery": "",
"services": "Dienste",
"uptime": "",
"uptime": "Verfügbarkeit",
"agent": "Agent"
}
},
"beszelAlerts": {
"name": "",
"description": "",
"name": "Beszel-Meldungen",
"description": "Zeige Beszels Benachrichtigungseinstellungen und -verlauf",
"option": {
"showHistory": {
"label": ""
"label": "Alarmverlauf anzeigen"
},
"maxHistoryItems": {
"label": ""
@@ -4072,9 +4118,9 @@
"internalServerError": ""
},
"history": "Verlauf",
"resolved": "",
"resolved": "Gelöst",
"status": {
"triggered": "",
"triggered": "Ausgelöst",
"ok": "Ok"
}
},
@@ -4083,43 +4129,43 @@
"description": "",
"option": {
"systemId": {
"label": "",
"label": "System",
"description": ""
},
"timePeriod": {
"label": ""
"label": "Zeitraum"
},
"showCpu": {
"label": ""
"label": "CPU-Diagramm anzeigen"
},
"showMemory": {
"label": ""
"label": "RAM-Diagramm anzeigen"
},
"showDisk": {
"label": ""
"label": "Festplatten-Diagramm anzeigen"
},
"showDiskIO": {
"label": ""
"label": "Festplatten-E/A-Diagramm anzeigen"
},
"showNetwork": {
"label": ""
"label": "Netzwerk-Diagramm anzeigen"
},
"showDockerCpu": {
"label": ""
"label": "Docker-CPU-Diagramm anzeigen"
},
"showDockerMemory": {
"label": ""
"label": "Docker-RAM-Diagramm anzeigen"
},
"showDockerNetwork": {
"label": ""
"label": "Docker-Netzwerk-Diagramm anzeigen"
}
},
"selectSystem": "System auswählen",
"empty": {
"noSystems": ""
"noSystems": "Keine Systeme gefunden"
},
"error": {
"internalServerError": "",
"internalServerError": "Keine Verbindung zu Beszel möglich. Überprüfe deine Integrations-Einstellungen.",
"liveConnectionFailed": "",
"switchToHistorical": "",
"systemNotFound": ""
@@ -4127,48 +4173,48 @@
"chart": {
"cpu": {
"title": "CPU Auslastung",
"subtitle": "",
"subtitle": "Durchschnittliche Systemweite CPU-Auslastung",
"series": "CPU"
},
"memory": {
"title": "",
"subtitle": "",
"title": "Speicherverbrauch",
"subtitle": "Genaue Auslastung zum erfassten Zeitpunkt",
"series": "Belegt",
"cache": ""
},
"disk": {
"title": "Festplattenbelegung",
"subtitle": "",
"series": ""
"series": "Root"
},
"diskIO": {
"title": "",
"subtitle": "",
"read": "",
"write": ""
"title": "Festplatten-E/A",
"subtitle": "Durchsatz des Root-Dateisystems",
"read": "Lesen",
"write": "Schreiben"
},
"storage": {
"title": "",
"subtitle": "",
"series": ""
"title": "Speicher",
"subtitle": "Festplattenverbrauch pro Dateisystem",
"series": "Belegt"
},
"network": {
"title": "",
"subtitle": "",
"sent": "",
"recv": ""
"title": "Bandbreite",
"subtitle": "Netzwerkverkehr öffentlicher Schnittstellen",
"sent": "Gesendet",
"recv": "Empfangen"
},
"dockerCpu": {
"title": "",
"subtitle": ""
"title": "Docker-CPU-Nutzung",
"subtitle": "Durchschnittliche CPU-Nutzung der Container"
},
"dockerMemory": {
"title": "",
"subtitle": ""
"title": "Docker-RAM-Nutzung",
"subtitle": "RAM-Nutzung der Docker-Container"
},
"dockerNetwork": {
"title": "",
"subtitle": ""
"title": "Docker-Netzwerk-E/A",
"subtitle": "Netzwerkverkehr der Docker-Container"
}
}
}
@@ -4545,7 +4591,7 @@
"text": "Konnte die angeforderte Ressource nicht finden"
},
"error": {
"title": "",
"title": "Diese Seite konnte nicht geladen werden",
"text": "",
"digest": ""
},
@@ -5110,7 +5156,7 @@
"copy": "",
"oneClick": {
"title": "",
"subtitle": "",
"subtitle": "OAuth wird verwendet. Authentifiziere dich bei der ersten Nutzung im Browser",
"vsCode": "In VS Code installieren",
"cursor": "In Cursor installieren",
"copyUrl": "MCP URL kopieren",
@@ -5130,7 +5176,7 @@
"button": "Sicherung herunterladen",
"error": "Export fehlgeschlagen",
"confirm": {
"title": "",
"title": "Export sensibler Daten",
"warningTitle": "Dieser Export enthält Ihre gesamte Datenbank.",
"warningBody": "Das Backup umfasst alle Benutzer, Integrationsgeheimnisse (verschlüsselt), API-Keys, Board-Konfigurationen und App-Daten. Speichern Sie die exportierte Datei sicher ab und teilen Sie diese nicht.",
"typePrompt": "Geben Sie \"{phrase}\" ein, um fortzufahren",
@@ -5140,8 +5186,8 @@
},
"import": {
"title": "Datenbank wiederherstellen",
"description": "",
"warning": "",
"description": "Lade ein zuvor exportiertes Backup-ZIP‑File hoch, um deine Datenbank wiederherzustellen. Damit ersetzt du deine gesamte jetzige Datenbank. Falls das Backup mit einem anderen Verschlüsselungs-Key erstellt wurde, werden vertrauliche Daten (Secrets) automatisch neu verschlüsselt.",
"warning": "Ein Backup wiederherzustellen, wird deine jetzige Datenbank komplett ersetzen und das Programm neu starten. Diese Aktion kann nicht rückgängig gemacht werden.",
"dropzone": {
"title": "Ziehen Sie Ihre Backup-ZIP hierher oder klicken Sie zum Durchsuchen",
"description": "Nur .zip Dateien aus einer Homarr SQLite-Sicherung werden akzeptiert"
@@ -6050,7 +6096,7 @@
}
},
"availability": {
"available": "",
"available": "Verfügbar",
"partiallyAvailable": "",
"processing": "",
"requested": "",
@@ -6332,10 +6378,10 @@
"header": {
"season": "Staffel",
"episodes": "Episoden",
"status": ""
"status": "Status"
},
"status": {
"requested": ""
"requested": "Angefragt"
}
},
"button": {
@@ -6448,18 +6494,18 @@
}
},
"onboardingTour": {
"learnMore": "",
"next": "",
"prev": "",
"done": "",
"skip": "",
"learnMore": "Lese die Dokumentation",
"next": "Weiter",
"prev": "Zurück",
"done": "Fertig",
"skip": "Überspringe die Einführung",
"manage": {
"welcome": {
"title": "",
"description": ""
"title": "Willkommen bei Homarr!",
"description": "Das ist dein Kontrollzentrum. Von hier steuerst du Boards, Apps, Integrationen, Benutzer und die Servereinstellungen. Lass uns eine Einführung in jeden Bereich machen."
},
"boardsList": {
"title": "",
"title": "Deine Boards",
"description": ""
},
"boardsCreate": {
@@ -6493,15 +6539,15 @@
},
"board": {
"welcome": {
"title": "",
"description": ""
"title": "Das ist dein Board",
"description": "Ein Drag-and-drop-Dashboard, wo du Apps und Widgets anordnen kannst. Du kannst jederzeit Strg+K drücken, um nach Apps, Boards und Aktionen zu suchen."
},
"editMode": {
"title": "Bearbeitungsmodus",
"description": ""
"description": "Drücke hier, um in den Bearbeitungsmodus zu kommen. Dort kannst du Widgets, Apps und Abschnitte hinzufügen, welche du durch anschließendes Ziehen neu anordnen und an den Ecken in der Größe anpassen kannst."
},
"settings": {
"title": "",
"title": "Board-Einstellungen",
"description": ""
},
"switcher": {
File diff suppressed because it is too large. Load diff
+112 -66
View File
@@ -91,7 +91,7 @@
},
"settings": {
"title": "Settings",
"subtitle": "Configure server settings"
"subtitle": "Configure server settings."
},
"integrations": {
"title": "Integrations",
@@ -351,7 +351,7 @@
"delete": {
"label": "Permanently delete user",
"description": "This deletes this user, including their preferences. This will not delete any boards. The user will not be notified.",
"confirm": "Are you sure that you want to delete the user {username}, as well as their preferences"
"confirm": "Are you sure that you want to delete the user {username}, as well as their preferences?"
},
"select": {
"label": "Select a user",
@@ -517,7 +517,7 @@
"transfer": {
"label": "Transfer group ownership",
"description": "Transfer ownership of this group to another user.",
"confirm": "Are you want to transfer the ownership of the group, {name} to {username}",
"confirm": "Are you want to transfer the ownership of the group, {name} to {username}?",
"notification": {
"success": {
"message": "Successfully transferred group {group} to {user}"
@@ -536,7 +536,7 @@
},
"delete": {
"label": "Delete group",
"description": "Once you delete this group, you can not revert the change. Please be careful",
"description": "Once you delete this group, you can not revert the change. Please be careful.",
"confirm": "Are you sure you want to delete the group, {name}?",
"notification": {
"success": {
@@ -1344,6 +1344,10 @@
"name": "Traefik",
"description": "Cloud-native reverse proxy and load balancer"
},
"wud": {
"name": "What's Up Docker",
"description": "Monitor which of your Docker containers have image updates available"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "Document management system for archiving and organizing scanned documents"
@@ -1437,8 +1441,18 @@
"here": "here",
"iconPicker": {
"label": "Icon URL",
"header": "Please enter a name or object to filter for the icon. Homarr will search throughout {countIcons} different icons to find the right one.",
"headerLoading": "Type to search icons…",
"description": "Search the library, paste an image URL, or upload a file.",
"header": "Please enter a name or object to filter for the icon. Homarr will search throughout {countIcons} different icons to find the right one",
"headerLoading": "Type to search icons",
"clear": "Clear image",
"uploadImage": "Upload image",
"results": "Image search results",
"localImages": "Your images",
"svgIcons": "SVG icons",
"otherImages": "Other images",
"urlLoading": "Checking image…",
"urlReady": "Image is ready to use",
"urlError": "This image could not be loaded. Check the URL and try again.",
"noResults": "No icons match \"{search}\".",
"error": "Couldn't load icons."
},
@@ -1498,7 +1512,7 @@
"login": "Log-in",
"homeBoard": "Your home board",
"loggedOut": "Logged out",
"updateAvailable": "New update available: {tag}"
"updateAvailable": "{countUpdates} updates available: {tag}"
}
},
"dangerZone": "Danger zone",
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "What's Up Docker",
"description": "Show how many watched containers have updates available.",
"title": "What's Up Docker",
"monitored": "Monitored",
"updatesAvailable": "{count, plural, one {# update available} other {# updates available}}",
"updateAvailable": "Update available",
"openReleaseNotes": "Open release notes",
"option": {
"showTitle": {
"label": "Show title"
},
"showRing": {
"label": "Show update ring"
},
"layout": {
"label": "Layout",
"option": {
"horizontal": {
"label": "Horizontal"
},
"vertical": {
"label": "Vertical"
}
}
},
"showUpdateList": {
"label": "Show container update list",
"description": "Lists each monitored container that has an image update available"
}
}
},
"dnsHoleSummary": {
"name": "DNS Hole Summary",
"description": "Displays the summary of your DNS Hole",
@@ -1885,7 +1931,7 @@
"label": "Display seconds"
},
"useCustomTimezone": {
"label": " "
"label": "Use a fixed timezone"
},
"timezone": {
"label": "Time zone",
@@ -2430,19 +2476,19 @@
"label": "Invert sorting"
},
"columnOrder": {
"label": ""
"label": "Column order"
},
"columnWidths": {
"label": ""
"label": "Column widths"
}
},
"error": {
"internalServerError": "Failed to fetch containers stats",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "Table layout not saved",
"layoutSaveMessage": "The Docker table layout could not be saved. Try moving or resizing the column again."
},
"empty": {
"noContainers": ""
"noContainers": "No containers found"
}
},
"coolify": {
@@ -2738,17 +2784,17 @@
"description": "Disabling this will not work for Plex"
},
"showBitrate": {
"label": "",
"description": ""
"label": "Show bitrate",
"description": "Show the current playback bitrate next to the location"
},
"showLocation": {
"label": "",
"description": ""
"label": "Show location",
"description": "Show whether the stream is on your LAN or WAN"
}
},
"footer": {
"streams": "",
"totalBitrate": ""
"streams": "{count, plural, one {# active stream} other {# active streams}}",
"totalBitrate": "Total: {bitrate}"
},
"items": {
"currentlyPlaying": "Currently playing",
@@ -2757,9 +2803,9 @@
"id": "Id",
"status": "Status",
"directPlay": "Direct play",
"directStream": "",
"transcodeVideo": "",
"transcodeAudio": "",
"directStream": "Direct stream",
"transcodeVideo": "Transcoding video",
"transcodeAudio": "Transcoding audio",
"transcoding": "Transcoding",
"paused": "Paused",
"remaining": "{minutes} min left",
@@ -3047,7 +3093,7 @@
"option": {
"albumId": {
"label": "Album ID",
"description": "This is a unique ID which refers to your Immich album. You can find this id by opening an album and copying the unique string from the URL, for example 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
"description": "This is a unique ID which refers to your Immich album. You can find this id by opening an album and copying the unique string from the URL, for example 'a21aca09-9f05-47dc-b1a1-7b53c547226e'."
},
"rotationIntervalSeconds": {
"label": "Interval in seconds",
@@ -3107,18 +3153,18 @@
"description": ""
},
"columnOrder": {
"label": ""
"label": "Column order"
},
"columnWidths": {
"label": ""
"label": "Column widths"
}
},
"errors": {
"noColumns": "",
"noCommunications": "",
"noItems": "",
"actionFailed": "",
"actionFailedMessage": ""
"noItems": "No downloads found",
"actionFailed": "Action failed",
"actionFailedMessage": "The action could not be completed. Please try again."
},
"items": {
"actions": {
@@ -3133,7 +3179,7 @@
"detailsTitle": ""
},
"downSpeed": {
"columnTitle": "",
"columnTitle": "Down",
"detailsTitle": ""
},
"index": {
@@ -3142,16 +3188,16 @@
},
"id": {
"columnTitle": "",
"detailsTitle": ""
"detailsTitle": "Item ID"
},
"integration": {
"columnTitle": ""
},
"name": {
"columnTitle": ""
"columnTitle": "Job name"
},
"progress": {
"columnTitle": "",
"columnTitle": "Progress",
"detailsTitle": ""
},
"ratio": {
@@ -3171,13 +3217,13 @@
"detailsTitle": ""
},
"state": {
"columnTitle": "",
"columnTitle": "State",
"detailsTitle": ""
},
"time": {
"columnTitle": "",
"detailsTitle": "",
"eta": ""
"eta": "ETA"
},
"type": {
"columnTitle": "",
@@ -3223,21 +3269,21 @@
},
"globalRatio": "",
"contextMenu": {
"copyName": "",
"copyId": "",
"clearFilters": ""
"copyName": "Copy name",
"copyId": "Copy ID",
"clearFilters": "Clear filters"
},
"footer": {
"filter": ""
"filter": "Filter downloads"
},
"stats": {
"show": "",
"hide": "",
"overallProgress": "",
"totalSize": "",
"clients": ""
"show": "Show global stats",
"hide": "Hide global stats",
"overallProgress": "Overall queue progress",
"totalSize": "Total queue size",
"clients": "{count, plural, one {# client} other {# clients}}"
},
"disconnected": ""
"disconnected": "(disconnected)"
},
"mediaReleases": {
"name": "",
@@ -3269,7 +3315,7 @@
}
},
"mediaRequests-requestList": {
"name": "",
"name": "Media Requests List",
"description": "",
"option": {
"linksTargetNewTab": {
@@ -3291,15 +3337,15 @@
"unknown": "",
"pending": "",
"processing": "",
"requested": "",
"requested": "Requested",
"partiallyAvailable": "",
"available": "",
"blacklisted": "",
"blacklisted": "Blacklisted",
"deleted": ""
},
"status": {
"pending": "",
"approved": "",
"approved": "Approved",
"declined": "",
"failed": "",
"completed": ""
@@ -3312,7 +3358,7 @@
"option": {},
"titles": {
"stats": {
"main": "",
"main": "Media Stats",
"approved": "",
"pending": "",
"processing": "",
@@ -3356,15 +3402,15 @@
"panel": {
"statistics": {
"empty": "",
"transcodes": "",
"transcodes": "Transcodes",
"transcodesCount": "",
"healthChecksCount": "",
"filesCount": "",
"savedSpace": "",
"healthChecks": "",
"videoCodecs": "",
"videoContainers": "",
"videoResolutions": ""
"healthChecks": "Health checks",
"videoCodecs": "Codecs",
"videoContainers": "Containers",
"videoResolutions": "Resolutions"
},
"workers": {
"empty": "",
@@ -3574,7 +3620,7 @@
"option": {},
"card": {
"vpn": {
"countConnected": ""
"countConnected": "{count} connected"
}
},
"error": {
@@ -3591,14 +3637,14 @@
"name": ""
},
"wifi": {
"name": ""
"name": "Wi-Fi"
}
},
"users": {
"label": ""
},
"guests": {
"label": ""
"label": "Guests"
}
},
"option": {
@@ -3844,7 +3890,7 @@
"option": {
"cpu": "",
"memory": "",
"gpu": "",
"gpu": "GPU",
"network": ""
}
},
@@ -3862,7 +3908,7 @@
"cpu": "",
"memory": "",
"gpu": "",
"network": "",
"network": "NET",
"up": "",
"down": ""
}
@@ -3968,17 +4014,17 @@
"label": "Show agent version"
},
"columnOrder": {
"label": ""
"label": "Column order"
},
"columnWidths": {
"label": ""
"label": "Column widths"
}
},
"noRecords": "No systems found",
"error": {
"internalServerError": "Unable to connect to Beszel. Check your integration settings.",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "Unable to save table layout",
"layoutSaveMessage": "Your column order or widths could not be saved. Please try again."
},
"column": {
"system": "System",
@@ -4910,7 +4956,7 @@
"title": "",
"status": {
"idle": "",
"running": "",
"running": "Running",
"error": "",
"disabled": ""
},
@@ -5376,7 +5422,7 @@
},
"remove": {
"label": "",
"confirm": "",
"confirm": "Click again to remove permanently",
"notification": {
"success": {
"title": "",
@@ -5812,7 +5858,7 @@
}
},
"search": {
"placeholder": "",
"placeholder": "Search for anything",
"nothingFound": "",
"error": {
"fetch": ""
+84
View File
@@ -1015,6 +1015,8 @@
"search": "Search",
"mediaTranscoding": "Transcoding",
"networkController": "Network",
"unifiOs": "UniFi OS",
"unifiSiteManager": "UniFi Site Manager",
"releasesProvider": "Releases",
"notifications": "Notifications",
"firewall": "Firewall",
@@ -1297,6 +1299,10 @@
"label": "API Secret",
"newLabel": "New API Secret"
},
"siteManagerApiKey": {
"label": "Site Manager API Key",
"newLabel": "New Site Manager API Key"
},
"githubAppId": {
"label": "App Id",
"newLabel": "New App Id"
@@ -4217,6 +4223,84 @@
"subtitle": "Network traffic of docker containers"
}
}
},
"unifiOs": {
"name": "UniFi OS",
"description": "Network overview from a UniFi OS console",
"option": {
"showIsp": {
"label": "Show ISP details",
"description": "Requires a Site Manager API key"
},
"showDevices": {
"label": "Show devices",
"description": "Display how many devices are online"
},
"showFirmwareUpdates": {
"label": "Show firmware updates",
"description": "Display how many devices have a pending firmware update"
}
},
"card": {
"internet": "Internet",
"up": "Up",
"down": "Down",
"latency": "{value} ms",
"packetLoss": "{value} % loss",
"measuredAt": "Measured at {time}",
"stale": "Local data could not be refreshed, showing the last known values",
"clients": "Clients",
"clientBreakdown": "{total} · {wired} wired · {wireless} Wi-Fi",
"devices": "Devices",
"devicesOnline": "{online} / {total} online",
"firmware": "Firmware",
"firmwarePending": "{count} to update",
"version": "Network {version}",
"gatewayUptime": "Gateway up {uptime}"
},
"error": {
"internalServerError": "Could not reach the UniFi OS console",
"noData": "No data available"
}
},
"unifiSiteManager": {
"name": "UniFi Site Manager",
"description": "Multi-site overview from a UniFi account",
"option": {
"showIsp": { "label": "Show ISP", "description": "Display the ISP name column" },
"showExternalIp": { "label": "Show public IP", "description": "Display the public IP column" }
},
"column": {
"site": "Site",
"health": "Health (24h)",
"wanUptime": "WAN uptime",
"latency": "Latency",
"isp": "ISP",
"externalIp": "Public IP",
"devices": "Devices",
"updates": "Updates",
"console": "Console",
"sdWan": "SD-WAN"
},
"sdWan": {
"connected": "Connected",
"disconnected": "Disconnected",
"offline": "Offline"
},
"health": {
"healthy": "healthy",
"degraded": "degraded",
"down": "down",
"unknown": "not reported"
},
"wanUptime": "{value} %",
"latency": "{value} ms · {loss} % loss",
"latencyOnly": "{value} ms",
"devicesOnline": "{online} / {total}",
"consoleUpdateAvailable": "Update available",
"consoleUpToDate": "Up to date",
"noSites": "No sites in this account",
"error": { "internalServerError": "Could not reach the UniFi Site Manager API" }
}
},
"widgetPreview": {
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+110 -64
View File
@@ -91,7 +91,7 @@
},
"settings": {
"title": "Asetukset",
"subtitle": "Määritä palvelinasetukset."
"subtitle": "Määritä palvelimen asetukset."
},
"integrations": {
"title": "Integraatiot",
@@ -110,7 +110,7 @@
"message": "Jotain meni pieleen kojelautaasi määritettäessä. Yritä uudelleen."
},
"helpers": {
"tooltip": "URL-apurit",
"tooltip": "URL-avustajat",
"description": "Nämä apurit pyrkivät arvaamaan palveluidesi URL-osoitteet. Jos tämä ei toimi, kirjoita osoite manuaalisesti."
}
},
@@ -131,7 +131,7 @@
"summary": "Homarr havaitse {apps} sovellusta, joista {integrations} löytyy sisäänrakennettu integraatio",
"appBadge": "Sovellus",
"appSectionLabel": "Ohjauspaneeliin lisättävät sovellukset ({count} valittu)",
"scanning": "Dockeria tutkitaan...",
"scanning": "Tutkitaan Dockeria...",
"scanningDescription": "Tunnistetaan järjestelmässäsi suoritettavia kontteja"
}
},
@@ -159,7 +159,7 @@
},
"invite": {
"title": "Liity Homarriin",
"subtitle": "Tervetuloa Homarriin! Luo itsellesi käyttäjätunnus",
"subtitle": "Tervetuloa Homarriin! Luo käyttäjätunnuksesi",
"description": "Sinut kutsui {username}"
},
"init": {
@@ -218,7 +218,7 @@
"action": {
"login": {
"label": "Kirjaudu",
"labelWith": "Kirjaudu {{provider}}-tunnuksella",
"labelWith": "Kirjaudu palvelulla: {provider}",
"notification": {
"success": {
"title": "Kirjautuminen onnistui",
@@ -302,7 +302,7 @@
"changeDdgBangs": {
"notification": {
"success": {
"message": "DuckDuckGo Bangs -komentojen tila vaihdettiin"
"message": "DuckDuckGon Bangs-komentojen tila vaihdettiin"
},
"error": {
"message": "DuckDuckGo Bangs -komentojen tilaa ei voitu vaihtaa"
@@ -397,7 +397,7 @@
},
"use-all": {
"label": "Sovellusten käyttö",
"description": "Sallii jäsenten lisätä kaikkia sovelluksia paneeleihinsa."
"description": "Sallii jäsenten lisätä kaikkia sovelluksia paneeleihinsa"
},
"modify-all": {
"label": "Sovellusten muokkaus",
@@ -414,19 +414,19 @@
"item": {
"create": {
"label": "Paneelien luonti",
"description": "Sallii jäsenten luoda paneeleita."
"description": "Sallii jäsenten luoda paneeleita"
},
"view-all": {
"label": "Paneelien tarkastelu",
"description": "Sallii jäsenten tarkastella kaikkia paneeleita."
"description": "Sallii jäsenten tarkastella kaikkia paneeleita"
},
"modify-all": {
"label": "Paneelien muokkaus",
"description": "Sallii jäsenten muokata kaikkia paneeleita (pois lukien käyttöoikeudet ja vaaravyöhyke)."
"description": "Sallii jäsenten muokata kaikkia paneeleita (pois lukien käyttöoikeudet ja vaaravyöhyke)"
},
"full-all": {
"label": "Paneelien hallinta",
"description": "Sallii jäsenten tarkastella, muokata ja poistaa kaikkia paneeleita (mukaan lukien käyttöoikeudet ja vaaravyöhyke)."
"description": "Sallii jäsenten tarkastella, muokata ja poistaa kaikkia paneeleita (mukaan lukien käyttöoikeudet ja vaaravyöhyke)"
}
}
},
@@ -996,7 +996,7 @@
"grid": {
"widgetCount": "{count} widgettiä",
"noWidgets": "Widgettejä ei ole",
"detected": "Havaittu Dockerin kautta"
"detected": "Havaittu Dockerilla"
},
"category": {
"dnsHole": "DNS",
@@ -1228,7 +1228,7 @@
},
"tooManyRequests": {
"title": "",
"message": "Pyyntöjä oli liikaa. Pyyntöjäsi todennäköisesti rajoitetaan tai sinut estetään kohdejärjestelmässä."
"message": "Pyyntöjä oli liikaa. Pyyntöjäsi todennäköisesti rajoitetaan tai sinut estetään kohdejärjestelmässä"
}
}
},
@@ -1254,8 +1254,8 @@
"newLabel": "Uusi käyttäjätunnus"
},
"apiKey": {
"label": "Rajapinnan avain",
"newLabel": "Uusi rajapinnan avain"
"label": "API-avain",
"newLabel": "Uusi API-avain"
},
"password": {
"label": "Salasana",
@@ -1344,6 +1344,10 @@
"name": "Traefik",
"description": "Pilvinatiivi käänteinen välityspalvelin ja kuormantasaaja"
},
"wud": {
"name": "Mikä Ylös Docker",
"description": "Tarkkaile missä Docker-säiliöissä on saatavilla kuvapäivityksiä"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "Asiakirjojen hallintajärjestelmä skannattujen dokumenttien arkistointiin ja järjestelyyn"
@@ -1437,8 +1441,18 @@
"here": "",
"iconPicker": {
"label": "Kuvakkeen URL-osoite",
"header": "Suodata kuvakkeita syöttämällä nimi tai objekti... Homarr etsii {countIcons} kuvakkeesta.",
"headerLoading": "Kirjoita hakeaksesi kuvakkeita…",
"description": "Etsi kirjastosta, liitä kuvan URL-osoite tai lataa tiedosto.",
"header": "Etsi {countIcons} kuvaa nimen mukaan",
"headerLoading": "Hae kuvia nimen mukaan",
"clear": "Tyhjennä kuva",
"uploadImage": "Lataa kuva",
"results": "Haun tulokset",
"localImages": "Omat kuvat",
"svgIcons": "SVG kuvakkeet",
"otherImages": "Muut kuvat",
"urlLoading": "Tarkistetaan kuvaa…",
"urlReady": "Kuva on valmis käytettäväksi",
"urlError": "Kuvaa ei voitu ladata. Tarkista URL-osoite ja yritä uudelleen.",
"noResults": "Ei kuvakkeita haulla \"{search}\".",
"error": "Kuvakkeiden lataaminen epäonnistui."
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "Mikä Ylös Docker",
"description": "Näytä kuinka monta katsottua astiaa on saatavilla päivityksiä.",
"title": "Mikä Ylös Docker",
"monitored": "Valvottu",
"updatesAvailable": "{count, plural, one {# päivitys saatavilla} other {# päivitystä saatavilla}}",
"updateAvailable": "Päivitys saatavilla",
"openReleaseNotes": "Avaa julkaisutiedot",
"option": {
"showTitle": {
"label": "Näytä otsikko"
},
"showRing": {
"label": "Näytä päivitysrengas"
},
"layout": {
"label": "Asettelu",
"option": {
"horizontal": {
"label": "Vaaka"
},
"vertical": {
"label": "Pysty"
}
}
},
"showUpdateList": {
"label": "Näytä kontin päivityslista",
"description": "Luettele jokaisen seuratun säiliön joka on saatavilla päivityksessä"
}
}
},
"dnsHoleSummary": {
"name": "",
"description": "",
@@ -2239,7 +2285,7 @@
},
"showCurrentWindSpeed": {
"label": "Näytä nykyinen tuulen nopeus",
"description": "Vain nykyiselle säälle."
"description": "Vain nykyiselle säälle"
},
"useImperialSpeed": {
"label": "Käytä tuulen nopeudelle mph-yksikköä"
@@ -2430,19 +2476,19 @@
"label": "Käänteinen järjestys"
},
"columnOrder": {
"label": ""
"label": "Sarakkeiden järjestys"
},
"columnWidths": {
"label": ""
"label": "Sarakkeiden leveydet"
}
},
"error": {
"internalServerError": "",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "Taulukon asettelua ei tallennettu",
"layoutSaveMessage": "Docker-taulukon asettelua ei voitu tallentaa. Yritä siirtää tai muuttaa sarakkeen kokoa uudelleen."
},
"empty": {
"noContainers": ""
"noContainers": "Kontteja ei löytynyt"
}
},
"coolify": {
@@ -2738,17 +2784,17 @@
"description": ""
},
"showBitrate": {
"label": "",
"description": ""
"label": "Näytä bittinopeus",
"description": "Näytä nykyinen toiston bittinopeus sijainnin vieressä"
},
"showLocation": {
"label": "",
"description": ""
"label": "Näytä sijainti",
"description": "Näytä, onko suoratoisto LAN- vai WAN-verkossa."
}
},
"footer": {
"streams": "",
"totalBitrate": ""
"streams": "{count, plural, one {# aktiivinen suoratoisto} other {# aktiivista suoratoistoa}}",
"totalBitrate": "Yhteensä: {bitrate}"
},
"items": {
"currentlyPlaying": "",
@@ -2757,9 +2803,9 @@
"id": "",
"status": "Tila",
"directPlay": "Muuntamaton toisto",
"directStream": "",
"transcodeVideo": "",
"transcodeAudio": "",
"directStream": "Suora suoratoisto",
"transcodeVideo": "Videon transkoodaus",
"transcodeAudio": "Äänen transkoodaus",
"transcoding": "Transkoodaus",
"paused": "Keskeytetty",
"remaining": "{minutes} min jäljellä",
@@ -3104,21 +3150,21 @@
},
"limitPerIntegration": {
"label": "Integraation elementtien määrärajoitus",
"description": "Tämä rajoittaa näytettävien elementtien määrää integraatiokohtaisesti, ei kokonaisvaltaisesti."
"description": "Tämä rajoittaa näytettävien elementtien määrää integraatiokohtaisesti, ei kokonaisvaltaisesti"
},
"columnOrder": {
"label": ""
"label": "Sarakkeiden järjestys"
},
"columnWidths": {
"label": ""
"label": "Sarakkeiden leveydet"
}
},
"errors": {
"noColumns": "Valitse kohteiden sarakkeet",
"noCommunications": "Integraatiolta ei voida noutaa tietoja",
"noItems": "",
"actionFailed": "",
"actionFailedMessage": ""
"noItems": "Latauksia ei löytynyt",
"actionFailed": "Toiminto epäonnistui",
"actionFailedMessage": "Toimintoa ei voitu suorittaa. Yritä uudelleen."
},
"items": {
"actions": {
@@ -3142,7 +3188,7 @@
},
"id": {
"columnTitle": "Tunniste",
"detailsTitle": ""
"detailsTitle": "Kohteen ID"
},
"integration": {
"columnTitle": "Integraatio"
@@ -3177,7 +3223,7 @@
"time": {
"columnTitle": "Valmistumisaika",
"detailsTitle": "",
"eta": ""
"eta": "Arvioitu aika"
},
"type": {
"columnTitle": "Tyyppi",
@@ -3223,21 +3269,21 @@
},
"globalRatio": "Kokonaissuhde",
"contextMenu": {
"copyName": "",
"copyId": "",
"clearFilters": ""
"copyName": "Kopioi nimi",
"copyId": "Kopioi ID",
"clearFilters": "Tyhjennä suodattimet"
},
"footer": {
"filter": ""
"filter": "Suodata latauksia"
},
"stats": {
"show": "",
"hide": "",
"overallProgress": "",
"totalSize": "",
"clients": ""
"show": "Näytä globaalit tilastot",
"hide": "Piilota globaalit tilastot",
"overallProgress": "Jonon kokonaisedistyminen",
"totalSize": "Jonon kokonaiskoko",
"clients": "{count, plural, one {# asiakas} other {# asiakasta}}"
},
"disconnected": ""
"disconnected": "(ei yhteydessä)"
},
"mediaReleases": {
"name": "",
@@ -3699,7 +3745,7 @@
"unhealthy": "",
"ok": "",
"fail": "",
"noSectionsEnabled": "Aktivoi ainakin yksi osio widgetin asetuksista.",
"noSectionsEnabled": "Ota ainakin yksi osio käyttöön widgetin asetuksista.",
"error": {
"internalServerError": ""
}
@@ -3968,17 +4014,17 @@
"label": "Näytä agentin versio"
},
"columnOrder": {
"label": ""
"label": "Sarakkeiden järjestys"
},
"columnWidths": {
"label": ""
"label": "Sarakkeiden leveydet"
}
},
"noRecords": "Järjestelmiä ei löytynyt",
"error": {
"internalServerError": "Beszel-yhteyden muodostaminen epäonnistui. Tarkista integraatioasetuksesi.",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "Taulukon asettelua ei voitu tallentaa",
"layoutSaveMessage": "Sarakkeiden järjestystä tai leveyksiä ei voitu tallentaa. Yritä uudelleen."
},
"column": {
"system": "Järjestelmä",
@@ -4377,7 +4423,7 @@
},
"itemRadius": {
"label": "Kohteen säde",
"description": "Muuttaa paneelin korttien kulmien pyöristystä.",
"description": "Muuttaa paneelin korttien pyöreyttä",
"option": {
"xs": "Erittäin pieni",
"sm": "Pieni",
@@ -4922,7 +4968,7 @@
"label": "Analytiikka"
},
"ping": {
"label": "Ping-koestukset"
"label": "Pingit"
}
},
"interval": {
@@ -5287,7 +5333,7 @@
"refresh": {
"lastUpdated": "Viimeisin päivitys {when}"
},
"search": "Suodata {count} konttia...",
"search": "Suodata {count} konttia",
"selected": "{selectCount}/{totalCount} kontista valittu",
"footer": "Yhteensä {count} konttia",
"totalCpu": "CPU yhteensä: {cpu}%",
@@ -5376,7 +5422,7 @@
},
"remove": {
"label": "Poista",
"confirm": "",
"confirm": "Napsauta uudelleen poistaaksesi pysyvästi",
"notification": {
"success": {
"title": "",
@@ -5918,14 +5964,14 @@
"title": "Asetukset",
"children": {
"detail": {
"title": "Valitse muutettava asetus.",
"title": "Valitse muutettava asetus",
"backHint": "Palaa takaisin askelpalauttimella tai painamalla Takaisin-painiketta",
"backAction": "Palaa takaisin"
}
},
"notification": {
"error": {
"message": "Asetusta ei voitu päivittää."
"message": "Asetusta ei voitu päivittää"
}
},
"option": {
@@ -6009,10 +6055,10 @@
}
},
"pingIconsEnabled": {
"label": "Käytä ping-kuvakkeita",
"label": "Käytä ping-ikoneita",
"children": {
"detail": {
"title": "Käytä ping-kuvakkeita"
"title": "Käytä ping-ikoneita"
}
}
},
@@ -6191,7 +6237,7 @@
"label": "Hallinnoi Dockeria"
},
"manageApi": {
"label": "Swagger-rajapinta"
"label": "Swagger API"
},
"manageLog": {
"label": "Tarkastele lokeja"
+251 -205
View File
@@ -4,7 +4,7 @@
"start": {
"title": "Bienvenue sur Homarr",
"subtitle": "Commençons par configurer votre instance Homarr.",
"description": "Pour commencer, veuillez selectionner comment vous souhaitez configurer votre instance Homarr.",
"description": "Pour commencer, veuillez sélectionner comment vous souhaitez configurer votre instance Homarr.",
"action": {
"scratch": "Partir de zéro",
"importOldmarr": "Importer depuis Homarr avant la 1.0",
@@ -129,7 +129,7 @@
"detected": "Docker a détecté {count} services",
"detectedBreakdown": "Intégrations {integrations} · Applications {apps}",
"summary": "Les applications {apps} ont été détectées par Homarr, dont {integrations} ont des intégrations intégrées",
"appBadge": "App",
"appBadge": "Application",
"appSectionLabel": "Applications à ajouter au tableau de bord ({count} sélectionné)",
"scanning": "Analyse de Docker...",
"scanningDescription": "Recherche de conteneurs en cours d'exécution sur votre système"
@@ -604,7 +604,7 @@
}
},
"app": {
"search": "Trouver une application",
"search": "Trouver une app",
"page": {
"list": {
"title": "Applications",
@@ -673,7 +673,7 @@
},
"action": {
"select": {
"label": "Sélectionner l'app",
"label": "Sélectionner une app",
"notFound": "Aucune app trouvée",
"search": "Rechercher une application",
"noResults": "Pas de résultats",
@@ -739,37 +739,37 @@
"label": "Étiquette",
"unit": "Unité",
"mappings": "Correspondances",
"tablePath": "",
"tablePathHint": "",
"tablePath": "Chemin du tableau JSON",
"tablePathHint": "Chemin vers le tableau dans la réponse, par exemple $.data.items",
"columns": "Colonnes",
"header": "En-tête",
"items": "Objets",
"gridColumns": "Nombre de colonnes",
"cardStyle": "Style des cartes",
"bars": "Barres",
"valuePath": "",
"maxPath": "",
"valuePath": "Chemin de la valeur JSON",
"maxPath": "Chemin de la valeur max JSON",
"showPercentage": "Afficher le pourcentage",
"barSize": "Taille de la barre",
"goodValues": "Bonnes valeurs (séparées par des virgules)",
"dotSize": "Taille des points",
"valueSize": "Taille",
"labelPosition": "Position du libellé",
"kvLayout": "",
"striped": "",
"kvLayout": "Mise en page",
"striped": "Lignes en couleur alternées",
"compact": "Mode Compact",
"maxHeight": "",
"maxHeight": "Hauteur maximale (px)",
"color": "Couleur",
"buttonLabel": "",
"buttonColor": "",
"buttonLabel": "Libellé du bouton",
"buttonColor": "Couleur du bouton",
"confirmText": "Texte de confirmation",
"confirmTextHint": "",
"confirmTextHint": "Si défini, une popup de confirmation apparaîtra avant d'exécuter la requête",
"successMessage": "Message de réussite",
"successMessageHint": "",
"successMessageHint": "Message affiché après une exécution réussie",
"enabled": "Activé",
"template": {
"label": "Template JSX",
"description": ""
"description": "Modèle JSX Mantine. Accédez aux champs de réponse de l'API via les liaisons de données (par ex. data.name). Utilisez uniquement les composants autorisés. Interdit : constructor, __proto__, eval, Function, window, document."
}
},
"placeholder": {
@@ -779,23 +779,23 @@
"exampleUnit": "°C",
"iconUrl": "https://...",
"url": "https://api.example.com/api/v1/status",
"headerName": "",
"headerName": "X-API-Key",
"jsonPath": "$.data.value",
"tablePath": "",
"columnJsonPath": "",
"valuePath": "",
"maxPath": "",
"goodValues": "",
"color": ""
"tablePath": "$.data.items",
"columnJsonPath": "$.name",
"valuePath": "$.data.used",
"maxPath": "$.data.total",
"goodValues": "en ligne, vrai,",
"color": "bleu"
},
"cardStyleOption": {
"filled": "",
"outline": "",
"subtle": ""
"filled": "Rempli",
"outline": "Contour",
"subtle": "Discret"
},
"layoutOption": {
"list": "",
"grid": ""
"list": "Liste",
"grid": "Grille"
},
"sizeOption": {
"sm": "Petit",
@@ -815,7 +815,7 @@
"displayTypeDescription": {
"singleValue": "Afficher une valeur extraite avec une étiquette et une unité",
"keyValue": "Afficher plusieurs valeurs étiquetées côte à côte",
"table": "",
"table": "Afficher les lignes de données dans un format de tableau",
"statGrid": "",
"progressBars": "",
"statusIndicator": "Points d'état colorés montrant en ligne/hors ligne ou l'état de santé",
@@ -851,23 +851,23 @@
"customJsx": "JSX personnalisé"
},
"secret": {
"apiKey": "",
"apiKey": "Clé API / jeton",
"username": "Nom d'utilisateur",
"password": "Mot de passe",
"savedPlaceholder": ""
"savedPlaceholder": "••••••• (sauvegardé, laisser vide pour garder)"
},
"preview": {
"title": "Aperçu",
"test": "Tester",
"hint": "Cliquez sur Test pour prévisualiser la réponse API avec votre configuration actuelle.",
"rawResponse": ""
"rawResponse": "Réponse de JSON brute"
},
"notification": {
"created": "Widget \"{name}\" créé avec succès.",
"updated": "Widget \"{name}\" mis à jour avec succès.",
"deleted": "Widget \"{name}\" supprimé.",
"imported": "Widget importé avec succès.",
"aiPromptCopied": "",
"aiPromptCopied": "Prompt IA a été copiée dans le presse-papiers",
"aiPromptDescription": "",
"aiPromptCopy": "Copier dans le presse-papiers",
"aiPromptNoResponse": "",
@@ -1168,15 +1168,15 @@
},
"invalidUrl": {
"title": "URL invalide",
"message": "L'URL est invalide."
"message": "L'URL est invalide"
},
"secretNotDefined": {
"title": "Identifiants manquants",
"message": "Les informations d'identification n'ont pas toutes été fournies"
"message": "Tous les identifiants n'ont pas été fournis"
},
"invalidCredentials": {
"title": "Informations d'identification incorrectes.",
"message": "Les informations d'identification ne sont pas valides"
"title": "Les identifiants sont invalides",
"message": "Les identifiants sont invalides"
},
"commonError": {
"title": "Échec de la connexion",
@@ -1290,12 +1290,12 @@
"newLabel": "Nouvelle clé API (secrète)"
},
"patchmonApiKey": {
"label": "",
"newLabel": ""
"label": "Clé API",
"newLabel": "Nouvelle clé API"
},
"patchmonApiSecret": {
"label": "",
"newLabel": ""
"label": "Clé secrète d'API",
"newLabel": "Nouveau secret API"
},
"githubAppId": {
"label": "Identifiant de l'application",
@@ -1321,15 +1321,15 @@
"full": "Accès intégral à l'intégration"
},
"audiobookshelf": {
"name": "",
"description": ""
"name": "Étagère de livres audio",
"description": "Serveur de livres audio et de podcasts auto-hébergés"
},
"navidrome": {
"name": "Navidrome",
"description": ""
"description": "Serveur de streaming de musique auto-hébergé avec compatibilité avec l'API Subsonic"
},
"uptimeKuma": {
"name": "",
"name": "Uptime Kuma",
"description": "",
"secret": {
"slug": {
@@ -1341,19 +1341,23 @@
}
},
"traefik": {
"name": "",
"name": "Traefik",
"description": ""
},
"wud": {
"name": "Qu'est ce que Docker",
"description": "Surveiller lequel de vos conteneurs Docker a des mises à jour d'images disponibles"
},
"paperlessNgx": {
"name": "",
"name": "Paperless-ngx",
"description": ""
},
"patchmon": {
"name": "",
"description": ""
"name": "PatchMon",
"description": "Gestion et surveillance des correctifs pour les hôtes Linux"
},
"bazarr": {
"name": "",
"name": "Bazarr",
"description": ""
}
},
@@ -1436,9 +1440,19 @@
},
"here": "ici",
"iconPicker": {
"label": "URL de l'icône :",
"header": "Tapez le nom ou les objets pour filtrer les icônes... Homarr recherchera les icônes {countIcons} pour vous.",
"headerLoading": "Tapez pour rechercher les icônes…",
"label": "URL de l'icône ",
"description": "Recherchez dans la bibliothèque, collez une URL d'image, ou téléchargez un fichier.",
"header": "Rechercher les images {countIcons} par nom",
"headerLoading": "Rechercher des images par nom",
"clear": "Effacer l'image",
"uploadImage": "Charger une image",
"results": "Résultats de la recherche d'images",
"localImages": "Vos images",
"svgIcons": "Icônes SVG",
"otherImages": "Autres images",
"urlLoading": "Vérification de l'image…",
"urlReady": "L'image est prête à être utilisée",
"urlError": "Cette image n'a pas pu être chargée. Vérifiez l'URL et réessayez.",
"noResults": "Aucune icône ne correspond à \"{search}\".",
"error": "Impossible de charger les icônes."
},
@@ -1628,10 +1642,10 @@
"actions": "Actions"
},
"status": {
"success": "",
"error": "",
"loading": "",
"idle": ""
"success": "OK",
"error": "Erreur",
"loading": "Chargement",
"idle": "Inactif"
}
},
"create": {
@@ -1785,7 +1799,7 @@
}
},
"archiveTeamWarrior": {
"name": "",
"name": "ArchiveTeam Warrior",
"description": "",
"option": {
"showBroadcastMessage": {
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "Qu'est ce que Docker",
"description": "Afficher combien de conteneurs surveillés ont des mises à jour disponibles.",
"title": "Qu'est ce que Docker",
"monitored": "Surveillé",
"updatesAvailable": "{count, plural, one {# mise à jour disponible} other {# mises à jour disponibles}}",
"updateAvailable": "Mise à jour disponible",
"openReleaseNotes": "Ouvrir les notes de version",
"option": {
"showTitle": {
"label": "Afficher le titre"
},
"showRing": {
"label": "Afficher l'anneau de mise à jour"
},
"layout": {
"label": "Mise en page",
"option": {
"horizontal": {
"label": "Horizontale"
},
"vertical": {
"label": "Vertical"
}
}
},
"showUpdateList": {
"label": "Afficher la liste de mise à jour du conteneur",
"description": "Liste chaque conteneur surveillé qui a une mise à jour d'image disponible"
}
}
},
"dnsHoleSummary": {
"name": "Résumé du puit DNS",
"description": "Affiche le résumé de votre puit DNS",
@@ -1907,14 +1953,14 @@
"description": "Utiliser ISO 8601 pour formater la date (cela remplacera les autres options)"
},
"showWeather": {
"label": "",
"description": ""
"label": "Afficher la météo",
"description": "Afficher une petite icône météo animée et la température dans le coin de la carte"
},
"weatherLocation": {
"label": ""
"label": "Lieu de la météo"
},
"isWeatherFormatFahrenheit": {
"label": ""
"label": "Utiliser les degrés Fahrenheit"
}
}
},
@@ -1944,7 +1990,7 @@
"noStation": "Aucune station sélectionnée",
"option": {
"baseUrl": {
"label": ""
"label": "URL Search.ch"
},
"station": {
"label": "Station"
@@ -1976,8 +2022,8 @@
"clear": "Effacer la mise en forme",
"heading": "Titre {level}",
"align": "Aligner le texte : {position}",
"directionLtr": "",
"directionRtl": "",
"directionLtr": "Définir la direction du texte de gauche à droite",
"directionRtl": "Définir la direction du texte de droite à gauche",
"blockquote": "Citation",
"horizontalLine": "Ligne horizontale",
"bulletList": "Liste à puces",
@@ -2047,7 +2093,7 @@
"edit": "Modifier",
"save": "Sauvegarder",
"cancel": "Annuler",
"readOnlyViewer": "",
"readOnlyViewer": "Vous avez un accès en lecture seule à cette note. La modification est désactivée.",
"saveForbidden": "Vous n'êtes pas autorisé à modifier cette note.",
"saveFailed": "Impossible d'enregistrer cette note. Veuillez réessayer."
},
@@ -2262,13 +2308,13 @@
"description": "À quoi devrait ressembler la date"
}
},
"currentWindSpeed": "{currentWindSpeed} km/h",
"currentWindSpeed": "{currentWindSpeed} {unit}",
"dailyForecast": {
"sunrise": "Lever du Soleil",
"sunset": "Coucher du soleil",
"maxWindSpeed": "Vitesse maximale du vent : {maxWindSpeed} km/h",
"maxWindGusts": "Rafales de vent maximales : {maxWindGusts} km/h",
"humidity": ""
"maxWindSpeed": "Vitesse maximale du vent : {maxWindSpeed} {unit}",
"maxWindGusts": "Rafales de vent maximales : {maxWindGusts} {unit}",
"humidity": "Humidité : {humidity}%"
},
"kind": {
"clear": "Clair",
@@ -2328,9 +2374,9 @@
"label": "Afficher les infos sur le système de fichiers"
},
"visibleStorageVolumes": {
"label": "",
"description": "",
"placeholder": ""
"label": "Volumes de stockage visibles",
"description": "Uniquement disponible lorsque toutes les intégrations sélectionnées sont Synology. Laissez vide pour afficher tous les volumes de stockage détectés.",
"placeholder": "Sélectionnez les volumes de stockage"
},
"defaultTab": {
"label": "Onglet par défaut"
@@ -2352,7 +2398,7 @@
"loadAverage": "Charge moyenne :",
"minute": "1 minute",
"minutes": "{count} minutes",
"used": "Utilisé ",
"used": "Utilisé",
"available": "Disponible",
"lastSeen": "Dernière mise à jour de statut : {lastSeen}"
},
@@ -2389,7 +2435,7 @@
"cpu": "Coeurs",
"memory": "Mémoire",
"storage": "Stockage",
"uptime": "Disponibilité",
"uptime": "Disponible",
"haState": "État HA",
"storageType": {
"local": "Stockage local",
@@ -2412,7 +2458,7 @@
"description": "Statistiques de vos conteneurs (Ce widget ne peut être ajouté qu'avec les privilèges d'administrateur)",
"option": {
"columns": {
"label": ""
"label": "Colonnes à afficher"
},
"enableRowSorting": {
"label": "Activer le tri des éléments"
@@ -2430,19 +2476,19 @@
"label": "Inverser le tri"
},
"columnOrder": {
"label": ""
"label": "Ordre des colonnes"
},
"columnWidths": {
"label": ""
"label": "Largeurs des colonnes"
}
},
"error": {
"internalServerError": "Impossible de récupérer les statistiques des conteneurs",
"layoutSaveTitle": "",
"layoutSaveTitle": "Disposition du tableau non sauvegardée",
"layoutSaveMessage": ""
},
"empty": {
"noContainers": ""
"noContainers": "Aucun conteneur trouvé"
}
},
"coolify": {
@@ -2479,9 +2525,9 @@
}
},
"vpn": {
"name": "",
"description": "",
"serviceUnavailable": "",
"name": "VPN",
"description": "Aperçu de vos connexions VPN",
"serviceUnavailable": "VPN indisponible",
"option": {}
},
"ups": {
@@ -2738,31 +2784,31 @@
"description": "Désactiver cette option ne fonctionnera pas pour Plex"
},
"showBitrate": {
"label": "",
"label": "Afficher le débit",
"description": ""
},
"showLocation": {
"label": "",
"label": "Afficher la localisation",
"description": ""
}
},
"footer": {
"streams": "",
"totalBitrate": ""
"totalBitrate": "Total : {bitrate}"
},
"items": {
"currentlyPlaying": "En cours de lecture",
"user": "Utilisateur",
"name": "Nom",
"id": "Id",
"status": "",
"directPlay": "",
"directStream": "",
"transcodeVideo": "",
"transcodeAudio": "",
"transcoding": "",
"paused": "",
"remaining": "",
"status": "Statut",
"directPlay": "Lecture directe",
"directStream": "Flux direct",
"transcodeVideo": "Transcodage vidéo",
"transcodeAudio": "Transcodage audio",
"transcoding": "Transcodage",
"paused": "En pause",
"remaining": "{minutes} min restantes",
"metadata": {
"title": "Statistiques détaillées",
"video": {
@@ -2788,111 +2834,111 @@
"description": "Aperçu de votre archive de documents Paperless-ngx",
"documentsTotal": "Nombre total de documents",
"documentsInbox": "Boîte de réception",
"correspondents": "",
"tags": "",
"documentTypes": "",
"inboxRatio": "",
"inbox": "",
"total": "",
"correspondents": "Correspondants",
"tags": "Tags",
"documentTypes": "Types de documents",
"inboxRatio": "Ratio de la boîte de réception",
"inbox": "boîte de réception",
"total": "total",
"option": {
"showInboxRatio": {
"label": "Afficher le ratio de la boîte de réception",
"description": ""
"description": "Afficher le rapport inbox/total des documents dans la section Héros"
},
"showInboxRing": {
"label": "",
"description": ""
"label": "Afficher l'anneau de la boîte de réception",
"description": "Afficher un anneau de progression à côté du ratio de la boîte de réception"
},
"showDocumentsTotal": {
"label": "",
"description": ""
"label": "Afficher le total des documents",
"description": "Afficher le nombre total de documents dans votre archive"
},
"showDocumentsInbox": {
"label": "",
"description": ""
"label": "Afficher le compteur de la boîte de réception",
"description": "Afficher le nombre de documents non traités dans la boîte de réception"
},
"showCorrespondents": {
"label": "",
"description": ""
"label": "Afficher les correspondants",
"description": "Afficher le nombre total de correspondants"
},
"showTags": {
"label": "",
"description": ""
"label": "Afficher les tags",
"description": "Afficher le nombre total de tags"
},
"showDocumentTypes": {
"label": "",
"description": ""
"label": "Afficher les types de documents",
"description": "Afficher le nombre total de types de documents"
}
},
"error": {
"internalServerError": ""
"internalServerError": "Échec de la récupération des données Paperless-ngx"
}
},
"patchmon": {
"name": "",
"description": "",
"title": "",
"totalHosts": "",
"hostsNeedingUpdates": "",
"securityUpdates": "",
"upToDateHosts": "",
"hostsWithSecurityUpdates": "",
"recentUpdates24h": "",
"totalOutdatedPackages": "",
"totalRepos": "",
"osDistribution": "",
"compliance": "",
"complianceRatio": "",
"lastUpdated": "",
"name": "PatchMon",
"description": "Aperçu de l'état des correctifs des hôtes depuis PatchMon",
"title": "Statistiques PatchMon",
"totalHosts": "Total des hôtes",
"hostsNeedingUpdates": "Mises à jour requises",
"securityUpdates": "Mises à jour de sécurité",
"upToDateHosts": "Hôtes à jour",
"hostsWithSecurityUpdates": "Hôtes avec mises à jour de sécurité",
"recentUpdates24h": "Mises à jour (24h)",
"totalOutdatedPackages": "Paquets obsolètes",
"totalRepos": "Dépôts",
"osDistribution": "Répartition des OS",
"compliance": "Conformité des correctifs",
"complianceRatio": "{upToDate} / {total}",
"lastUpdated": "Mis à jour {time}",
"option": {
"showTotalHosts": {
"label": "",
"description": ""
"label": "Afficher le nombre total d'hôtes",
"description": "Afficher le nombre total d'hôtes surveillés"
},
"showHostsNeedingUpdates": {
"label": "",
"description": ""
"label": "Afficher les hôtes ayant besoin de mises à jour",
"description": "Afficher les hôtes avec au moins un paquet obsolète"
},
"showSecurityUpdates": {
"label": "",
"description": ""
"label": "Afficher les mises à jour de sécurité",
"description": "Afficher le nombre total de mises à jour de sécurité disponibles"
},
"showUpToDateHosts": {
"label": "",
"description": ""
"label": "Afficher les hôtes à jour",
"description": "Afficher les hôtes avec aucun paquet obsolète"
},
"showHostsWithSecurityUpdates": {
"label": "",
"description": ""
"label": "Afficher les hôtes avec les mises à jour de sécurité",
"description": "Afficher les hôtes nécessitant des correctifs de sécurité"
},
"showRecentUpdates24h": {
"label": "",
"description": ""
"label": "Afficher les mises à jour récentes (24h)",
"description": "Afficher le nombre de mises à jour appliquées au cours des dernières 24 heures"
},
"showTotalOutdatedPackages": {
"label": "",
"label": "Afficher les paquets obsolètes",
"description": ""
},
"showTotalRepos": {
"label": "",
"description": ""
"label": "Afficher les dépôts",
"description": "Afficher le nombre de dépôts actifs en cours de surveillance"
},
"enableThresholdColors": {
"label": "",
"label": "Activer les couleurs de seuil",
"description": ""
},
"useCustomThresholds": {
"label": "",
"label": "Seuils avancés",
"description": ""
},
"thresholdMode": {
"option": {
"absolute": "",
"percent": ""
"percent": "Pourcentage du total des hôtes"
}
},
"hostsNeedingUpdatesThresholdMode": {
"label": "",
"label": "Nécessite le mode de mise à jour de seuil",
"description": ""
},
"hostsNeedingUpdatesWarningAt": {
@@ -2912,7 +2958,7 @@
"description": ""
},
"securityUpdatesCriticalAt": {
"label": "",
"label": "Seuil critique de mise à jour de sécurité",
"description": ""
},
"hostsWithSecurityUpdatesThresholdMode": {
@@ -2952,33 +2998,33 @@
"description": ""
},
"showOsDistribution": {
"label": "",
"label": "Afficher la répartition des OS",
"description": ""
},
"osDistributionLimit": {
"label": "",
"description": "",
"option": {
"3": "",
"5": "",
"10": "",
"all": ""
"3": "Top 3",
"5": "Top 5",
"10": "Top 10",
"all": "Tout"
}
},
"showOsVersion": {
"label": "",
"description": ""
"label": "Afficher la version de l'OS",
"description": "Ajouter la version de l'OS à chaque étiquette de distribution lorsque disponible"
},
"showComplianceHero": {
"label": "",
"label": "Afficher la jauge de conformité",
"description": ""
},
"osDisplayMode": {
"label": "",
"description": "",
"label": "Mode d'affichage de l'OS",
"description": "Choisir comment afficher la répartition des systèmes d'exploitation",
"option": {
"bars": "",
"donut": ""
"bars": "Barres horizontales",
"donut": "Graphique en anneau"
}
}
},
@@ -2987,19 +3033,19 @@
}
},
"bazarr": {
"name": "",
"name": "Bazarr",
"description": "",
"episodes": "",
"movies": "",
"providers": "",
"episodes": "Épisodes manquants",
"movies": "Films manquants",
"providers": "Problèmes de fournisseurs",
"status": "",
"option": {
"showMissingEpisodes": {
"label": "",
"description": ""
"label": "Afficher les épisodes manquants",
"description": "Afficher le nombre d'épisodes avec les sous-titres manquants"
},
"showMissingMovies": {
"label": "",
"label": "Afficher les films manquants",
"description": ""
},
"showProviderIssues": {
@@ -3047,7 +3093,7 @@
"option": {
"albumId": {
"label": "Identifiant de l'album",
"description": "C'est l'identifiant unique qui correspond à l'album Immich. Vous pouvez le trouver en ouvrant un album et copiant l'identifiant unique depuis l'URL, par exemple 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
"description": "C'est l'identifiant unique qui correspond à l'album Immich. Vous pouvez le trouver en ouvrant un album et copiant l'identifiant unique depuis l'URL, par exemple 'a21aca09-9f05-47dc-b1a1-7b53c547226e'."
},
"rotationIntervalSeconds": {
"label": "Intervalle en secondes",
@@ -3107,18 +3153,18 @@
"description": "Cela limitera le nombre d'éléments affichés par intégration, pas globalement"
},
"columnOrder": {
"label": ""
"label": "Ordre des colonnes"
},
"columnWidths": {
"label": ""
"label": "Largeur des colonnes"
}
},
"errors": {
"noColumns": "Sélectionner les colonnes dans les éléments",
"noCommunications": "Impossible de charger les données à partir de l'intégration",
"noItems": "",
"actionFailed": "",
"actionFailedMessage": ""
"noItems": "Aucun téléchargement trouvé",
"actionFailed": "Action échouée",
"actionFailedMessage": "Cette action n'a pas pu être complétée. Veuillez ressayer."
},
"items": {
"actions": {
@@ -3312,7 +3358,7 @@
"option": {},
"titles": {
"stats": {
"main": "Statistiques des médias",
"main": "Stats des médias",
"approved": "Déjà approuvé",
"pending": "En attente de validation",
"processing": "En cours de traitement",
@@ -3382,7 +3428,7 @@
"file": "Fichier",
"size": "Taille",
"transcode": "Transcodeur",
"healthCheck": "Bilan de santé"
"healthCheck": "Contrôle de santé"
}
}
}
@@ -3395,26 +3441,26 @@
"label": ""
},
"showQueued": {
"label": ""
"label": "Afficher les éléments en attente"
},
"pageSize": {
"label": ""
"label": "Éléments par page"
}
},
"tab": {
"missing": "",
"queued": ""
"queued": "En file d’attente"
},
"type": {
"movie": "",
"episode": ""
"movie": "Film",
"episode": "Épisode"
},
"empty": {
"missing": "",
"queued": "",
"noTabsEnabled": ""
"missing": "Aucun élément manquant",
"queued": "Aucun élément en file d'attente",
"noTabsEnabled": "Activer au moins un onglet dans les paramètres du widget"
},
"timeLeft": ""
"timeLeft": "Temps restant"
},
"rssFeed": {
"name": "Flux RSS",
@@ -3548,9 +3594,9 @@
"not-found": "Non trouvé",
"pre-release": "Pré-publication",
"archived": "Archivé",
"forked": "",
"forked": "Forké",
"starsCount": "Étoiles",
"forksCount": "",
"forksCount": "Forks",
"issuesCount": "Problèmes ouverts",
"markViewed": "Marquer comme vu(s)",
"openProjectPage": "Ouvrir la page du projet",
@@ -3661,7 +3707,7 @@
"noItems": "Aucune notification à afficher.",
"option": {
"hideLogos": {
"label": ""
"label": "Masquer les logos"
}
}
},
@@ -3705,7 +3751,7 @@
}
},
"uptimeKuma": {
"name": "",
"name": "Uptime Kuma",
"description": "",
"option": {
"showAverageUptime": {
@@ -3766,7 +3812,7 @@
},
"resource": {
"routers": "",
"services": "",
"services": "Services",
"middlewares": ""
},
"status": {
@@ -3984,15 +4030,15 @@
"system": "",
"cpu": "",
"memory": "",
"disk": "",
"disk": "Disque",
"gpu": "",
"loadAvg": "",
"net": "",
"temp": "",
"temp": "Temp",
"battery": "",
"services": "",
"uptime": "",
"agent": ""
"agent": "Agent"
}
},
"beszelSystemGrid": {
@@ -4044,7 +4090,7 @@
},
"metric": {
"cpu": "",
"memory": "",
"memory": "Mémoire",
"disk": "",
"gpu": "",
"loadAvg": "",
@@ -4071,8 +4117,8 @@
"error": {
"internalServerError": ""
},
"history": "",
"resolved": "",
"history": "Historique",
"resolved": "Résolu",
"status": {
"triggered": "",
"ok": ""
@@ -4127,12 +4173,12 @@
"chart": {
"cpu": {
"title": "",
"subtitle": "",
"series": ""
"subtitle": "Utilisation moyenne du CPU à l'échelle du système",
"series": "CPU"
},
"memory": {
"title": "",
"subtitle": "",
"title": "Utilisation Mémoire",
"subtitle": "Utilisation précise au moment enregistré",
"series": "",
"cache": ""
},
@@ -4143,7 +4189,7 @@
},
"diskIO": {
"title": "",
"subtitle": "",
"subtitle": "Débit du système de fichiers root",
"read": "",
"write": ""
},
@@ -5434,7 +5480,7 @@
"title": "Capacité",
"resource": {
"reserved": "Réservé",
"used": "Utilisé "
"used": "Utilisé"
}
},
"resources": {
@@ -5720,7 +5766,7 @@
"label": "Médias"
},
"apps": {
"label": "Applications",
"label": "Apps",
"new": {
"label": "Nouveau"
},
@@ -5815,7 +5861,7 @@
"placeholder": "Rechercher quelque chose",
"nothingFound": "Aucun résultat",
"error": {
"fetch": "Une erreur s'est produite lors de la récupération des données."
"fetch": "Une erreur s'est produite lors de la récupération des données"
},
"mode": {
"appIntegrationBoard": {
@@ -6498,7 +6544,7 @@
},
"editMode": {
"title": "Mode édition",
"description": "Cliquez ici pour entrer en mode édition. Vous pouvez ensuite ajouter des widgets, des applications et des sections — faites glisser pour repositionner, redimensionnez avec la poignée d'angle. Cliquez à nouveau pour enregistrer vos modifications."
"description": "Cliquez ici pour entrer en mode édition. Vous pourrez ensuite ajouter des widgets, des applications et des sections — faites glisser pour repositionner, redimensionnez avec la poignée d'angle. Cliquez à nouveau pour enregistrer vos modifications."
},
"settings": {
"title": "Paramètres du tableau de bord",
+49 -3
View File
@@ -1344,6 +1344,10 @@
"name": "",
"description": ""
},
"wud": {
"name": "וואטס אפ דוקר",
"description": "עקוב אחר אילו מקונטיינרי הדוקר שלך כוללים עדכוני תמונה זמינים"
},
"paperlessNgx": {
"name": "",
"description": ""
@@ -1437,8 +1441,18 @@
"here": "כאן",
"iconPicker": {
"label": "קישור של הסמל",
"header": "הקלד שם או אובייקטים לסינון עבור אייקונים... Homarr יחפש עבורך סמלים של {countIcons} .",
"headerLoading": "",
"description": "חפש בספרייה, הדבק כתובת URL של תמונה, או העלה קובץ.",
"header": "הקלד שם או אובייקטים לסינון עבור אייקונים... Homarr יחפש עבורך סמלים של {countIcons} ",
"headerLoading": "חפש תמונות לפי שם",
"clear": "נקה תמונה",
"uploadImage": "העלה תמונה",
"results": "תוצאות חיפוש תמונות",
"localImages": "התמונות שלך",
"svgIcons": "סמלי SVG",
"otherImages": "תמונות אחרות",
"urlLoading": "בודק תמונה…",
"urlReady": "התמונה מוכנה לשימוש",
"urlError": "לא ניתן היה לטעון את התמונה. בדוק את כתובת ה-URL ונסה שוב.",
"noResults": "",
"error": ""
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "וואטס אפ דוקר",
"description": "הצג כמה מהמכולות הנצפות עם עדכונים זמינים.",
"title": "What's Up Docker",
"monitored": "מנוטר",
"updatesAvailable": "{count, plural, one {# עדכון זמין} two {# עדכונים זמינים} many {# עדכונים זמינים} other {# עדכונים זמינים}}",
"updateAvailable": "עדכון זמין",
"openReleaseNotes": "פתח הערות שחרור",
"option": {
"showTitle": {
"label": "הצג כותרת"
},
"showRing": {
"label": "הצג טבעת עדכון"
},
"layout": {
"label": "פריסה",
"option": {
"horizontal": {
"label": "אופקי"
},
"vertical": {
"label": "אנכי"
}
}
},
"showUpdateList": {
"label": "הצג רשימת עדכוני מכולות",
"description": "מפרט כל מכולה מנוטרת שיש עדכון תמונה זמין עבורה"
}
}
},
"dnsHoleSummary": {
"name": "סיכום חור אבטחה DNS",
"description": "מציג את הסיכום חור אבטחת DNS שלך",
@@ -2595,7 +2641,7 @@
"today": "היום",
"24h": "24 השעות האחרונות",
"7d": "7 הימים האחרונים",
"30d": "",
"30d": "30 הימים האחרונים",
"month": "",
"lastMonth": ""
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+55 -9
View File
@@ -1344,6 +1344,10 @@
"name": "Traefik",
"description": "Cloud-native reverse proxy e bilanciatore del carico"
},
"wud": {
"name": "Cos'è Il Docker",
"description": "Monitora quali dei tuoi contenitori Docker sono disponibili aggiornamenti delle immagini"
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "Sistema di gestione documentale per archiviare e organizzare documenti scansionati"
@@ -1437,8 +1441,18 @@
"here": "qui",
"iconPicker": {
"label": "Icona URL",
"header": "Digita il nome o gli oggetti da filtrare per le icone... Homarr cercherà tra le icone {countIcons} per te.",
"headerLoading": "Digita per cercare icone…",
"description": "Cerca nella libreria, incolla un URL di immagine, o carica un file.",
"header": "Digita il nome o gli oggetti da filtrare per le icone... Homarr cercherà tra le icone {countIcons} per te",
"headerLoading": "Digita per cercare icone",
"clear": "Cancella immagine",
"uploadImage": "Carica immagine",
"results": "Risultati della ricerca immagini",
"localImages": "Le tue immagini",
"svgIcons": "Icone SVG",
"otherImages": "Altre immagini",
"urlLoading": "Controllo immagine…",
"urlReady": "L'immagine è pronta per l'uso",
"urlError": "Questa immagine non può essere caricata. Controlla l'URL e riprova.",
"noResults": "Nessuna icona corrisponde a \"{search}\".",
"error": "Impossibile caricare le icone."
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "Cos'è Il Docker",
"description": "Mostra quanti contenitori visti hanno aggiornamenti disponibili.",
"title": "Cos'è Il Docker",
"monitored": "Monitorato",
"updatesAvailable": "{count, plural, one {# aggiornamento disponibile} other {# aggiornamenti disponibili}}",
"updateAvailable": "Aggiornamento disponibile",
"openReleaseNotes": "Apri note di rilascio",
"option": {
"showTitle": {
"label": "Mostra titolo"
},
"showRing": {
"label": "Mostra anello di aggiornamento"
},
"layout": {
"label": "Layout",
"option": {
"horizontal": {
"label": "Orizzontale"
},
"vertical": {
"label": "Verticale"
}
}
},
"showUpdateList": {
"label": "Mostra elenco aggiornamenti container",
"description": "Elenca ogni contenitore monitorato che ha un aggiornamento dell'immagine disponibile"
}
}
},
"dnsHoleSummary": {
"name": "Riepilogo del filtraggio DNS",
"description": "Mostra il riepilogo del tuo filtro DNS",
@@ -2024,7 +2070,7 @@
}
},
"anchorNote": {
"name": "Nota Anchor",
"name": "Ancora Nota",
"description": "Visualizza una nota selezionata da Ancoraggio",
"option": {
"noteId": {
@@ -2262,12 +2308,12 @@
"description": "Come dovrebbe apparire la data"
}
},
"currentWindSpeed": "{currentWindSpeed} km/h",
"currentWindSpeed": "{currentWindSpeed} {unit}",
"dailyForecast": {
"sunrise": "Alba",
"sunset": "Tramonto",
"maxWindSpeed": "Max velocità vento: {maxWindSpeed} km/h",
"maxWindGusts": "Max raffiche di vento: {maxWindGusts} km/h",
"maxWindSpeed": "Velocità massima del vento: {maxWindSpeed} {unit}",
"maxWindGusts": "Raffiche di vento massime: {maxWindGusts} {unit}",
"humidity": "Umidità: {humidity}%"
},
"kind": {
@@ -3047,7 +3093,7 @@
"option": {
"albumId": {
"label": "ID Album",
"description": "Si tratta di un ID univoco che si riferisce al tuo album Immich. Puoi trovare questo id aprendo un album e copiando la stringa univoca dall'URL, ad esempio 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
"description": "Si tratta di un ID univoco che si riferisce al tuo album Immich. Puoi trovare questo id aprendo un album e copiando la stringa univoca dall'URL, ad esempio 'a21aca09-9f05-47dc-b1a1-7b53c547226e'."
},
"rotationIntervalSeconds": {
"label": "Intervallo in secondi",
@@ -3208,7 +3254,7 @@
},
"client": {
"pause": "Metti in pausa il client",
"resume": "Ripristina il client"
"resume": "Riprendi il client"
},
"item": {
"pause": "Metti in pausa l'elemento",
@@ -5352,7 +5398,7 @@
"label": "Arresta",
"notification": {
"success": {
"title": "Containers arrestati",
"title": "Containers fermati",
"message": "I containers sono stati arrestati con successo"
},
"error": {
+51 -5
View File
@@ -1344,6 +1344,10 @@
"name": "",
"description": ""
},
"wud": {
"name": "What's Up Docker",
"description": "どのDockerコンテナがイメージアップデートを利用できるかを監視します"
},
"paperlessNgx": {
"name": "",
"description": ""
@@ -1437,8 +1441,18 @@
"here": "こちら",
"iconPicker": {
"label": "アイコン URL",
"header": "アイコンをフィルタするために、名前またはオブジェクトを入力してください... Homarrは {countIcons} アイコンを検索します。",
"headerLoading": "",
"description": "ライブラリを検索し、画像の URL を貼り付けるか、ファイルをアップロードします。",
"header": "{countIcons} 画像を名前で検索",
"headerLoading": "名前で画像を検索",
"clear": "画像をクリア",
"uploadImage": "画像をアップロード",
"results": "画像検索結果",
"localImages": "あなたの画像",
"svgIcons": "SVGアイコン",
"otherImages": "その他の画像",
"urlLoading": "画像を確認中…",
"urlReady": "画像を使用する準備ができました",
"urlError": "この画像を読み込めませんでした。URLを確認して再度お試し下さい。",
"noResults": "",
"error": ""
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "What's Up Docker",
"description": "利用可能な更新があるコンテナの数を表示します。",
"title": "What's Up Docker",
"monitored": "監視中",
"updatesAvailable": "{count, plural, one {# アップデートが} other {# アップデートが}}",
"updateAvailable": "アップデートがあります",
"openReleaseNotes": "リリースノートを開く",
"option": {
"showTitle": {
"label": "タイトルを表示"
},
"showRing": {
"label": "更新の着信音を表示"
},
"layout": {
"label": "レイアウト",
"option": {
"horizontal": {
"label": "水平方向"
},
"vertical": {
"label": "垂直方向"
}
}
},
"showUpdateList": {
"label": "コンテナ更新リストを表示",
"description": "利用可能な画像の更新がある各監視対象のコンテナを一覧表示します"
}
}
},
"dnsHoleSummary": {
"name": "DNS Hole 概要",
"description": "DNS Hole の概要を表示します",
@@ -2489,7 +2535,7 @@
"description": "",
"option": {
"showBattery": {
"label": ""
"label": "バッテリーを表示"
},
"showLoad": {
"label": ""
@@ -2595,7 +2641,7 @@
"today": "今日",
"24h": "過去24時間",
"7d": "過去7日間",
"30d": "",
"30d": "過去30日間",
"month": "",
"lastMonth": ""
}
@@ -6455,7 +6501,7 @@
"skip": "",
"manage": {
"welcome": {
"title": "",
"title": "Homarrへようこそ!",
"description": ""
},
"boardsList": {
+264 -218
View File
@@ -1042,20 +1042,20 @@
},
"unknown": {
"title": "알 수 없는 오류",
"description": ""
"description": "알 수 없는 오류가 발생했습니다. 자세한 내용을 보려면 아래 원인을 펼치세요"
},
"parse": {
"title": "파싱 오류",
"description": ""
"description": "응답을 파싱할 수 없습니다. URL이 서비스의 기본 URL을 가리키는지 확인하세요."
},
"authorization": {
"title": "인증 오류",
"description": ""
"description": "요청이 승인되지 않았습니다. 자격 증명이 올바르고 충분한 권한으로 구성되어 있는지 확인하세요."
},
"statusCode": {
"title": "응답 오류",
"description": "",
"otherDescription": "",
"description": "예상치 못한 {statusCode} ({reason}) 응답을 <url></url>에서 받았습니다. URL이 통합의 기본 URL을 가리키는지 확인하세요.",
"otherDescription": "예상치 못한 {statusCode} 응답을 <url></url>에서 받았습니다. URL이 통합의 기본 URL을 가리키는지 확인하세요.",
"reason": {
"badRequest": "잘못된 요청",
"notFound": "찾을 수 없음",
@@ -1344,6 +1344,10 @@
"name": "Traefik",
"description": "클라우드 네이티브 리버스 프록시 및 로드 밸런서"
},
"wud": {
"name": "왓츠업 도커",
"description": "Docker 컨테이너 중 이미지 업데이트가 가능한 것을 모니터링합니다."
},
"paperlessNgx": {
"name": "Paperless-ngx",
"description": "스캔된 문서를 보관하고 정리하는 문서 관리 시스템"
@@ -1437,8 +1441,18 @@
"here": "여기",
"iconPicker": {
"label": "아이콘 URL",
"header": "이름 또는 주제를 입력해 아이콘을 필터링하세요... Homarr가 {countIcons}에서 아이콘을 검색합니다.",
"headerLoading": "아이콘을 검색하려면 입력…",
"description": "라이브러리에서 검색하거나, 이미지 URL을 붙여넣거나, 파일을 업로드하세요.",
"header": "이름 또는 주제를 입력해 아이콘을 필터링하세요... Homarr가 {countIcons}에서 아이콘을 검색합니다",
"headerLoading": "아이콘을 검색하려면 입력",
"clear": "이미지 지우기",
"uploadImage": "이미지 업로드",
"results": "이미지 검색 결과",
"localImages": "내 이미지",
"svgIcons": "SVG 아이콘",
"otherImages": "기타 이미지",
"urlLoading": "이미지 확인 중…",
"urlReady": "이미지 사용 준비 완료",
"urlError": "이 이미지는 불러올 수 없습니다. URL을 확인하고 다시 시도하십시오.",
"noResults": "\"{search}\"에 일치하는 아이콘이 없습니다.",
"error": "아이콘을 불러올 수 없습니다."
},
@@ -1793,6 +1807,38 @@
}
}
},
"wud": {
"name": "왓츠업 도커",
"description": "모니터링 중인 컨테이너에서 사용 가능한 업데이트 수를 표시합니다.",
"title": "What's Up Docker",
"monitored": "모니터링 중",
"updatesAvailable": "{count, plural, other {업데이트 #개 사용 가능}}",
"updateAvailable": "업데이트 사용 가능",
"openReleaseNotes": "릴리스 노트 열기",
"option": {
"showTitle": {
"label": "제목 표시"
},
"showRing": {
"label": "업데이트 링 표시"
},
"layout": {
"label": "레이아웃",
"option": {
"horizontal": {
"label": "가로"
},
"vertical": {
"label": "세로"
}
}
},
"showUpdateList": {
"label": "컨테이너 업데이트 목록 표시",
"description": "이미지 업데이트가 있는 각 모니터링 컨테이너를 나열합니다."
}
}
},
"dnsHoleSummary": {
"name": "DNS 홀 요약",
"description": "DNS 홀의 요약을 표시합니다",
@@ -1938,16 +1984,16 @@
}
},
"timetable": {
"name": "",
"description": "",
"title": "",
"noStation": "",
"name": "시간표",
"description": "역의 출발 시간을 표시합니다",
"title": "{station} 출발",
"noStation": "선택한 역이 없습니다",
"option": {
"baseUrl": {
"label": "Search.ch URL"
},
"station": {
"label": ""
"label": "역"
}
}
},
@@ -2015,7 +2061,7 @@
},
"placeholder": "노트 작성 시작",
"dismiss": {
"title": "변경사항 삭제",
"title": "변경사항을 버리시겠습니까??",
"message": "노트북에 저장되지 않은 변경 사항이 있습니다. 삭제하시겠습니까?",
"action": {
"discard": "저장하지 않음",
@@ -2024,32 +2070,32 @@
}
},
"anchorNote": {
"name": "",
"description": "",
"name": "Anchor 노트",
"description": "Anchor에서 선택한 노트를 표시합니다",
"option": {
"noteId": {
"label": ""
"label": "노트"
},
"showTitle": {
"label": ""
"label": "제목 표시"
},
"showUpdatedAt": {
"label": ""
"label": "마지막 업데이트 표시"
}
},
"empty": "",
"emptyContent": "",
"notFound": "",
"noNotes": "",
"integrationRequired": "",
"updatedAt": "",
"untitled": "",
"edit": "",
"save": "",
"cancel": "",
"readOnlyViewer": "",
"saveForbidden": "",
"saveFailed": ""
"empty": "표시할 노트를 선택하세요",
"emptyContent": "이 노트에는 내용이 없습니다",
"notFound": "노트를 찾을 수 없습니다",
"noNotes": "노트를 찾을 수 없습니다",
"integrationRequired": "먼저 Anchor 통합을 선택하세요",
"updatedAt": "{date}에 업데이트됨",
"untitled": "제목 없음",
"edit": "편집",
"save": "저장",
"cancel": "취소",
"readOnlyViewer": "이 노트에 대한 뷰어 권한이 있습니다. 편집이 비활성화되었습니다.",
"saveForbidden": "이 노트를 편집할 권한이 없습니다.",
"saveFailed": "이 노트를 저장하지 못했습니다. 다시 시도하세요."
},
"iframe": {
"name": "iFrame",
@@ -2409,7 +2455,7 @@
},
"dockerContainers": {
"name": "Docker 상태",
"description": "",
"description": "컨테이너 통계 (이 위젯은 관리자 권한으로만 추가할 수 있습니다)",
"option": {
"columns": {
"label": "표시할 열"
@@ -2418,7 +2464,7 @@
"label": "항목 정렬 활성화"
},
"defaultSort": {
"label": "",
"label": "기본 정렬에 사용되는 열",
"option": {
"name": "이름",
"state": "상태",
@@ -2430,52 +2476,52 @@
"label": "역순 정렬"
},
"columnOrder": {
"label": ""
"label": "열 순서"
},
"columnWidths": {
"label": ""
"label": "열 너비"
}
},
"error": {
"internalServerError": "컨테이너 상태 불러오기 실패",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "테이블 레이아웃이 저장되지 않았습니다",
"layoutSaveMessage": "Docker 테이블 레이아웃을 저장할 수 없습니다. 열을 다시 이동하거나 크기를 조정해 보세요."
},
"empty": {
"noContainers": ""
"noContainers": "컨테이너 없음"
}
},
"coolify": {
"name": "",
"description": "",
"name": "Coolify",
"description": "서버와 애플리케이션을 포함한 Coolify 인스턴스 개요",
"option": {
"showServers": {
"label": ""
"label": "서버 표시"
},
"showApplications": {
"label": ""
"label": "애플리케이션 표시"
},
"showServices": {
"label": ""
"label": "서비스 표시"
}
},
"empty": {
"servers": "",
"applications": "",
"services": ""
"servers": "서버를 찾을 수 없습니다",
"applications": "애플리케이션을 찾을 수 없습니다",
"services": "서비스를 찾을 수 없습니다"
},
"footer": {
"updated": ""
"updated": "{when}에 업데이트됨"
},
"error": {
"noIntegration": "",
"internalServerError": ""
"noIntegration": "구성된 Coolify 통합이 없습니다",
"internalServerError": "Coolify 데이터를 가져오지 못했습니다"
},
"server": {
"buildServer": ""
"buildServer": "빌드"
},
"instances": {
"title": ""
"title": "인스턴스"
}
},
"vpn": {
@@ -2516,85 +2562,85 @@
}
},
"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 데이터를 가져오지 못했습니다"
}
},
"umami": {
"name": "",
"description": "",
"visitors": "",
"active": "",
"pageviews": "",
"visits": "",
"bounceRate": "",
"avgDuration": "",
"name": "Umami Analytics",
"description": "Umami 분석 인스턴스의 방문자 통계를 표시합니다",
"visitors": "방문자",
"active": "활성",
"pageviews": "페이지뷰",
"visits": "방문",
"bounceRate": "이탈률",
"avgDuration": "평균",
"option": {
"websiteId": {
"label": "",
"description": "",
"placeholder": "",
"loading": "",
"noWebsites": "",
"configureIntegrationFirst": ""
"label": "웹사이트",
"description": "Umami 인스턴스에서 추적하는 웹사이트 선택",
"placeholder": "웹사이트 선택",
"loading": "웹사이트 불러오는 중...",
"noWebsites": "웹사이트를 찾을 수 없습니다",
"configureIntegrationFirst": "먼저 Umami 통합을 연결하세요"
},
"timeFrame": {
"label": "",
"description": "",
"label": "시간 범위",
"description": "방문자 데이터를 표시할 기간",
"option": {
"today": "",
"24h": "",
"7d": "",
"today": "오늘",
"24h": "지난 24시간",
"7d": "지난 7일",
"30d": "지난 30일",
"month": "이번 달",
"lastMonth": "지난 달"
@@ -2738,17 +2784,17 @@
"description": "비활성화 옵션은 plex에서는 지원되지 않음"
},
"showBitrate": {
"label": "",
"description": ""
"label": "비트레이트 표시",
"description": "위치 옆에 현재 재생 비트레이트를 표시합니다"
},
"showLocation": {
"label": "",
"description": ""
"label": "위치 표시",
"description": "스트림이 LAN 또는 WAN에 있는지 표시합니다"
}
},
"footer": {
"streams": "",
"totalBitrate": ""
"streams": "{count, plural, other {# 활성 스트림}}",
"totalBitrate": "총: {bitrate}"
},
"items": {
"currentlyPlaying": "현재 재생 중",
@@ -2757,9 +2803,9 @@
"id": "아이디",
"status": "상태",
"directPlay": "직접 재생",
"directStream": "",
"transcodeVideo": "",
"transcodeAudio": "",
"directStream": "직접 스트림",
"transcodeVideo": "비디오 트랜스코딩",
"transcodeAudio": "오디오 트랜스코딩",
"transcoding": "트랜스코딩",
"paused": "일시 중지됨",
"remaining": "남은 시간 {minutes}분",
@@ -3107,18 +3153,18 @@
"description": "통합당 표시되는 항목 수를 제한하여 전체 항목이 표시되지 않습니다"
},
"columnOrder": {
"label": ""
"label": "열 순서"
},
"columnWidths": {
"label": ""
"label": "열 너비"
}
},
"errors": {
"noColumns": "항목에서 열 선택",
"noCommunications": "통합에서 데이터를 불러올 수 없습니다",
"noItems": "",
"actionFailed": "",
"actionFailedMessage": ""
"noItems": "다운로드 없음",
"actionFailed": "작업 실패",
"actionFailedMessage": "작업을 완료할 수 없습니다. 다시 시도해 주세요."
},
"items": {
"actions": {
@@ -3142,7 +3188,7 @@
},
"id": {
"columnTitle": "아이디",
"detailsTitle": ""
"detailsTitle": "항목 ID"
},
"integration": {
"columnTitle": "통합"
@@ -3177,7 +3223,7 @@
"time": {
"columnTitle": "완료 시간",
"detailsTitle": "완료/완료 후 경과 시간",
"eta": ""
"eta": "남은 시간"
},
"type": {
"columnTitle": "유형",
@@ -3223,49 +3269,49 @@
},
"globalRatio": "전체 비율",
"contextMenu": {
"copyName": "",
"copyId": "",
"clearFilters": ""
"copyName": "이름 복사",
"copyId": "ID 복사",
"clearFilters": "필터 지우기"
},
"footer": {
"filter": ""
"filter": "다운로드 필터"
},
"stats": {
"show": "",
"hide": "",
"overallProgress": "",
"totalSize": "",
"clients": ""
"show": "전체 통계 표시",
"hide": "전체 통계 숨기기",
"overallProgress": "전체 대기열 진행률",
"totalSize": "전체 대기열 크기",
"clients": "{count, plural, other {# 클라이언트}}"
},
"disconnected": ""
"disconnected": "(연결 끊김)"
},
"mediaReleases": {
"name": "",
"description": "",
"name": "미디어 릴리스",
"description": "다른 통합에서 새로 추가된 미디어나 예정된 릴리스를 표시합니다",
"option": {
"layout": {
"label": "",
"label": "레이아웃",
"option": {
"backdrop": {
"label": ""
"label": "배경"
},
"poster": {
"label": ""
"label": "포스터"
}
}
},
"showDescriptionTooltip": {
"label": ""
"label": "설명 도구 설명 표시"
},
"showType": {
"label": ""
"label": "미디어 유형 배지 표시"
},
"showSource": {
"label": ""
"label": "소스 통합 표시"
}
},
"length": {
"duration": ""
"duration": "{length}분"
}
},
"mediaRequests-requestList": {
@@ -3291,11 +3337,11 @@
"unknown": "알 수 없음",
"pending": "대기 중",
"processing": "처리 중",
"requested": "",
"requested": "요청됨",
"partiallyAvailable": "부분",
"available": "사용 가능",
"blacklisted": "",
"deleted": ""
"blacklisted": "블랙리스트",
"deleted": "삭제됨"
},
"status": {
"pending": "대기 중",
@@ -3433,10 +3479,10 @@
"label": "게시물 수 제한"
},
"hideDescription": {
"label": ""
"label": "설명 숨기기"
},
"showPosterImage": {
"label": ""
"label": "포스터 이미지 표시"
}
}
},
@@ -3460,7 +3506,7 @@
"label": "세부 정보 표시"
},
"showOnlyIcon": {
"label": ""
"label": "아이콘만 표시"
},
"topReleases": {
"label": "최상위 릴리스",
@@ -3469,18 +3515,18 @@
"repositories": {
"label": "저장소",
"addRepository": {
"label": ""
"label": "저장소 추가"
},
"importRepositories": {
"label": "",
"loading": "",
"noImagesFound": "",
"listFoundImages": "",
"listAlreadyImportedImages": "",
"allImagesAlreadyImported": "",
"onlyAdminCanImport": "",
"selectAll": "",
"deselectAll": ""
"label": "Docker에서 가져오기",
"loading": "Docker 이미지 불러오는 중",
"noImagesFound": "Docker 이미지를 찾을 수 없습니다",
"listFoundImages": "발견된 이미지 목록",
"listAlreadyImportedImages": "이미 가져온 이미지 목록",
"allImagesAlreadyImported": "모든 이미지를 이미 가져왔습니다",
"onlyAdminCanImport": "관리자만 Docker에서 가져올 수 있습니다",
"selectAll": "모두 선택",
"deselectAll": "모두 선택 해제"
},
"provider": {
"label": "제공자"
@@ -3526,15 +3572,15 @@
}
},
"importForm": {
"title": ""
"title": "Docker에서 가져오기"
},
"example": {
"label": "예시"
},
"invalid": "잘못된 저장소 정의, 값을 확인하십시오",
"noProvider": {
"label": "",
"tooltip": ""
"label": "제공자 없음",
"tooltip": "제공자를 파싱할 수 없습니다. 이미지를 가져온 후 수동으로 설정하세요"
},
"tokens": {
"label": "공급자 토큰",
@@ -3552,20 +3598,20 @@
"starsCount": "별",
"forksCount": "포크",
"issuesCount": "열린 이슈",
"markViewed": "",
"markViewed": "본 것으로 표시",
"openProjectPage": "프로젝트 페이지 열기",
"openReleasePage": "릴리스 페이지 열기",
"releaseDescription": "릴리스 설명",
"projectDescription": "",
"projectDescription": "프로젝트 설명",
"created": "생성됨",
"error": {
"label": "오류",
"messages": {
"invalidIdentifier": "",
"noMatchingVersion": "",
"noReleasesFound": "",
"invalidIdentifier": "잘못된 식별자",
"noMatchingVersion": "일치하는 버전을 찾을 수 없습니다",
"noReleasesFound": "릴리스를 찾을 수 없습니다",
"noProviderSelected": "선택한 공급자가 없습니다",
"noProviderResponse": "",
"noProviderResponse": "제공자로부터 응답이 없습니다",
"unexpected": "예기치 않은 공급자 오류"
}
}
@@ -3627,31 +3673,31 @@
}
},
"firewall": {
"name": "",
"description": "",
"name": "방화벽 모니터링",
"description": "방화벽 요약을 표시합니다",
"tab": {
"system": "",
"interfaces": ""
"system": "시스템",
"interfaces": "인터페이스"
},
"error": {
"internalServerError": ""
"internalServerError": "방화벽에서 데이터를 가져올 수 없습니다"
},
"option": {
"interfaces": ""
"interfaces": "표시할 네트워크 인터페이스"
},
"widget": {
"fwname": "",
"version": "",
"versiontitle": "",
"cputitle": "",
"memorytitle": "",
"cpu": "",
"memory": "",
"fwname": "이름",
"version": "버전",
"versiontitle": "버전",
"cputitle": "CPU 사용량",
"memorytitle": "메모리 사용량",
"cpu": "CPU",
"memory": "메모리",
"interfaces": {
"name": "",
"trans": "",
"recv": "",
"title": ""
"name": "이름",
"trans": "전송됨",
"recv": "수신됨",
"title": "네트워크 인터페이스"
}
}
},
@@ -3666,42 +3712,42 @@
}
},
"speedtestTracker": {
"name": "",
"description": "",
"name": "Speedtest Tracker",
"description": "Speedtest Tracker 인스턴스의 속도 테스트 결과를 표시합니다.",
"option": {
"showLatestResult": {
"label": ""
"label": "최신 결과 표시"
},
"showStats": {
"label": ""
"label": "평균 표시"
},
"showRecentResults": {
"label": ""
"label": "최근 결과 표시"
},
"showPingGraph": {
"label": ""
"label": "핑 그래프 표시"
}
},
"latestResult": "",
"averages": "",
"tests": "",
"recentResults": "",
"recentResultsSpeed": "",
"recentResultsPing": "",
"download": "",
"upload": "",
"ping": "",
"status": "",
"avgDownload": "",
"avgUpload": "",
"avgPing": "",
"healthy": "",
"unhealthy": "",
"ok": "",
"fail": "",
"noSectionsEnabled": "",
"latestResult": "최신 결과",
"averages": "평균",
"tests": "테스트 {count}개",
"recentResults": "최근 결과",
"recentResultsSpeed": "속도",
"recentResultsPing": "핑",
"download": "다운로드",
"upload": "업로드",
"ping": "핑",
"status": "상태",
"avgDownload": "평균 다운로드",
"avgUpload": "평균 업로드",
"avgPing": "평균 핑",
"healthy": "정상",
"unhealthy": "비정상",
"ok": "정상",
"fail": "실패",
"noSectionsEnabled": "위젯 옵션에서 하나 이상의 섹션을 활성화하세요.",
"error": {
"internalServerError": ""
"internalServerError": "속도 테스트 데이터를 가져오지 못했습니다"
}
},
"uptimeKuma": {
@@ -3968,17 +4014,17 @@
"label": "에이전트 버전 표시"
},
"columnOrder": {
"label": ""
"label": "열 순서"
},
"columnWidths": {
"label": ""
"label": "열 너비"
}
},
"noRecords": "시스템을 찾을 수 없음",
"error": {
"internalServerError": "Beszel에 연결할 수 없습니다. 통합 설정을 확인하십시오.",
"layoutSaveTitle": "",
"layoutSaveMessage": ""
"layoutSaveTitle": "테이블 레이아웃을 저장할 수 없습니다",
"layoutSaveMessage": "열 순서나 너비를 저장할 수 없습니다. 다시 시도해 주세요."
},
"column": {
"system": "시스템",
@@ -4610,7 +4656,7 @@
"authorization": "권한"
},
"heroBanner": {
"title": "",
"title": "다시 오신 것을 환영합니다",
"subtitle": "{app} 보드"
}
},
@@ -4876,7 +4922,7 @@
"title": "사용자",
"enableGravatar": {
"label": "Gravatar 활성화",
"description": ""
"description": "사용자 지정 아바타가 설정되지 않고 이메일이 구성된 경우 Libravatar/Gravatar의 사용자 아바타로 대체됩니다"
}
},
"search": {
@@ -4912,7 +4958,7 @@
"idle": "대기",
"running": "실행 중",
"error": "오류",
"disabled": ""
"disabled": "비활성화됨"
},
"job": {
"iconsUpdater": {
@@ -5254,8 +5300,8 @@
"subtitle": "{count}명이 여러 언어로 번역 기여"
},
"sponsors": {
"title": "",
"subtitle": ""
"title": "스폰서",
"subtitle": "재정적으로 지원 중인 {count}명"
},
"libraries": {
"title": "라이브러리",
@@ -5269,12 +5315,12 @@
"action": "행동"
},
"action": {
"toggleBoardEdit": "",
"toggleColorScheme": "",
"saveNotebook": "",
"openSpotlight": ""
"toggleBoardEdit": "보드 편집 모드 전환",
"toggleColorScheme": "라이트/다크 모드 전환",
"saveNotebook": "노트북 저장 (노트북 위젯 내에서만)",
"openSpotlight": "검색 열기"
},
"note": ""
"note": "팁: Mod는 Ctrl 키와 macOS의 ⌘ 키를 모두 의미합니다"
}
}
}
@@ -5376,7 +5422,7 @@
},
"remove": {
"label": "제거",
"confirm": "",
"confirm": "영구적으로 제거하려면 다시 클릭하세요",
"notification": {
"success": {
"title": "컨테이너 제거됨",
File diff suppressed because it is too large. Load diff
Loaded 100 of 139 files, more files were not shown because too many files have changed in this diff. Show more