Compare commits

..

16 Commits

Author SHA1 Message Date
shamoon 93763b7c10 2.1.0
Docker CI / Docker Build & Push (push) Has been cancelled
Docs / Test Build Docs (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-20 19:14:17 -07:00
github-actions[bot] 6c551ace34 New Crowdin translations by GitHub Action (#6983)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-08-20 19:13:24 -07:00
shamoon 7886742d56 Just test to keep this from changing 2026-08-20 16:46:59 -07:00
shamoon a253861061 Tweak: read auth providers in-process on the sign-in page, set env earlier (#7023) 2026-08-20 16:44:15 -07:00
dependabot[bot] edfb28ab5d Chore(deps): Bump astral-sh/setup-uv from 9.0.0 to 10.0.0 (#7021)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-20 10:00:42 -07:00
shamoon 3ab6b040b2 Fixhancement: handle linkwarden API change (#7018)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-19 10:25:24 -07:00
shamoon 9cabb46bb7 Fix: fix calendar hover with white theme (#7017) 2026-08-19 10:03:52 -07:00
shamoon d7cc2d3f19 Tweakhancement: use routeNamespace as fallback for k8s gateway integration (#7009)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-18 10:55:33 -07:00
shamoon b5084ba8b3 Fix: fix k8s gateway error logging (#7008) 2026-08-18 10:51:29 -07:00
shamoon dca0c9ab81 Fix: fix duplicati widget with no jobs (#7005) 2026-08-18 08:44:44 -07:00
shamoon d4fd14b724 Merge branch 'main' into dev
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-18 00:54:00 -07:00
Zhelyan Radoev 600c9eee78 Enhancement: add authorizationsLast24H field to Authentik widget, opt… (#6989)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-08-16 07:21:51 -07:00
shamoon 198c86fb49 Fix: ensure authentik widget v1 fallback (#6991)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-15 11:05:46 -07:00
shamoon f711d290a7 Fix: re-enable global lint, fix un-caught warnings / errors (#6990) 2026-08-15 11:01:29 -07:00
shamoon 342afa2215 Enhancement: widget support for Pulse v6 API changes (#6987)
Lint / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-15 00:11:08 -07:00
shamoon 27704f962e Tweak: whitelist custom.css from auth (#6986) 2026-08-14 23:52:46 -07:00
96 changed files with 1085 additions and 669 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ jobs:
with: with:
python-version-file: ".python-version" python-version-file: ".python-version"
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
- run: sudo apt-get install pngquant - run: sudo apt-get install pngquant
- name: Test Docs Build - name: Test Docs Build
run: uv run --frozen zensical build --clean run: uv run --frozen zensical build --clean
@@ -43,7 +43,7 @@ jobs:
with: with:
python-version-file: ".python-version" python-version-file: ".python-version"
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
- run: sudo apt-get install pngquant - run: sudo apt-get install pngquant
- name: Build Docs - name: Build Docs
run: uv run --frozen zensical build --clean run: uv run --frozen zensical build --clean
+4
View File
@@ -7,6 +7,10 @@ As of version v0.6.30 homepage supports adding your own custom css & javascript.
To add custom css simply edit the `custom.css` file under your config directory, similarly for javascript you would edit `custom.js`. You can then target elements in homepage with various classes / ids to customize things to your liking. To add custom css simply edit the `custom.css` file under your config directory, similarly for javascript you would edit `custom.js`. You can then target elements in homepage with various classes / ids to customize things to your liking.
!!! warning
When Homepage authentication is enabled, `custom.css` remains publicly accessible so it can style the sign-in page. Do not include secrets or sensitive internal URLs in this file. `custom.js` remains protected and is only loaded after authentication.
You can also set a specific `id` for a service or bookmark to target with your custom css or javascript, e.g. You can also set a specific `id` for a service or bookmark to target with your custom css or javascript, e.g.
```yaml ```yaml
+1 -1
View File
@@ -74,6 +74,6 @@ For OIDC login (overrides password login):
Homepage grants access to any identity that the configured OIDC provider authorizes for this client. Configure client assignments, groups, or access policies at the identity provider. Homepage does not apply additional claim-based authorization. Homepage grants access to any identity that the configured OIDC provider authorizes for this client. Configure client assignments, groups, or access policies at the identity provider. Homepage does not apply additional claim-based authorization.
All app pages and `/api` routes except `/api/healthcheck` will require a signed-in session. Static assets remain public. All app pages and `/api` routes except `/api/healthcheck` and `/api/config/custom.css` will require a signed-in session. Static assets remain public.
Configure your OIDC provider with the a callback URI like `https://homepage.example.com/api/auth/callback/homepage-oidc`. Configure your OIDC provider with the a callback URI like `https://homepage.example.com/api/auth/callback/homepage-oidc`.
+2 -2
View File
@@ -5,7 +5,7 @@ description: Authentik Widget Configuration
Learn more about [Authentik](https://github.com/goauthentik/authentik). Learn more about [Authentik](https://github.com/goauthentik/authentik).
This widget reads the number of active users in the system, as well as logins for the last 24 hours. This widget reads the number of active users in the system, as well as logins for the last 24 hours, and authorizations when using widget version 2.
You will need to generate an API token for an existing user under `Admin Portal` > `Directory` > `Tokens & App passwords`. You will need to generate an API token for an existing user under `Admin Portal` > `Directory` > `Tokens & App passwords`.
Make sure to set Intent to "API Token". Make sure to set Intent to "API Token".
@@ -15,7 +15,7 @@ The account you made the API token for also needs the following **Assigned globa
- authentik Core -> Can view User (Model: User) - authentik Core -> Can view User (Model: User)
- authentik Events -> Can view Event (Model: Event) - authentik Events -> Can view Event (Model: Event)
Allowed fields: `["users", "loginsLast24H", "failedLoginsLast24H"]`. Allowed fields: `["users", "loginsLast24H", "failedLoginsLast24H", "authorizationsLast24H"]` (`authorizationsLast24H` works with v2 only).
| Authentik Version | Homepage Widget Version | | Authentik Version | Homepage Widget Version |
| ----------------- | ----------------------- | | ----------------- | ----------------------- |
+1
View File
@@ -12,5 +12,6 @@ widget:
type: pulse type: pulse
url: http://pulse.host.or.ip:7655 url: http://pulse.host.or.ip:7655
key: your-api-token # `monitoring:read` scope is required key: your-api-token # `monitoring:read` scope is required
version: 2 # required for Pulse v6, defaults to 1
fields: ["nodes", "vms", "lxcs"] # optional fields: ["nodes", "vms", "lxcs"] # optional
``` ```
+2
View File
@@ -17,6 +17,8 @@ const compat = new FlatCompat({
export default defineConfig([ export default defineConfig([
{ {
files: ["**/*.{js,mjs,cjs,jsx}"],
extends: fixupConfigRules(compat.extends("next/core-web-vitals", "prettier", "plugin:react-hooks/recommended")), extends: fixupConfigRules(compat.extends("next/core-web-vitals", "prettier", "plugin:react-hooks/recommended")),
plugins: { plugins: {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "homepage", "name": "homepage",
"version": "2.0.0", "version": "2.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Gebruikers", "users": "Gebruikers",
"loginsLast24H": "Aantekenings (24h)", "loginsLast24H": "Aantekenings (24h)",
"failedLoginsLast24H": "Mislukte Aantekenings (24h)" "failedLoginsLast24H": "Mislukte Aantekenings (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "GEH", "mem": "GEH",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "المستخدمون", "users": "المستخدمون",
"loginsLast24H": "تسجيلات الدخول (٢٤س)", "loginsLast24H": "تسجيلات الدخول (٢٤س)",
"failedLoginsLast24H": "فشل تسجيلات الدخول (٢٤س)" "failedLoginsLast24H": "فشل تسجيلات الدخول (٢٤س)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "الذاكرة", "mem": "الذاكرة",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Потребители", "users": "Потребители",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Usuaris", "users": "Usuaris",
"loginsLast24H": "Inicis de sessió (24h)", "loginsLast24H": "Inicis de sessió (24h)",
"failedLoginsLast24H": "Errors d'inici de sessió (24h)" "failedLoginsLast24H": "Errors d'inici de sessió (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+27 -26
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Odhlásit se"
}, },
"widget": { "widget": {
"missing_type": "Chybí typ widgetu: {{type}}", "missing_type": "Chybí typ widgetu: {{type}}",
@@ -75,13 +75,13 @@
"no_data": "Nejsou k dispozici žádná data úložiště" "no_data": "Nejsou k dispozici žádná data úložiště"
}, },
"duplicati": { "duplicati": {
"jobs": "Jobs", "jobs": "Úlohy",
"stored": "Stored", "stored": "Uloženo",
"lastBackup": "Last Run", "lastBackup": "Naposledy spuštěno",
"nextRun": "Next Run", "nextRun": "Další spuštění",
"running": "Running", "running": "Běží",
"warnings": "Warnings", "warnings": "Upozornění",
"errors": "Errors" "errors": "Chyby"
}, },
"docker": { "docker": {
"rx": "RX", "rx": "RX",
@@ -133,7 +133,7 @@
"series": "Seriály", "series": "Seriály",
"episodes": "Epizody", "episodes": "Epizody",
"songs": "Skladby", "songs": "Skladby",
"albums": "Albums" "albums": "Alba"
}, },
"esphome": { "esphome": {
"offline": "Offline", "offline": "Offline",
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Uživatelé", "users": "Uživatelé",
"loginsLast24H": "Příhlášení (24h)", "loginsLast24H": "Příhlášení (24h)",
"failedLoginsLast24H": "Neúspěšná přihlášení (24h)" "failedLoginsLast24H": "Neúspěšná přihlášení (24h)",
"authorizationsLast24H": "Autorizace (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "Využití paměti", "mem": "Využití paměti",
@@ -951,15 +952,15 @@
"storage": "Úložiště" "storage": "Úložiště"
}, },
"maintainerr": { "maintainerr": {
"itemsHandled": "Items Handled", "itemsHandled": "Zpracované položky",
"episodesHandled": "Episodes Handled", "episodesHandled": "Zpracované epizody",
"moviesHandled": "Movies Handled", "moviesHandled": "Zpracované filmy",
"showsHandled": "Shows Handled", "showsHandled": "Zpracované seriály",
"seasonsHandled": "Seasons Handled", "seasonsHandled": "Zpracované série",
"reclaimable": "Reclaimable", "reclaimable": "Uvolnitelné",
"movieReclaimable": "Movie Reclaimable", "movieReclaimable": "Uvolnitelné filmy",
"showReclaimable": "Show Reclaimable", "showReclaimable": "Uvolnitelné seriály",
"totalCapacity": "Total Capacity" "totalCapacity": "Celková kapacita"
}, },
"netdata": { "netdata": {
"warnings": "Upozornění", "warnings": "Upozornění",
@@ -1241,14 +1242,14 @@
"steps": "Kroky" "steps": "Kroky"
}, },
"syncthing": { "syncthing": {
"connected": "Connected", "connected": "Připojeno",
"synced": "Synced", "synced": "Synchronizováno",
"errors": "Errors", "errors": "Chyby",
"storage": "Storage" "storage": "Úložiště"
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Požadované",
"queued": "Queued", "queued": "Ve frontě",
"leagues": "Leagues" "leagues": "Ligy"
} }
} }
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Login (24 timer)", "loginsLast24H": "Login (24 timer)",
"failedLoginsLast24H": "Mislykkede logins (24 timer)" "failedLoginsLast24H": "Mislykkede logins (24 timer)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Benutzer", "users": "Benutzer",
"loginsLast24H": "Anmeldungen (24 h)", "loginsLast24H": "Anmeldungen (24 h)",
"failedLoginsLast24H": "Fehlversuche (24 h)" "failedLoginsLast24H": "Fehlversuche (24 h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "RAM", "mem": "RAM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Συνδέσεις (24h)", "loginsLast24H": "Συνδέσεις (24h)",
"failedLoginsLast24H": "Αποτυχημένες Συνδέσεις (24h)" "failedLoginsLast24H": "Αποτυχημένες Συνδέσεις (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+3 -2
View File
@@ -133,7 +133,7 @@
"series": "Series", "series": "Series",
"episodes": "Episodios", "episodes": "Episodios",
"songs": "Canciones", "songs": "Canciones",
"albums": "Albums" "albums": "Álbumes"
}, },
"esphome": { "esphome": {
"offline": "Fuera de línea", "offline": "Fuera de línea",
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Usuarios", "users": "Usuarios",
"loginsLast24H": "Inicios de sesión (24h)", "loginsLast24H": "Inicios de sesión (24h)",
"failedLoginsLast24H": "Inicios de sesión fallidos (24h)" "failedLoginsLast24H": "Inicios de sesión fallidos (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Kirjautumisia (24h)", "loginsLast24H": "Kirjautumisia (24h)",
"failedLoginsLast24H": "Epäonnistuneita kirjautumisia (24h)" "failedLoginsLast24H": "Epäonnistuneita kirjautumisia (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+3 -2
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Se déconnecter"
}, },
"widget": { "widget": {
"missing_type": "Type de widget manquant : {{type}}", "missing_type": "Type de widget manquant : {{type}}",
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Utilisateurs", "users": "Utilisateurs",
"loginsLast24H": "Connexions (24 h)", "loginsLast24H": "Connexions (24 h)",
"failedLoginsLast24H": "Connexions échouées (24 h)" "failedLoginsLast24H": "Connexions échouées (24 h)",
"authorizationsLast24H": "Authentifications (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "RAM", "mem": "RAM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "משתמשים", "users": "משתמשים",
"loginsLast24H": "כניסות (24h)", "loginsLast24H": "כניסות (24h)",
"failedLoginsLast24H": "כניסות שנכשלו (24h)" "failedLoginsLast24H": "כניסות שנכשלו (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "זיכרון", "mem": "זיכרון",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Korisnici", "users": "Korisnici",
"loginsLast24H": "Prijave (24 h)", "loginsLast24H": "Prijave (24 h)",
"failedLoginsLast24H": "Neuspjele prijave (24 h)" "failedLoginsLast24H": "Neuspjele prijave (24 h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Felhasználók", "users": "Felhasználók",
"loginsLast24H": "Bejelentkezések (24 óra)", "loginsLast24H": "Bejelentkezések (24 óra)",
"failedLoginsLast24H": "Sikertelen bejelentkezések (24h)" "failedLoginsLast24H": "Sikertelen bejelentkezések (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Login (24j)", "loginsLast24H": "Login (24j)",
"failedLoginsLast24H": "Login Gagal (24j)" "failedLoginsLast24H": "Login Gagal (24j)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Utenti", "users": "Utenti",
"loginsLast24H": "Accessi (24h)", "loginsLast24H": "Accessi (24h)",
"failedLoginsLast24H": "Accessi Falliti (24h)" "failedLoginsLast24H": "Accessi Falliti (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "ログイン (24時間)", "loginsLast24H": "ログイン (24時間)",
"failedLoginsLast24H": "ログイン失敗(24時間)" "failedLoginsLast24H": "ログイン失敗(24時間)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "사용자", "users": "사용자",
"loginsLast24H": "로그인 (24시간)", "loginsLast24H": "로그인 (24시간)",
"failedLoginsLast24H": "실패한 로그인 (24시간)" "failedLoginsLast24H": "실패한 로그인 (24시간)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "메모리", "mem": "메모리",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logmasuk (24j)", "loginsLast24H": "Logmasuk (24j)",
"failedLoginsLast24H": "Logmasuk Gagal (24j)" "failedLoginsLast24H": "Logmasuk Gagal (24j)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Gebruikers", "users": "Gebruikers",
"loginsLast24H": "Logins (24u)", "loginsLast24H": "Logins (24u)",
"failedLoginsLast24H": "Mislukte Logins (24u)" "failedLoginsLast24H": "Mislukte Logins (24u)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "GEH", "mem": "GEH",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Mislykket innlogginger (24t)" "failedLoginsLast24H": "Mislykket innlogginger (24t)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+4 -3
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Wyloguj się"
}, },
"widget": { "widget": {
"missing_type": "Brakujący typ widżetu: {{type}}", "missing_type": "Brakujący typ widżetu: {{type}}",
@@ -133,7 +133,7 @@
"series": "Seriale", "series": "Seriale",
"episodes": "Odcinki", "episodes": "Odcinki",
"songs": "Piosenki", "songs": "Piosenki",
"albums": "Albums" "albums": "Albumy"
}, },
"esphome": { "esphome": {
"offline": "Offline", "offline": "Offline",
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Użytkownicy", "users": "Użytkownicy",
"loginsLast24H": "Logowania (24h)", "loginsLast24H": "Logowania (24h)",
"failedLoginsLast24H": "Nieudane logowania (24h)" "failedLoginsLast24H": "Nieudane logowania (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "RAM", "mem": "RAM",
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Usuários", "users": "Usuários",
"loginsLast24H": "Inícios de sessão (24h)", "loginsLast24H": "Inícios de sessão (24h)",
"failedLoginsLast24H": "Inícios de sessão falhados (24h)" "failedLoginsLast24H": "Inícios de sessão falhados (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Autentificări (24h)", "loginsLast24H": "Autentificări (24h)",
"failedLoginsLast24H": "Conectări eșuate (24h)" "failedLoginsLast24H": "Conectări eșuate (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+62 -61
View File
@@ -21,7 +21,7 @@
"seconds": "сек" "seconds": "сек"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Выход"
}, },
"widget": { "widget": {
"missing_type": "Отсутствует тип виджета: {{type}}", "missing_type": "Отсутствует тип виджета: {{type}}",
@@ -75,13 +75,13 @@
"no_data": "Нет доступных данных о хранилище" "no_data": "Нет доступных данных о хранилище"
}, },
"duplicati": { "duplicati": {
"jobs": "Jobs", "jobs": "Работы",
"stored": "Stored", "stored": "Сохранено",
"lastBackup": "Last Run", "lastBackup": "Последний запуск",
"nextRun": "Next Run", "nextRun": "Следующий запуск",
"running": "Running", "running": "Запущено",
"warnings": "Warnings", "warnings": "Предупреждения",
"errors": "Errors" "errors": "Ошибки"
}, },
"docker": { "docker": {
"rx": "RX", "rx": "RX",
@@ -133,7 +133,7 @@
"series": "Сериалы", "series": "Сериалы",
"episodes": "Эпизоды", "episodes": "Эпизоды",
"songs": "Песни", "songs": "Песни",
"albums": "Albums" "albums": "Альбомы"
}, },
"esphome": { "esphome": {
"offline": "Не в сети", "offline": "Не в сети",
@@ -235,17 +235,17 @@
"rutorrent": { "rutorrent": {
"active": "Активно", "active": "Активно",
"upload": "Отдача", "upload": "Отдача",
"download": "Скачивание" "download": "Загрузка"
}, },
"transmission": { "transmission": {
"download": "Скачивание", "download": "Загрузка",
"upload": "Отдача", "upload": "Отдача",
"leech": "Лич", "leech": "Лич",
"seed": "Сид" "seed": "Сид"
}, },
"qbittorrent": { "qbittorrent": {
"download": "Скачивание", "download": "Загрузка",
"upload": "Загрузка", "upload": "Отдача",
"leech": "Лич", "leech": "Лич",
"seed": "Сид" "seed": "Сид"
}, },
@@ -258,8 +258,8 @@
"invalid": "Некорректный" "invalid": "Некорректный"
}, },
"deluge": { "deluge": {
"download": "Скачивание", "download": "Загрузка",
"upload": "Загрузка", "upload": "Отдача",
"leech": "Лич", "leech": "Лич",
"seed": "Сид" "seed": "Сид"
}, },
@@ -268,8 +268,8 @@
"cachemissbytes": "Мисс байты кэша" "cachemissbytes": "Мисс байты кэша"
}, },
"downloadstation": { "downloadstation": {
"download": "Скачивание", "download": "Загрузка",
"upload": "Загрузка", "upload": "Отдача",
"leech": "Лич", "leech": "Лич",
"seed": "Сид" "seed": "Сид"
}, },
@@ -334,8 +334,8 @@
"latency": "Задержка" "latency": "Задержка"
}, },
"speedtest": { "speedtest": {
"upload": "Загрузка", "upload": "Отдача",
"download": "Скачивание", "download": "Загрузка",
"ping": "Пинг" "ping": "Пинг"
}, },
"portainer": { "portainer": {
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Пользователи", "users": "Пользователи",
"loginsLast24H": "Входы (24ч)", "loginsLast24H": "Входы (24ч)",
"failedLoginsLast24H": "Неудачные входы (24ч)" "failedLoginsLast24H": "Неудачные входы (24ч)",
"authorizationsLast24H": "Входы (24ч)"
}, },
"proxmox": { "proxmox": {
"mem": "Память", "mem": "Память",
@@ -480,9 +481,9 @@
"vms": "Виртуальные машины" "vms": "Виртуальные машины"
}, },
"pulse": { "pulse": {
"nodes": "Nodes", "nodes": "Узлы",
"vms": "VMs", "vms": "Виртуальные машины",
"lxcs": "LXCs" "lxcs": "Контейнеры LXC"
}, },
"glances": { "glances": {
"cpu": "ЦП", "cpu": "ЦП",
@@ -581,7 +582,7 @@
"up": "В сети", "up": "В сети",
"pending": "Ожидают", "pending": "Ожидают",
"down": "Не в сети", "down": "Не в сети",
"ok": "Ok" "ok": "OK"
}, },
"healthchecks": { "healthchecks": {
"new": "Новый", "new": "Новый",
@@ -649,7 +650,7 @@
"total": "Всего" "total": "Всего"
}, },
"pangolin": { "pangolin": {
"orgs": "Orgs", "orgs": "Организации",
"sites": "Сайты", "sites": "Сайты",
"resources": "Ресурсы", "resources": "Ресурсы",
"targets": "Цели", "targets": "Цели",
@@ -687,7 +688,7 @@
"limit": "Лимит" "limit": "Лимит"
}, },
"opnsense": { "opnsense": {
"cpu": "ЦП", "cpu": "Нагрузка ЦП",
"memory": "Активно ОЗУ", "memory": "Активно ОЗУ",
"wanUpload": "WAN Загрузка", "wanUpload": "WAN Загрузка",
"wanDownload": "WAN скачивание" "wanDownload": "WAN скачивание"
@@ -822,7 +823,7 @@
"gross_percent_today": "Сегодня", "gross_percent_today": "Сегодня",
"gross_percent_1y": "Один год", "gross_percent_1y": "Один год",
"gross_percent_max": "Все время", "gross_percent_max": "Все время",
"net_worth": "Net Worth" "net_worth": "Общая стоимость"
}, },
"audiobookshelf": { "audiobookshelf": {
"podcasts": "Подкасты", "podcasts": "Подкасты",
@@ -951,15 +952,15 @@
"storage": "Хранилище" "storage": "Хранилище"
}, },
"maintainerr": { "maintainerr": {
"itemsHandled": "Items Handled", "itemsHandled": "Элементы обрабатываются",
"episodesHandled": "Episodes Handled", "episodesHandled": "Серии обрабатываются",
"moviesHandled": "Movies Handled", "moviesHandled": "Фильмы обрабатываются",
"showsHandled": "Shows Handled", "showsHandled": "Шоу обрабатываются",
"seasonsHandled": "Seasons Handled", "seasonsHandled": "Сезоны обрабатываются",
"reclaimable": "Reclaimable", "reclaimable": "Восстановленные",
"movieReclaimable": "Movie Reclaimable", "movieReclaimable": "Восстановленный фильм",
"showReclaimable": "Show Reclaimable", "showReclaimable": "Восстановленное шоу",
"totalCapacity": "Total Capacity" "totalCapacity": "Общая ёмкость"
}, },
"netdata": { "netdata": {
"warnings": "Предупреждения", "warnings": "Предупреждения",
@@ -968,7 +969,7 @@
"ntfy": { "ntfy": {
"title": "Название", "title": "Название",
"priority": "Приоритет", "priority": "Приоритет",
"lastReceived": "Last Received", "lastReceived": "Последние полученные",
"message": "Сообщение", "message": "Сообщение",
"tags": "Теги", "tags": "Теги",
"none": "Отсутствует", "none": "Отсутствует",
@@ -1105,7 +1106,7 @@
"apps": "Приложения", "apps": "Приложения",
"synced": "Синхронизированные", "synced": "Синхронизированные",
"outOfSync": "Не синхронизированные", "outOfSync": "Не синхронизированные",
"healthy": "Healthy", "healthy": "Здоров",
"degraded": "Деградированные", "degraded": "Деградированные",
"progressing": "Выполняются", "progressing": "Выполняются",
"missing": "Отсутствует", "missing": "Отсутствует",
@@ -1152,18 +1153,18 @@
"other": "Другое" "other": "Другое"
}, },
"checkmk": { "checkmk": {
"serviceErrors": "Service issues", "serviceErrors": "Проблемы сервиса",
"hostErrors": "Host issues" "hostErrors": "Проблемы узла"
}, },
"komodo": { "komodo": {
"total": "Всего", "total": "Всего",
"running": "Запущено", "running": "Запущено",
"stopped": "Остановлено", "stopped": "Остановлено",
"down": "Не в сети", "down": "Не в сети",
"unhealthy": "Unhealthy", "unhealthy": "Неисправен",
"unknown": "Неизвестно", "unknown": "Неизвестно",
"servers": "Серверы", "servers": "Серверы",
"stacks": "Stacks", "stacks": "Стеки",
"containers": "Контейнеры" "containers": "Контейнеры"
}, },
"filebrowser": { "filebrowser": {
@@ -1186,7 +1187,7 @@
"DISABLE_DISK": "Диск отключен", "DISABLE_DISK": "Диск отключен",
"SWAP_DSBL": "Swap отключён", "SWAP_DSBL": "Swap отключён",
"INVALID_EXPANSION": "Неверное Расширение", "INVALID_EXPANSION": "Неверное Расширение",
"PARITY_NOT_BIGGEST": "Parity Not Biggest", "PARITY_NOT_BIGGEST": "Четность не наибольшая",
"TOO_MANY_MISSING_DISKS": "Слишком много отсутствующих дисков", "TOO_MANY_MISSING_DISKS": "Слишком много отсутствующих дисков",
"NEW_DISK_TOO_SMALL": "Новый диск слишком мал", "NEW_DISK_TOO_SMALL": "Новый диск слишком мал",
"NO_DATA_DISKS": "Нет дисков данных", "NO_DATA_DISKS": "Нет дисков данных",
@@ -1195,18 +1196,18 @@
"cpu": "ЦП", "cpu": "ЦП",
"memoryUsed": "Использовано ОЗУ", "memoryUsed": "Использовано ОЗУ",
"memoryAvailable": "Доступная память", "memoryAvailable": "Доступная память",
"arrayUsed": "Array Used", "arrayUsed": "Используемый массив",
"arrayFree": "Array Free", "arrayFree": "Свободный массив",
"poolUsed": "{{pool}} Использовано", "poolUsed": "{{pool}} Использовано",
"poolFree": "{{pool}} Свободно" "poolFree": "{{pool}} Свободно"
}, },
"backrest": { "backrest": {
"num_plans": "Plans", "num_plans": "Планы",
"num_success_30": "Successes", "num_success_30": "Успешные",
"num_failure_30": "Ошибки", "num_failure_30": "Ошибки",
"num_success_latest": "Succeeding", "num_success_latest": "Успешно",
"num_failure_latest": "Failing", "num_failure_latest": "Неудачные",
"bytes_added_30": "Bytes Added" "bytes_added_30": "Байты добавлены"
}, },
"yourspotify": { "yourspotify": {
"songs": "Треков", "songs": "Треков",
@@ -1235,20 +1236,20 @@
"environment_not_found": "Среда не найдена" "environment_not_found": "Среда не найдена"
}, },
"sparkyfitness": { "sparkyfitness": {
"eaten": "Eaten", "eaten": "Съедено",
"burned": "Burned", "burned": "Сожжено",
"remaining": "Remaining", "remaining": "Осталось",
"steps": "Steps" "steps": "Шаги"
}, },
"syncthing": { "syncthing": {
"connected": "Connected", "connected": "Подключено",
"synced": "Synced", "synced": "Синхронизировано",
"errors": "Errors", "errors": "Ошибки",
"storage": "Storage" "storage": "Хранилище"
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Требуется",
"queued": "Queued", "queued": "В очереди",
"leagues": "Leagues" "leagues": "Лиги"
} }
} }
+6 -5
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Odhlásiť sa"
}, },
"widget": { "widget": {
"missing_type": "Chýba typ widgetu: {{type}}", "missing_type": "Chýba typ widgetu: {{type}}",
@@ -133,7 +133,7 @@
"series": "Seriálov", "series": "Seriálov",
"episodes": "Epizód", "episodes": "Epizód",
"songs": "Skladieb", "songs": "Skladieb",
"albums": "Albums" "albums": "Albumov"
}, },
"esphome": { "esphome": {
"offline": "Nedostupné", "offline": "Nedostupné",
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Používateľov", "users": "Používateľov",
"loginsLast24H": "Prihlás. (24 hod.)", "loginsLast24H": "Prihlás. (24 hod.)",
"failedLoginsLast24H": "Neúspešné prihlás. (24 hod.)" "failedLoginsLast24H": "Neúspešné prihlás. (24 hod.)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "RAM", "mem": "RAM",
@@ -959,7 +960,7 @@
"reclaimable": "Reclaimable", "reclaimable": "Reclaimable",
"movieReclaimable": "Movie Reclaimable", "movieReclaimable": "Movie Reclaimable",
"showReclaimable": "Show Reclaimable", "showReclaimable": "Show Reclaimable",
"totalCapacity": "Total Capacity" "totalCapacity": "Celková kapacita"
}, },
"netdata": { "netdata": {
"warnings": "Upozornenia", "warnings": "Upozornenia",
@@ -1248,7 +1249,7 @@
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Wanted",
"queued": "Queued", "queued": "V poradí",
"leagues": "Leagues" "leagues": "Leagues"
} }
} }
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Prijave (24h)", "loginsLast24H": "Prijave (24h)",
"failedLoginsLast24H": "Neveljavne prijave (24h)" "failedLoginsLast24H": "Neveljavne prijave (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Корисника", "users": "Корисника",
"loginsLast24H": "Пријаве (24ч)", "loginsLast24H": "Пријаве (24ч)",
"failedLoginsLast24H": "Неуспешне пријаве (24ч)" "failedLoginsLast24H": "Неуспешне пријаве (24ч)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "Меморија", "mem": "Меморија",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Inloggningar (24h)", "loginsLast24H": "Inloggningar (24h)",
"failedLoginsLast24H": "Misslyckade inloggningar (24h)" "failedLoginsLast24H": "Misslyckade inloggningar (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "లాగిన్లు (24గం)", "loginsLast24H": "లాగిన్లు (24గం)",
"failedLoginsLast24H": "విఫలమైన లాగిన్‌లు (24గం)" "failedLoginsLast24H": "విఫలమైన లాగిన్‌లు (24గం)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Kullanıcılar", "users": "Kullanıcılar",
"loginsLast24H": "Girişler (24 Saat)", "loginsLast24H": "Girişler (24 Saat)",
"failedLoginsLast24H": "Başarısız Girişler (24 Saat)" "failedLoginsLast24H": "Başarısız Girişler (24 Saat)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "Bellek", "mem": "Bellek",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Користувачі", "users": "Користувачі",
"loginsLast24H": "Вхід (протягом доби)", "loginsLast24H": "Вхід (протягом доби)",
"failedLoginsLast24H": "Невдалі входи (протягом доби)" "failedLoginsLast24H": "Невдалі входи (протягом доби)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "Пам'ять", "mem": "Пам'ять",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "登錄( 24小时)", "loginsLast24H": "登錄( 24小时)",
"failedLoginsLast24H": "登錄失敗( 24鐘頭)" "failedLoginsLast24H": "登錄失敗( 24鐘頭)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "登录 (24h)", "loginsLast24H": "登录 (24h)",
"failedLoginsLast24H": "登录失败 (24h)" "failedLoginsLast24H": "登录失败 (24h)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "内存", "mem": "内存",
+2 -1
View File
@@ -471,7 +471,8 @@
"authentik": { "authentik": {
"users": "Users", "users": "Users",
"loginsLast24H": "登入 (過去 24 小時)", "loginsLast24H": "登入 (過去 24 小時)",
"failedLoginsLast24H": "登入失敗 (過去 24 小時)" "failedLoginsLast24H": "登入失敗 (過去 24 小時)",
"authorizationsLast24H": "Auths (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
+60 -6
View File
@@ -3,21 +3,27 @@
import { render, screen, waitFor } from "@testing-library/react"; import { render, screen, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
const { getSettingsMock } = vi.hoisted(() => ({ const { getSettingsMock, authOptionsMock } = vi.hoisted(() => ({
getSettingsMock: vi.fn(), getSettingsMock: vi.fn(),
authOptionsMock: vi.fn(),
})); }));
vi.mock("utils/config/config", () => ({ vi.mock("utils/config/config", () => ({
getSettings: getSettingsMock, getSettings: getSettingsMock,
})); }));
vi.mock("pages/api/auth/[...nextauth]", () => ({
get authOptions() {
return authOptionsMock();
},
}));
vi.mock("next/router", () => ({ vi.mock("next/router", () => ({
useRouter: () => ({ useRouter: () => ({
query: {}, query: {},
}), }),
})); }));
import { getProviders } from "next-auth/react";
import SignInPage, { getServerSideProps } from "pages/auth/signin"; import SignInPage, { getServerSideProps } from "pages/auth/signin";
describe("pages/auth/signin", () => { describe("pages/auth/signin", () => {
@@ -33,7 +39,7 @@ describe("pages/auth/signin", () => {
/>, />,
); );
expect(screen.getByText("Authentication not configured")).toBeInTheDocument(); expect(screen.getByText("Authentication error")).toBeInTheDocument();
await waitFor(() => { await waitFor(() => {
expect(document.documentElement.classList.contains("dark")).toBe(true); expect(document.documentElement.classList.contains("dark")).toBe(true);
@@ -61,7 +67,7 @@ describe("pages/auth/signin", () => {
}); });
it("getServerSideProps returns providers and only public sign-in settings", async () => { it("getServerSideProps returns providers and only public sign-in settings", async () => {
getProviders.mockResolvedValueOnce({ foo: { id: "foo", name: "Foo" } }); authOptionsMock.mockReturnValueOnce({ providers: [{ id: "foo", name: "Foo", type: "oauth" }] });
getSettingsMock.mockReturnValueOnce({ getSettingsMock.mockReturnValueOnce({
theme: "dark", theme: "dark",
color: "slate", color: "slate",
@@ -79,11 +85,10 @@ describe("pages/auth/signin", () => {
const res = await getServerSideProps({}); const res = await getServerSideProps({});
expect(getProviders).toHaveBeenCalled();
expect(getSettingsMock).toHaveBeenCalled(); expect(getSettingsMock).toHaveBeenCalled();
expect(res).toEqual({ expect(res).toEqual({
props: { props: {
providers: { foo: { id: "foo", name: "Foo" } }, providers: { foo: { id: "foo", name: "Foo", type: "oauth" } },
settings: { settings: {
theme: "dark", theme: "dark",
color: "slate", color: "slate",
@@ -96,4 +101,53 @@ describe("pages/auth/signin", () => {
expect(res.props.settings).not.toHaveProperty("providers"); expect(res.props.settings).not.toHaveProperty("providers");
expect(res.props.settings).not.toHaveProperty("layout"); expect(res.props.settings).not.toHaveProperty("layout");
}); });
it("getServerSideProps falls back to no providers when auth options fail to load", async () => {
const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});
authOptionsMock.mockImplementationOnce(() => {
throw new Error("Homepage auth is enabled but HOMEPAGE_EXTERNAL_URL (or NEXTAUTH_URL) is missing.");
});
getSettingsMock.mockReturnValueOnce({ theme: "dark" });
const res = await getServerSideProps({});
expect(res.props.providers).toEqual({});
expect(consoleError).toHaveBeenCalled();
consoleError.mockRestore();
});
it("getServerSideProps passes only id, name and type from each provider", async () => {
authOptionsMock.mockReturnValueOnce({
providers: [
{
id: "homepage-oidc",
name: "Homepage OIDC",
type: "oauth",
issuer: "https://oidc.example",
clientId: "canary-client-id",
clientSecret: "canary-client-secret",
wellKnown: "https://oidc.example/.well-known/openid-configuration",
authorization: { params: { scope: "openid email profile" } },
profile: () => ({}),
},
{
id: "credentials",
name: "Password",
type: "credentials",
credentials: { password: { label: "Password", type: "password" } },
authorize: () => null,
},
],
});
getSettingsMock.mockReturnValueOnce({ theme: "dark" });
const res = await getServerSideProps({});
expect(res.props.providers).toEqual({
"homepage-oidc": { id: "homepage-oidc", name: "Homepage OIDC", type: "oauth" },
credentials: { id: "credentials", name: "Password", type: "credentials" },
});
// These props get serialized into the sign-in page, which is unauthenticated
expect(JSON.stringify(res.props)).not.toMatch(/canary-client-secret|canary-client-id|oidc\.example/);
});
}); });
-1
View File
@@ -15,7 +15,6 @@ export default class ErrorBoundary extends React.Component {
// You can also log error messages to an error reporting service here // You can also log error messages to an error reporting service here
if (error || errorInfo) { if (error || errorInfo) {
// eslint-disable-next-line no-console
console.error("component error: %s, info: %s", error, errorInfo); console.error("component error: %s, info: %s", error, errorInfo);
} }
} }
+1 -2
View File
@@ -147,7 +147,7 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
let descriptionMatch; let descriptionMatch;
if (searchDescriptions) { if (searchDescriptions) {
descriptionMatch = r.description?.toLowerCase().includes(searchString); descriptionMatch = r.description?.toLowerCase().includes(searchString);
r.priority = nameMatch ? 2 * +nameMatch : +descriptionMatch; // eslint-disable-line no-param-reassign r.priority = nameMatch ? 2 * +nameMatch : +descriptionMatch;
} }
return nameMatch || descriptionMatch; return nameMatch || descriptionMatch;
}); });
@@ -244,7 +244,6 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
<span> <span>
{parts.map((part, i) => {parts.map((part, i) =>
part.toLowerCase() === searchString.toLowerCase() ? ( part.toLowerCase() === searchString.toLowerCase() ? (
// eslint-disable-next-line react/no-array-index-key
<span key={`${searchString}_${i}`} className="bg-theme-300/10"> <span key={`${searchString}_${i}`} className="bg-theme-300/10">
{part} {part}
</span> </span>
+3 -3
View File
@@ -13,13 +13,13 @@ export default function Error({ error }) {
const { t } = useTranslation(); const { t } = useTranslation();
if (typeof error === "string") { if (typeof error === "string") {
error = { message: error }; // eslint-disable-line no-param-reassign error = { message: error };
} else if (typeof error === "number") { } else if (typeof error === "number") {
error = { message: `Error ${error}` }; // eslint-disable-line no-param-reassign error = { message: `Error ${error}` };
} }
if (error?.data?.error) { if (error?.data?.error) {
error = error.data.error; // eslint-disable-line no-param-reassign error = error.data.error;
} }
return ( return (
@@ -7,7 +7,6 @@ import Resource from "../widget/resource";
export default function Network({ options, refresh = 1500 }) { export default function Network({ options, refresh = 1500 }) {
const { t } = useTranslation(); const { t } = useTranslation();
// eslint-disable-next-line no-param-reassign
if (options.network === true) options.network = "default"; if (options.network === true) options.network = "default";
const { data, error } = useSWR(`/api/widgets/resources?type=network&interfaceName=${options.network}`, { const { data, error } = useSWR(`/api/widgets/resources?type=network&interfaceName=${options.network}`, {
+8 -8
View File
@@ -11,7 +11,7 @@ import {
} from "@headlessui/react"; } from "@headlessui/react";
import classNames from "classnames"; import classNames from "classnames";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import { Fragment, useEffect, useState } from "react"; import { Fragment, useEffect, useMemo, useState } from "react";
import { BiLogoBing } from "react-icons/bi"; import { BiLogoBing } from "react-icons/bi";
import { FiSearch } from "react-icons/fi"; import { FiSearch } from "react-icons/fi";
import { SiBaidu, SiBrave, SiDuckduckgo, SiGoogle } from "react-icons/si"; import { SiBaidu, SiBrave, SiDuckduckgo, SiGoogle } from "react-icons/si";
@@ -57,12 +57,12 @@ export const searchProviders = {
}, },
}; };
function getAvailableProviderIds(options) { function getAvailableProviderIds(provider) {
if (options.provider && Array.isArray(options.provider)) { if (provider && Array.isArray(provider)) {
return options.provider.filter((value) => searchProviders.hasOwnProperty(value)); return provider.filter((value) => searchProviders.hasOwnProperty(value));
} }
if (options.provider && searchProviders[options.provider]) { if (provider && searchProviders[provider]) {
return [options.provider]; return [provider];
} }
return null; return null;
} }
@@ -82,7 +82,8 @@ export function getStoredProvider() {
export default function Search({ options }) { export default function Search({ options }) {
const { t } = useTranslation(); const { t } = useTranslation();
const availableProviderIds = getAvailableProviderIds(options) ?? []; // options is a fresh object each render, so memo on provider itself
const availableProviderIds = useMemo(() => getAvailableProviderIds(options.provider) ?? [], [options.provider]);
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
const [selectedProvider, setSelectedProvider] = useState(searchProviders[availableProviderIds[0] ?? "google"]); const [selectedProvider, setSelectedProvider] = useState(searchProviders[availableProviderIds[0] ?? "google"]);
@@ -184,7 +185,6 @@ export default function Search({ options }) {
autoCapitalize="off" autoCapitalize="off"
autoCorrect="off" autoCorrect="off"
autoComplete="off" autoComplete="off"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={options.focus} autoFocus={options.focus}
onBlur={(e) => e.preventDefault()} onBlur={(e) => e.preventDefault()}
onKeyDown={handleSearchKeyDown} onKeyDown={handleSearchKeyDown}
@@ -14,7 +14,6 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Widget({ options }) { export default function Widget({ options }) {
const { t } = useTranslation(); const { t } = useTranslation();
// eslint-disable-next-line no-param-reassign, no-multi-assign
options.service_group = options.service_name = "unifi_console"; options.service_group = options.service_name = "unifi_console";
const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites", { index: options.index }); const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites", { index: options.index });
@@ -39,8 +38,8 @@ export default function Widget({ options }) {
const lan = defaultSite.health.find((h) => h.subsystem === "lan"); const lan = defaultSite.health.find((h) => h.subsystem === "lan");
const wlan = defaultSite.health.find((h) => h.subsystem === "wlan"); const wlan = defaultSite.health.find((h) => h.subsystem === "wlan");
[wan, lan, wlan].forEach((s) => { [wan, lan, wlan].forEach((s) => {
s.up = s.status === "ok"; // eslint-disable-line no-param-reassign s.up = s.status === "ok";
s.show = s.status !== "unknown"; // eslint-disable-line no-param-reassign s.show = s.status !== "unknown";
}); });
const name = wan.gw_name ?? defaultSite.desc; const name = wan.gw_name ?? defaultSite.desc;
const uptime = wan["gw_system-stats"] ? wan["gw_system-stats"].uptime : null; const uptime = wan["gw_system-stats"] ? wan["gw_system-stats"].uptime : null;
@@ -10,7 +10,6 @@ import WidgetIcon from "./widget_icon";
export function getAllClasses(options, additionalClassNames = "") { export function getAllClasses(options, additionalClassNames = "") {
if (options?.style?.header === "boxedWidgets") { if (options?.style?.header === "boxedWidgets") {
if (options?.style?.cardBlur !== undefined) { if (options?.style?.cardBlur !== undefined) {
// eslint-disable-next-line no-param-reassign
additionalClassNames = [ additionalClassNames = [
additionalClassNames, additionalClassNames,
`backdrop-blur${options.style.cardBlur.length ? "-" : ""}${options.style.cardBlur}`, `backdrop-blur${options.style.cardBlur.length ? "-" : ""}${options.style.cardBlur}`,
+7
View File
@@ -0,0 +1,7 @@
import { applyNextAuthEnv } from "utils/env";
export function register() {
if (process.env.NEXT_RUNTIME !== "nodejs") return;
applyNextAuthEnv();
}
+53
View File
@@ -0,0 +1,53 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
describe("instrumentation", () => {
const originalEnv = process.env;
beforeEach(() => {
vi.resetModules();
process.env = { ...originalEnv };
delete process.env.NEXTAUTH_SECRET;
delete process.env.NEXTAUTH_URL;
delete process.env.HOMEPAGE_AUTH_SECRET;
delete process.env.HOMEPAGE_EXTERNAL_URL;
process.env.NEXT_RUNTIME = "nodejs";
});
afterEach(() => {
process.env = originalEnv;
});
it("maps HOMEPAGE_* auth envs to their NextAuth equivalents", async () => {
process.env.HOMEPAGE_AUTH_SECRET = "secret";
process.env.HOMEPAGE_EXTERNAL_URL = "https://homepage.example";
const { register } = await import("./instrumentation");
register();
expect(process.env.NEXTAUTH_SECRET).toBe("secret");
expect(process.env.NEXTAUTH_URL).toBe("https://homepage.example");
});
it("does not override explicitly configured NextAuth envs", async () => {
process.env.HOMEPAGE_AUTH_SECRET = "secret";
process.env.HOMEPAGE_EXTERNAL_URL = "https://homepage.example";
process.env.NEXTAUTH_SECRET = "explicit-secret";
process.env.NEXTAUTH_URL = "https://explicit.example";
const { register } = await import("./instrumentation");
register();
expect(process.env.NEXTAUTH_SECRET).toBe("explicit-secret");
expect(process.env.NEXTAUTH_URL).toBe("https://explicit.example");
});
it("is a no-op outside the node runtime", async () => {
process.env.NEXT_RUNTIME = "edge";
process.env.HOMEPAGE_EXTERNAL_URL = "https://homepage.example";
const { register } = await import("./instrumentation");
register();
expect(process.env.NEXTAUTH_URL).toBeUndefined();
});
});
+2 -1
View File
@@ -33,7 +33,8 @@ export async function middleware(req) {
} }
const pathname = new URL(req.url).pathname; const pathname = new URL(req.url).pathname;
if (authEnabled && !pathname.startsWith("/api/healthcheck")) { const isPublicAuthPath = pathname.startsWith("/api/healthcheck") || pathname === "/api/config/custom.css";
if (authEnabled && !isPublicAuthPath) {
// The MCP API handler authorizes both bearer tokens and Homepage sessions. // The MCP API handler authorizes both bearer tokens and Homepage sessions.
if (pathname === "/api/mcp") { if (pathname === "/api/mcp") {
return withPrivateCache(NextResponse.next()); return withPrivateCache(NextResponse.next());
+25
View File
@@ -100,6 +100,31 @@ describe("middleware", () => {
expect(res.type).toBe("next"); expect(res.type).toBe("next");
}); });
it("allows custom CSS without auth so it can style the signin page", async () => {
process.env.HOMEPAGE_AUTH_ENABLED = "true";
process.env.HOMEPAGE_AUTH_SECRET = "secret";
const middleware = await loadMiddleware();
const res = await middleware(createReq("localhost:3000", "http://localhost:3000/api/config/custom.css"));
expect(getToken).not.toHaveBeenCalled();
expect(NextResponse.next).toHaveBeenCalled();
expect(res.type).toBe("next");
});
it("continues to require auth for custom JavaScript", async () => {
process.env.HOMEPAGE_AUTH_ENABLED = "true";
process.env.HOMEPAGE_AUTH_SECRET = "secret";
getToken.mockResolvedValueOnce(null);
const middleware = await loadMiddleware();
const res = await middleware(createReq("localhost:3000", "http://localhost:3000/api/config/custom.js"));
expect(getToken).toHaveBeenCalled();
expect(res.type).toBe("redirect");
});
it.each(["false", "0", "no", "off", ""])("treats HOMEPAGE_AUTH_ENABLED=%j as disabled", async (value) => { it.each(["false", "0", "no", "off", ""])("treats HOMEPAGE_AUTH_ENABLED=%j as disabled", async (value) => {
process.env.HOMEPAGE_AUTH_ENABLED = value; process.env.HOMEPAGE_AUTH_ENABLED = value;
-2
View File
@@ -1,4 +1,3 @@
/* eslint-disable react/jsx-props-no-spreading */
import { SessionProvider } from "next-auth/react"; import { SessionProvider } from "next-auth/react";
import { appWithTranslation } from "next-i18next/pages"; import { appWithTranslation } from "next-i18next/pages";
import Head from "next/head"; import Head from "next/head";
@@ -13,7 +12,6 @@ import { ThemeProvider } from "utils/contexts/theme";
import nextI18nextConfig from "../../next-i18next.config"; import nextI18nextConfig from "../../next-i18next.config";
// eslint-disable-next-line no-unused-vars
const tailwindSafelist = [ const tailwindSafelist = [
// TODO: remove pending https://github.com/tailwindlabs/tailwindcss/pull/17147 // TODO: remove pending https://github.com/tailwindlabs/tailwindcss/pull/17147
"backdrop-blur", "backdrop-blur",
+3 -10
View File
@@ -3,7 +3,7 @@ import { createHash, timingSafeEqual } from "node:crypto";
import NextAuth from "next-auth"; import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials"; import CredentialsProvider from "next-auth/providers/credentials";
import { isAuthEnabled } from "utils/env"; import { applyNextAuthEnv, isAuthEnabled } from "utils/env";
import createLogger from "utils/logger"; import createLogger from "utils/logger";
const MIN_AUTH_SECRET_LENGTH = 32; const MIN_AUTH_SECRET_LENGTH = 32;
@@ -12,20 +12,13 @@ const authEnabled = isAuthEnabled();
const issuer = process.env.HOMEPAGE_OIDC_ISSUER; const issuer = process.env.HOMEPAGE_OIDC_ISSUER;
const clientId = process.env.HOMEPAGE_OIDC_CLIENT_ID; const clientId = process.env.HOMEPAGE_OIDC_CLIENT_ID;
const clientSecret = process.env.HOMEPAGE_OIDC_CLIENT_SECRET; const clientSecret = process.env.HOMEPAGE_OIDC_CLIENT_SECRET;
const homepageAuthSecret = process.env.HOMEPAGE_AUTH_SECRET;
const homepageExternalUrl = process.env.HOMEPAGE_EXTERNAL_URL;
const homepageAuthPassword = process.env.HOMEPAGE_AUTH_PASSWORD; const homepageAuthPassword = process.env.HOMEPAGE_AUTH_PASSWORD;
const homepageAuthPasswordDigest = homepageAuthPassword const homepageAuthPasswordDigest = homepageAuthPassword
? createHash("sha256").update(homepageAuthPassword, "utf8").digest() ? createHash("sha256").update(homepageAuthPassword, "utf8").digest()
: null; : null;
// Map HOMEPAGE_* envs to what NextAuth expects // Also done in instrumentation.js
if (!process.env.NEXTAUTH_SECRET && homepageAuthSecret) { applyNextAuthEnv();
process.env.NEXTAUTH_SECRET = homepageAuthSecret;
}
if (!process.env.NEXTAUTH_URL && homepageExternalUrl) {
process.env.NEXTAUTH_URL = homepageExternalUrl;
}
const defaultScope = process.env.HOMEPAGE_OIDC_SCOPE || "openid email profile"; const defaultScope = process.env.HOMEPAGE_OIDC_SCOPE || "openid email profile";
const cleanedIssuer = issuer ? issuer.replace(/\/+$/, "") : issuer; const cleanedIssuer = issuer ? issuer.replace(/\/+$/, "") : issuer;
+13 -6
View File
@@ -1,5 +1,5 @@
import classNames from "classnames"; import classNames from "classnames";
import { getProviders, signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { BiShieldQuarter } from "react-icons/bi"; import { BiShieldQuarter } from "react-icons/bi";
@@ -94,10 +94,8 @@ export default function SignIn({ providers, settings }) {
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-2xl bg-theme-500/15 text-theme-600 dark:text-theme-300"> <div className="mx-auto flex h-12 w-12 items-center justify-center rounded-2xl bg-theme-500/15 text-theme-600 dark:text-theme-300">
<BiShieldQuarter className="h-6 w-6" /> <BiShieldQuarter className="h-6 w-6" />
</div> </div>
<h1 className="mt-6 text-2xl font-semibold text-gray-900 dark:text-slate-100"> <h1 className="mt-6 text-2xl font-semibold text-gray-900 dark:text-slate-100">Authentication error</h1>
Authentication not configured <p className="mt-3 text-sm text-gray-600 dark:text-slate-400">Auth is disabled or misconfigured.</p>
</h1>
<p className="mt-3 text-sm text-gray-600 dark:text-slate-400">OIDC is disabled or misconfigured.</p>
</div> </div>
</main> </main>
</> </>
@@ -202,7 +200,16 @@ export default function SignIn({ providers, settings }) {
} }
export async function getServerSideProps(context) { export async function getServerSideProps(context) {
const providers = await getProviders(); // Avoid getProviders() fetch
let providers = {};
try {
// Dynamic so a bad config throws in here rather than at page load
const { authOptions } = await import("pages/api/auth/[...nextauth]");
providers = Object.fromEntries(authOptions.providers.map(({ id, name, type }) => [id, { id, name, type }]));
} catch (e) {
console.error("Unable to load auth providers: %s", e.message);
}
const homepageSettings = getSettings(); const homepageSettings = getSettings();
const settings = Object.fromEntries( const settings = Object.fromEntries(
PUBLIC_SIGN_IN_SETTINGS.filter((key) => Object.prototype.hasOwnProperty.call(homepageSettings, key)).map((key) => [ PUBLIC_SIGN_IN_SETTINGS.filter((key) => Object.prototype.hasOwnProperty.call(homepageSettings, key)).map((key) => [
+1 -2
View File
@@ -1,4 +1,3 @@
/* eslint-disable react/no-array-index-key */
import classNames from "classnames"; import classNames from "classnames";
import BookmarksGroup from "components/bookmarks/group"; import BookmarksGroup from "components/bookmarks/group";
import ErrorBoundary from "components/errorboundry"; import ErrorBoundary from "components/errorboundry";
@@ -175,7 +174,7 @@ function Index({ initialSettings, fallback }) {
</div> </div>
<div className="p-2 text-theme-100 dark:text-theme-200"> <div className="p-2 text-theme-100 dark:text-theme-200">
<pre className="opacity-50 font-bold pb-2"> <pre className="opacity-50 font-bold pb-2">
Reason: "{error.reason}" at line {error.mark?.line} Reason: &quot;{error.reason}&quot; at line {error.mark?.line}
</pre> </pre>
<pre className="font-italic">Check logs for details.</pre> <pre className="font-italic">Check logs for details.</pre>
</div> </div>
-1
View File
@@ -1,5 +1,4 @@
import { render } from "@testing-library/react"; import { render } from "@testing-library/react";
import { SettingsContext } from "utils/contexts/settings"; import { SettingsContext } from "utils/contexts/settings";
export function renderWithProviders(ui, { settings = {} } = {}) { export function renderWithProviders(ui, { settings = {} } = {}) {
+1
View File
@@ -589,6 +589,7 @@ export function cleanServiceGroups(groups) {
"grafana", "grafana",
"gluetun", "gluetun",
"vikunja", "vikunja",
"pulse",
].includes(type) ].includes(type)
) { ) {
widget.version = parseVersionForUrl(version); widget.version = parseVersionForUrl(version);
+2
View File
@@ -266,6 +266,7 @@ describe("utils/config/service-helpers", () => {
widgets: [ widgets: [
{ type: "azuredevops", userEmail: "u@example.com", repositoryId: "r" }, { type: "azuredevops", userEmail: "u@example.com", repositoryId: "r" },
{ type: "beszel", version: "2", systemId: "sys" }, { type: "beszel", version: "2", systemId: "sys" },
{ type: "pulse", version: "2" },
{ type: "coinmarketcap", currency: "USD", symbols: "BTC", slugs: "bitcoin", defaultinterval: "1d" }, { type: "coinmarketcap", currency: "USD", symbols: "BTC", slugs: "bitcoin", defaultinterval: "1d" },
{ type: "crowdsec", limit24h: "true" }, { type: "crowdsec", limit24h: "true" },
{ type: "docker", server: "docker-local", container: "c1" }, { type: "docker", server: "docker-local", container: "c1" },
@@ -345,6 +346,7 @@ describe("utils/config/service-helpers", () => {
expect.objectContaining({ userEmail: "u@example.com", repositoryId: "r" }), expect.objectContaining({ userEmail: "u@example.com", repositoryId: "r" }),
); );
expect(widgets.find((w) => w.type === "beszel")).toEqual(expect.objectContaining({ version: 2, systemId: "sys" })); expect(widgets.find((w) => w.type === "beszel")).toEqual(expect.objectContaining({ version: 2, systemId: "sys" }));
expect(widgets.find((w) => w.type === "pulse")).toEqual(expect.objectContaining({ version: 2 }));
expect(widgets.find((w) => w.type === "crowdsec")).toEqual(expect.objectContaining({ limit24h: true })); expect(widgets.find((w) => w.type === "crowdsec")).toEqual(expect.objectContaining({ limit24h: true }));
expect(widgets.find((w) => w.type === "docker")).toEqual( expect(widgets.find((w) => w.type === "docker")).toEqual(
expect.objectContaining({ server: "docker-local", container: "c1" }), expect.objectContaining({ server: "docker-local", container: "c1" }),
-1
View File
@@ -32,7 +32,6 @@ export function ColorProvider({ initialTheme, children }) {
useEffect(() => { useEffect(() => {
if (initialTheme !== undefined) setColor(initialTheme ?? getInitialColor()); if (initialTheme !== undefined) setColor(initialTheme ?? getInitialColor());
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialTheme]); }, [initialTheme]);
useEffect(() => { useEffect(() => {
-1
View File
@@ -33,7 +33,6 @@ export function ThemeProvider({ initialTheme, children }) {
useEffect(() => { useEffect(() => {
if (initialTheme !== undefined) setTheme(initialTheme ?? getInitialTheme()); if (initialTheme !== undefined) setTheme(initialTheme ?? getInitialTheme());
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialTheme]); }, [initialTheme]);
useEffect(() => { useEffect(() => {
+10
View File
@@ -1,3 +1,13 @@
export function isAuthEnabled() { export function isAuthEnabled() {
return process.env.HOMEPAGE_AUTH_ENABLED === "true"; return process.env.HOMEPAGE_AUTH_ENABLED === "true";
} }
// Frozen at module load, so map them before anything imports it
export function applyNextAuthEnv() {
if (!process.env.NEXTAUTH_SECRET && process.env.HOMEPAGE_AUTH_SECRET) {
process.env.NEXTAUTH_SECRET = process.env.HOMEPAGE_AUTH_SECRET;
}
if (!process.env.NEXTAUTH_URL && process.env.HOMEPAGE_EXTERNAL_URL) {
process.env.NEXTAUTH_URL = process.env.HOMEPAGE_EXTERNAL_URL;
}
}
+5 -4
View File
@@ -14,13 +14,14 @@ import createLogger from "utils/logger";
const logger = createLogger("resource-helpers"); const logger = createLogger("resource-helpers");
const kc = getKubeConfig(); const kc = getKubeConfig();
const getSchemaFromGateway = async (parentRef) => { const getSchemaFromGateway = async (parentRef, routeNamespace) => {
const crd = kc.makeApiClient(CustomObjectsApi); const crd = kc.makeApiClient(CustomObjectsApi);
const schema = await crd const schema = await crd
.getNamespacedCustomObject({ .getNamespacedCustomObject({
group: HTTPROUTE_API_GROUP, group: HTTPROUTE_API_GROUP,
version: HTTPROUTE_API_VERSION, version: HTTPROUTE_API_VERSION,
namespace: parentRef.namespace, // parentRef namespace is optional, defaults to the route's namespace
namespace: parentRef.namespace ?? routeNamespace,
plural: "gateways", plural: "gateways",
name: parentRef.name, name: parentRef.name,
}) })
@@ -31,7 +32,7 @@ const getSchemaFromGateway = async (parentRef) => {
return listener.protocol.toLowerCase(); return listener.protocol.toLowerCase();
}) })
.catch((error) => { .catch((error) => {
logger.error("Error getting gateways: %d %s %s", error.statusCode, error.body, error.response); logger.error("Error getting gateways: %s", error.body ?? error.message);
logger.debug(error); logger.debug(error);
return "http"; return "http";
@@ -48,7 +49,7 @@ async function getUrlFromHttpRoute(resource) {
if (resource.spec.rules[0].matches[0].path.type !== "RegularExpression") { if (resource.spec.rules[0].matches[0].path.type !== "RegularExpression") {
const urlHost = resource.spec.hostnames[0]; const urlHost = resource.spec.hostnames[0];
const urlPath = resource.spec.rules[0].matches[0].path.value; const urlPath = resource.spec.rules[0].matches[0].path.value;
const urlSchema = await getSchemaFromGateway(resource.spec.parentRefs[0]); const urlSchema = await getSchemaFromGateway(resource.spec.parentRefs[0], resource.metadata.namespace);
url = `${urlSchema}://${urlHost}${urlPath}`; url = `${urlSchema}://${urlHost}${urlPath}`;
} }
} }
+62 -1
View File
@@ -137,6 +137,36 @@ describe("utils/kubernetes/resource-helpers", () => {
expect(service.href).toBe("https://example.com/r"); expect(service.href).toBe("https://example.com/r");
}); });
it("falls back to the route namespace when the parentRef omits one", async () => {
const kc = getKubeConfig();
const crd = kc.makeApiClient();
const base = "gethomepage.dev";
const resource = {
kind: "HTTPRoute",
metadata: {
name: "route",
namespace: "ns",
annotations: {
[`${base}/enabled`]: "true",
},
},
spec: {
hostnames: ["example.com"],
parentRefs: [{ name: "gw", sectionName: "web" }],
rules: [
{
matches: [{ path: { type: "PathPrefix", value: "/r" } }],
},
],
},
};
const service = await constructedServiceFromResource(resource);
expect(crd.getNamespacedCustomObject).toHaveBeenCalledWith(expect.objectContaining({ namespace: "ns" }));
expect(service.href).toBe("https://example.com/r");
});
it("falls back to http when the gateway listener protocol cannot be resolved", async () => { it("falls back to http when the gateway listener protocol cannot be resolved", async () => {
const kc = getKubeConfig(); const kc = getKubeConfig();
const crd = kc.makeApiClient(); const crd = kc.makeApiClient();
@@ -169,10 +199,41 @@ describe("utils/kubernetes/resource-helpers", () => {
const service = await constructedServiceFromResource(resource); const service = await constructedServiceFromResource(resource);
expect(service.href).toBe("http://example.com/r"); expect(service.href).toBe("http://example.com/r");
expect(logger.error).toHaveBeenCalled(); expect(logger.error).toHaveBeenCalledWith("Error getting gateways: %s", "boom");
expect(logger.debug).toHaveBeenCalled(); expect(logger.debug).toHaveBeenCalled();
}); });
it("logs the message for gateway errors that carry no response body", async () => {
const kc = getKubeConfig();
const crd = kc.makeApiClient();
crd.getNamespacedCustomObject.mockRejectedValueOnce(new Error("Required parameter namespace was null"));
const base = "gethomepage.dev";
const resource = {
kind: "HTTPRoute",
metadata: {
name: "route",
namespace: "ns",
annotations: {
[`${base}/enabled`]: "true",
},
},
spec: {
hostnames: ["example.com"],
parentRefs: [{ namespace: "ns", name: "gw", sectionName: "web" }],
rules: [
{
matches: [{ path: { type: "PathPrefix", value: "/r" } }],
},
],
},
};
const service = await constructedServiceFromResource(resource);
expect(service.href).toBe("http://example.com/r");
expect(logger.error).toHaveBeenCalledWith("Error getting gateways: %s", "Required parameter namespace was null");
});
it("logs and recovers when environment substitution yields invalid json", async () => { it("logs and recovers when environment substitution yields invalid json", async () => {
substituteEnvironmentVars.mockImplementationOnce(() => "{bad json"); substituteEnvironmentVars.mockImplementationOnce(() => "{bad json");
+7 -5
View File
@@ -16,14 +16,16 @@ export default function Component({ service }) {
widget.fields = widget.fields.slice(0, MAX_FIELDS); widget.fields = widget.fields.slice(0, MAX_FIELDS);
} }
if (widget?.env == null || widget.env === "") { const envNotSet = widget.env == null || widget.env === "";
const { data: containers, error: containersError } = useWidgetAPI(widget, envNotSet ? "" : "containers");
const { data: images, error: imagesError } = useWidgetAPI(widget, envNotSet ? "" : "images");
const { data: updates, error: updatesError } = useWidgetAPI(widget, envNotSet ? "" : "updates");
if (envNotSet) {
return <Container service={service} error={t("arcane.environment_required")} />; return <Container service={service} error={t("arcane.environment_required")} />;
} }
const { data: containers, error: containersError } = useWidgetAPI(widget, "containers");
const { data: images, error: imagesError } = useWidgetAPI(widget, "images");
const { data: updates, error: updatesError } = useWidgetAPI(widget, "updates");
const error = const error =
containersError ?? imagesError ?? updatesError ?? containers?.detail ?? images?.detail ?? updates?.detail; containersError ?? imagesError ?? updatesError ?? containers?.detail ?? images?.detail ?? updates?.detail;
if (error) { if (error) {
+5 -1
View File
@@ -20,11 +20,15 @@ describe("widgets/arcane/component", () => {
}); });
it("shows an environment required error when env is missing", () => { it("shows an environment required error when env is missing", () => {
useWidgetAPI.mockImplementation(() => ({ data: undefined, error: undefined }));
renderWithProviders(<Component service={{ widget: { type: "arcane" } }} />, { renderWithProviders(<Component service={{ widget: { type: "arcane" } }} />, {
settings: { hideErrors: false }, settings: { hideErrors: false },
}); });
expect(useWidgetAPI).not.toHaveBeenCalled(); // hooks always run; the empty endpoint is what skips the request
expect(useWidgetAPI).toHaveBeenCalledTimes(3);
useWidgetAPI.mock.calls.forEach((call) => expect(call[1]).toBe(""));
expect(screen.getByText("arcane.environment_required")).toBeInTheDocument(); expect(screen.getByText("arcane.environment_required")).toBeInTheDocument();
}); });
+40 -13
View File
@@ -8,34 +8,43 @@ export default function Component({ service }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { widget } = service; const { widget } = service;
const isV2 = widget.version === 2;
const { data: usersData, error: usersError } = useWidgetAPI(widget, "users"); const { data: usersData, error: usersError } = useWidgetAPI(widget, "users");
const loginsEndpoint = widget.version === 2 ? "loginv2" : "login"; const loginsEndpoint = isV2 ? "" : "login";
const { data: loginsData, error: loginsError } = useWidgetAPI(widget, loginsEndpoint); const { data: loginsData, error: loginsError } = useWidgetAPI(widget, loginsEndpoint);
const failedLoginsEndpoint = widget.version === 2 ? "login_failedv2" : "login_failed"; const failedLoginsEndpoint = isV2 ? "" : "login_failed";
const { data: failedLoginsData, error: failedLoginsError } = useWidgetAPI(widget, failedLoginsEndpoint); const { data: failedLoginsData, error: failedLoginsError } = useWidgetAPI(widget, failedLoginsEndpoint);
if (usersError || loginsError || failedLoginsError) { const eventsDataEndpoint = isV2 ? "datav2" : "";
const finalError = usersError ?? loginsError ?? failedLoginsError; const { data: eventsData, error: eventsDataError } = useWidgetAPI(widget, eventsDataEndpoint);
if (usersError || loginsError || failedLoginsError || eventsDataError) {
const finalError = usersError ?? loginsError ?? failedLoginsError ?? eventsDataError;
return <Container service={service} error={finalError} />; return <Container service={service} error={finalError} />;
} }
if (!usersData || !loginsData || !failedLoginsData) { const hasNoData = isV2 ? !usersData || !eventsData : !usersData || !loginsData || !failedLoginsData;
if (hasNoData) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="authentik.users" /> <Block label="authentik.users" />
<Block label="authentik.loginsLast24H" /> <Block label="authentik.loginsLast24H" />
<Block label="authentik.failedLoginsLast24H" /> <Block label="authentik.failedLoginsLast24H" />
{isV2 && <Block label="authentik.authorizationsLast24H" />}
</Container> </Container>
); );
} }
let loginsLast24H; let loginsLast24H;
let failedLoginsLast24H; let failedLoginsLast24H;
let authorizationsLast24H;
switch (widget.version) { switch (widget.version) {
case 1: // v1 is default
default:
const yesterday = new Date(Date.now()).setHours(-24); const yesterday = new Date(Date.now()).setHours(-24);
loginsLast24H = loginsData.reduce( loginsLast24H = loginsData.reduce(
(total, current) => (current.x_cord >= yesterday ? total + current.y_cord : total), (total, current) => (current.x_cord >= yesterday ? total + current.y_cord : total),
@@ -47,13 +56,28 @@ export default function Component({ service }) {
); );
break; break;
case 2: case 2:
loginsLast24H = const events = Array.isArray(eventsData) ? eventsData : [];
loginsData.reduce?.( const result = events.reduce(
(total, current) => (current?.count && current?.action === "login" ? total + current.count : total), (acc, current) => {
0, if (!current?.count || !current?.action) {
) || 0; return acc;
failedLoginsLast24H = }
failedLoginsData.reduce?.((total, current) => (current?.count ? total + current.count : total), 0) || 0;
if (current.action === "login") {
acc.logins += current.count;
} else if (current.action === "login_failed") {
acc.failed += current.count;
} else if (current.action === "authorize_application") {
acc.authorizations += current.count;
}
return acc;
},
{ logins: 0, failed: 0, authorizations: 0 },
);
loginsLast24H = result.logins;
failedLoginsLast24H = result.failed;
authorizationsLast24H = result.authorizations;
break; break;
} }
@@ -62,6 +86,9 @@ export default function Component({ service }) {
<Block label="authentik.users" value={t("common.number", { value: usersData.pagination.count })} /> <Block label="authentik.users" value={t("common.number", { value: usersData.pagination.count })} />
<Block label="authentik.loginsLast24H" value={t("common.number", { value: loginsLast24H })} /> <Block label="authentik.loginsLast24H" value={t("common.number", { value: loginsLast24H })} />
<Block label="authentik.failedLoginsLast24H" value={t("common.number", { value: failedLoginsLast24H })} /> <Block label="authentik.failedLoginsLast24H" value={t("common.number", { value: failedLoginsLast24H })} />
{isV2 && (
<Block label="authentik.authorizationsLast24H" value={t("common.number", { value: authorizationsLast24H })} />
)}
</Container> </Container>
); );
} }
+37 -5
View File
@@ -30,24 +30,31 @@ describe("widgets/authentik/component", () => {
settings: { hideErrors: false }, settings: { hideErrors: false },
}); });
expect(container.querySelectorAll(".service-block")).toHaveLength(3); expect(container.querySelectorAll(".service-block")).toHaveLength(4);
expect(screen.getByText("authentik.users")).toBeInTheDocument(); expect(screen.getByText("authentik.users")).toBeInTheDocument();
expect(screen.getByText("authentik.loginsLast24H")).toBeInTheDocument(); expect(screen.getByText("authentik.loginsLast24H")).toBeInTheDocument();
expect(screen.getByText("authentik.failedLoginsLast24H")).toBeInTheDocument(); expect(screen.getByText("authentik.failedLoginsLast24H")).toBeInTheDocument();
expect(screen.getByText("authentik.authorizationsLast24H")).toBeInTheDocument();
}); });
it("computes v2 login/failed counts from action data", () => { it("computes v2 login/failed counts from action data", () => {
useWidgetAPI.mockImplementation((widget, endpoint) => { useWidgetAPI.mockImplementation((widget, endpoint) => {
if (endpoint === "users") return { data: { pagination: { count: 10 } }, error: undefined }; if (endpoint === "users") return { data: { pagination: { count: 10 } }, error: undefined };
if (endpoint === "loginv2") if (endpoint === "datav2")
return { return {
data: [ data: [
{ action: "login", count: 2 }, { action: "login", count: 2 },
{ action: "login", count: 4 },
{ action: "logout", count: 9 }, { action: "logout", count: 9 },
{ action: "login_failed", count: 1 },
{ action: "login_failed", count: 2 },
{ action: "authorize_application", count: 10 },
{ action: "authorize_application", count: 8 },
{ action: null, count: null },
{ action: "login", count: null },
], ],
error: undefined, error: undefined,
}; };
if (endpoint === "login_failedv2") return { data: [{ count: 3 }, { count: null }], error: undefined };
return { data: undefined, error: undefined }; return { data: undefined, error: undefined };
}); });
@@ -55,10 +62,11 @@ describe("widgets/authentik/component", () => {
settings: { hideErrors: false }, settings: { hideErrors: false },
}); });
expect(container.querySelectorAll(".service-block")).toHaveLength(3); expect(container.querySelectorAll(".service-block")).toHaveLength(4);
expectBlockValue(container, "authentik.users", 10); expectBlockValue(container, "authentik.users", 10);
expectBlockValue(container, "authentik.loginsLast24H", 2); expectBlockValue(container, "authentik.loginsLast24H", 6);
expectBlockValue(container, "authentik.failedLoginsLast24H", 3); expectBlockValue(container, "authentik.failedLoginsLast24H", 3);
expectBlockValue(container, "authentik.authorizationsLast24H", 18);
}); });
it("computes v1 login/failed counts for entries within the last 24h window", () => { it("computes v1 login/failed counts for entries within the last 24h window", () => {
@@ -99,4 +107,28 @@ describe("widgets/authentik/component", () => {
expectBlockValue(container, "authentik.loginsLast24H", 2); expectBlockValue(container, "authentik.loginsLast24H", 2);
expectBlockValue(container, "authentik.failedLoginsLast24H", 1); expectBlockValue(container, "authentik.failedLoginsLast24H", 1);
}); });
it("falls back to v1 when no version is configured", () => {
vi.useFakeTimers();
vi.setSystemTime(new Date("2026-01-02T00:00:00Z"));
const oneHourAgo = Date.now() - 60 * 60 * 1000;
useWidgetAPI.mockImplementation((widget, endpoint) => {
if (endpoint === "users") return { data: { pagination: { count: 5 } }, error: undefined };
if (endpoint === "login") return { data: [{ x_cord: oneHourAgo, y_cord: 2 }], error: undefined };
if (endpoint === "login_failed") return { data: [{ x_cord: oneHourAgo, y_cord: 1 }], error: undefined };
return { data: undefined, error: undefined };
});
// service-helpers sets version to null when the key is absent
const { container } = renderWithProviders(
<Component service={{ widget: { type: "authentik", version: null } }} />,
{ settings: { hideErrors: false } },
);
expectBlockValue(container, "authentik.users", 5);
expectBlockValue(container, "authentik.loginsLast24H", 2);
expectBlockValue(container, "authentik.failedLoginsLast24H", 1);
});
}); });
+2 -5
View File
@@ -11,14 +11,11 @@ const widget = {
login: { login: {
endpoint: "events/events/per_month/?action=login", endpoint: "events/events/per_month/?action=login",
}, },
loginv2: {
endpoint: "events/events/volume/?action=login&&history_days=1",
},
login_failed: { login_failed: {
endpoint: "events/events/per_month/?action=login_failed", endpoint: "events/events/per_month/?action=login_failed",
}, },
login_failedv2: { datav2: {
endpoint: "events/events/volume/?action=login_failed&&history_days=1", endpoint: "events/events/volume/?actions=login&actions=login_failed&actions=authorize_application&history_days=1",
}, },
}, },
}; };
+11 -3
View File
@@ -28,14 +28,14 @@ export function Day({ weekNumber, weekday, events, colorVariants, showDate, setS
// selected same day style // selected same day style
style += style +=
displayDate.startOf("day").ts === showDate.startOf("day").ts displayDate.startOf("day").ts === showDate.startOf("day").ts
? "text-black-500 bg-theme-100/20 dark:bg-white/10 rounded-md " ? "text-black-500 bg-black/10 dark:bg-white/10 rounded-md "
: ""; : "";
if (displayDate.startOf("day").ts === currentDate.startOf("day").ts) { if (displayDate.startOf("day").ts === currentDate.startOf("day").ts) {
// today style // today style
style += "text-black-500 bg-theme-100/20 dark:bg-black/20 rounded-md "; style += "text-black-500 bg-black/20! dark:bg-black/20! rounded-md ";
} else { } else {
style += "hover:bg-theme-100/20 dark:hover:bg-white/5 rounded-md cursor-pointer"; style += "calendar-day-hover rounded-md cursor-pointer";
} }
return style; return style;
@@ -110,6 +110,14 @@ export default function Monthly({ service, colorVariants, events, showDate, setS
return ( return (
<div className="w-full text-center"> <div className="w-full text-center">
<style jsx>{`
:global(.calendar-day-hover:hover) {
background-color: rgb(0 0 0 / 10%);
}
:global(.dark:not(.theme-white) .calendar-day-hover:hover) {
background-color: rgb(255 255 255 / 5%);
}
`}</style>
<div className="flex-col"> <div className="flex-col">
<span> <span>
<button <button
-1
View File
@@ -27,7 +27,6 @@ export default function Component({ service }) {
} }
// uptime info // uptime info
// eslint-disable-next-line no-unused-vars
const [hour, minutes, seconds] = infoData.data.up_time.split(":"); const [hour, minutes, seconds] = infoData.data.up_time.split(":");
const days = Math.floor(hour / 24); const days = Math.floor(hour / 24);
const uptime = `${t("common.number", { value: days })} ${t("diskstation.days")}`; const uptime = `${t("common.number", { value: days })} ${t("diskstation.days")}`;
+7 -2
View File
@@ -70,7 +70,7 @@ async function login(widget) {
return body.AccessToken; return body.AccessToken;
} }
async function apiGet(widget, endpoint, accessToken) { async function apiGet(widget, endpoint, accessToken, { allow404 = false } = {}) {
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget })); const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
const [status, , data] = await httpProxy(url, { const [status, , data] = await httpProxy(url, {
method: "GET", method: "GET",
@@ -79,6 +79,11 @@ async function apiGet(widget, endpoint, accessToken) {
}, },
}); });
// e.g. progressstate 404s until a job has run
if (status === 404 && allow404) {
return null;
}
if (status !== 200) { if (status !== 200) {
throw new Error(`Duplicati request failed for ${endpoint}`); throw new Error(`Duplicati request failed for ${endpoint}`);
} }
@@ -108,7 +113,7 @@ export default async function duplicatiProxyHandler(req, res) {
apiGet(widget, "backups", accessToken), apiGet(widget, "backups", accessToken),
apiGet(widget, "serverstate", accessToken), apiGet(widget, "serverstate", accessToken),
apiGet(widget, "notifications", accessToken), apiGet(widget, "notifications", accessToken),
apiGet(widget, "progressstate", accessToken), apiGet(widget, "progressstate", accessToken, { allow404: true }),
]); ]);
const summary = buildSummary( const summary = buildSummary(
+32
View File
@@ -75,6 +75,38 @@ describe("widgets/duplicati/proxy", () => {
expect(res.body.lastBackup).toBe("2026-07-12T10:00:00.000Z"); expect(res.body.lastBackup).toBe("2026-07-12T10:00:00.000Z");
}); });
it("tolerates progressstate 404 when no job has run", async () => {
getServiceWidget.mockResolvedValue({ type: "duplicati", url: "http://dup", password: "secret" });
httpProxy
.mockResolvedValueOnce([200, "application/json", Buffer.from(JSON.stringify({ AccessToken: "token" }))])
.mockResolvedValueOnce([200, "application/json", Buffer.from(JSON.stringify([]))])
.mockResolvedValueOnce([200, "application/json", Buffer.from(JSON.stringify({ ActiveTask: null }))])
.mockResolvedValueOnce([200, "application/json", Buffer.from(JSON.stringify([]))])
.mockResolvedValueOnce([
404,
"application/json",
Buffer.from(JSON.stringify({ Error: "No active backup", Code: 404 })),
]);
const res = createMockRes();
await duplicatiProxyHandler({ query: { group: "g", service: "s" } }, res);
expect(res.statusCode).toBe(200);
expect(res.body.running).toBe(0);
});
it("returns 500 when a non-progressstate endpoint 404s", async () => {
getServiceWidget.mockResolvedValue({ type: "duplicati", url: "http://dup", password: "secret" });
httpProxy
.mockResolvedValueOnce([200, "application/json", Buffer.from(JSON.stringify({ AccessToken: "token" }))])
.mockResolvedValue([404, "application/json", Buffer.from("{}")]);
const res = createMockRes();
await duplicatiProxyHandler({ query: { group: "g", service: "s" } }, res);
expect(res.statusCode).toBe(500);
});
it("returns 500 when login fails", async () => { it("returns 500 when login fails", async () => {
getServiceWidget.mockResolvedValue({ type: "duplicati", url: "http://dup", password: "secret" }); getServiceWidget.mockResolvedValue({ type: "duplicati", url: "http://dup", password: "secret" });
httpProxy.mockResolvedValueOnce([401, "application/json", Buffer.from("{}")]); httpProxy.mockResolvedValueOnce([401, "application/json", Buffer.from("{}")]);
-2
View File
@@ -28,7 +28,6 @@ export default function Component({ service }) {
useEffect(() => { useEffect(() => {
if (data && !data.error) { if (data && !data.error) {
// eslint-disable-next-line eqeqeq
const gpuData = data.find((item) => item[item.key] == gpuName); const gpuData = data.find((item) => item[item.key] == gpuName);
if (gpuData) { if (gpuData) {
@@ -56,7 +55,6 @@ export default function Component({ service }) {
); );
} }
// eslint-disable-next-line eqeqeq
const gpuData = data.find((item) => item[item.key] == gpuName); const gpuData = data.find((item) => item[item.key] == gpuName);
if (!gpuData) { if (!gpuData) {
+1 -1
View File
@@ -11,7 +11,7 @@ export default function Component({ service }) {
// Some APIs return raw arrays, others wrap the payload (e.g. { response: [...] }). // Some APIs return raw arrays, others wrap the payload (e.g. { response: [...] }).
const collections = collectionsStatsData?.response ?? collectionsStatsData; const collections = collectionsStatsData?.response ?? collectionsStatsData;
const tags = tagsStatsData?.response ?? tagsStatsData; const tags = tagsStatsData?.response ?? tagsStatsData?.data?.tags ?? tagsStatsData;
const totalLinks = Array.isArray(collections) const totalLinks = Array.isArray(collections)
? collections.reduce((sum, collection) => sum + (collection._count?.links || 0), 0) ? collections.reduce((sum, collection) => sum + (collection._count?.links || 0), 0)
+22
View File
@@ -67,4 +67,26 @@ describe("widgets/linkwarden/component", () => {
expectBlockValue(container, "linkwarden.collections", 2); expectBlockValue(container, "linkwarden.collections", 2);
expectBlockValue(container, "linkwarden.tags", 4); expectBlockValue(container, "linkwarden.tags", 4);
}); });
it("computes the tags total from the nested Linkwarden API response", () => {
useWidgetAPI.mockImplementation((_widget, endpoint) => {
if (endpoint === "collections") {
return { data: { response: [{ _count: { links: 2 } }] }, error: undefined };
}
if (endpoint === "tags") {
return { data: { data: { tags: [{ id: 1 }, { id: 2 }, { id: 3 }] } }, error: undefined };
}
return { data: undefined, error: undefined };
});
const { container } = renderWithProviders(<Component service={{ widget: { type: "linkwarden" } }} />, {
settings: { hideErrors: false },
});
expectBlockValue(container, "linkwarden.links", 2);
expectBlockValue(container, "linkwarden.collections", 1);
expectBlockValue(container, "linkwarden.tags", 3);
});
}); });
+13 -1
View File
@@ -39,7 +39,8 @@ function formatResourceCount(total, active) {
export default function Component({ service }) { export default function Component({ service }) {
const { widget } = service; const { widget } = service;
const { data: resourcesData, error: resourcesError } = useWidgetAPI(widget, "resources"); const version = widget.version ?? 1;
const { data: resourcesData, error: resourcesError } = useWidgetAPI(widget, version === 2 ? "summary" : "resources");
if (resourcesError) { if (resourcesError) {
return <Container service={service} error={resourcesError} />; return <Container service={service} error={resourcesError} />;
@@ -55,6 +56,17 @@ export default function Component({ service }) {
); );
} }
if (version === 2) {
// pulse v6 (v2 widget) returns the counts directly in the summary
return (
<Container service={service}>
<Block label="pulse.nodes" value={resourcesData.nodes} />
<Block label="pulse.vms" value={resourcesData.vms} />
<Block label="pulse.lxcs" value={resourcesData.containers} />
</Container>
);
}
let resources = resourcesData.resources; let resources = resourcesData.resources;
if (!resources && resourcesData.count === 0) { if (!resources && resourcesData.count === 0) {
resources = []; resources = [];
+21
View File
@@ -27,6 +27,27 @@ describe("widgets/pulse/component", () => {
expect(screen.getByText("pulse.nodes")).toBeInTheDocument(); expect(screen.getByText("pulse.nodes")).toBeInTheDocument();
expect(screen.getByText("pulse.vms")).toBeInTheDocument(); expect(screen.getByText("pulse.vms")).toBeInTheDocument();
expect(screen.getByText("pulse.lxcs")).toBeInTheDocument(); expect(screen.getByText("pulse.lxcs")).toBeInTheDocument();
expect(useWidgetAPI).toHaveBeenCalledWith({ type: "pulse" }, "resources");
});
it("renders Pulse v6 summary counts", () => {
useWidgetAPI.mockReturnValue({
data: {
nodes: 2,
vms: 8,
containers: 12,
},
error: undefined,
});
const { container } = renderWithProviders(<Component service={{ widget: { type: "pulse", version: 2 } }} />, {
settings: { hideErrors: false },
});
expect(useWidgetAPI).toHaveBeenCalledWith({ type: "pulse", version: 2 }, "summary");
expectBlockValue(container, "pulse.nodes", 2);
expectBlockValue(container, "pulse.vms", 8);
expectBlockValue(container, "pulse.lxcs", 12);
}); });
it("renders error UI when the resources endpoint errors", () => { it("renders error UI when the resources endpoint errors", () => {
+3
View File
@@ -8,6 +8,9 @@ const widget = {
resources: { resources: {
endpoint: "api/resources", endpoint: "api/resources",
}, },
summary: {
endpoint: "api/state/summary",
},
}, },
}; };
+5 -1
View File
@@ -1,4 +1,4 @@
import { describe, it } from "vitest"; import { describe, expect, it } from "vitest";
import { expectWidgetConfigShape } from "test-utils/widget-config"; import { expectWidgetConfigShape } from "test-utils/widget-config";
@@ -8,4 +8,8 @@ describe("pulse widget config", () => {
it("exports a valid widget config", () => { it("exports a valid widget config", () => {
expectWidgetConfigShape(widget); expectWidgetConfigShape(widget);
}); });
it("maps the Pulse v6 summary endpoint", () => {
expect(widget.mappings.summary.endpoint).toBe("api/state/summary");
});
}); });
+1
View File
@@ -1,6 +1,7 @@
import Block from "components/services/widget/block"; import Block from "components/services/widget/block";
import Container from "components/services/widget/container"; import Container from "components/services/widget/container";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import useWidgetAPI from "utils/proxy/use-widget-api"; import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) { export default function Component({ service }) {
-2
View File
@@ -8,7 +8,6 @@ export default function Component({ service }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { widget } = service; const { widget } = service;
// eslint-disable-next-line prefer-const
let { data: spoolData, error: spoolError } = useWidgetAPI(widget, "spools"); let { data: spoolData, error: spoolError } = useWidgetAPI(widget, "spools");
if (spoolError) { if (spoolError) {
@@ -20,7 +19,6 @@ export default function Component({ service }) {
return ( return (
<Container service={service}> <Container service={service}>
{[...Array(nBlocksGuess)].map((_, i) => ( {[...Array(nBlocksGuess)].map((_, i) => (
// eslint-disable-next-line react/no-array-index-key
<Block key={i} label="spoolman.loading" /> <Block key={i} label="spoolman.loading" />
))} ))}
</Container> </Container>
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable camelcase */
import Container from "components/services/widget/container"; import Container from "components/services/widget/container";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import { BsCpu, BsFillCpuFill, BsFillPlayFill, BsPauseFill } from "react-icons/bs"; import { BsCpu, BsFillCpuFill, BsFillPlayFill, BsPauseFill } from "react-icons/bs";
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable camelcase */
import Block from "components/services/widget/block"; import Block from "components/services/widget/block";
import Container from "components/services/widget/container"; import Container from "components/services/widget/container";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
+2 -2
View File
@@ -38,8 +38,8 @@ export default function Component({ service }) {
const lan = defaultSite.health.find((h) => h.subsystem === "lan"); const lan = defaultSite.health.find((h) => h.subsystem === "lan");
const wlan = defaultSite.health.find((h) => h.subsystem === "wlan"); const wlan = defaultSite.health.find((h) => h.subsystem === "wlan");
[wan, lan, wlan].forEach((s) => { [wan, lan, wlan].forEach((s) => {
s.up = s.status === "ok"; // eslint-disable-line no-param-reassign s.up = s.status === "ok";
s.show = s.status !== "unknown"; // eslint-disable-line no-param-reassign s.show = s.status !== "unknown";
}); });
const uptime = wan["gw_system-stats"] const uptime = wan["gw_system-stats"]
-1
View File
@@ -11,7 +11,6 @@ afterEach(() => {
// Avoid NextAuth client-side fetches during unit tests. // Avoid NextAuth client-side fetches during unit tests.
vi.mock("next-auth/react", () => ({ vi.mock("next-auth/react", () => ({
SessionProvider: ({ children }) => children ?? null, SessionProvider: ({ children }) => children ?? null,
getProviders: vi.fn(async () => ({})),
})); }));
// implement a couple of common formatters mocked in next-i18next // implement a couple of common formatters mocked in next-i18next