Compare commits
168
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b0d50f523 | ||
|
|
49d9394cd7 | ||
|
|
798293813c | ||
|
|
42a3791e6b | ||
|
|
3d8e22574e | ||
|
|
531d87a83b | ||
|
|
929a803965 | ||
|
|
003dac4744 | ||
|
|
d7f0596db8 | ||
|
|
dec490365a | ||
|
|
1639da5779 | ||
|
|
d53c922688 | ||
|
|
22f5d3b959 | ||
|
|
8d64cb8a5e | ||
|
|
bbd42600aa | ||
|
|
8859923bb7 | ||
|
|
e23a397a80 | ||
|
|
f88bf9582e | ||
|
|
22bbef9d8e | ||
|
|
4f2b8217f8 | ||
|
|
2fefd9da01 | ||
|
|
b3e9b3351b | ||
|
|
d4e4c9669d | ||
|
|
1db20df19c | ||
|
|
feaf022965 | ||
|
|
5b4e6fcc11 | ||
|
|
20a9b3d556 | ||
|
|
47b2d36f7a | ||
|
|
2336f9ee5e | ||
|
|
6fa6ba385e | ||
|
|
dadf596a31 | ||
|
|
7537184a81 | ||
|
|
5a81d035cf | ||
|
|
b0b6fbd315 | ||
|
|
883161357d | ||
|
|
24694b9241 | ||
|
|
13b99d021b | ||
|
|
94dfddf8bd | ||
|
|
b6b11c39d2 | ||
|
|
369b4d4863 | ||
|
|
6f8e62963a | ||
|
|
991044ebd7 | ||
|
|
b3f012226b | ||
|
|
63c55cec57 | ||
|
|
c009dd7de6 | ||
|
|
62764499e7 | ||
|
|
09227a3884 | ||
|
|
37bafaa71a | ||
|
|
237d11d2c0 | ||
|
|
4efe7496a5 | ||
|
|
c3fa4e866c | ||
|
|
1938798ba1 | ||
|
|
4fb48c23a2 | ||
|
|
e13afb721e | ||
|
|
3ed31d8f59 | ||
|
|
1d5b4fd7fb | ||
|
|
55cf3c72a3 | ||
|
|
9648d9e99f | ||
|
|
0e0b857905 | ||
|
|
7d93b10032 | ||
|
|
6fa9087a11 | ||
|
|
d2f438f294 | ||
|
|
2423ecdce5 | ||
|
|
7094110da2 | ||
|
|
72ec253644 | ||
|
|
3bbde3cbb8 | ||
|
|
6f85b2161f | ||
|
|
c85910d24f | ||
|
|
397c1d3dbc | ||
|
|
078fb6de93 | ||
|
|
8159b4f146 | ||
|
|
e8f6876d24 | ||
|
|
615062c6b1 | ||
|
|
d9294ed4bf | ||
|
|
d1d8659f95 | ||
|
|
ac80008ce0 | ||
|
|
13853f2981 | ||
|
|
f995cba157 | ||
|
|
91a9b6bec9 | ||
|
|
314ab3a28e | ||
|
|
7841b58f0f | ||
|
|
63f91b6352 | ||
|
|
4fd8ac9118 | ||
|
|
1bd924ea99 | ||
|
|
1040ecac04 | ||
|
|
729b49ffa9 | ||
|
|
dbf5b375f5 | ||
|
|
7e8723ce57 | ||
|
|
c5e83943a4 | ||
|
|
d3424ec71b | ||
|
|
9bfcb04aa2 | ||
|
|
ec24fe22f9 | ||
|
|
f68600150a | ||
|
|
d3c2ad134f | ||
|
|
25f3b074ee | ||
|
|
ba9c3f3e27 | ||
|
|
3daadec358 | ||
|
|
21225c979e | ||
|
|
3091ed6358 | ||
|
|
451602d1e6 | ||
|
|
745121c4b4 | ||
|
|
0bd3a8728a | ||
|
|
8ee05e0d49 | ||
|
|
5c4f394501 | ||
|
|
85c460190c | ||
|
|
7c10becc74 | ||
|
|
5723da21aa | ||
|
|
a9085399c0 | ||
|
|
aa36ce3c47 | ||
|
|
12ad241406 | ||
|
|
22fd8e9b95 | ||
|
|
c12f1bf2b3 | ||
|
|
1c6e23a4b6 | ||
|
|
c7fa5cdbb3 | ||
|
|
bece83eb8b | ||
|
|
00dd32bbe1 | ||
|
|
d941ed58fa | ||
|
|
324bfd90d1 | ||
|
|
b02e8cc875 | ||
|
|
7b207cc83b | ||
|
|
4b8f8a1785 | ||
|
|
bbf0adf31a | ||
|
|
8b79e54245 | ||
|
|
2c9b47bc0b | ||
|
|
217a9fe864 | ||
|
|
4a2cfcd8b5 | ||
|
|
a682cc430b | ||
|
|
dabe96bd5e | ||
|
|
04e7a202d0 | ||
|
|
5159d9f0e7 | ||
|
|
3778338e34 | ||
|
|
9a878af414 | ||
|
|
4eece0d607 | ||
|
|
cdd90b8aa0 | ||
|
|
6aaaf31d8b | ||
|
|
df08046cdf | ||
|
|
340399597b | ||
|
|
671e5621ad | ||
|
|
4da8734ff3 | ||
|
|
9807afcec7 | ||
|
|
c2f2f96bc7 | ||
|
|
bc2a532a03 | ||
|
|
905b7954ca | ||
|
|
e248db4508 | ||
|
|
2893152377 | ||
|
|
751fb35f90 | ||
|
|
58a90d3fc5 | ||
|
|
ff1159943c | ||
|
|
663789c891 | ||
|
|
91015484bd | ||
|
|
ec45aacc63 | ||
|
|
1c06e562c3 | ||
|
|
4717a5724d | ||
|
|
8f86944014 | ||
|
|
0e29a2fce1 | ||
|
|
249a9264e6 | ||
|
|
4763908b5d | ||
|
|
8bf2a43e06 | ||
|
|
bcb626600b | ||
|
|
be543dadb6 | ||
|
|
eb2f85f6f8 | ||
|
|
a10807a6c4 | ||
|
|
3df52f4013 | ||
|
|
0b0fb1c579 | ||
|
|
5971af91a8 | ||
|
|
ac3b4e7de0 | ||
|
|
52792af186 | ||
|
|
66ad67eced |
No files matched your search
@@ -33,6 +33,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
# The below comment is used to insert a new version with on-release.yml
|
# The below comment is used to insert a new version with on-release.yml
|
||||||
#NEXT_VERSION#
|
#NEXT_VERSION#
|
||||||
|
- 1.56.1
|
||||||
- 1.56.0
|
- 1.56.0
|
||||||
- 1.55.0
|
- 1.55.0
|
||||||
- 1.54.0
|
- 1.54.0
|
||||||
|
|||||||
+1
-5
@@ -57,7 +57,6 @@ apps/tasks/tasks.cjs
|
|||||||
apps/tasks/tasks.css
|
apps/tasks/tasks.css
|
||||||
apps/websocket/wssServer.cjs
|
apps/websocket/wssServer.cjs
|
||||||
apps/websocket/wssServer.css
|
apps/websocket/wssServer.css
|
||||||
apps/nextjs/customServer.cjs
|
|
||||||
apps/nextjs/.million/
|
apps/nextjs/.million/
|
||||||
packages/cli/cli.cjs
|
packages/cli/cli.cjs
|
||||||
|
|
||||||
@@ -68,7 +67,4 @@ e2e/shared/tmp
|
|||||||
apps/nextjs/public/images/background.png
|
apps/nextjs/public/images/background.png
|
||||||
|
|
||||||
# next-intl
|
# next-intl
|
||||||
en.d.json.ts
|
en.d.json.ts
|
||||||
|
|
||||||
# Custom server build artifacts
|
|
||||||
apps/nextjs/customServer.css
|
|
||||||
-369
@@ -1,369 +0,0 @@
|
|||||||
# Memory Optimization Approaches
|
|
||||||
|
|
||||||
This document describes the approaches tried and considered for reducing the RAM footprint of Homarr's server processes.
|
|
||||||
|
|
||||||
## Baseline Architecture (Before)
|
|
||||||
|
|
||||||
Homarr runs **three separate Node.js processes**:
|
|
||||||
|
|
||||||
| Process | Port | Purpose |
|
|
||||||
|---|---|---|
|
|
||||||
| `apps/nextjs` (Next.js) | 3000 | Web UI + API routes |
|
|
||||||
| `apps/websocket` (WS server) | 3001 | tRPC WebSocket subscriptions |
|
|
||||||
| `apps/tasks` (Tasks/Cron server) | 3002 | Cron job scheduling + management API |
|
|
||||||
|
|
||||||
Each process loads its own V8 heap, duplicates shared dependencies (`@homarr/db`, `@homarr/auth`, etc.), and runs its own event loop.
|
|
||||||
|
|
||||||
**Measured baseline (dev mode, idle):** ~2,954 MB total RSS
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 1: Integrate WebSocket Server into Next.js Custom Server
|
|
||||||
|
|
||||||
**Status:** ✅ Implemented
|
|
||||||
|
|
||||||
Eliminates `apps/websocket` by handling WebSocket upgrades inside a [Next.js custom server](https://nextjs.org/docs/pages/guides/custom-server):
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const app = next({ dev, hostname, port, dir });
|
|
||||||
const upgradeHandler = app.getUpgradeHandler();
|
|
||||||
|
|
||||||
server.on("upgrade", (req, socket, head) => {
|
|
||||||
if (req.url?.startsWith("/websockets")) {
|
|
||||||
wss.handleUpgrade(req, socket, head, (ws) => wss.emit("connection", ws, req));
|
|
||||||
} else {
|
|
||||||
upgradeHandler(req, socket, head); // HMR, etc.
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- Eliminates one V8 heap (~208 MB)
|
|
||||||
- WebSocket runs on same port as HTTP (simpler networking/proxying)
|
|
||||||
- Shared `@homarr/db` connection pool and module cache
|
|
||||||
- `getUpgradeHandler()` properly delegates HMR to Next.js in dev mode
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- Custom server disables some Next.js optimizations (automatic static optimization still works with `output: "standalone"`)
|
|
||||||
- WebSocket errors could affect the main server process
|
|
||||||
- Slightly more complex startup code
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 2: Integrate Tasks/Cron Server into Next.js Custom Server
|
|
||||||
|
|
||||||
**Status:** ✅ Implemented (combined with Approach 1)
|
|
||||||
|
|
||||||
Eliminates `apps/tasks` by running the Fastify tRPC cron API and job scheduler inside the same process:
|
|
||||||
|
|
||||||
```ts
|
|
||||||
async function startTasksServer() {
|
|
||||||
const tasksServer = fastify({ maxParamLength: 5000 });
|
|
||||||
tasksServer.register(fastifyTRPCPlugin, { ... });
|
|
||||||
await cleanupSessionsAsync();
|
|
||||||
await invalidateUpdateCheckerCacheAsync();
|
|
||||||
await jobGroup.initializeAsync();
|
|
||||||
await jobGroup.startAllAsync();
|
|
||||||
await tasksServer.listen({ port: CRON_JOB_API_PORT });
|
|
||||||
return tasksServer;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- Eliminates another V8 heap (~328 MB)
|
|
||||||
- Shared database connection pool across Next.js API routes and cron jobs
|
|
||||||
- Single process to manage (simpler Docker, `run.sh`, monitoring)
|
|
||||||
- Cron jobs can directly share in-memory state with the web server
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- A misbehaving cron job could affect web request latency
|
|
||||||
- Fastify still binds to port 3002 for internal tRPC communication (minor overhead)
|
|
||||||
- More dependencies in the custom server bundle
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Combined Result (Approaches 1 + 2)
|
|
||||||
|
|
||||||
| Component | Separate (before) | Integrated (after) |
|
|
||||||
|---|---|---|
|
|
||||||
| WebSocket server | ~208 MB | — |
|
|
||||||
| Tasks/Cron server | ~328 MB | — |
|
|
||||||
| Next.js (incl. workers) | ~2,418 MB | — |
|
|
||||||
| Custom Server (all-in-one) | — | ~2,007 MB |
|
|
||||||
| **Total RSS** | **~2,954 MB** | **~2,007 MB** |
|
|
||||||
| **Savings** | — | **~947 MB (~32%)** |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 3: Eliminate Fastify — Direct Function Calls for Cron API
|
|
||||||
|
|
||||||
**Status:** 📋 Considered, not implemented
|
|
||||||
|
|
||||||
Since the cron job API client (`cronJobApi`) is only used from Next.js API routes (same process now), we could replace the HTTP+tRPC client with direct function calls to `JobManager`:
|
|
||||||
|
|
||||||
```ts
|
|
||||||
// Before: HTTP call to localhost:3002/trpc
|
|
||||||
await cronJobApi.trigger.mutate({ name: "myJob" });
|
|
||||||
|
|
||||||
// After: direct call in same process
|
|
||||||
await jobManager.triggerAsync("myJob");
|
|
||||||
```
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- Eliminates Fastify dependency and port 3002 listener entirely
|
|
||||||
- Zero network overhead for cron API calls
|
|
||||||
- Simpler architecture (no internal HTTP, no API key needed)
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- Requires refactoring `packages/api/src/router/cron-jobs.ts` and `packages/cron-job-api`
|
|
||||||
- Breaks the clean separation between Next.js API and tasks concerns
|
|
||||||
- If the architecture ever splits back to separate processes, this would need to be reverted
|
|
||||||
- API key authentication for cron operations would need a different mechanism
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 4: Node.js `--max-old-space-size` Flag
|
|
||||||
|
|
||||||
**Status:** 📋 Considered, available as user override
|
|
||||||
|
|
||||||
Setting `NODE_OPTIONS=--max-old-space-size=N` limits V8 heap growth and forces more aggressive garbage collection.
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
# Example: limit heap to 512 MB
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=512"
|
|
||||||
```
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- Can reduce peak memory usage in constrained environments
|
|
||||||
- Easy to configure via environment variable
|
|
||||||
- No code changes required
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- Too low a value causes OOM crashes under load
|
|
||||||
- Doesn't reduce actual memory *needed*, just forces earlier GC
|
|
||||||
- Default Node.js behavior (~1.7 GB limit on 64-bit) is reasonable for most deployments
|
|
||||||
- Different deployments have different memory constraints — no single good default
|
|
||||||
|
|
||||||
**Recommendation:** Don't set a default in the Dockerfile. Document as a tuning option for users running on low-memory hosts (e.g., `docker run -e NODE_OPTIONS="--max-old-space-size=512"`).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 5: Next.js `output: "standalone"` (Already in Use)
|
|
||||||
|
|
||||||
**Status:** ✅ Already configured
|
|
||||||
|
|
||||||
The `next.config.ts` already uses `output: "standalone"`, which:
|
|
||||||
- Traces only the files needed for production
|
|
||||||
- Creates a minimal `.next/standalone` directory
|
|
||||||
- Avoids shipping full `node_modules`
|
|
||||||
|
|
||||||
This is already optimized and no further action needed.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 6: Shared Redis Connection Pooling
|
|
||||||
|
|
||||||
**Status:** 📋 Considered, not implemented
|
|
||||||
|
|
||||||
With all services in one process, Redis connection pools could be shared. Currently, each module may create its own Redis client instance.
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- Fewer open connections to Redis
|
|
||||||
- Slightly less memory for connection buffers
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- Marginal memory savings (Redis connections are lightweight)
|
|
||||||
- Requires auditing all Redis usage across packages
|
|
||||||
- Risk of connection contention under high load
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Summary of Recommendations
|
|
||||||
|
|
||||||
| Approach | Impact | Effort | Status |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1. Integrate WS server | ~208 MB saved | Low | ✅ Done |
|
|
||||||
| 2. Integrate Tasks server | ~328 MB saved | Medium | ✅ Done |
|
|
||||||
| 3. Eliminate Fastify | ~10-30 MB saved | High | 📋 Future |
|
|
||||||
| 4. `--max-old-space-size` | Configurable | None | 📋 User option |
|
|
||||||
| 5. Standalone output | Already optimal | None | ✅ Already done |
|
|
||||||
| 6. Shared Redis pools | ~5-10 MB saved | Medium | 📋 Future |
|
|
||||||
| 7. Redis-backed initial query data | Faster page loads | Medium | 📋 POC documented |
|
|
||||||
| 8. Client-side rendering with ISR shell | Faster TTFB | High | 📋 POC documented |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 7: Redis-Backed TanStack Query Initial Data
|
|
||||||
|
|
||||||
**Status:** 📋 POC documented
|
|
||||||
|
|
||||||
### Problem
|
|
||||||
|
|
||||||
Currently, the dashboard page (`/`) is fully server-rendered on every request:
|
|
||||||
|
|
||||||
1. Server calls `api.board.getHomeBoard()` (database query)
|
|
||||||
2. Server prefetches all widget data via `prefetchForKindAsync()` (multiple database/integration queries)
|
|
||||||
3. Server renders the full React tree with hydration boundary
|
|
||||||
4. Client hydrates and takes over
|
|
||||||
|
|
||||||
Each page load triggers a cascade: **Client → Next.js Server → tRPC → Database → Back**. For data that doesn't change often (board layout, widget configurations), this is wasteful.
|
|
||||||
|
|
||||||
### Approach
|
|
||||||
|
|
||||||
Use Redis as a shared cache layer between cron jobs and page loads. Cron jobs already populate Redis with integration data. The idea is to:
|
|
||||||
|
|
||||||
1. **Cron jobs write to Redis** (already happening via `createItemAndIntegrationChannel`)
|
|
||||||
2. **Server reads from Redis first** instead of hitting the database for widget data
|
|
||||||
3. **Pass Redis data as `initialData`** to TanStack Query on the client
|
|
||||||
4. **Client-side queries take over** with stale-while-revalidate behavior
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
// POC: In _creator.tsx, read from Redis cache first for widget prefetching
|
|
||||||
import { createItemAndIntegrationChannel } from "@homarr/redis";
|
|
||||||
|
|
||||||
// Instead of always calling the database:
|
|
||||||
const cachedData = await redisChannel.getAsync();
|
|
||||||
if (cachedData) {
|
|
||||||
// Use cached data as initial query data - skip the database call
|
|
||||||
queryClient.setQueryData(queryKey, cachedData.data);
|
|
||||||
} else {
|
|
||||||
// Fall back to normal prefetch
|
|
||||||
await prefetchForKindAsync(kind, queryClient, items);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
On the client side, TanStack Query's `initialData` option lets us hydrate from cache:
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
// Client component using cached initial data
|
|
||||||
const { data } = useQuery({
|
|
||||||
queryKey: ["widget", widgetId],
|
|
||||||
queryFn: () => fetchWidgetData(widgetId),
|
|
||||||
initialData: cachedWidgetData, // From Redis via server props
|
|
||||||
staleTime: 30_000, // Consider fresh for 30s
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### How TanStack Query Initial Data Works
|
|
||||||
|
|
||||||
From the [TanStack Query docs](https://tanstack.com/query/v5/docs/framework/react/guides/initial-query-data):
|
|
||||||
|
|
||||||
- `initialData` pre-populates the query cache before the component mounts
|
|
||||||
- The query still revalidates in the background (stale-while-revalidate)
|
|
||||||
- Combined with `staleTime`, the query won't refetch until the data is considered stale
|
|
||||||
- This means the page renders instantly with cached data, then silently updates
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- **Faster page loads**: Redis reads are ~1ms vs ~50-200ms for database queries with joins
|
|
||||||
- **Reduced database load**: Most page views hit Redis instead of SQLite/MySQL/PostgreSQL
|
|
||||||
- **Leverages existing infrastructure**: Cron jobs already write widget data to Redis channels
|
|
||||||
- **Graceful degradation**: Falls back to normal database queries on cache miss
|
|
||||||
- **Non-breaking**: Can be adopted incrementally per widget type
|
|
||||||
- **Shared across users**: Non-personal data (board layout, widget data) is the same for all users viewing the same board
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- **Cache staleness**: Data may be up to one cron interval old (typically 1-5 minutes)
|
|
||||||
- **Cache invalidation complexity**: Need to invalidate Redis when boards are edited
|
|
||||||
- **Memory usage**: More data stored in Redis (marginal since it's already stored for pub/sub)
|
|
||||||
- **Serialization overhead**: superjson parse/stringify on every cache read
|
|
||||||
- **Testing complexity**: Need to test cache hit/miss/stale scenarios
|
|
||||||
|
|
||||||
### Estimated Impact
|
|
||||||
|
|
||||||
| Metric | Before | After (cache hit) | Improvement |
|
|
||||||
|---|---|---|---|
|
|
||||||
| Dashboard TTFB | ~200-500ms | ~50-100ms | 2-5x faster |
|
|
||||||
| Database queries per page load | 5-20 (depending on widgets) | 0-2 (board + auth only) | ~90% reduction |
|
|
||||||
| Redis reads per page load | 0 | 5-20 | Acceptable (~1ms each) |
|
|
||||||
|
|
||||||
### Implementation Path
|
|
||||||
|
|
||||||
1. Create a `createBoardCacheChannel(boardId)` in `@homarr/redis`
|
|
||||||
2. Populate it when boards are saved and when cron jobs update widget data
|
|
||||||
3. In `_creator.tsx`, check cache before `prefetchForKindAsync()`
|
|
||||||
4. Set `staleTime` to match cron interval for each widget type
|
|
||||||
5. Add cache invalidation when boards are edited (`board.saveBoard` mutation)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Approach 8: Client-Side Rendering with ISR Static Shell
|
|
||||||
|
|
||||||
**Status:** 📋 POC documented (not recommended for Homarr's use case)
|
|
||||||
|
|
||||||
### Concept
|
|
||||||
|
|
||||||
Instead of server-rendering the entire dashboard on each request, serve a **static HTML shell** via Next.js ISR (Incremental Static Regeneration) and let the client fetch all dynamic content via TanStack Query.
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
// Hypothetical ISR dashboard page
|
|
||||||
export const revalidate = 60; // Regenerate every 60 seconds
|
|
||||||
|
|
||||||
export default function DashboardPage() {
|
|
||||||
// Return a static shell - no server-side data fetching
|
|
||||||
return (
|
|
||||||
<DashboardShell>
|
|
||||||
<Suspense fallback={<BoardSkeleton />}>
|
|
||||||
<ClientBoard /> {/* Fetches via useQuery on mount */}
|
|
||||||
</Suspense>
|
|
||||||
</DashboardShell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The client component would then fetch everything:
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
"use client";
|
|
||||||
|
|
||||||
function ClientBoard() {
|
|
||||||
const { data: board, isLoading } = clientApi.board.getHomeBoard.useQuery(undefined, {
|
|
||||||
initialData: undefined, // Could be populated from Redis via API route
|
|
||||||
});
|
|
||||||
|
|
||||||
if (isLoading) return <BoardSkeleton />;
|
|
||||||
return <BoardContent board={board} />;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### How Next.js ISR Works
|
|
||||||
|
|
||||||
- On first request, Next.js generates the page and caches it
|
|
||||||
- Subsequent requests serve the cached HTML instantly (TTFB ~0ms for CDN)
|
|
||||||
- After `revalidate` seconds, the next request triggers background regeneration
|
|
||||||
- The stale page is served until the new one is ready (stale-while-revalidate)
|
|
||||||
|
|
||||||
### PROs
|
|
||||||
- **Near-instant TTFB**: Static HTML served from disk/CDN cache
|
|
||||||
- **Reduced server CPU**: No React SSR on every request
|
|
||||||
- **Scalable**: Static pages can be served by any CDN or reverse proxy
|
|
||||||
- **Good for public boards**: Shared boards viewed by many users benefit most
|
|
||||||
|
|
||||||
### CONs
|
|
||||||
- **Layout shift (CLS)**: Dashboard appears empty then fills in — bad UX for dashboards
|
|
||||||
- **No SSR for SEO**: Not relevant for Homarr (it's a private dashboard app)
|
|
||||||
- **Slower perceived load**: Users see a skeleton for 200-500ms while queries run
|
|
||||||
- **Authentication complexity**: ISR pages must be the same for all users. Homarr's dashboard is user-specific (permissions, board access), making ISR caching ineffective for the page itself
|
|
||||||
- **Breaks existing hydration pattern**: The current `HydrationBoundary` + `dehydrate()` pattern works well and ensures no layout shift
|
|
||||||
- **WebSocket subscriptions delayed**: Real-time updates don't start until client JS loads and connects
|
|
||||||
|
|
||||||
### Benchmark Comparison (Theoretical)
|
|
||||||
|
|
||||||
| Metric | Current (SSR) | Approach 7 (Redis initial data) | Approach 8 (ISR + CSR) |
|
|
||||||
|---|---|---|---|
|
|
||||||
| TTFB | 200-500ms | 50-100ms | ~10ms (static) |
|
|
||||||
| Time to Interactive | 200-500ms | 50-100ms | 200-500ms (same) |
|
|
||||||
| Largest Contentful Paint | 200-500ms | 50-100ms | 400-800ms (worse) |
|
|
||||||
| Cumulative Layout Shift | ~0 | ~0 | 0.1-0.3 (worse) |
|
|
||||||
| Server CPU per request | High | Low | Near zero |
|
|
||||||
|
|
||||||
### Recommendation
|
|
||||||
|
|
||||||
**Approach 7 (Redis-backed initial data) is recommended over Approach 8 (ISR)** for Homarr because:
|
|
||||||
|
|
||||||
1. **Dashboards are personalized**: Board access depends on user permissions, making ISR page-level caching ineffective
|
|
||||||
2. **No layout shift**: Users expect the dashboard to appear fully rendered
|
|
||||||
3. **Existing infrastructure**: Redis + cron jobs already provide the cache layer needed
|
|
||||||
4. **Incremental adoption**: Can be applied per-widget without changing the overall rendering strategy
|
|
||||||
5. **ISR is designed for content sites**: Blog posts, documentation pages, product pages — not interactive dashboards with real-time WebSocket subscriptions
|
|
||||||
|
|
||||||
ISR could still be useful for specific Homarr pages like `/manage/about` or documentation pages that don't depend on user state, but the main dashboard is not a good candidate.
|
|
||||||
@@ -1,3 +1,68 @@
|
|||||||
|
## [1.57.0](https://github.com/homarr-labs/homarr/compare/v1.56.1...v1.57.0) (2026-03-27)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add "allowModals" option for iframe widget ([#5339](https://github.com/homarr-labs/homarr/issues/5339)) ([2fefd9d](https://github.com/homarr-labs/homarr/commit/2fefd9da01c827160fa5fd9b63a38615ea9969e2))
|
||||||
|
* add GPU monitoring support via Glances integration ([#5255](https://github.com/homarr-labs/homarr/issues/5255)) ([003dac4](https://github.com/homarr-labs/homarr/commit/003dac4744f2e23535f1cbb7494187201af4b164)), closes [#5102](https://github.com/homarr-labs/homarr/issues/5102)
|
||||||
|
* add nextcloud notification provider ([#5343](https://github.com/homarr-labs/homarr/issues/5343)) ([f88bf95](https://github.com/homarr-labs/homarr/commit/f88bf9582e1cf45a6b7fd898e12d227869a3849f))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **deps:** update dependency @immich/sdk to ^2.6.0 ([#5318](https://github.com/homarr-labs/homarr/issues/5318)) ([20a9b3d](https://github.com/homarr-labs/homarr/commit/20a9b3d556a15e6fdf7d1dbd78b677b5ce219c75))
|
||||||
|
* **deps:** update dependency @immich/sdk to ^2.6.1 ([#5319](https://github.com/homarr-labs/homarr/issues/5319)) ([feaf022](https://github.com/homarr-labs/homarr/commit/feaf022965cf4a27112c7e3bcb9ef3ad0dd5c281))
|
||||||
|
* **deps:** update dependency @next/eslint-plugin-next to v16.1.7 ([#5289](https://github.com/homarr-labs/homarr/issues/5289)) ([237d11d](https://github.com/homarr-labs/homarr/commit/237d11d2c021e28d58b0d627d2802d509d4c1b2b))
|
||||||
|
* **deps:** update dependency @tanstack/react-query to ^5.91.0 ([#5305](https://github.com/homarr-labs/homarr/issues/5305)) ([13b99d0](https://github.com/homarr-labs/homarr/commit/13b99d021b46fe0541ce9b42ba66756fafd26c30))
|
||||||
|
* **deps:** update dependency @tanstack/react-query to ^5.91.2 ([#5314](https://github.com/homarr-labs/homarr/issues/5314)) ([6fa6ba3](https://github.com/homarr-labs/homarr/commit/6fa6ba385e6691fefbb9f045a0ff976bcd85de16))
|
||||||
|
* **deps:** update dependency drizzle-kit to ^0.31.10 ([#5291](https://github.com/homarr-labs/homarr/issues/5291)) ([09227a3](https://github.com/homarr-labs/homarr/commit/09227a3884d291032f1012b59ce06babc3c87103))
|
||||||
|
* **deps:** update dependency fast-xml-parser to ^5.5.6 ([#5297](https://github.com/homarr-labs/homarr/issues/5297)) ([991044e](https://github.com/homarr-labs/homarr/commit/991044ebd78288bea7b441d3c14b159b5e66915b))
|
||||||
|
* **deps:** update dependency fast-xml-parser to ^5.5.7 ([#5315](https://github.com/homarr-labs/homarr/issues/5315)) ([2336f9e](https://github.com/homarr-labs/homarr/commit/2336f9ee5e35f7b610743dee55b91caf8434c1e4))
|
||||||
|
* **deps:** update dependency ioredis to v5.10.1 ([#5316](https://github.com/homarr-labs/homarr/issues/5316)) ([47b2d36](https://github.com/homarr-labs/homarr/commit/47b2d36f7a0933b6a6bbb61a449888be9304e1c5))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.4.0 ([#5292](https://github.com/homarr-labs/homarr/issues/5292)) ([6276449](https://github.com/homarr-labs/homarr/commit/62764499e7bbc9995ecf3de7351c9224d6aee4b6))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.5.0 ([#5299](https://github.com/homarr-labs/homarr/issues/5299)) ([b6b11c3](https://github.com/homarr-labs/homarr/commit/b6b11c39d2b4a33c5732ae239d7c1aaba6003cc6))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.5.1 ([#5300](https://github.com/homarr-labs/homarr/issues/5300)) ([94dfddf](https://github.com/homarr-labs/homarr/commit/94dfddf8bde2966b46bcd2d30e5e4f886ebe4605))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.6.0 ([#5334](https://github.com/homarr-labs/homarr/issues/5334)) ([8d64cb8](https://github.com/homarr-labs/homarr/commit/8d64cb8a5e276677b033774152c921aedc1e6c8a))
|
||||||
|
* **deps:** update dependency mysql2 to v3.20.0 ([#5283](https://github.com/homarr-labs/homarr/issues/5283)) ([4fb48c2](https://github.com/homarr-labs/homarr/commit/4fb48c23a2ccb1c047bab0d354933561e81cc3ed))
|
||||||
|
* **deps:** update dependency swagger-ui-react to ^5.32.1 ([#5296](https://github.com/homarr-labs/homarr/issues/5296)) ([63c55ce](https://github.com/homarr-labs/homarr/commit/63c55cec5711c41544c65ab83f24d09e63b10354))
|
||||||
|
* **deps:** update dependency trpc-to-openapi to ^3.2.0 ([#5320](https://github.com/homarr-labs/homarr/issues/5320)) ([22f5d3b](https://github.com/homarr-labs/homarr/commit/22f5d3b95959cf0a835c9750b41106eaafc4432e))
|
||||||
|
* **deps:** update dependency typescript-eslint to ^8.57.1 ([#5286](https://github.com/homarr-labs/homarr/issues/5286)) ([d4e4c96](https://github.com/homarr-labs/homarr/commit/d4e4c9669d648632a055b5ec0515821b50821142))
|
||||||
|
* **deps:** update dependency undici to v7.24.5 ([#5338](https://github.com/homarr-labs/homarr/issues/5338)) ([22bbef9](https://github.com/homarr-labs/homarr/commit/22bbef9d8e03215abddf6c6e26a5df45f252626d))
|
||||||
|
* **deps:** update dependency ws to ^8.20.0 ([#5337](https://github.com/homarr-labs/homarr/issues/5337)) ([d53c922](https://github.com/homarr-labs/homarr/commit/d53c922688606bd7d9494089e1ec43b930ad9923))
|
||||||
|
* **deps:** update mantine monorepo to ^8.3.18 ([#5298](https://github.com/homarr-labs/homarr/issues/5298)) ([6f8e629](https://github.com/homarr-labs/homarr/commit/6f8e62963a4eb47cb3095dff46ee0e759e1cbd3c))
|
||||||
|
* **deps:** update nextjs monorepo to v16.2.0 ([#5309](https://github.com/homarr-labs/homarr/issues/5309)) ([8831613](https://github.com/homarr-labs/homarr/commit/883161357dab4d94ff794f9444040d88074c464c))
|
||||||
|
* **deps:** update nextjs monorepo to v16.2.1 ([#5330](https://github.com/homarr-labs/homarr/issues/5330)) ([e23a397](https://github.com/homarr-labs/homarr/commit/e23a397a80e4409f5da50c737aeb26b295ce79fc))
|
||||||
|
* **deps:** update testcontainers-node monorepo to ^11.13.0 ([#5293](https://github.com/homarr-labs/homarr/issues/5293)) ([c009dd7](https://github.com/homarr-labs/homarr/commit/c009dd7de649bf24ab9bcf5ea25c65ebd18540bb))
|
||||||
|
* **deps:** update tiptap monorepo to v3.20.4 ([#5287](https://github.com/homarr-labs/homarr/issues/5287)) ([369b4d4](https://github.com/homarr-labs/homarr/commit/369b4d486327d0eaa04b70dd692c426f9a39afd7))
|
||||||
|
* **deps:** update trpc monorepo to ^11.14.1 ([#5328](https://github.com/homarr-labs/homarr/issues/5328)) ([d7f0596](https://github.com/homarr-labs/homarr/commit/d7f0596db8e44e2e79bb26095abd142b50675cc3))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.18 ([#5308](https://github.com/homarr-labs/homarr/issues/5308)) ([24694b9](https://github.com/homarr-labs/homarr/commit/24694b92411aae818b97a3a5c9add97d707a2f38))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.19 ([#5310](https://github.com/homarr-labs/homarr/issues/5310)) ([7537184](https://github.com/homarr-labs/homarr/commit/7537184a8168a4837d0a83a925a70c938555f199))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.20 ([#5317](https://github.com/homarr-labs/homarr/issues/5317)) ([5b4e6fc](https://github.com/homarr-labs/homarr/commit/5b4e6fcc11c877815c4730607de84ab70d630fb8))
|
||||||
|
* handle null ports in Docker container table ([#5313](https://github.com/homarr-labs/homarr/issues/5313)) ([1639da5](https://github.com/homarr-labs/homarr/commit/1639da57794d2555426e56030b4b34e2cc201aa9)), closes [#5311](https://github.com/homarr-labs/homarr/issues/5311)
|
||||||
|
* warnings in code ([4f2b821](https://github.com/homarr-labs/homarr/commit/4f2b8217f819b91ec4b05e32aebd6bc5473db155))
|
||||||
|
|
||||||
|
## [1.56.1](https://github.com/homarr-labs/homarr/compare/v1.56.0...v1.56.1) (2026-03-20)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **deps:** update dependency dayjs to ^1.11.20 ([#5253](https://github.com/homarr-labs/homarr/issues/5253)) ([615062c](https://github.com/homarr-labs/homarr/commit/615062c6b141fa1e4bc91d2fab505fa1652608d2))
|
||||||
|
* **deps:** update dependency fast-xml-parser to ^5.5.1 ([#5246](https://github.com/homarr-labs/homarr/issues/5246)) ([91a9b6b](https://github.com/homarr-labs/homarr/commit/91a9b6bec9438e9a812960b829cea343e8478c63))
|
||||||
|
* **deps:** update dependency fast-xml-parser to ^5.5.3 ([#5251](https://github.com/homarr-labs/homarr/issues/5251)) ([d1d8659](https://github.com/homarr-labs/homarr/commit/d1d8659f951cdd22bf4a22b407a4f3027f036ec2))
|
||||||
|
* **deps:** update dependency fast-xml-parser to ^5.5.5 ([#5270](https://github.com/homarr-labs/homarr/issues/5270)) ([2423ecd](https://github.com/homarr-labs/homarr/commit/2423ecdce57353dd50d678444da800c02a246223))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.1.0 ([#5239](https://github.com/homarr-labs/homarr/issues/5239)) ([63f91b6](https://github.com/homarr-labs/homarr/commit/63f91b6352e9ba58a0823434d86915371f1c1d30))
|
||||||
|
* **deps:** update dependency isomorphic-dompurify to ^3.3.0 ([#5252](https://github.com/homarr-labs/homarr/issues/5252)) ([e8f6876](https://github.com/homarr-labs/homarr/commit/e8f6876d2477fb0e1936006b81f7324b90b6eb33))
|
||||||
|
* **deps:** update dependency jotai to ^2.18.1 ([#5238](https://github.com/homarr-labs/homarr/issues/5238)) ([729b49f](https://github.com/homarr-labs/homarr/commit/729b49ffa9b1f91ebd7bcd2300febba4d9d0fbb9))
|
||||||
|
* **deps:** update dependency mysql2 to v3.19.1 ([#5240](https://github.com/homarr-labs/homarr/issues/5240)) ([1040eca](https://github.com/homarr-labs/homarr/commit/1040ecac04fd0b10e101495d5230a3fa4898097a))
|
||||||
|
* **deps:** update dependency next to v16.1.7 [security] ([#5263](https://github.com/homarr-labs/homarr/issues/5263)) ([3bbde3c](https://github.com/homarr-labs/homarr/commit/3bbde3cbb8eb3aa528485f17d40817cb982a8687))
|
||||||
|
* **deps:** update dependency sass to ^1.98.0 ([#5247](https://github.com/homarr-labs/homarr/issues/5247)) ([f995cba](https://github.com/homarr-labs/homarr/commit/f995cba157c9954b6f266bd5b2bb8d60a08f51f1))
|
||||||
|
* **deps:** update dependency typescript-eslint to ^8.57.0 ([#5241](https://github.com/homarr-labs/homarr/issues/5241)) ([7841b58](https://github.com/homarr-labs/homarr/commit/7841b58f0fdd4a4494b6f3d61881a1efb4c9eba3))
|
||||||
|
* **deps:** update mantine monorepo to ^8.3.17 ([#5271](https://github.com/homarr-labs/homarr/issues/5271)) ([6fa9087](https://github.com/homarr-labs/homarr/commit/6fa9087a119334dee63e4ca4ed51276b25c4564a))
|
||||||
|
* **deps:** update tiptap monorepo to v3.20.2 ([#5279](https://github.com/homarr-labs/homarr/issues/5279)) ([55cf3c7](https://github.com/homarr-labs/homarr/commit/55cf3c72a3d9cd9f702e802716d549d7d2644105))
|
||||||
|
* **deps:** update trpc monorepo to ^11.13.2 ([#5273](https://github.com/homarr-labs/homarr/issues/5273)) ([7d93b10](https://github.com/homarr-labs/homarr/commit/7d93b1003245ab89fdba7175b0b4f745041cd1fe))
|
||||||
|
* **deps:** update trpc monorepo to ^11.13.3 ([#5276](https://github.com/homarr-labs/homarr/issues/5276)) ([0e0b857](https://github.com/homarr-labs/homarr/commit/0e0b857905a7b5196dbf529520f86467aa94d8ce))
|
||||||
|
* **deps:** update trpc monorepo to ^11.13.4 ([#5278](https://github.com/homarr-labs/homarr/issues/5278)) ([9648d9e](https://github.com/homarr-labs/homarr/commit/9648d9e99f02be8ba16a5238bd47866f7303724d))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.15 ([#5243](https://github.com/homarr-labs/homarr/issues/5243)) ([1bd924e](https://github.com/homarr-labs/homarr/commit/1bd924ea9917949ac64ab754d97964b12c083b82))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.16 ([#5250](https://github.com/homarr-labs/homarr/issues/5250)) ([ac80008](https://github.com/homarr-labs/homarr/commit/ac80008ce0796cb6927642c83ff2e667f6e9d24c))
|
||||||
|
* **deps:** update turbo monorepo to ^2.8.17 ([#5265](https://github.com/homarr-labs/homarr/issues/5265)) ([d2f438f](https://github.com/homarr-labs/homarr/commit/d2f438f294df3093b249213ac0a018b770705e3b))
|
||||||
|
|
||||||
## [1.56.0](https://github.com/homarr-labs/homarr/compare/v1.55.0...v1.56.0) (2026-03-13)
|
## [1.56.0](https://github.com/homarr-labs/homarr/compare/v1.55.0...v1.56.0) (2026-03-13)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
+2
-1
@@ -43,7 +43,8 @@ RUN mkdir -p /var/cache/nginx && \
|
|||||||
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
||||||
COPY --from=builder /app/apps/nextjs/package.json .
|
COPY --from=builder /app/apps/nextjs/package.json .
|
||||||
|
|
||||||
COPY --from=builder /app/apps/nextjs/customServer.cjs ./apps/nextjs/customServer.cjs
|
COPY --from=builder /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs
|
||||||
|
COPY --from=builder /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs
|
||||||
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
||||||
|
|
||||||
COPY --from=builder /app/packages/db/migrations ./db/migrations
|
COPY --from=builder /app/packages/db/migrations ./db/migrations
|
||||||
|
|||||||
+19
-30
@@ -4,13 +4,12 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm with-env next build && pnpm build:custom-server",
|
"build": "pnpm with-env next build",
|
||||||
"build:custom-server": "esbuild server.ts --bundle --platform=node --outfile=customServer.cjs --external:next --external:fastify --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
|
|
||||||
"clean": "git clean -xdf .next .turbo node_modules",
|
"clean": "git clean -xdf .next .turbo node_modules",
|
||||||
"dev": "pnpm with-env tsx ./server.ts",
|
"dev": "pnpm with-env next dev",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"start": "pnpm with-env node customServer.cjs",
|
"start": "pnpm with-env next start",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e ../../.env --"
|
"with-env": "dotenv -e ../../.env --"
|
||||||
},
|
},
|
||||||
@@ -26,10 +25,7 @@
|
|||||||
"@homarr/boards": "workspace:^0.1.0",
|
"@homarr/boards": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/cron-job-api": "workspace:^0.1.0",
|
|
||||||
"@homarr/cron-job-status": "workspace:^0.1.0",
|
"@homarr/cron-job-status": "workspace:^0.1.0",
|
||||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
|
||||||
"@homarr/cron-jobs-core": "workspace:^0.1.0",
|
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
"@homarr/definitions": "workspace:^0.1.0",
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
"@homarr/docker": "workspace:^0.1.0",
|
"@homarr/docker": "workspace:^0.1.0",
|
||||||
@@ -44,9 +40,7 @@
|
|||||||
"@homarr/notifications": "workspace:^0.1.0",
|
"@homarr/notifications": "workspace:^0.1.0",
|
||||||
"@homarr/old-import": "workspace:^0.1.0",
|
"@homarr/old-import": "workspace:^0.1.0",
|
||||||
"@homarr/old-schema": "workspace:^0.1.0",
|
"@homarr/old-schema": "workspace:^0.1.0",
|
||||||
"@homarr/ping": "workspace:^0.1.0",
|
|
||||||
"@homarr/redis": "workspace:^0.1.0",
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
"@homarr/request-handler": "workspace:^0.1.0",
|
|
||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@homarr/settings": "workspace:^0.1.0",
|
"@homarr/settings": "workspace:^0.1.0",
|
||||||
"@homarr/spotlight": "workspace:^0.1.0",
|
"@homarr/spotlight": "workspace:^0.1.0",
|
||||||
@@ -54,47 +48,45 @@
|
|||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@homarr/widgets": "workspace:^0.1.0",
|
"@homarr/widgets": "workspace:^0.1.0",
|
||||||
"@mantine/colors-generator": "^8.3.16",
|
"@mantine/colors-generator": "^8.3.18",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/dropzone": "^8.3.16",
|
"@mantine/dropzone": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"@mantine/modals": "^8.3.16",
|
"@mantine/modals": "^8.3.18",
|
||||||
"@mantine/tiptap": "^8.3.16",
|
"@mantine/tiptap": "^8.3.18",
|
||||||
"@million/lint": "1.0.14",
|
"@million/lint": "1.0.14",
|
||||||
"@tabler/icons-react": "^3.40.0",
|
"@tabler/icons-react": "^3.40.0",
|
||||||
"@tanstack/react-query": "^5.90.21",
|
"@tanstack/react-query": "^5.91.2",
|
||||||
"@tanstack/react-query-devtools": "^5.91.3",
|
"@tanstack/react-query-devtools": "^5.91.3",
|
||||||
"@tanstack/react-query-next-experimental": "^5.91.0",
|
"@tanstack/react-query-next-experimental": "^5.91.0",
|
||||||
"@trpc/client": "^11.12.0",
|
"@trpc/client": "^11.14.1",
|
||||||
"@trpc/next": "^11.12.0",
|
"@trpc/next": "^11.14.1",
|
||||||
"@trpc/react-query": "^11.12.0",
|
"@trpc/react-query": "^11.14.1",
|
||||||
"@trpc/server": "^11.12.0",
|
"@trpc/server": "^11.14.1",
|
||||||
"@xterm/addon-canvas": "^0.7.0",
|
"@xterm/addon-canvas": "^0.7.0",
|
||||||
"@xterm/addon-fit": "0.11.0",
|
"@xterm/addon-fit": "0.11.0",
|
||||||
"@xterm/xterm": "^6.0.0",
|
"@xterm/xterm": "^6.0.0",
|
||||||
"babel-plugin-react-compiler": "^1.0.0",
|
"babel-plugin-react-compiler": "^1.0.0",
|
||||||
"chroma-js": "^3.2.0",
|
"chroma-js": "^3.2.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"dotenv": "^17.3.1",
|
"dotenv": "^17.3.1",
|
||||||
"fastify": "^5.7.4",
|
|
||||||
"flag-icons": "^7.5.0",
|
"flag-icons": "^7.5.0",
|
||||||
"glob": "^13.0.6",
|
"glob": "^13.0.6",
|
||||||
"isomorphic-dompurify": "^3.1.0",
|
"isomorphic-dompurify": "^3.6.0",
|
||||||
"jotai": "^2.18.1",
|
"jotai": "^2.18.1",
|
||||||
"mantine-react-table": "2.0.0-beta.9",
|
"mantine-react-table": "2.0.0-beta.9",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"postcss-preset-mantine": "^1.18.0",
|
"postcss-preset-mantine": "^1.18.0",
|
||||||
"prismjs": "^1.30.0",
|
"prismjs": "^1.30.0",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"react-error-boundary": "^6.1.1",
|
"react-error-boundary": "^6.1.1",
|
||||||
"react-simple-code-editor": "^0.14.1",
|
"react-simple-code-editor": "^0.14.1",
|
||||||
"sass": "^1.97.3",
|
"sass": "^1.98.0",
|
||||||
"superjson": "2.2.6",
|
"superjson": "2.2.6",
|
||||||
"swagger-ui-react": "^5.32.0",
|
"swagger-ui-react": "^5.32.1",
|
||||||
"use-deep-compare-effect": "^1.8.1",
|
"use-deep-compare-effect": "^1.8.1",
|
||||||
"ws": "^8.19.0",
|
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -107,13 +99,10 @@
|
|||||||
"@types/react": "19.2.14",
|
"@types/react": "19.2.14",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "19.2.3",
|
||||||
"@types/swagger-ui-react": "^5.18.0",
|
"@types/swagger-ui-react": "^5.18.0",
|
||||||
"@types/ws": "^8.18.1",
|
|
||||||
"concurrently": "^9.2.1",
|
"concurrently": "^9.2.1",
|
||||||
"esbuild": "^0.27.3",
|
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"node-loader": "^2.1.0",
|
"node-loader": "^2.1.0",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"tsx": "4.20.4",
|
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,318 +0,0 @@
|
|||||||
// Must be imported first to set up globalThis.AsyncLocalStorage for Next.js
|
|
||||||
import "next/dist/server/node-environment-baseline";
|
|
||||||
|
|
||||||
// Set up undici HTTP agent override (from tasks app)
|
|
||||||
import { setGlobalDispatcher } from "undici";
|
|
||||||
import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
|
|
||||||
setGlobalDispatcher(new UndiciHttpAgent());
|
|
||||||
|
|
||||||
import { createServer } from "http";
|
|
||||||
import path from "path";
|
|
||||||
import next from "next";
|
|
||||||
import { parse } from "url";
|
|
||||||
import { applyWSSHandler } from "@trpc/server/adapters/ws";
|
|
||||||
import { WebSocketServer } from "ws";
|
|
||||||
import type { FastifyTRPCPluginOptions } from "@trpc/server/adapters/fastify";
|
|
||||||
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
|
|
||||||
import fastify from "fastify";
|
|
||||||
|
|
||||||
import { appRouter, createTRPCContext } from "@homarr/api/websocket";
|
|
||||||
import { getSessionFromToken, sessionTokenCookieName } from "@homarr/auth";
|
|
||||||
import { env as authEnv } from "@homarr/auth/env";
|
|
||||||
import { parseCookies } from "@homarr/common";
|
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
|
||||||
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
|
||||||
import type { JobRouter } from "@homarr/cron-job-api";
|
|
||||||
import { jobRouter } from "@homarr/cron-job-api";
|
|
||||||
import { CRON_JOB_API_KEY_HEADER, CRON_JOB_API_PATH, CRON_JOB_API_PORT } from "@homarr/cron-job-api/constants";
|
|
||||||
import { jobGroup } from "@homarr/cron-jobs";
|
|
||||||
import { db, eq, inArray } from "@homarr/db";
|
|
||||||
import { cronJobConfigurations, sessions, users } from "@homarr/db/schema";
|
|
||||||
import { supportedAuthProviders } from "@homarr/definitions";
|
|
||||||
import { updateCheckerRequestHandler } from "@homarr/request-handler/update-checker";
|
|
||||||
import { schedule, validate as validateCron } from "node-cron";
|
|
||||||
|
|
||||||
const logger = createLogger({ module: "customServer" });
|
|
||||||
|
|
||||||
// --- JobManager (from apps/tasks/src/job-manager.ts) ---
|
|
||||||
import type { IJobManager } from "@homarr/cron-job-api";
|
|
||||||
import type { jobGroup as CronJobGroup, JobGroupKeys } from "@homarr/cron-jobs";
|
|
||||||
import type { Database, InferInsertModel } from "@homarr/db";
|
|
||||||
|
|
||||||
class JobManager implements IJobManager {
|
|
||||||
constructor(
|
|
||||||
private db: Database,
|
|
||||||
private jobGroup: typeof CronJobGroup,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
public async startAsync(name: JobGroupKeys): Promise<void> {
|
|
||||||
await this.jobGroup.startAsync(name);
|
|
||||||
}
|
|
||||||
public async triggerAsync(name: JobGroupKeys): Promise<void> {
|
|
||||||
await this.jobGroup.runManuallyAsync(name);
|
|
||||||
}
|
|
||||||
public async stopAsync(name: JobGroupKeys): Promise<void> {
|
|
||||||
await this.jobGroup.stopAsync(name);
|
|
||||||
}
|
|
||||||
public async updateIntervalAsync(name: JobGroupKeys, cron: string): Promise<void> {
|
|
||||||
logger.info("Updating cron job interval", { name, expression: cron });
|
|
||||||
const job = this.jobGroup.getJobRegistry().get(name);
|
|
||||||
if (!job) throw new Error(`Job ${name} not found`);
|
|
||||||
if (!validateCron(cron)) {
|
|
||||||
throw new Error(`Invalid cron expression: ${cron}`);
|
|
||||||
}
|
|
||||||
if (job.preventCustomInterval && cron !== job.cronExpression) {
|
|
||||||
throw new Error(`Custom cron expressions are not allowed for job ${name}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.updateConfigurationAsync(name, { cronExpression: cron });
|
|
||||||
await this.jobGroup.getTask(name)?.destroy();
|
|
||||||
|
|
||||||
this.jobGroup.setTask(
|
|
||||||
name,
|
|
||||||
schedule(cron, () => void job.executeAsync(), {
|
|
||||||
name,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
logger.info("Cron job interval updated", { name, expression: cron });
|
|
||||||
}
|
|
||||||
public async disableAsync(name: JobGroupKeys): Promise<void> {
|
|
||||||
logger.info("Disabling cron job", { name });
|
|
||||||
const job = this.jobGroup.getJobRegistry().get(name);
|
|
||||||
if (!job) throw new Error(`Job ${name} not found`);
|
|
||||||
|
|
||||||
await this.updateConfigurationAsync(name, { isEnabled: false });
|
|
||||||
await this.jobGroup.stopAsync(name);
|
|
||||||
logger.info("Cron job disabled", { name });
|
|
||||||
}
|
|
||||||
public async enableAsync(name: JobGroupKeys): Promise<void> {
|
|
||||||
logger.info("Enabling cron job", { name });
|
|
||||||
await this.updateConfigurationAsync(name, { isEnabled: true });
|
|
||||||
await this.jobGroup.startAsync(name);
|
|
||||||
logger.info("Cron job enabled", { name });
|
|
||||||
}
|
|
||||||
|
|
||||||
private async updateConfigurationAsync(
|
|
||||||
name: JobGroupKeys,
|
|
||||||
configuration: Omit<Partial<InferInsertModel<typeof cronJobConfigurations>>, "name">,
|
|
||||||
) {
|
|
||||||
const existingConfig = await this.db.query.cronJobConfigurations.findFirst({
|
|
||||||
where: (table, { eq }) => eq(table.name, name),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (existingConfig) {
|
|
||||||
await this.db
|
|
||||||
.update(cronJobConfigurations)
|
|
||||||
.set({ ...configuration, name: undefined })
|
|
||||||
.where(eq(cronJobConfigurations.name, name));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const job = this.jobGroup.getJobRegistry().get(name);
|
|
||||||
if (!job) throw new Error(`Job ${name} not found`);
|
|
||||||
|
|
||||||
await this.db.insert(cronJobConfigurations).values({
|
|
||||||
name,
|
|
||||||
cronExpression: configuration.cronExpression ?? job.cronExpression,
|
|
||||||
isEnabled: configuration.isEnabled ?? true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getAllAsync(): Promise<
|
|
||||||
{
|
|
||||||
name: JobGroupKeys;
|
|
||||||
cron: string;
|
|
||||||
preventManualExecution: boolean;
|
|
||||||
preventCustomInterval: boolean;
|
|
||||||
isEnabled: boolean;
|
|
||||||
}[]
|
|
||||||
> {
|
|
||||||
const configurations = await this.db.query.cronJobConfigurations.findMany();
|
|
||||||
|
|
||||||
return [...this.jobGroup.getJobRegistry().entries()].map(([name, job]) => {
|
|
||||||
const config = configurations.find((config) => config.name === name);
|
|
||||||
return {
|
|
||||||
name,
|
|
||||||
cron: config?.cronExpression ?? job.cronExpression,
|
|
||||||
preventManualExecution: job.preventManualExecution,
|
|
||||||
preventCustomInterval: job.preventCustomInterval,
|
|
||||||
isEnabled: config?.isEnabled ?? true,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- On-start functions (from apps/tasks/src/on-start/) ---
|
|
||||||
async function cleanupSessionsAsync() {
|
|
||||||
try {
|
|
||||||
const currentAuthProviders = authEnv.AUTH_PROVIDERS;
|
|
||||||
const inactiveAuthProviders = supportedAuthProviders.filter((provider) => !currentAuthProviders.includes(provider));
|
|
||||||
const subQuery = db
|
|
||||||
.select({ id: users.id })
|
|
||||||
.from(users)
|
|
||||||
.where(inArray(users.provider, inactiveAuthProviders))
|
|
||||||
.as("sq");
|
|
||||||
const sessionsWithInactiveProviders = await db
|
|
||||||
.select({ userId: sessions.userId })
|
|
||||||
.from(sessions)
|
|
||||||
.rightJoin(subQuery, eq(sessions.userId, subQuery.id));
|
|
||||||
|
|
||||||
const userIds = sessionsWithInactiveProviders.map(({ userId }) => userId).filter((value) => value !== null);
|
|
||||||
await db.delete(sessions).where(inArray(sessions.userId, userIds));
|
|
||||||
|
|
||||||
if (sessionsWithInactiveProviders.length > 0) {
|
|
||||||
logger.info("Deleted sessions for inactive providers", { count: userIds.length });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(new Error("Failed to clean up sessions", { cause: error }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function invalidateUpdateCheckerCacheAsync() {
|
|
||||||
try {
|
|
||||||
const handler = updateCheckerRequestHandler.handler({});
|
|
||||||
await handler.invalidateAsync();
|
|
||||||
logger.debug("Update checker cache invalidated");
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(new Error("Failed to invalidate update checker cache", { cause: error }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Tasks/Cron Fastify server setup ---
|
|
||||||
async function startTasksServer() {
|
|
||||||
const tasksLogger = createLogger({ module: "tasksMain" });
|
|
||||||
|
|
||||||
const tasksServer = fastify({ maxParamLength: 5000 });
|
|
||||||
tasksServer.register(fastifyTRPCPlugin, {
|
|
||||||
prefix: CRON_JOB_API_PATH,
|
|
||||||
trpcOptions: {
|
|
||||||
router: jobRouter,
|
|
||||||
createContext: ({ req }) => ({
|
|
||||||
manager: new JobManager(db, jobGroup),
|
|
||||||
apiKey: req.headers[CRON_JOB_API_KEY_HEADER] as string | undefined,
|
|
||||||
}),
|
|
||||||
onError({ path, error }) {
|
|
||||||
tasksLogger.error(new ErrorWithMetadata("Error in tasks tRPC handler", { path }, { cause: error }));
|
|
||||||
},
|
|
||||||
} satisfies FastifyTRPCPluginOptions<JobRouter>["trpcOptions"],
|
|
||||||
});
|
|
||||||
|
|
||||||
// Run on-start tasks
|
|
||||||
await cleanupSessionsAsync();
|
|
||||||
await invalidateUpdateCheckerCacheAsync();
|
|
||||||
|
|
||||||
// Initialize and start cron jobs
|
|
||||||
await jobGroup.initializeAsync();
|
|
||||||
await jobGroup.startAllAsync();
|
|
||||||
|
|
||||||
try {
|
|
||||||
await tasksServer.listen({ port: CRON_JOB_API_PORT });
|
|
||||||
tasksLogger.info("Tasks web server started successfully", { port: CRON_JOB_API_PORT });
|
|
||||||
} catch (err) {
|
|
||||||
tasksLogger.error(
|
|
||||||
new ErrorWithMetadata("Failed to start tasks web server", { port: CRON_JOB_API_PORT }, { cause: err }),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tasksServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Main server setup ---
|
|
||||||
const dev = process.env.NODE_ENV !== "production";
|
|
||||||
const hostname = process.env.HOSTNAME || "localhost";
|
|
||||||
const port = parseInt(process.env.PORT || "3000", 10);
|
|
||||||
// Resolve the directory of this file so Next.js can find the app/pages dirs
|
|
||||||
const dir = path.resolve(__dirname);
|
|
||||||
|
|
||||||
const app = next({ dev, hostname, port, dir });
|
|
||||||
const handle = app.getRequestHandler();
|
|
||||||
const upgradeHandler = app.getUpgradeHandler();
|
|
||||||
|
|
||||||
app.prepare().then(async () => {
|
|
||||||
const server = createServer((req, res) => {
|
|
||||||
const parsedUrl = parse(req.url!, true);
|
|
||||||
handle(req, res, parsedUrl);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create WebSocket server in noServer mode so we handle upgrade manually
|
|
||||||
const wss = new WebSocketServer({ noServer: true });
|
|
||||||
|
|
||||||
const wssHandler = applyWSSHandler({
|
|
||||||
wss,
|
|
||||||
router: appRouter,
|
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
|
||||||
createContext: async ({ req }) => {
|
|
||||||
try {
|
|
||||||
const headers = Object.entries(req.headers).map(
|
|
||||||
([key, value]) => [key, typeof value === "string" ? value : value?.[0]] as [string, string],
|
|
||||||
);
|
|
||||||
const nextHeaders = new Headers(headers);
|
|
||||||
|
|
||||||
const store = parseCookies(nextHeaders.get("cookie") ?? "");
|
|
||||||
const sessionToken = store[sessionTokenCookieName];
|
|
||||||
|
|
||||||
const session = await getSessionFromToken(db, sessionToken);
|
|
||||||
|
|
||||||
return createTRPCContext({
|
|
||||||
headers: nextHeaders,
|
|
||||||
session,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(error);
|
|
||||||
return createTRPCContext({
|
|
||||||
headers: new Headers(),
|
|
||||||
session: null,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
keepAlive: {
|
|
||||||
enabled: true,
|
|
||||||
pingMs: 30000,
|
|
||||||
pongWaitMs: 5000,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle upgrade requests: route /websockets to our WS server,
|
|
||||||
// delegate everything else (e.g. HMR _next/webpack-hmr) to Next.js
|
|
||||||
server.on("upgrade", (req, socket, head) => {
|
|
||||||
if (req.url?.startsWith("/websockets")) {
|
|
||||||
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
||||||
wss.emit("connection", ws, req);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
upgradeHandler(req, socket, head);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
wss.on("connection", (websocket, incomingMessage) => {
|
|
||||||
logger.info(`➕ Connection (${wss.clients.size}) ${incomingMessage.method} ${incomingMessage.url}`);
|
|
||||||
websocket.once("close", (code, reason) => {
|
|
||||||
logger.info(`➖ Connection (${wss.clients.size}) ${code} ${reason.toString()}`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Start the integrated tasks/cron server
|
|
||||||
const tasksServer = await startTasksServer();
|
|
||||||
|
|
||||||
server.once("error", (err) => {
|
|
||||||
logger.error(new ErrorWithMetadata("Server error", {}, { cause: err }));
|
|
||||||
wssHandler.broadcastReconnectNotification();
|
|
||||||
wss.close();
|
|
||||||
tasksServer.close().catch((closeError) => logger.error("Failed to close tasks server", closeError));
|
|
||||||
server.close(() => process.exit(1));
|
|
||||||
});
|
|
||||||
|
|
||||||
server.listen(port, () => {
|
|
||||||
logger.info(`✅ Custom server ready on http://${hostname}:${port}`);
|
|
||||||
logger.info(`✅ WebSocket Server integrated on ws://${hostname}:${port}/websockets`);
|
|
||||||
logger.info(`✅ Tasks/Cron server integrated on port ${CRON_JOB_API_PORT}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on("SIGTERM", () => {
|
|
||||||
logger.info("SIGTERM");
|
|
||||||
wssHandler.broadcastReconnectNotification();
|
|
||||||
wss.close();
|
|
||||||
tasksServer.close().catch((closeError) => logger.error("Failed to close tasks server", closeError));
|
|
||||||
server.close();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -32,12 +32,13 @@ const getWebSocketProtocol = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const constructWebsocketUrl = () => {
|
const constructWebsocketUrl = () => {
|
||||||
|
const fallback = `${getWebSocketProtocol()}://localhost:3001/websockets`;
|
||||||
if (typeof window === "undefined") {
|
if (typeof window === "undefined") {
|
||||||
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env.NODE_ENV === "development") {
|
if (env.NODE_ENV === "development") {
|
||||||
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;
|
return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import type { useForm } from "@homarr/form";
|
|||||||
import { useZodForm } from "@homarr/form";
|
import { useZodForm } from "@homarr/form";
|
||||||
import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";
|
import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";
|
||||||
import { useScopedI18n } from "@homarr/translation/client";
|
import { useScopedI18n } from "@homarr/translation/client";
|
||||||
|
import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url";
|
||||||
import { userSignInSchema } from "@homarr/validation/user";
|
import { userSignInSchema } from "@homarr/validation/user";
|
||||||
|
|
||||||
type Provider = "credentials" | "ldap" | "oidc";
|
type Provider = "credentials" | "ldap" | "oidc";
|
||||||
@@ -70,7 +71,7 @@ export const LoginForm = ({ providers, oidcClientName, isOidcAutoLoginEnabled, c
|
|||||||
|
|
||||||
// Redirect to the callback URL if the response is defined and comes from a credentials provider (ldap or credentials). oidc is redirected automatically.
|
// Redirect to the callback URL if the response is defined and comes from a credentials provider (ldap or credentials). oidc is redirected automatically.
|
||||||
await revalidatePathActionAsync("/");
|
await revalidatePathActionAsync("/");
|
||||||
router.push(callbackUrl);
|
router.push(sanitizeRedirectionUrl(callbackUrl));
|
||||||
},
|
},
|
||||||
[t, router, callbackUrl],
|
[t, router, callbackUrl],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { Card, Center, Stack, Text, Title } from "@mantine/core";
|
|||||||
import { env } from "@homarr/auth/env";
|
import { env } from "@homarr/auth/env";
|
||||||
import { auth } from "@homarr/auth/next";
|
import { auth } from "@homarr/auth/next";
|
||||||
import { getScopedI18n } from "@homarr/translation/server";
|
import { getScopedI18n } from "@homarr/translation/server";
|
||||||
|
import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url";
|
||||||
|
|
||||||
import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo";
|
import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo";
|
||||||
import { LoginForm } from "./_login-form";
|
import { LoginForm } from "./_login-form";
|
||||||
@@ -19,7 +20,7 @@ export default async function Login(props: LoginProps) {
|
|||||||
const session = await auth();
|
const session = await auth();
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
redirect(searchParams.callbackUrl ?? "/");
|
redirect(sanitizeRedirectionUrl(searchParams.callbackUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
const t = await getScopedI18n("user.page.login");
|
const t = await getScopedI18n("user.page.login");
|
||||||
|
|||||||
@@ -264,6 +264,5 @@ const usePreventLeaveWithDirty = (isDirty: boolean) => {
|
|||||||
window.removeEventListener("popstate", handlePopState);
|
window.removeEventListener("popstate", handlePopState);
|
||||||
window.removeEventListener("beforeunload", handleBeforeUnload);
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [isDirty]);
|
}, [isDirty]);
|
||||||
};
|
};
|
||||||
@@ -27,7 +27,6 @@ export const BoardReadyProvider = ({ children }: PropsWithChildren) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setReadySections((previous) => previous.filter((id) => board.sections.some((section) => section.id === id)));
|
setReadySections((previous) => previous.filter((id) => board.sections.some((section) => section.id === id)));
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [board.sections.length, setReadySections]);
|
}, [board.sections.length, setReadySections]);
|
||||||
|
|
||||||
const markAsReady = useCallback((id: string) => {
|
const markAsReady = useCallback((id: string) => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { ApiKeysManagement } from "./components/api-keys";
|
|||||||
|
|
||||||
export async function generateMetadata() {
|
export async function generateMetadata() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ export async function generateMetadata() {
|
|||||||
|
|
||||||
export default async function ApiPage() {
|
export default async function ApiPage() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
const document = openApiDocument(extractBaseUrlFromHeaders(await headers()));
|
const document = openApiDocument(extractBaseUrlFromHeaders(await headers()));
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ const createColumns = (
|
|||||||
accessorKey: "ports",
|
accessorKey: "ports",
|
||||||
header: t("docker.field.ports.label"),
|
header: t("docker.field.ports.label"),
|
||||||
Cell({ cell }) {
|
Cell({ cell }) {
|
||||||
|
if (!cell.row.original.ports) return null;
|
||||||
if (!cell.row.original.ports.length) return null;
|
if (!cell.row.original.ports.length) return null;
|
||||||
return (
|
return (
|
||||||
<OverflowBadge overflowCount={1} data={cell.row.original.ports.map((port) => port.PrivatePort.toString())} />
|
<OverflowBadge overflowCount={1} data={cell.row.original.ports.map((port) => port.PrivatePort.toString())} />
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { LogContextProvider } from "./log-context";
|
|||||||
|
|
||||||
export async function generateMetadata() {
|
export async function generateMetadata() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const t = await getScopedI18n("management");
|
const t = await getScopedI18n("management");
|
||||||
@@ -30,7 +30,7 @@ export async function generateMetadata() {
|
|||||||
|
|
||||||
export default async function LogsManagementPage() {
|
export default async function LogsManagementPage() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("other-view-logs")) {
|
if (!session?.user.permissions.includes("other-view-logs")) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ const executeHealthCheckSafelyAsync = async (
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
||||||
logger.error(new ErrorWithMetadata("Healthcheck failed", { name }, { cause: error }));
|
logger.error(new ErrorWithMetadata("Healthcheck failed", { name }, { cause: error }));
|
||||||
return {
|
return {
|
||||||
status: "unhealthy",
|
status: "unhealthy",
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ const InnerContent = ({ item, ...dimensions }: InnerContentProps) => {
|
|||||||
when={
|
when={
|
||||||
widgetSupportsIntegrations &&
|
widgetSupportsIntegrations &&
|
||||||
item.integrationIds.length === 0 &&
|
item.integrationIds.length === 0 &&
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
||||||
(!("integrationsRequired" in definition) || definition.integrationsRequired !== false)
|
(!("integrationsRequired" in definition) || definition.integrationsRequired !== false)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ export const useGridstack = (section: Omit<Section, "items">, itemIds: string[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only run this effect when the section items change
|
// Only run this effect when the section items change
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [itemIds.length, columnCount]);
|
}, [itemIds.length, columnCount]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,5 +14,5 @@
|
|||||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
},
|
},
|
||||||
"include": [".", ".next/types/**/*.ts"],
|
"include": [".", ".next/types/**/*.ts"],
|
||||||
"exclude": ["node_modules", ".next", "customServer.cjs", "customServer.css"]
|
"exclude": ["node_modules", ".next"]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import baseConfig from "@homarr/eslint-config/base";
|
||||||
|
|
||||||
|
/** @type {import('typescript-eslint').Config} */
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ["tasks.cjs"],
|
||||||
|
},
|
||||||
|
...baseConfig,
|
||||||
|
];
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"name": "@homarr/tasks",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index.ts"
|
||||||
|
},
|
||||||
|
"main": "./src/main.ts",
|
||||||
|
"types": "./src/main.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "esbuild src/main.ts --bundle --platform=node --loader:.scss=text --external:*.node --external:@opentelemetry/api --external:deasync --external:bcrypt --outfile=tasks.cjs",
|
||||||
|
"clean": "rm -rf .turbo node_modules",
|
||||||
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||||
|
"lint": "eslint",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"with-env": "dotenv -e ../../.env --"
|
||||||
|
},
|
||||||
|
"prettier": "@homarr/prettier-config",
|
||||||
|
"dependencies": {
|
||||||
|
"@homarr/analytics": "workspace:^0.1.0",
|
||||||
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
|
"@homarr/core": "workspace:^",
|
||||||
|
"@homarr/cron-job-api": "workspace:^0.1.0",
|
||||||
|
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||||
|
"@homarr/cron-jobs-core": "workspace:^0.1.0",
|
||||||
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
|
"@homarr/icons": "workspace:^0.1.0",
|
||||||
|
"@homarr/integrations": "workspace:^0.1.0",
|
||||||
|
"@homarr/ping": "workspace:^0.1.0",
|
||||||
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
|
"@homarr/request-handler": "workspace:^0.1.0",
|
||||||
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
|
"@homarr/widgets": "workspace:^0.1.0",
|
||||||
|
"dayjs": "^1.11.20",
|
||||||
|
"dotenv": "^17.3.1",
|
||||||
|
"fastify": "^5.8.2",
|
||||||
|
"superjson": "2.2.6",
|
||||||
|
"undici": "7.24.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
|
"@types/node": "^24.12.0",
|
||||||
|
"dotenv-cli": "^11.0.0",
|
||||||
|
"esbuild": "^0.27.4",
|
||||||
|
"eslint": "^9.39.4",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
|
"tsx": "4.20.4",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
import { schedule, validate as validateCron } from "node-cron";
|
||||||
|
|
||||||
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
import type { IJobManager } from "@homarr/cron-job-api";
|
||||||
|
import type { jobGroup as cronJobGroup, JobGroupKeys } from "@homarr/cron-jobs";
|
||||||
|
import type { Database, InferInsertModel } from "@homarr/db";
|
||||||
|
import { eq } from "@homarr/db";
|
||||||
|
import { cronJobConfigurations } from "@homarr/db/schema";
|
||||||
|
|
||||||
|
const logger = createLogger({ module: "jobManager" });
|
||||||
|
|
||||||
|
export class JobManager implements IJobManager {
|
||||||
|
constructor(
|
||||||
|
private db: Database,
|
||||||
|
private jobGroup: typeof cronJobGroup,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public async startAsync(name: JobGroupKeys): Promise<void> {
|
||||||
|
await this.jobGroup.startAsync(name);
|
||||||
|
}
|
||||||
|
public async triggerAsync(name: JobGroupKeys): Promise<void> {
|
||||||
|
await this.jobGroup.runManuallyAsync(name);
|
||||||
|
}
|
||||||
|
public async stopAsync(name: JobGroupKeys): Promise<void> {
|
||||||
|
await this.jobGroup.stopAsync(name);
|
||||||
|
}
|
||||||
|
public async updateIntervalAsync(name: JobGroupKeys, cron: string): Promise<void> {
|
||||||
|
logger.info("Updating cron job interval", { name, expression: cron });
|
||||||
|
const job = this.jobGroup.getJobRegistry().get(name);
|
||||||
|
if (!job) throw new Error(`Job ${name} not found`);
|
||||||
|
if (!validateCron(cron)) {
|
||||||
|
throw new Error(`Invalid cron expression: ${cron}`);
|
||||||
|
}
|
||||||
|
if (job.preventCustomInterval && cron !== job.cronExpression) {
|
||||||
|
throw new Error(`Custom cron expressions are not allowed for job ${name}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.updateConfigurationAsync(name, { cronExpression: cron });
|
||||||
|
await this.jobGroup.getTask(name)?.destroy();
|
||||||
|
|
||||||
|
this.jobGroup.setTask(
|
||||||
|
name,
|
||||||
|
schedule(cron, () => void job.executeAsync(), {
|
||||||
|
name,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
logger.info("Cron job interval updated", { name, expression: cron });
|
||||||
|
}
|
||||||
|
public async disableAsync(name: JobGroupKeys): Promise<void> {
|
||||||
|
logger.info("Disabling cron job", { name });
|
||||||
|
const job = this.jobGroup.getJobRegistry().get(name);
|
||||||
|
if (!job) throw new Error(`Job ${name} not found`);
|
||||||
|
|
||||||
|
await this.updateConfigurationAsync(name, { isEnabled: false });
|
||||||
|
await this.jobGroup.stopAsync(name);
|
||||||
|
logger.info("Cron job disabled", { name });
|
||||||
|
}
|
||||||
|
public async enableAsync(name: JobGroupKeys): Promise<void> {
|
||||||
|
logger.info("Enabling cron job", { name });
|
||||||
|
await this.updateConfigurationAsync(name, { isEnabled: true });
|
||||||
|
await this.jobGroup.startAsync(name);
|
||||||
|
logger.info("Cron job enabled", { name });
|
||||||
|
}
|
||||||
|
|
||||||
|
private async updateConfigurationAsync(
|
||||||
|
name: JobGroupKeys,
|
||||||
|
configuration: Omit<Partial<InferInsertModel<typeof cronJobConfigurations>>, "name">,
|
||||||
|
) {
|
||||||
|
const existingConfig = await this.db.query.cronJobConfigurations.findFirst({
|
||||||
|
where: (table, { eq }) => eq(table.name, name),
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.debug("Updating cron job configuration", {
|
||||||
|
name,
|
||||||
|
configuration: JSON.stringify(configuration),
|
||||||
|
exists: Boolean(existingConfig),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (existingConfig) {
|
||||||
|
await this.db
|
||||||
|
.update(cronJobConfigurations)
|
||||||
|
// prevent updating the name, as it is the primary key
|
||||||
|
.set({ ...configuration, name: undefined })
|
||||||
|
.where(eq(cronJobConfigurations.name, name));
|
||||||
|
logger.debug("Cron job configuration updated", {
|
||||||
|
name,
|
||||||
|
configuration: JSON.stringify(configuration),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const job = this.jobGroup.getJobRegistry().get(name);
|
||||||
|
if (!job) throw new Error(`Job ${name} not found`);
|
||||||
|
|
||||||
|
await this.db.insert(cronJobConfigurations).values({
|
||||||
|
name,
|
||||||
|
cronExpression: configuration.cronExpression ?? job.cronExpression,
|
||||||
|
isEnabled: configuration.isEnabled ?? true,
|
||||||
|
});
|
||||||
|
logger.debug("Cron job configuration updated", {
|
||||||
|
name,
|
||||||
|
configuration: JSON.stringify(configuration),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getAllAsync(): Promise<
|
||||||
|
{
|
||||||
|
name: JobGroupKeys;
|
||||||
|
cron: string;
|
||||||
|
preventManualExecution: boolean;
|
||||||
|
preventCustomInterval: boolean;
|
||||||
|
isEnabled: boolean;
|
||||||
|
}[]
|
||||||
|
> {
|
||||||
|
const configurations = await this.db.query.cronJobConfigurations.findMany();
|
||||||
|
|
||||||
|
return [...this.jobGroup.getJobRegistry().entries()].map(([name, job]) => {
|
||||||
|
const config = configurations.find((config) => config.name === name);
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
cron: config?.cronExpression ?? job.cronExpression,
|
||||||
|
preventManualExecution: job.preventManualExecution,
|
||||||
|
preventCustomInterval: job.preventCustomInterval,
|
||||||
|
isEnabled: config?.isEnabled ?? true,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
// This import has to be the first import in the file so that the agent is overridden before any other modules are imported.
|
||||||
|
import "./overrides";
|
||||||
|
|
||||||
|
import type { FastifyTRPCPluginOptions } from "@trpc/server/adapters/fastify";
|
||||||
|
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
|
||||||
|
import fastify from "fastify";
|
||||||
|
|
||||||
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
||||||
|
import type { JobRouter } from "@homarr/cron-job-api";
|
||||||
|
import { jobRouter } from "@homarr/cron-job-api";
|
||||||
|
import { CRON_JOB_API_KEY_HEADER, CRON_JOB_API_PATH, CRON_JOB_API_PORT } from "@homarr/cron-job-api/constants";
|
||||||
|
import { jobGroup } from "@homarr/cron-jobs";
|
||||||
|
import { db } from "@homarr/db";
|
||||||
|
|
||||||
|
import { JobManager } from "./job-manager";
|
||||||
|
import { onStartAsync } from "./on-start";
|
||||||
|
|
||||||
|
const logger = createLogger({ module: "tasksMain" });
|
||||||
|
|
||||||
|
const server = fastify({
|
||||||
|
maxParamLength: 5000,
|
||||||
|
});
|
||||||
|
server.register(fastifyTRPCPlugin, {
|
||||||
|
prefix: CRON_JOB_API_PATH,
|
||||||
|
trpcOptions: {
|
||||||
|
router: jobRouter,
|
||||||
|
createContext: ({ req }) => ({
|
||||||
|
manager: new JobManager(db, jobGroup),
|
||||||
|
apiKey: req.headers[CRON_JOB_API_KEY_HEADER] as string | undefined,
|
||||||
|
}),
|
||||||
|
onError({ path, error }) {
|
||||||
|
logger.error(new ErrorWithMetadata("Error in tasks tRPC handler", { path }, { cause: error }));
|
||||||
|
},
|
||||||
|
} satisfies FastifyTRPCPluginOptions<JobRouter>["trpcOptions"],
|
||||||
|
});
|
||||||
|
|
||||||
|
void (async () => {
|
||||||
|
await onStartAsync();
|
||||||
|
await jobGroup.initializeAsync();
|
||||||
|
await jobGroup.startAllAsync();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await server.listen({ port: CRON_JOB_API_PORT });
|
||||||
|
logger.info("Tasks web server started successfully", { port: CRON_JOB_API_PORT });
|
||||||
|
} catch (err) {
|
||||||
|
logger.error(
|
||||||
|
new ErrorWithMetadata("Failed to start tasks web server", { port: CRON_JOB_API_PORT }, { cause: err }),
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { invalidateUpdateCheckerCacheAsync } from "./invalidate-update-checker-cache";
|
||||||
|
import { cleanupSessionsAsync } from "./session-cleanup";
|
||||||
|
|
||||||
|
export async function onStartAsync() {
|
||||||
|
await cleanupSessionsAsync();
|
||||||
|
await invalidateUpdateCheckerCacheAsync();
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
import { updateCheckerRequestHandler } from "@homarr/request-handler/update-checker";
|
||||||
|
|
||||||
|
const logger = createLogger({ module: "invalidateUpdateCheckerCache" });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invalidates the update checker cache on startup to ensure fresh data.
|
||||||
|
* It is important as we want to avoid showing pending updates after the update to latest version.
|
||||||
|
*/
|
||||||
|
export async function invalidateUpdateCheckerCacheAsync() {
|
||||||
|
try {
|
||||||
|
const handler = updateCheckerRequestHandler.handler({});
|
||||||
|
await handler.invalidateAsync();
|
||||||
|
logger.debug("Update checker cache invalidated");
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(new Error("Failed to invalidate update checker cache", { cause: error }));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { env } from "@homarr/auth/env";
|
||||||
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
import { db, eq, inArray } from "@homarr/db";
|
||||||
|
import { sessions, users } from "@homarr/db/schema";
|
||||||
|
import { supportedAuthProviders } from "@homarr/definitions";
|
||||||
|
|
||||||
|
const logger = createLogger({ module: "sessionCleanup" });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes sessions for users that have inactive auth providers.
|
||||||
|
* Sessions from other providers are deleted so they can no longer be used.
|
||||||
|
*/
|
||||||
|
export async function cleanupSessionsAsync() {
|
||||||
|
try {
|
||||||
|
const currentAuthProviders = env.AUTH_PROVIDERS;
|
||||||
|
|
||||||
|
const inactiveAuthProviders = supportedAuthProviders.filter((provider) => !currentAuthProviders.includes(provider));
|
||||||
|
const subQuery = db
|
||||||
|
.select({ id: users.id })
|
||||||
|
.from(users)
|
||||||
|
.where(inArray(users.provider, inactiveAuthProviders))
|
||||||
|
.as("sq");
|
||||||
|
const sessionsWithInactiveProviders = await db
|
||||||
|
.select({ userId: sessions.userId })
|
||||||
|
.from(sessions)
|
||||||
|
.rightJoin(subQuery, eq(sessions.userId, subQuery.id));
|
||||||
|
|
||||||
|
const userIds = sessionsWithInactiveProviders.map(({ userId }) => userId).filter((value) => value !== null);
|
||||||
|
await db.delete(sessions).where(inArray(sessions.userId, userIds));
|
||||||
|
|
||||||
|
if (sessionsWithInactiveProviders.length > 0) {
|
||||||
|
logger.info("Deleted sessions for inactive providers", {
|
||||||
|
count: userIds.length,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
logger.debug("No sessions to delete");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(new Error("Failed to clean up sessions", { cause: error }));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { setGlobalDispatcher } from "undici";
|
||||||
|
|
||||||
|
import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
|
||||||
|
|
||||||
|
setGlobalDispatcher(new UndiciHttpAgent());
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "@homarr/tsconfig/base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"~/*": ["src/*"],
|
||||||
|
"@homarr/node-unifi": ["../../node_modules/@types/node-unifi"]
|
||||||
|
},
|
||||||
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
|
},
|
||||||
|
"include": ["."],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import baseConfig from "@homarr/eslint-config/base";
|
||||||
|
|
||||||
|
/** @type {import('typescript-eslint').Config} */
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ["wssServer.cjs"],
|
||||||
|
},
|
||||||
|
...baseConfig,
|
||||||
|
];
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"name": "@homarr/websocket",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"type": "module",
|
||||||
|
"main": "./src/main.ts",
|
||||||
|
"types": "./src/main.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "esbuild src/main.ts --bundle --platform=node --outfile=wssServer.cjs --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
|
||||||
|
"clean": "rm -rf .turbo node_modules",
|
||||||
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||||
|
"lint": "eslint",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"with-env": "dotenv -e ../../.env --"
|
||||||
|
},
|
||||||
|
"prettier": "@homarr/prettier-config",
|
||||||
|
"dependencies": {
|
||||||
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
|
"@homarr/core": "workspace:^",
|
||||||
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
|
"dotenv": "^17.3.1",
|
||||||
|
"tsx": "4.20.4",
|
||||||
|
"ws": "^8.20.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
|
"@types/ws": "^8.18.1",
|
||||||
|
"esbuild": "^0.27.4",
|
||||||
|
"eslint": "^9.39.4",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import { applyWSSHandler } from "@trpc/server/adapters/ws";
|
||||||
|
import { WebSocketServer } from "ws";
|
||||||
|
|
||||||
|
import { appRouter, createTRPCContext } from "@homarr/api/websocket";
|
||||||
|
import { getSessionFromToken, sessionTokenCookieName } from "@homarr/auth";
|
||||||
|
import { parseCookies } from "@homarr/common";
|
||||||
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
import { db } from "@homarr/db";
|
||||||
|
|
||||||
|
const logger = createLogger({ module: "websocketMain" });
|
||||||
|
|
||||||
|
const wss = new WebSocketServer({
|
||||||
|
port: 3001,
|
||||||
|
});
|
||||||
|
const handler = applyWSSHandler({
|
||||||
|
wss,
|
||||||
|
router: appRouter,
|
||||||
|
// ignore error on next line because the createContext must be set with this name
|
||||||
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
|
createContext: async ({ req }) => {
|
||||||
|
try {
|
||||||
|
const headers = Object.entries(req.headers).map(
|
||||||
|
([key, value]) => [key, typeof value === "string" ? value : value?.[0]] as [string, string],
|
||||||
|
);
|
||||||
|
const nextHeaders = new Headers(headers);
|
||||||
|
|
||||||
|
const store = parseCookies(nextHeaders.get("cookie") ?? "");
|
||||||
|
const sessionToken = store[sessionTokenCookieName];
|
||||||
|
|
||||||
|
const session = await getSessionFromToken(db, sessionToken);
|
||||||
|
|
||||||
|
return createTRPCContext({
|
||||||
|
headers: nextHeaders,
|
||||||
|
session,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(error);
|
||||||
|
return createTRPCContext({
|
||||||
|
headers: new Headers(),
|
||||||
|
session: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Enable heartbeat messages to keep connection open (disabled by default)
|
||||||
|
keepAlive: {
|
||||||
|
enabled: true,
|
||||||
|
// server ping message interval in milliseconds
|
||||||
|
pingMs: 30000,
|
||||||
|
// connection is terminated if pong message is not received in this many milliseconds
|
||||||
|
pongWaitMs: 5000,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
wss.on("connection", (websocket, incomingMessage) => {
|
||||||
|
logger.info(`➕ Connection (${wss.clients.size}) ${incomingMessage.method} ${incomingMessage.url}`);
|
||||||
|
websocket.once("close", (code, reason) => {
|
||||||
|
logger.info(`➖ Connection (${wss.clients.size}) ${code} ${reason.toString()}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
logger.info("✅ WebSocket Server listening on ws://localhost:3001");
|
||||||
|
|
||||||
|
process.on("SIGTERM", () => {
|
||||||
|
logger.info("SIGTERM");
|
||||||
|
handler.broadcastReconnectNotification();
|
||||||
|
wss.close();
|
||||||
|
});
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "@homarr/tsconfig/base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"~/*": ["src/*"],
|
||||||
|
"@homarr/node-unifi": ["../../node_modules/@types/node-unifi"]
|
||||||
|
},
|
||||||
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
|
},
|
||||||
|
"include": ["."],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^12.6.2"
|
"better-sqlite3": "^12.6.2"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.32.0",
|
"packageManager": "pnpm@10.32.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.14.0",
|
"node": ">=24.14.0",
|
||||||
"pnpm": ">=10.32.0"
|
"pnpm": ">=10.32.1"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
+2
-2
@@ -356,8 +356,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Unifi<br/>Controller</p>
|
<p align="center">Unifi<br/>Controller</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/unraid" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/unraid" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg" alt="Unraid" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg" alt="Unraid" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
+2
-2
@@ -7,9 +7,9 @@ http {
|
|||||||
listen 7575;
|
listen 7575;
|
||||||
listen [::]:7575;
|
listen [::]:7575;
|
||||||
|
|
||||||
# Route websockets traffic to port 3000 (integrated custom server)
|
# Route websockets traffic to port 3001
|
||||||
location /websockets {
|
location /websockets {
|
||||||
proxy_pass http://${HOSTNAME}:3000;
|
proxy_pass http://${HOSTNAME}:3001;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
|
|||||||
+20
-23
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homarr",
|
"name": "homarr",
|
||||||
"version": "1.56.0",
|
"version": "1.57.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env CI=true turbo build",
|
"build": "cross-env CI=true turbo build",
|
||||||
@@ -17,9 +17,6 @@
|
|||||||
"db:studio": "pnpm -F db studio",
|
"db:studio": "pnpm -F db studio",
|
||||||
"dev": "turbo dev --parallel",
|
"dev": "turbo dev --parallel",
|
||||||
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
||||||
"docker:build": "docker build -t homarr:test .",
|
|
||||||
"docker:test": "bash scripts/docker-test.sh",
|
|
||||||
"docker:test:skip-build": "bash scripts/docker-test.sh --skip-build",
|
|
||||||
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
||||||
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
||||||
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
|
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
|
||||||
@@ -29,7 +26,7 @@
|
|||||||
"release": "semantic-release",
|
"release": "semantic-release",
|
||||||
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
|
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
|
||||||
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
|
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
|
||||||
"start": "pnpm -F nextjs start",
|
"start": "concurrently \"pnpm with-env node apps/tasks/tasks.cjs\" \"pnpm with-env node apps/websocket/wssServer.cjs\" \"pnpm -F nextjs start\"",
|
||||||
"test": "cross-env NODE_ENV=development CI=true vitest run --exclude e2e --coverage.enabled ",
|
"test": "cross-env NODE_ENV=development CI=true vitest run --exclude e2e --coverage.enabled ",
|
||||||
"test:e2e": "cross-env NODE_ENV=development CI=true vitest e2e",
|
"test:e2e": "cross-env NODE_ENV=development CI=true vitest e2e",
|
||||||
"test:ui": "cross-env NODE_ENV=development CI=true vitest --exclude e2e --ui --coverage.enabled",
|
"test:ui": "cross-env NODE_ENV=development CI=true vitest --exclude e2e --ui --coverage.enabled",
|
||||||
@@ -45,27 +42,27 @@
|
|||||||
"@semantic-release/github": "^12.0.6",
|
"@semantic-release/github": "^12.0.6",
|
||||||
"@semantic-release/npm": "^13.1.5",
|
"@semantic-release/npm": "^13.1.5",
|
||||||
"@semantic-release/release-notes-generator": "^14.1.0",
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
||||||
"@testcontainers/redis": "^11.12.0",
|
"@testcontainers/redis": "^11.13.0",
|
||||||
"@turbo/gen": "^2.8.15",
|
"@turbo/gen": "^2.8.20",
|
||||||
"@vitejs/plugin-react": "^5.1.4",
|
"@vitejs/plugin-react": "^5.2.0",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "^4.1.0",
|
||||||
"@vitest/ui": "^4.0.18",
|
"@vitest/ui": "^4.1.0",
|
||||||
"conventional-changelog-conventionalcommits": "^9.3.0",
|
"conventional-changelog-conventionalcommits": "^9.3.0",
|
||||||
"cross-env": "^10.1.0",
|
"cross-env": "^10.1.0",
|
||||||
"jsdom": "^28.1.0",
|
"jsdom": "^28.1.0",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"semantic-release": "^25.0.3",
|
"semantic-release": "^25.0.3",
|
||||||
"testcontainers": "^11.12.0",
|
"testcontainers": "^11.13.0",
|
||||||
"turbo": "^2.8.15",
|
"turbo": "^2.8.20",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite-tsconfig-paths": "^6.1.1",
|
"vite-tsconfig-paths": "^6.1.1",
|
||||||
"vitest": "^4.0.18"
|
"vitest": "^4.1.0"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.32.0",
|
"packageManager": "pnpm@10.32.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.14.0",
|
"node": ">=24.14.0",
|
||||||
"pnpm": ">=10.32.0"
|
"pnpm": ">=10.32.1"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
@@ -80,25 +77,25 @@
|
|||||||
"tree-sitter-json"
|
"tree-sitter-json"
|
||||||
],
|
],
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@babel/helpers@<7.26.10": ">=7.28.6",
|
"@babel/helpers@<7.26.10": ">=7.29.2",
|
||||||
"@babel/runtime@<7.26.10": ">=7.28.6",
|
"@babel/runtime@<7.26.10": ">=7.29.2",
|
||||||
"axios@>=1.0.0 <1.8.2": ">=1.13.6",
|
"axios@>=1.0.0 <1.8.2": ">=1.13.6",
|
||||||
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.4",
|
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.4",
|
||||||
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.4",
|
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.4",
|
||||||
"esbuild@<=0.24.2": ">=0.27.3",
|
"esbuild@<=0.24.2": ">=0.27.4",
|
||||||
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
||||||
"hono@<4.6.5": ">=4.12.7",
|
"hono@<4.6.5": ">=4.12.8",
|
||||||
"linkifyjs@<4.3.2": ">=4.3.2",
|
"linkifyjs@<4.3.2": ">=4.3.2",
|
||||||
"nanoid@>=4.0.0 <5.0.9": ">=5.1.6",
|
"nanoid@>=4.0.0 <5.0.9": ">=5.1.7",
|
||||||
"prismjs@<1.30.0": ">=1.30.0",
|
"prismjs@<1.30.0": ">=1.30.0",
|
||||||
"proxmox-api>undici": "7.19.2",
|
"proxmox-api>undici": "7.24.5",
|
||||||
"react-is": "^19.2.4",
|
"react-is": "^19.2.4",
|
||||||
"rollup@>=4.0.0 <4.22.4": ">=4.59.0",
|
"rollup@>=4.0.0 <4.22.4": ">=4.60.0",
|
||||||
"sha.js@<=2.4.11": ">=2.4.12",
|
"sha.js@<=2.4.11": ">=2.4.12",
|
||||||
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
|
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
|
||||||
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
|
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
|
||||||
"tmp@<=0.2.3": ">=0.2.5",
|
"tmp@<=0.2.3": ">=0.2.5",
|
||||||
"vite@>=5.0.0 <=5.4.18": ">=7.3.1"
|
"vite@>=5.0.0 <=5.4.18": ">=8.0.1"
|
||||||
},
|
},
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
||||||
|
|||||||
@@ -41,17 +41,17 @@
|
|||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@kubernetes/client-node": "^1.4.0",
|
"@kubernetes/client-node": "^1.4.0",
|
||||||
"@tanstack/react-query": "^5.90.21",
|
"@tanstack/react-query": "^5.91.2",
|
||||||
"@trpc/client": "^11.12.0",
|
"@trpc/client": "^11.14.1",
|
||||||
"@trpc/react-query": "^11.12.0",
|
"@trpc/react-query": "^11.14.1",
|
||||||
"@trpc/server": "^11.12.0",
|
"@trpc/server": "^11.14.1",
|
||||||
"@trpc/tanstack-react-query": "^11.12.0",
|
"@trpc/tanstack-react-query": "^11.14.1",
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "^4.5.0",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"superjson": "2.2.6",
|
"superjson": "2.2.6",
|
||||||
"trpc-to-openapi": "^3.1.0",
|
"trpc-to-openapi": "^3.2.0",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ interface DockerContainer {
|
|||||||
id: string;
|
id: string;
|
||||||
state: ContainerState;
|
state: ContainerState;
|
||||||
image: string;
|
image: string;
|
||||||
ports: Port[];
|
ports: Port[] | undefined;
|
||||||
iconUrl: string | null;
|
iconUrl: string | null;
|
||||||
cpuUsage: number;
|
cpuUsage: number;
|
||||||
memoryUsage: number;
|
memoryUsage: number;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
|
import type { MySqlRawQueryResult } from "drizzle-orm/mysql2";
|
||||||
|
import type { QueryResult } from "pg";
|
||||||
import { z } from "zod/v4";
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";
|
import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import type { Database } from "@homarr/db";
|
import type { Database } from "@homarr/db";
|
||||||
import { and, eq, like } from "@homarr/db";
|
import { and, eq, handleTransactionsAsync, like } from "@homarr/db";
|
||||||
import { getMaxGroupPositionAsync } from "@homarr/db/queries";
|
import { getMaxGroupPositionAsync } from "@homarr/db/queries";
|
||||||
import { boards, groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema";
|
import { boards, groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema";
|
||||||
import { selectUserSchema } from "@homarr/db/validationSchemas";
|
import { selectUserSchema } from "@homarr/db/validationSchemas";
|
||||||
@@ -90,10 +92,55 @@ export const userRouter = createTRPCRouter({
|
|||||||
|
|
||||||
await checkUsernameAlreadyTakenAndThrowAsync(ctx.db, "credentials", input.username);
|
await checkUsernameAlreadyTakenAndThrowAsync(ctx.db, "credentials", input.username);
|
||||||
|
|
||||||
await createUserAsync(ctx.db, input);
|
const salt = await createSaltAsync();
|
||||||
|
const hashedPassword = await hashPasswordAsync(input.password, salt);
|
||||||
|
|
||||||
// Delete invite as it's used
|
const userId = createId();
|
||||||
await ctx.db.delete(invites).where(inviteWhere);
|
const user = {
|
||||||
|
id: userId,
|
||||||
|
name: input.username,
|
||||||
|
password: hashedPassword,
|
||||||
|
salt,
|
||||||
|
};
|
||||||
|
|
||||||
|
await handleTransactionsAsync(ctx.db, {
|
||||||
|
async handleAsync(db, schema) {
|
||||||
|
await db.transaction(async (trx) => {
|
||||||
|
await trx.insert(schema.users).values(user);
|
||||||
|
|
||||||
|
// Delete invite as it's used
|
||||||
|
const queryResult = (await trx.delete(schema.invites).where(inviteWhere)) as
|
||||||
|
| QueryResult
|
||||||
|
| MySqlRawQueryResult;
|
||||||
|
let count = 0;
|
||||||
|
if (Array.isArray(queryResult)) {
|
||||||
|
count = queryResult[0].affectedRows;
|
||||||
|
} else {
|
||||||
|
count = queryResult.rowCount ?? 0;
|
||||||
|
}
|
||||||
|
if (count === 0) {
|
||||||
|
throw new TRPCError({
|
||||||
|
code: "FORBIDDEN",
|
||||||
|
message: "Invalid invite",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((trx) => {
|
||||||
|
trx.insert(users).values(user).run();
|
||||||
|
// Delete invite as it's used
|
||||||
|
const result = trx.delete(invites).where(inviteWhere).run();
|
||||||
|
|
||||||
|
if (result.changes === 0) {
|
||||||
|
throw new TRPCError({
|
||||||
|
code: "FORBIDDEN",
|
||||||
|
message: "Invalid invite",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
create: permissionRequiredProcedure
|
create: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"bcrypt": "^6.0.0",
|
"bcrypt": "^6.0.0",
|
||||||
"cookies": "^0.9.1",
|
"cookies": "^0.9.1",
|
||||||
"ldapts": "8.1.7",
|
"ldapts": "8.1.7",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"next-auth": "5.0.0-beta.30",
|
"next-auth": "5.0.0-beta.30",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"esbuild": "^0.27.3",
|
"esbuild": "^0.27.4",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@paralleldrive/cuid2": "^3.3.0",
|
"@paralleldrive/cuid2": "^3.3.0",
|
||||||
"cookie": "1.1.1",
|
"cookie": "1.1.1",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"octokit": "^5.0.5",
|
"octokit": "^5.0.5",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"undici": "7.18.2",
|
"undici": "7.24.5",
|
||||||
"zod": "^4.2.1",
|
"zod": "^4.2.1",
|
||||||
"zod-validation-error": "^5.0.0"
|
"zod-validation-error": "^5.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,12 +37,12 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@t3-oss/env-nextjs": "^0.13.10",
|
"@t3-oss/env-nextjs": "^0.13.11",
|
||||||
"better-sqlite3": "^12.6.2",
|
"better-sqlite3": "^12.6.2",
|
||||||
"dns-caching": "^0.2.9",
|
"dns-caching": "^0.2.9",
|
||||||
"drizzle-orm": "^0.45.1",
|
"drizzle-orm": "^0.45.1",
|
||||||
"ioredis": "5.10.0",
|
"ioredis": "5.10.1",
|
||||||
"mysql2": "3.19.1",
|
"mysql2": "3.20.0",
|
||||||
"pg": "^8.20.0",
|
"pg": "^8.20.0",
|
||||||
"superjson": "2.2.6",
|
"superjson": "2.2.6",
|
||||||
"winston": "3.19.0",
|
"winston": "3.19.0",
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/better-sqlite3": "7.6.13",
|
"@types/better-sqlite3": "7.6.13",
|
||||||
"@types/pg": "^8.18.0",
|
"@types/pg": "^8.20.0",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||||
"@tanstack/react-query": "^5.90.21",
|
"@tanstack/react-query": "^5.91.2",
|
||||||
"@trpc/client": "^11.12.0",
|
"@trpc/client": "^11.14.1",
|
||||||
"@trpc/server": "^11.12.0",
|
"@trpc/server": "^11.14.1",
|
||||||
"@trpc/tanstack-react-query": "^11.12.0",
|
"@trpc/tanstack-react-query": "^11.14.1",
|
||||||
"node-cron": "^4.2.1",
|
"node-cron": "^4.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
|
|||||||
@@ -47,16 +47,16 @@
|
|||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/definitions": "workspace:^0.1.0",
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@paralleldrive/cuid2": "^3.3.0",
|
"@paralleldrive/cuid2": "^3.3.0",
|
||||||
"@testcontainers/mysql": "^11.12.0",
|
"@testcontainers/mysql": "^11.13.0",
|
||||||
"@testcontainers/postgresql": "^11.12.0",
|
"@testcontainers/postgresql": "^11.13.0",
|
||||||
"better-sqlite3": "^12.6.2",
|
"better-sqlite3": "^12.6.2",
|
||||||
"dotenv": "^17.3.1",
|
"dotenv": "^17.3.1",
|
||||||
"drizzle-kit": "^0.31.9",
|
"drizzle-kit": "^0.31.10",
|
||||||
"drizzle-orm": "^0.45.1",
|
"drizzle-orm": "^0.45.1",
|
||||||
"drizzle-zod": "^0.8.3",
|
"drizzle-zod": "^0.8.3",
|
||||||
"mysql2": "3.19.1",
|
"mysql2": "3.20.0",
|
||||||
"pg": "^8.20.0",
|
"pg": "^8.20.0",
|
||||||
"superjson": "2.2.6"
|
"superjson": "2.2.6"
|
||||||
},
|
},
|
||||||
@@ -65,9 +65,9 @@
|
|||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/better-sqlite3": "7.6.13",
|
"@types/better-sqlite3": "7.6.13",
|
||||||
"@types/pg": "^8.18.0",
|
"@types/pg": "^8.20.0",
|
||||||
"dotenv-cli": "^11.0.0",
|
"dotenv-cli": "^11.0.0",
|
||||||
"esbuild": "^0.27.3",
|
"esbuild": "^0.27.4",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"tsx": "4.20.4",
|
"tsx": "4.20.4",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"fast-xml-parser": "^5.4.2",
|
"fast-xml-parser": "^5.5.8",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ export const integrationDefs = {
|
|||||||
name: "Nextcloud",
|
name: "Nextcloud",
|
||||||
secretKinds: [["username", "password"]],
|
secretKinds: [["username", "password"]],
|
||||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/nextcloud.svg",
|
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/nextcloud.svg",
|
||||||
category: ["calendar"],
|
category: ["calendar", "notifications"],
|
||||||
documentationUrl: createDocumentationLink("/docs/integrations/nextcloud"),
|
documentationUrl: createDocumentationLink("/docs/integrations/nextcloud"),
|
||||||
},
|
},
|
||||||
unifiController: {
|
unifiController: {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"dockerode": "^4.0.9"
|
"dockerode": "^4.0.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/form": "^8.3.16",
|
"@mantine/form": "^8.3.18",
|
||||||
"mantine-form-zod-resolver": "^1.3.0",
|
"mantine-form-zod-resolver": "^1.3.0",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
"@homarr/redis": "workspace:^0.1.0",
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@immich/sdk": "^2.5.6",
|
"@immich/sdk": "^2.6.1",
|
||||||
"@jellyfin/sdk": "^0.13.0",
|
"@jellyfin/sdk": "^0.13.0",
|
||||||
"@octokit/auth-app": "^8.2.0",
|
"@octokit/auth-app": "^8.2.0",
|
||||||
"ical.js": "^2.2.1",
|
"ical.js": "^2.2.1",
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
"octokit": "^5.0.5",
|
"octokit": "^5.0.5",
|
||||||
"proxmox-api": "1.1.1",
|
"proxmox-api": "1.1.1",
|
||||||
"tsdav": "^2.1.8",
|
"tsdav": "^2.1.8",
|
||||||
"undici": "7.18.2",
|
"undici": "7.24.5",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export class DashDotIntegration extends Integration implements ISystemHealthMoni
|
|||||||
const memoryLoad = await this.getCurrentMemoryLoadAsync();
|
const memoryLoad = await this.getCurrentMemoryLoadAsync();
|
||||||
const storageLoad = await this.getCurrentStorageLoadAsync();
|
const storageLoad = await this.getCurrentStorageLoadAsync();
|
||||||
const networkLoad = await this.getCurrentNetworkLoadAsync();
|
const networkLoad = await this.getCurrentNetworkLoadAsync();
|
||||||
|
const gpuLoad = await this.getCurrentGpuLoadAsync();
|
||||||
|
|
||||||
const channel = this.getChannel();
|
const channel = this.getChannel();
|
||||||
const history = await channel.getSliceUntilTimeAsync(dayjs().subtract(15, "minutes").toDate());
|
const history = await channel.getSliceUntilTimeAsync(dayjs().subtract(15, "minutes").toDate());
|
||||||
@@ -56,6 +57,14 @@ export class DashDotIntegration extends Integration implements ISystemHealthMoni
|
|||||||
availablePkgUpdates: 0,
|
availablePkgUpdates: 0,
|
||||||
rebootRequired: false,
|
rebootRequired: false,
|
||||||
smart: [], // API endpoint does not provide S.M.A.R.T data.
|
smart: [], // API endpoint does not provide S.M.A.R.T data.
|
||||||
|
gpu: gpuLoad.map((gpu, index) => ({
|
||||||
|
gpuId: `gpu-${index}`,
|
||||||
|
name: info.gpuNames[index] ?? `GPU ${index}`,
|
||||||
|
memoryUtilization: gpu.memory ?? 0,
|
||||||
|
processorUtilization: gpu.load ?? 0,
|
||||||
|
temperature: null,
|
||||||
|
fanSpeed: null,
|
||||||
|
})),
|
||||||
uptime: info.uptime,
|
uptime: info.uptime,
|
||||||
version: `${info.operatingSystemVersion}`,
|
version: `${info.operatingSystemVersion}`,
|
||||||
loadAverage: {
|
loadAverage: {
|
||||||
@@ -76,6 +85,7 @@ export class DashDotIntegration extends Integration implements ISystemHealthMoni
|
|||||||
cpuModel: serverInfo.cpu.model,
|
cpuModel: serverInfo.cpu.model,
|
||||||
operatingSystemVersion: `${serverInfo.os.distro} ${serverInfo.os.release} (${serverInfo.os.kernel})`,
|
operatingSystemVersion: `${serverInfo.os.distro} ${serverInfo.os.release} (${serverInfo.os.kernel})`,
|
||||||
uptime: serverInfo.os.uptime,
|
uptime: serverInfo.os.uptime,
|
||||||
|
gpuNames: serverInfo.gpu.layout.map((gpu) => gpu.brand),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +160,17 @@ export class DashDotIntegration extends Integration implements ISystemHealthMoni
|
|||||||
return await networkLoadApi.parseAsync(JSON.parse(result));
|
return await networkLoadApi.parseAsync(JSON.parse(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async getCurrentGpuLoadAsync() {
|
||||||
|
try {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/load/gpu"));
|
||||||
|
const result = await response.json();
|
||||||
|
const data = await gpuLoadApi.parseAsync(result);
|
||||||
|
return data.layout;
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private getChannel() {
|
private getChannel() {
|
||||||
return createChannelEventHistoryOld<z.infer<typeof cpuLoadPerCoreApiList>>(
|
return createChannelEventHistoryOld<z.infer<typeof cpuLoadPerCoreApiList>>(
|
||||||
`integration:${this.integration.id}:history:cpu`,
|
`integration:${this.integration.id}:history:cpu`,
|
||||||
@@ -198,6 +219,25 @@ const internalServerInfoApi = z.object({
|
|||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
gpu: z.object({
|
||||||
|
layout: z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
brand: z.string(),
|
||||||
|
model: z.string().optional(),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.default([]),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const cpuLoadPerCoreApiList = z.array(cpuLoadPerCoreApi);
|
const cpuLoadPerCoreApiList = z.array(cpuLoadPerCoreApi);
|
||||||
|
|
||||||
|
const gpuLoadApi = z.object({
|
||||||
|
layout: z.array(
|
||||||
|
z.object({
|
||||||
|
load: z.number().min(0).optional(),
|
||||||
|
memory: z.number().min(0).optional(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
});
|
||||||
@@ -59,6 +59,14 @@ export class GlancesIntegration extends Integration implements ISystemHealthMoni
|
|||||||
loadAverage: null,
|
loadAverage: null,
|
||||||
smart: [],
|
smart: [],
|
||||||
cpuTemp: undefined,
|
cpuTemp: undefined,
|
||||||
|
gpu: stats.gpu.map((gpu) => ({
|
||||||
|
gpuId: gpu.gpu_id,
|
||||||
|
name: gpu.name,
|
||||||
|
memoryUtilization: gpu.mem ?? 0,
|
||||||
|
processorUtilization: gpu.proc ?? 0,
|
||||||
|
temperature: gpu.temperature ?? null,
|
||||||
|
fanSpeed: gpu.fan_speed ?? null,
|
||||||
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,4 +158,16 @@ const allSchema = z.object({
|
|||||||
quicklook: z.object({
|
quicklook: z.object({
|
||||||
cpu_name: z.string(),
|
cpu_name: z.string(),
|
||||||
}),
|
}),
|
||||||
|
gpu: z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
gpu_id: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
mem: z.number().nullable().optional(),
|
||||||
|
proc: z.number().nullable().optional(),
|
||||||
|
temperature: z.number().nullable().optional(),
|
||||||
|
fan_speed: z.number().nullable().optional(),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.default([]),
|
||||||
});
|
});
|
||||||
@@ -31,6 +31,14 @@ export interface SystemHealthMonitoring {
|
|||||||
overallStatus: string;
|
overallStatus: string;
|
||||||
healthy: boolean;
|
healthy: boolean;
|
||||||
}[];
|
}[];
|
||||||
|
gpu: {
|
||||||
|
gpuId: string;
|
||||||
|
name: string;
|
||||||
|
memoryUtilization: number;
|
||||||
|
processorUtilization: number;
|
||||||
|
temperature: number | null;
|
||||||
|
fanSpeed: number | null;
|
||||||
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: in the future decouple this from the Proxmox integration
|
// TODO: in the future decouple this from the Proxmox integration
|
||||||
|
|||||||
@@ -36,6 +36,16 @@ export class SystemHealthMonitoringMockService implements ISystemHealthMonitorin
|
|||||||
healthy: true,
|
healthy: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
gpu: [
|
||||||
|
{
|
||||||
|
gpuId: "mock0",
|
||||||
|
name: "Mock GPU RTX 4090",
|
||||||
|
memoryUtilization: Math.floor(Math.random() * 100),
|
||||||
|
processorUtilization: Math.floor(Math.random() * 100),
|
||||||
|
temperature: Math.floor(Math.random() * 90),
|
||||||
|
fanSpeed: Math.floor(Math.random() * 2000),
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,10 @@ import utc from "dayjs/plugin/utc";
|
|||||||
import type { RequestInit as NodeFetchRequestInit } from "node-fetch";
|
import type { RequestInit as NodeFetchRequestInit } from "node-fetch";
|
||||||
import * as ical from "node-ical";
|
import * as ical from "node-ical";
|
||||||
import { DAVClient } from "tsdav";
|
import { DAVClient } from "tsdav";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
import { createHttpsAgentAsync } from "@homarr/core/infrastructure/http";
|
import { ResponseError } from "@homarr/common/server";
|
||||||
|
import { createHttpsAgentAsync, fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
|
|
||||||
import { HandleIntegrationErrors } from "../base/errors/decorator";
|
import { HandleIntegrationErrors } from "../base/errors/decorator";
|
||||||
@@ -16,6 +18,21 @@ import { Integration } from "../base/integration";
|
|||||||
import type { TestingResult } from "../base/test-connection/test-connection-service";
|
import type { TestingResult } from "../base/test-connection/test-connection-service";
|
||||||
import type { ICalendarIntegration } from "../interfaces/calendar/calendar-integration";
|
import type { ICalendarIntegration } from "../interfaces/calendar/calendar-integration";
|
||||||
import type { CalendarEvent } from "../interfaces/calendar/calendar-types";
|
import type { CalendarEvent } from "../interfaces/calendar/calendar-types";
|
||||||
|
import type { Notification } from "../interfaces/notifications/notification-types";
|
||||||
|
import type { INotificationsIntegration } from "../interfaces/notifications/notifications-integration";
|
||||||
|
|
||||||
|
const notificationSchema = z.object({
|
||||||
|
ocs: z.object({
|
||||||
|
data: z.array(
|
||||||
|
z.object({
|
||||||
|
notification_id: z.number(),
|
||||||
|
datetime: z.string(),
|
||||||
|
subject: z.string(),
|
||||||
|
message: z.string(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
const logger = createLogger({ module: "nextcloudIntegration" });
|
const logger = createLogger({ module: "nextcloudIntegration" });
|
||||||
|
|
||||||
@@ -23,7 +40,7 @@ dayjs.extend(utc);
|
|||||||
dayjs.extend(timezone);
|
dayjs.extend(timezone);
|
||||||
|
|
||||||
@HandleIntegrationErrors([integrationTsdavHttpErrorHandler])
|
@HandleIntegrationErrors([integrationTsdavHttpErrorHandler])
|
||||||
export class NextcloudIntegration extends Integration implements ICalendarIntegration {
|
export class NextcloudIntegration extends Integration implements ICalendarIntegration, INotificationsIntegration {
|
||||||
protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {
|
protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {
|
||||||
const client = await this.createCalendarClientAsync(await createHttpsAgentAsync(input.options));
|
const client = await this.createCalendarClientAsync(await createHttpsAgentAsync(input.options));
|
||||||
await client.login();
|
await client.login();
|
||||||
@@ -104,6 +121,29 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
|
|||||||
.flat();
|
.flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getNotificationsAsync(): Promise<Notification[]> {
|
||||||
|
const url = this.url("/ocs/v2.php/apps/notifications/api/v2/notifications", { format: "json" });
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(url, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Basic ${Buffer.from(
|
||||||
|
`${this.getSecretValue("username")}:${this.getSecretValue("password")}`,
|
||||||
|
).toString("base64")}`,
|
||||||
|
"OCS-APIRequest": "true",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) throw new ResponseError(response);
|
||||||
|
|
||||||
|
const json = notificationSchema.parse(await response.json());
|
||||||
|
|
||||||
|
return json.ocs.data.map((notification) => ({
|
||||||
|
id: String(notification.notification_id),
|
||||||
|
time: new Date(notification.datetime),
|
||||||
|
title: notification.subject,
|
||||||
|
body: notification.message,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
private async createCalendarClientAsync(agent?: Agent) {
|
private async createCalendarClientAsync(agent?: Agent) {
|
||||||
return new DAVClient({
|
return new DAVClient({
|
||||||
serverUrl: this.integration.url,
|
serverUrl: this.integration.url,
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export class OpenMediaVaultIntegration extends Integration implements ISystemHea
|
|||||||
cpuTemp: cpuTempResult.success ? cpuTempResult.data.response.cputemp : undefined,
|
cpuTemp: cpuTempResult.success ? cpuTempResult.data.response.cputemp : undefined,
|
||||||
fileSystem,
|
fileSystem,
|
||||||
smart,
|
smart,
|
||||||
|
gpu: [], // OpenMediaVault does not expose GPU monitoring via its RPC API.
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -297,6 +297,7 @@ export class TrueNasIntegration extends Integration implements ISystemHealthMoni
|
|||||||
version: systemInformation.version,
|
version: systemInformation.version,
|
||||||
cpuModelName: systemInformation.model,
|
cpuModelName: systemInformation.model,
|
||||||
rebootRequired: false,
|
rebootRequired: false,
|
||||||
|
gpu: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
|
|||||||
// See ArrayDiskStatus from https://studio.apollographql.com/public/Unraid-API/variant/current/explorer
|
// See ArrayDiskStatus from https://studio.apollographql.com/public/Unraid-API/variant/current/explorer
|
||||||
healthy: disk.status === "DISK_OK",
|
healthy: disk.status === "DISK_OK",
|
||||||
})),
|
})),
|
||||||
|
gpu: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,10 @@
|
|||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@tabler/icons-react": "^3.40.0",
|
"@tabler/icons-react": "^3.40.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
|
|||||||
@@ -57,10 +57,12 @@ export const AddBoardModal = createModal(({ actions }) => {
|
|||||||
{...form.getInputProps("name")}
|
{...form.getInputProps("name")}
|
||||||
description={
|
description={
|
||||||
boardNameStatus.description ? (
|
boardNameStatus.description ? (
|
||||||
<Group c={boardNameStatus.description.color} gap="xs" align="center">
|
<span>
|
||||||
{boardNameStatus.description.icon ? <boardNameStatus.description.icon size={16} /> : null}
|
<Group c={boardNameStatus.description.color} gap="xs" align="center">
|
||||||
<span>{boardNameStatus.description.label}</span>
|
{boardNameStatus.description.icon ? <boardNameStatus.description.icon size={16} /> : null}
|
||||||
</Group>
|
<span>{boardNameStatus.description.label}</span>
|
||||||
|
</Group>
|
||||||
|
</span>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const AddDockerAppToHomarrModal = createModal<AddDockerAppToHomarrProps>(
|
|||||||
{
|
{
|
||||||
initialValues: {
|
initialValues: {
|
||||||
containerUrls: innerProps.selectedContainers.map((container) => {
|
containerUrls: innerProps.selectedContainers.map((container) => {
|
||||||
if (container.ports[0]) {
|
if (Array.isArray(container.ports) && container.ports[0]) {
|
||||||
return `http://${container.ports[0].IP}:${container.ports[0].PublicPort}`;
|
return `http://${container.ports[0].IP}:${container.ports[0].PublicPort}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"react": "19.2.4"
|
"react": "19.2.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@mantine/notifications": "^8.3.16",
|
"@mantine/notifications": "^8.3.18",
|
||||||
"@tabler/icons-react": "^3.40.0"
|
"@tabler/icons-react": "^3.40.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -37,10 +37,10 @@
|
|||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"adm-zip": "0.5.16",
|
"adm-zip": "0.5.16",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"superjson": "2.2.6",
|
"superjson": "2.2.6",
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/adm-zip": "0.5.7",
|
"@types/adm-zip": "0.5.8",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ const optionMapping: OptionMapping = {
|
|||||||
allowMicrophone: (oldOptions) => oldOptions.allowMicrophone,
|
allowMicrophone: (oldOptions) => oldOptions.allowMicrophone,
|
||||||
allowGeolocation: (oldOptions) => oldOptions.allowGeolocation,
|
allowGeolocation: (oldOptions) => oldOptions.allowGeolocation,
|
||||||
allowScrolling: (oldOptions) => oldOptions.allowScrolling,
|
allowScrolling: (oldOptions) => oldOptions.allowScrolling,
|
||||||
|
allowModals: () => undefined,
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
feedUrl: (oldOptions) => oldOptions.FeedUrl,
|
feedUrl: (oldOptions) => oldOptions.FeedUrl,
|
||||||
@@ -161,6 +162,7 @@ const optionMapping: OptionMapping = {
|
|||||||
sectionIndicatorRequirement: (oldOptions) =>
|
sectionIndicatorRequirement: (oldOptions) =>
|
||||||
"sectionIndicatorColor" in oldOptions ? oldOptions.sectionIndicatorColor : undefined,
|
"sectionIndicatorColor" in oldOptions ? oldOptions.sectionIndicatorColor : undefined,
|
||||||
showUptime: () => undefined,
|
showUptime: () => undefined,
|
||||||
|
gpu: () => undefined,
|
||||||
visibleClusterSections: (oldOptions) => {
|
visibleClusterSections: (oldOptions) => {
|
||||||
if (!("showNode" in oldOptions)) return undefined;
|
if (!("showNode" in oldOptions)) return undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"@homarr/core": "workspace:^",
|
"@homarr/core": "workspace:^",
|
||||||
"@homarr/db": "workspace:^",
|
"@homarr/db": "workspace:^",
|
||||||
"@homarr/definitions": "workspace:^",
|
"@homarr/definitions": "workspace:^",
|
||||||
"ioredis": "5.10.0",
|
"ioredis": "5.10.1",
|
||||||
"superjson": "2.2.6"
|
"superjson": "2.2.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { LogLevel } from "@homarr/core/infrastructure/logs/constants";
|
import type { LogLevel } from "@homarr/core/infrastructure/logs/constants";
|
||||||
|
|
||||||
import { createCacheChannel, createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
|
import { createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
createCacheChannel,
|
createCacheChannel,
|
||||||
@@ -40,14 +40,3 @@ export interface LoggerMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const loggingChannel = createSubPubChannel<LoggerMessage>("logging");
|
export const loggingChannel = createSubPubChannel<LoggerMessage>("logging");
|
||||||
|
|
||||||
/**
|
|
||||||
* POC: Redis cache for widget prefetch data.
|
|
||||||
* Caches serialized query data per widget kind to avoid database queries on every page load.
|
|
||||||
* Default TTL: 5 minutes (matches existing cron job intervals).
|
|
||||||
*
|
|
||||||
* Usage: see packages/widgets/src/prefetch.ts
|
|
||||||
* This can be reverted by reverting this commit.
|
|
||||||
*/
|
|
||||||
export const createWidgetPrefetchCache = (widgetKind: string) =>
|
|
||||||
createCacheChannel<Record<string, unknown>>(`widget-prefetch:${widgetKind}`, 5 * 60 * 1000);
|
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
"@homarr/docker": "workspace:^0.1.0",
|
"@homarr/docker": "workspace:^0.1.0",
|
||||||
"@homarr/integrations": "workspace:^0.1.0",
|
"@homarr/integrations": "workspace:^0.1.0",
|
||||||
"@homarr/redis": "workspace:^0.1.0",
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"octokit": "^5.0.5",
|
"octokit": "^5.0.5",
|
||||||
"superjson": "2.2.6",
|
"superjson": "2.2.6",
|
||||||
"undici": "7.18.2",
|
"undici": "7.24.5",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import type { ContainerInfo, ContainerStats } from "dockerode";
|
import type { ContainerInfo, ContainerStats } from "dockerode";
|
||||||
|
import type Dockerode from "dockerode";
|
||||||
|
|
||||||
import { db, like, or } from "@homarr/db";
|
import { db, like, or } from "@homarr/db";
|
||||||
import { icons } from "@homarr/db/schema";
|
import { icons } from "@homarr/db/schema";
|
||||||
@@ -72,7 +73,7 @@ async function getContainersWithStatsAsync() {
|
|||||||
cpuUsage,
|
cpuUsage,
|
||||||
memoryUsage,
|
memoryUsage,
|
||||||
image: container.Image,
|
image: container.Image,
|
||||||
ports: container.Ports,
|
ports: container.Ports as Dockerode.Port[] | undefined,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@mantine/dates": "^8.3.16",
|
"@mantine/dates": "^8.3.18",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4"
|
"react-dom": "19.2.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,12 +33,12 @@
|
|||||||
"@homarr/settings": "workspace:^0.1.0",
|
"@homarr/settings": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"@mantine/spotlight": "^8.3.16",
|
"@mantine/spotlight": "^8.3.18",
|
||||||
"@tabler/icons-react": "^3.40.0",
|
"@tabler/icons-react": "^3.40.0",
|
||||||
"jotai": "^2.18.1",
|
"jotai": "^2.18.1",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"use-deep-compare-effect": "^1.8.1"
|
"use-deep-compare-effect": "^1.8.1"
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ const createSpotlightContext = (displayName: string) => {
|
|||||||
context.unregisterItems(key);
|
context.unregisterItems(key);
|
||||||
};
|
};
|
||||||
// We ignore the results
|
// We ignore the results
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [...dependencyArray, key]);
|
}, [...dependencyArray, key]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/definitions": "workspace:^0.1.0",
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"mantine-react-table": "2.0.0-beta.9",
|
"mantine-react-table": "2.0.0-beta.9",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"next-intl": "4.8.3",
|
"next-intl": "4.8.3",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4"
|
"react-dom": "19.2.4"
|
||||||
|
|||||||
@@ -2001,7 +2001,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"option": {
|
"option": {
|
||||||
"showStreams": {
|
"showStreams": {
|
||||||
"label": ""
|
"label": "Aktive Streams anzeigen"
|
||||||
},
|
},
|
||||||
"showStats": {
|
"showStats": {
|
||||||
"label": ""
|
"label": ""
|
||||||
@@ -2014,7 +2014,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stats": {
|
"stats": {
|
||||||
"activeStreams": "",
|
"activeStreams": "Aktive Streams",
|
||||||
"totalUsers": "",
|
"totalUsers": "",
|
||||||
"transcodes": "",
|
"transcodes": "",
|
||||||
"bandwidth": ""
|
"bandwidth": ""
|
||||||
@@ -2151,7 +2151,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"option": {
|
"option": {
|
||||||
"showUsers": {
|
"showUsers": {
|
||||||
"label": "",
|
"label": "Benutzer anzeigen",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"showPhotos": {
|
"showPhotos": {
|
||||||
|
|||||||
@@ -1689,171 +1689,171 @@
|
|||||||
"label": "3 Months"
|
"label": "3 Months"
|
||||||
},
|
},
|
||||||
"6mo": {
|
"6mo": {
|
||||||
"label": ""
|
"label": "6 Months"
|
||||||
},
|
},
|
||||||
"ytd": {
|
"ytd": {
|
||||||
"label": ""
|
"label": "Year to Date"
|
||||||
},
|
},
|
||||||
"1y": {
|
"1y": {
|
||||||
"label": ""
|
"label": "1 Year"
|
||||||
},
|
},
|
||||||
"2y": {
|
"2y": {
|
||||||
"label": ""
|
"label": "2 Years"
|
||||||
},
|
},
|
||||||
"5y": {
|
"5y": {
|
||||||
"label": ""
|
"label": "5 Years"
|
||||||
},
|
},
|
||||||
"10y": {
|
"10y": {
|
||||||
"label": ""
|
"label": "10 Years"
|
||||||
},
|
},
|
||||||
"max": {
|
"max": {
|
||||||
"label": ""
|
"label": "Max"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"timeInterval": {
|
"timeInterval": {
|
||||||
"label": "",
|
"label": "Time Interval",
|
||||||
"option": {
|
"option": {
|
||||||
"5m": {
|
"5m": {
|
||||||
"label": ""
|
"label": "5 Minutes"
|
||||||
},
|
},
|
||||||
"15m": {
|
"15m": {
|
||||||
"label": ""
|
"label": "15 Minutes"
|
||||||
},
|
},
|
||||||
"30m": {
|
"30m": {
|
||||||
"label": ""
|
"label": "30 Minutes"
|
||||||
},
|
},
|
||||||
"1h": {
|
"1h": {
|
||||||
"label": ""
|
"label": "1 Hour"
|
||||||
},
|
},
|
||||||
"1d": {
|
"1d": {
|
||||||
"label": ""
|
"label": "1 Day"
|
||||||
},
|
},
|
||||||
"5d": {
|
"5d": {
|
||||||
"label": ""
|
"label": "5 Days"
|
||||||
},
|
},
|
||||||
"1wk": {
|
"1wk": {
|
||||||
"label": ""
|
"label": "1 Week"
|
||||||
},
|
},
|
||||||
"1mo": {
|
"1mo": {
|
||||||
"label": ""
|
"label": "1 Month"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"calendar": {
|
"calendar": {
|
||||||
"name": "",
|
"name": "Calendar",
|
||||||
"description": "",
|
"description": "Display events from your integrations in a calendar view within a certain relative time period",
|
||||||
"duration": {
|
"duration": {
|
||||||
"allDay": ""
|
"allDay": "All day"
|
||||||
},
|
},
|
||||||
"option": {
|
"option": {
|
||||||
"releaseType": {
|
"releaseType": {
|
||||||
"label": "",
|
"label": "Radarr release type",
|
||||||
"options": {
|
"options": {
|
||||||
"inCinemas": "",
|
"inCinemas": "In cinemas",
|
||||||
"digitalRelease": "",
|
"digitalRelease": "Digital release",
|
||||||
"physicalRelease": ""
|
"physicalRelease": "Physical release"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"filterPastMonths": {
|
"filterPastMonths": {
|
||||||
"label": ""
|
"label": "Start from"
|
||||||
},
|
},
|
||||||
"filterFutureMonths": {
|
"filterFutureMonths": {
|
||||||
"label": ""
|
"label": "End at"
|
||||||
},
|
},
|
||||||
"showUnmonitored": {
|
"showUnmonitored": {
|
||||||
"label": ""
|
"label": "Show unmonitored"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"weather": {
|
"weather": {
|
||||||
"name": "",
|
"name": "Weather",
|
||||||
"description": "",
|
"description": "Displays the current weather information of a set location.",
|
||||||
"option": {
|
"option": {
|
||||||
"isFormatFahrenheit": {
|
"isFormatFahrenheit": {
|
||||||
"label": ""
|
"label": "Temperature in Fahrenheit"
|
||||||
},
|
},
|
||||||
"disableTemperatureDecimals": {
|
"disableTemperatureDecimals": {
|
||||||
"label": ""
|
"label": "Disable temperature decimals"
|
||||||
},
|
},
|
||||||
"showCurrentWindSpeed": {
|
"showCurrentWindSpeed": {
|
||||||
"label": "",
|
"label": "Show current wind speed",
|
||||||
"description": ""
|
"description": "Only on current weather"
|
||||||
},
|
},
|
||||||
"useImperialSpeed": {
|
"useImperialSpeed": {
|
||||||
"label": ""
|
"label": "Use mph for windspeed"
|
||||||
},
|
},
|
||||||
"location": {
|
"location": {
|
||||||
"label": ""
|
"label": "Weather location"
|
||||||
},
|
},
|
||||||
"showCity": {
|
"showCity": {
|
||||||
"label": ""
|
"label": "Show city"
|
||||||
},
|
},
|
||||||
"hasForecast": {
|
"hasForecast": {
|
||||||
"label": ""
|
"label": "Show forecast"
|
||||||
},
|
},
|
||||||
"forecastDayCount": {
|
"forecastDayCount": {
|
||||||
"label": "",
|
"label": "Amount of forecast days",
|
||||||
"description": ""
|
"description": "When the widget is not wide enough, less days are shown"
|
||||||
},
|
},
|
||||||
"dateFormat": {
|
"dateFormat": {
|
||||||
"label": "",
|
"label": "Date Format",
|
||||||
"description": ""
|
"description": "How the date should look like"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"currentWindSpeed": "",
|
"currentWindSpeed": "{currentWindSpeed} {unit}",
|
||||||
"dailyForecast": {
|
"dailyForecast": {
|
||||||
"sunrise": "",
|
"sunrise": "Sunrise",
|
||||||
"sunset": "",
|
"sunset": "Sunset",
|
||||||
"maxWindSpeed": "",
|
"maxWindSpeed": "Max wind speed: {maxWindSpeed} {unit}",
|
||||||
"maxWindGusts": ""
|
"maxWindGusts": "Max wind gusts: {maxWindGusts} {unit}"
|
||||||
},
|
},
|
||||||
"kind": {
|
"kind": {
|
||||||
"clear": "",
|
"clear": "Clear",
|
||||||
"mainlyClear": "",
|
"mainlyClear": "Mainly clear",
|
||||||
"fog": "",
|
"fog": "Fog",
|
||||||
"drizzle": "",
|
"drizzle": "Drizzle",
|
||||||
"freezingDrizzle": "",
|
"freezingDrizzle": "Freezing drizzle",
|
||||||
"rain": "Rain",
|
"rain": "Rain",
|
||||||
"freezingRain": "Freezing rain",
|
"freezingRain": "Freezing rain",
|
||||||
"snowFall": "Snow fall",
|
"snowFall": "Snow fall",
|
||||||
"snowGrains": "",
|
"snowGrains": "Snow grains",
|
||||||
"rainShowers": "",
|
"rainShowers": "Rain showers",
|
||||||
"snowShowers": "",
|
"snowShowers": "Snow showers",
|
||||||
"thunderstorm": "",
|
"thunderstorm": "Thunderstorm",
|
||||||
"thunderstormWithHail": "",
|
"thunderstormWithHail": "Thunderstorm with hail",
|
||||||
"unknown": ""
|
"unknown": "Unknown"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"indexerManager": {
|
"indexerManager": {
|
||||||
"name": "",
|
"name": "Indexer manager status",
|
||||||
"description": "",
|
"description": "Status of your indexers",
|
||||||
"option": {
|
"option": {
|
||||||
"openIndexerSiteInNewTab": {
|
"openIndexerSiteInNewTab": {
|
||||||
"label": ""
|
"label": "Open indexer site in new tab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title": "",
|
"title": "Indexer manager",
|
||||||
"testAll": "",
|
"testAll": "Test all",
|
||||||
"error": {
|
"error": {
|
||||||
"internalServerError": ""
|
"internalServerError": "Failed to fetch indexers status"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"healthMonitoring": {
|
"healthMonitoring": {
|
||||||
"name": "",
|
"name": "System Health Monitoring",
|
||||||
"description": "",
|
"description": "Displays information showing the health and status of your system(s).",
|
||||||
"tab": {
|
"tab": {
|
||||||
"system": "",
|
"system": "System",
|
||||||
"cluster": ""
|
"cluster": "Cluster"
|
||||||
},
|
},
|
||||||
"option": {
|
"option": {
|
||||||
"fahrenheit": {
|
"fahrenheit": {
|
||||||
"label": ""
|
"label": "CPU Temp in Fahrenheit"
|
||||||
},
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"label": ""
|
"label": "Show CPU Info"
|
||||||
},
|
},
|
||||||
"memory": {
|
"memory": {
|
||||||
"label": ""
|
"label": ""
|
||||||
|
|||||||
@@ -1625,6 +1625,9 @@
|
|||||||
},
|
},
|
||||||
"allowGeolocation": {
|
"allowGeolocation": {
|
||||||
"label": "Allow geolocation"
|
"label": "Allow geolocation"
|
||||||
|
},
|
||||||
|
"allowModals": {
|
||||||
|
"label": "Allow modals"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
@@ -1858,6 +1861,9 @@
|
|||||||
"memory": {
|
"memory": {
|
||||||
"label": "Show Memory Info"
|
"label": "Show Memory Info"
|
||||||
},
|
},
|
||||||
|
"gpu": {
|
||||||
|
"label": "Show GPU Info"
|
||||||
|
},
|
||||||
"showUptime": {
|
"showUptime": {
|
||||||
"label": "Show Uptime"
|
"label": "Show Uptime"
|
||||||
},
|
},
|
||||||
@@ -2725,6 +2731,7 @@
|
|||||||
"option": {
|
"option": {
|
||||||
"cpu": "CPU",
|
"cpu": "CPU",
|
||||||
"memory": "Memory",
|
"memory": "Memory",
|
||||||
|
"gpu": "GPU",
|
||||||
"network": "Network"
|
"network": "Network"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2741,6 +2748,7 @@
|
|||||||
"card": {
|
"card": {
|
||||||
"cpu": "CPU",
|
"cpu": "CPU",
|
||||||
"memory": "MEM",
|
"memory": "MEM",
|
||||||
|
"gpu": "GPU",
|
||||||
"network": "NET",
|
"network": "NET",
|
||||||
"up": "UP",
|
"up": "UP",
|
||||||
"down": "DOWN"
|
"down": "DOWN"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
"description": "Configurer le comportement d'importation"
|
"description": "Configurer le comportement d'importation"
|
||||||
},
|
},
|
||||||
"boardSelection": {
|
"boardSelection": {
|
||||||
"title": "Tableaux {count} trouvés",
|
"title": "{count} tableaux trouvés",
|
||||||
"description": "Choisissez tous les tableaux avec la taille que vous souhaitez importer",
|
"description": "Choisissez tous les tableaux avec la taille que vous souhaitez importer",
|
||||||
"action": {
|
"action": {
|
||||||
"selectAll": "Tout sélectionner",
|
"selectAll": "Tout sélectionner",
|
||||||
@@ -1997,36 +1997,36 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"name": "",
|
"name": "Tracearr",
|
||||||
"description": "",
|
"description": "Surveillance avancée du serveur multimédia avec des données détaillées de flux et de transcodage",
|
||||||
"option": {
|
"option": {
|
||||||
"showStreams": {
|
"showStreams": {
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
},
|
||||||
"showStats": {
|
"showStats": {
|
||||||
"label": ""
|
"label": "Afficher le résumé des statistiques"
|
||||||
},
|
},
|
||||||
"showRecentActivity": {
|
"showRecentActivity": {
|
||||||
"label": ""
|
"label": "Afficher l'activité récente"
|
||||||
},
|
},
|
||||||
"showViolations": {
|
"showViolations": {
|
||||||
"label": ""
|
"label": "Afficher les violations"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stats": {
|
"stats": {
|
||||||
"activeStreams": "",
|
"activeStreams": "",
|
||||||
"totalUsers": "",
|
"totalUsers": "Utilisateurs totaux",
|
||||||
"transcodes": "",
|
"transcodes": "",
|
||||||
"bandwidth": ""
|
"bandwidth": "Bande passante"
|
||||||
},
|
},
|
||||||
"streams": {
|
"streams": {
|
||||||
"empty": "",
|
"empty": "",
|
||||||
"user": "",
|
"user": "Utilisateur",
|
||||||
"media": "",
|
"media": "Média",
|
||||||
"state": "",
|
"state": "",
|
||||||
"quality": "",
|
"quality": "Qualité",
|
||||||
"device": "",
|
"device": "Appareil",
|
||||||
"progress": "",
|
"progress": "Progression",
|
||||||
"videoDecision": {
|
"videoDecision": {
|
||||||
"directPlay": "",
|
"directPlay": "",
|
||||||
"transcode": "",
|
"transcode": "",
|
||||||
@@ -2034,21 +2034,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"recentActivity": {
|
"recentActivity": {
|
||||||
"title": "",
|
"title": "Activité récente",
|
||||||
"empty": "",
|
"empty": "Aucune activité récente",
|
||||||
"watched": "",
|
"watched": "",
|
||||||
"partial": ""
|
"partial": ""
|
||||||
},
|
},
|
||||||
"violations": {
|
"violations": {
|
||||||
"title": "",
|
"title": "Violations",
|
||||||
"empty": "",
|
"empty": "Aucune violation récente",
|
||||||
"rule": "",
|
"rule": "Règle",
|
||||||
"user": ""
|
"user": "Utilisateur"
|
||||||
},
|
},
|
||||||
"noSectionsEnabled": "",
|
"noSectionsEnabled": "",
|
||||||
"error": {
|
"error": {
|
||||||
"noIntegration": "",
|
"noIntegration": "Aucune intégration Tracearr configurée",
|
||||||
"internalServerError": ""
|
"internalServerError": "Impossible de récupérer les données de Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
@@ -2147,50 +2147,50 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"immich-serverStats": {
|
"immich-serverStats": {
|
||||||
"name": "",
|
"name": "Statistiques du serveur Immich",
|
||||||
"description": "",
|
"description": "Informations sur votre instance Immich",
|
||||||
"option": {
|
"option": {
|
||||||
"showUsers": {
|
"showUsers": {
|
||||||
"label": "",
|
"label": "Afficher les utilisateurs",
|
||||||
"description": ""
|
"description": "Afficher le nombre d'utilisateurs de l'instance"
|
||||||
},
|
},
|
||||||
"showPhotos": {
|
"showPhotos": {
|
||||||
"label": "",
|
"label": "Afficher les photos",
|
||||||
"description": ""
|
"description": "Afficher le nombre de photos de l'instance"
|
||||||
},
|
},
|
||||||
"showVideos": {
|
"showVideos": {
|
||||||
"label": "",
|
"label": "Afficher les vidéos",
|
||||||
"description": ""
|
"description": "Afficher le nombre de vidéos de l'instance"
|
||||||
},
|
},
|
||||||
"showStorage": {
|
"showStorage": {
|
||||||
"label": "",
|
"label": "Affiche le stockage",
|
||||||
"description": ""
|
"description": "Afficher le stockage total utilisé"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"users": "",
|
"users": "Utilisateurs",
|
||||||
"photos": "",
|
"photos": "Photos",
|
||||||
"videos": "",
|
"videos": "Vidéos",
|
||||||
"storage": ""
|
"storage": "Stockage utilisé"
|
||||||
},
|
},
|
||||||
"immich-albumCarousel": {
|
"immich-albumCarousel": {
|
||||||
"name": "",
|
"name": "Album Immich",
|
||||||
"option": {
|
"option": {
|
||||||
"albumId": {
|
"albumId": {
|
||||||
"label": "",
|
"label": "Identifiant de l'album",
|
||||||
"description": ""
|
"description": "C'est l'identifiant unique qui correspond à l'album Immich. Vous pouvez le trouver en ouvrant un album et copiant l'identifiant unique depuis l'URL, par exemple 'a21aca09-9f05-47dc-b1a1-7b53c547226e'"
|
||||||
},
|
},
|
||||||
"rotationIntervalSeconds": {
|
"rotationIntervalSeconds": {
|
||||||
"label": "",
|
"label": "Intervalle en secondes",
|
||||||
"description": ""
|
"description": "Rotation entre les images de l'album chaque X secondes. Doit être entre 1 et 3600."
|
||||||
},
|
},
|
||||||
"showPhotoInfo": {
|
"showPhotoInfo": {
|
||||||
"label": "",
|
"label": "Afficher les informations de la photo",
|
||||||
"description": ""
|
"description": "Afficher la date et l'index de la photo en bas du diaporama"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "",
|
"description": "Diaporama de photos dans votre album Immich",
|
||||||
"noAlbumSelected": "",
|
"noAlbumSelected": "Aucun album sélectionné, modifier le widget et choisissez un album",
|
||||||
"noPhotos": ""
|
"noPhotos": "Aucune photo dans cet album"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"name": "Client de téléchargement",
|
"name": "Client de téléchargement",
|
||||||
@@ -3575,7 +3575,7 @@
|
|||||||
"label": "Météo"
|
"label": "Météo"
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"label": ""
|
"label": "Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"interval": {
|
"interval": {
|
||||||
|
|||||||
@@ -1997,46 +1997,46 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"name": "",
|
"name": "Tracearr",
|
||||||
"description": "",
|
"description": "Monitoraggio avanzato del server multimediale con dati dettagliati su streaming e transcodifica",
|
||||||
"option": {
|
"option": {
|
||||||
"showStreams": {
|
"showStreams": {
|
||||||
"label": ""
|
"label": "Mostra stream attivo"
|
||||||
},
|
},
|
||||||
"showStats": {
|
"showStats": {
|
||||||
"label": ""
|
"label": "Mostra riepilogo statistiche"
|
||||||
},
|
},
|
||||||
"showRecentActivity": {
|
"showRecentActivity": {
|
||||||
"label": ""
|
"label": "Mostra attività recenti"
|
||||||
},
|
},
|
||||||
"showViolations": {
|
"showViolations": {
|
||||||
"label": ""
|
"label": "Visualizza violazioni"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stats": {
|
"stats": {
|
||||||
"activeStreams": "",
|
"activeStreams": "Stream Attivi",
|
||||||
"totalUsers": "Utenti Totali",
|
"totalUsers": "Utenti Totali",
|
||||||
"transcodes": "",
|
"transcodes": "Transcodifiche",
|
||||||
"bandwidth": ""
|
"bandwidth": "Larghezza banda"
|
||||||
},
|
},
|
||||||
"streams": {
|
"streams": {
|
||||||
"empty": "",
|
"empty": "Nessun stream attivo",
|
||||||
"user": "Utente",
|
"user": "Utente",
|
||||||
"media": "",
|
"media": "Multimedia",
|
||||||
"state": "",
|
"state": "Stato",
|
||||||
"quality": "",
|
"quality": "Qualità",
|
||||||
"device": "Dispositivo",
|
"device": "Dispositivo",
|
||||||
"progress": "Avanzamento",
|
"progress": "Avanzamento",
|
||||||
"videoDecision": {
|
"videoDecision": {
|
||||||
"directPlay": "",
|
"directPlay": "Riproduzione diretta",
|
||||||
"transcode": "",
|
"transcode": "Transcodifica",
|
||||||
"directStream": ""
|
"directStream": "Streaming Diretto"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"recentActivity": {
|
"recentActivity": {
|
||||||
"title": "",
|
"title": "Attività recenti",
|
||||||
"empty": "",
|
"empty": "Nessuna attività recente",
|
||||||
"watched": "",
|
"watched": "Guardato",
|
||||||
"partial": "Parziale"
|
"partial": "Parziale"
|
||||||
},
|
},
|
||||||
"violations": {
|
"violations": {
|
||||||
@@ -2047,8 +2047,8 @@
|
|||||||
},
|
},
|
||||||
"noSectionsEnabled": "Nessuna sezione abilitata",
|
"noSectionsEnabled": "Nessuna sezione abilitata",
|
||||||
"error": {
|
"error": {
|
||||||
"noIntegration": "",
|
"noIntegration": "Nessuna integrazione Tracearr configurata",
|
||||||
"internalServerError": ""
|
"internalServerError": "Impossibile recuperare i dati di Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
@@ -3575,7 +3575,7 @@
|
|||||||
"label": "Meteo"
|
"label": "Meteo"
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"label": ""
|
"label": "Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"interval": {
|
"interval": {
|
||||||
|
|||||||
@@ -764,7 +764,7 @@
|
|||||||
"expired": "Het certificaat is verlopen.",
|
"expired": "Het certificaat is verlopen.",
|
||||||
"notYetValid": "Het certificaat is nog niet geldig.",
|
"notYetValid": "Het certificaat is nog niet geldig.",
|
||||||
"untrusted": "Het certificaat wordt niet vertrouwd.",
|
"untrusted": "Het certificaat wordt niet vertrouwd.",
|
||||||
"hostnameMismatch": ""
|
"hostnameMismatch": "Het certificaat hostname komt niet overeen met de URL."
|
||||||
},
|
},
|
||||||
"alert": {
|
"alert": {
|
||||||
"permission": {
|
"permission": {
|
||||||
|
|||||||
@@ -1997,58 +1997,58 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"name": "",
|
"name": "Tracearr",
|
||||||
"description": "",
|
"description": "Мониторинг медиасервера с детальной информацией о потоках и транскодировании",
|
||||||
"option": {
|
"option": {
|
||||||
"showStreams": {
|
"showStreams": {
|
||||||
"label": ""
|
"label": "Показать активные потоки"
|
||||||
},
|
},
|
||||||
"showStats": {
|
"showStats": {
|
||||||
"label": ""
|
"label": "Показать сводку статистики"
|
||||||
},
|
},
|
||||||
"showRecentActivity": {
|
"showRecentActivity": {
|
||||||
"label": ""
|
"label": "Показать недавнюю активность"
|
||||||
},
|
},
|
||||||
"showViolations": {
|
"showViolations": {
|
||||||
"label": ""
|
"label": "Показать нарушения"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stats": {
|
"stats": {
|
||||||
"activeStreams": "",
|
"activeStreams": "Активные потоки",
|
||||||
"totalUsers": "",
|
"totalUsers": "Всего пользователей",
|
||||||
"transcodes": "",
|
"transcodes": "Транскодирования",
|
||||||
"bandwidth": ""
|
"bandwidth": "Пропускная способность"
|
||||||
},
|
},
|
||||||
"streams": {
|
"streams": {
|
||||||
"empty": "",
|
"empty": "Нет активных потоков",
|
||||||
"user": "",
|
"user": "Пользователь",
|
||||||
"media": "",
|
"media": "Медиа",
|
||||||
"state": "",
|
"state": "Состояние",
|
||||||
"quality": "",
|
"quality": "Качество",
|
||||||
"device": "",
|
"device": "Устройство",
|
||||||
"progress": "",
|
"progress": "Прогресс",
|
||||||
"videoDecision": {
|
"videoDecision": {
|
||||||
"directPlay": "",
|
"directPlay": "Прямое воспроизведение",
|
||||||
"transcode": "",
|
"transcode": "Транскодирование",
|
||||||
"directStream": ""
|
"directStream": "Прямой поток"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"recentActivity": {
|
"recentActivity": {
|
||||||
"title": "",
|
"title": "Недавняя активность",
|
||||||
"empty": "",
|
"empty": "Нет недавней активности",
|
||||||
"watched": "",
|
"watched": "Просмотрено",
|
||||||
"partial": ""
|
"partial": "Частично"
|
||||||
},
|
},
|
||||||
"violations": {
|
"violations": {
|
||||||
"title": "",
|
"title": "Нарушения",
|
||||||
"empty": "",
|
"empty": "Нет недавних нарушений",
|
||||||
"rule": "",
|
"rule": "Правило",
|
||||||
"user": ""
|
"user": "Пользователь"
|
||||||
},
|
},
|
||||||
"noSectionsEnabled": "",
|
"noSectionsEnabled": "Секции не включены",
|
||||||
"error": {
|
"error": {
|
||||||
"noIntegration": "",
|
"noIntegration": "Интеграция Tracearr не настроена",
|
||||||
"internalServerError": ""
|
"internalServerError": "Не удалось получить данные Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
@@ -3575,7 +3575,7 @@
|
|||||||
"label": "Погода"
|
"label": "Погода"
|
||||||
},
|
},
|
||||||
"tracearr": {
|
"tracearr": {
|
||||||
"label": ""
|
"label": "Tracearr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"interval": {
|
"interval": {
|
||||||
|
|||||||
@@ -30,13 +30,13 @@
|
|||||||
"@homarr/settings": "workspace:^0.1.0",
|
"@homarr/settings": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/dates": "^8.3.16",
|
"@mantine/dates": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"@tabler/icons-react": "^3.40.0",
|
"@tabler/icons-react": "^3.40.0",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"mantine-react-table": "2.0.0-beta.9",
|
"mantine-react-table": "2.0.0-beta.9",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"svgson": "^5.3.1"
|
"svgson": "^5.3.1"
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* Sanitizes the URL from malicious payloads.
|
||||||
|
* Prevents open redirects such as //example.com/path
|
||||||
|
* and prevents XSS such as javascript:().
|
||||||
|
* Returns / as a default or when unsafe.
|
||||||
|
* @param url The URL to sanitize
|
||||||
|
*/
|
||||||
|
export const sanitizeRedirectionUrl = (url?: string) => {
|
||||||
|
if (url && url.startsWith("/") && !url.startsWith("//")) {
|
||||||
|
return url;
|
||||||
|
} else {
|
||||||
|
return "/"; // Safe default
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -48,31 +48,31 @@
|
|||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@mantine/charts": "^8.3.16",
|
"@mantine/charts": "^8.3.18",
|
||||||
"@mantine/core": "^8.3.16",
|
"@mantine/core": "^8.3.18",
|
||||||
"@mantine/hooks": "^8.3.16",
|
"@mantine/hooks": "^8.3.18",
|
||||||
"@tabler/icons-react": "^3.40.0",
|
"@tabler/icons-react": "^3.40.0",
|
||||||
"@tiptap/extension-color": "3.20.1",
|
"@tiptap/extension-color": "3.20.4",
|
||||||
"@tiptap/extension-highlight": "3.20.1",
|
"@tiptap/extension-highlight": "3.20.4",
|
||||||
"@tiptap/extension-image": "3.20.1",
|
"@tiptap/extension-image": "3.20.4",
|
||||||
"@tiptap/extension-link": "^3.20.1",
|
"@tiptap/extension-link": "^3.20.4",
|
||||||
"@tiptap/extension-placeholder": "^3.20.1",
|
"@tiptap/extension-placeholder": "^3.20.4",
|
||||||
"@tiptap/extension-table": "3.20.1",
|
"@tiptap/extension-table": "3.20.4",
|
||||||
"@tiptap/extension-table-cell": "3.20.1",
|
"@tiptap/extension-table-cell": "3.20.4",
|
||||||
"@tiptap/extension-table-header": "3.20.1",
|
"@tiptap/extension-table-header": "3.20.4",
|
||||||
"@tiptap/extension-table-row": "3.20.1",
|
"@tiptap/extension-table-row": "3.20.4",
|
||||||
"@tiptap/extension-task-item": "3.20.1",
|
"@tiptap/extension-task-item": "3.20.4",
|
||||||
"@tiptap/extension-task-list": "3.20.1",
|
"@tiptap/extension-task-list": "3.20.4",
|
||||||
"@tiptap/extension-text-align": "3.20.1",
|
"@tiptap/extension-text-align": "3.20.4",
|
||||||
"@tiptap/extension-text-style": "3.20.1",
|
"@tiptap/extension-text-style": "3.20.4",
|
||||||
"@tiptap/extension-underline": "3.20.1",
|
"@tiptap/extension-underline": "3.20.4",
|
||||||
"@tiptap/react": "^3.20.1",
|
"@tiptap/react": "^3.20.4",
|
||||||
"@tiptap/starter-kit": "^3.20.1",
|
"@tiptap/starter-kit": "^3.20.4",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.20",
|
||||||
"mantine-form-zod-resolver": "^1.3.0",
|
"mantine-form-zod-resolver": "^1.3.0",
|
||||||
"mantine-react-table": "2.0.0-beta.9",
|
"mantine-react-table": "2.0.0-beta.9",
|
||||||
"next": "16.1.6",
|
"next": "16.2.1",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"react-markdown": "^10.1.0",
|
"react-markdown": "^10.1.0",
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ export const { definition, componentLoader } = createWidgetDefinition("healthMon
|
|||||||
memory: factory.switch({
|
memory: factory.switch({
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
}),
|
}),
|
||||||
|
gpu: factory.switch({
|
||||||
|
defaultValue: true,
|
||||||
|
}),
|
||||||
showUptime: factory.switch({
|
showUptime: factory.switch({
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
import { Center, RingProgress, Stack, Text, Tooltip } from "@mantine/core";
|
||||||
|
import { IconDeviceDesktop } from "@tabler/icons-react";
|
||||||
|
|
||||||
|
import { progressColor } from "../system-health";
|
||||||
|
|
||||||
|
interface GpuRingProps {
|
||||||
|
gpu: {
|
||||||
|
gpuId: string;
|
||||||
|
name: string;
|
||||||
|
memoryUtilization: number;
|
||||||
|
processorUtilization: number;
|
||||||
|
temperature: number | null;
|
||||||
|
fanSpeed: number | null;
|
||||||
|
};
|
||||||
|
isTiny: boolean;
|
||||||
|
fahrenheit: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const GpuRing = ({ gpu, isTiny, fahrenheit }: GpuRingProps) => {
|
||||||
|
const tempDisplay =
|
||||||
|
gpu.temperature != null
|
||||||
|
? fahrenheit
|
||||||
|
? `${(gpu.temperature * 1.8 + 32).toFixed(0)}°F`
|
||||||
|
: `${gpu.temperature}°C`
|
||||||
|
: null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip
|
||||||
|
label={
|
||||||
|
<Stack gap={2}>
|
||||||
|
<Text size="xs" fw={600}>
|
||||||
|
{gpu.name}
|
||||||
|
</Text>
|
||||||
|
<Text size="xs">VRAM: {gpu.memoryUtilization.toFixed(1)}%</Text>
|
||||||
|
{tempDisplay && <Text size="xs">Temp: {tempDisplay}</Text>}
|
||||||
|
{gpu.fanSpeed != null && <Text size="xs">Fan: {gpu.fanSpeed} RPM</Text>}
|
||||||
|
</Stack>
|
||||||
|
}
|
||||||
|
multiline
|
||||||
|
>
|
||||||
|
<RingProgress
|
||||||
|
className={`health-monitoring-gpu health-monitoring-gpu-${gpu.gpuId}`}
|
||||||
|
roundCaps
|
||||||
|
size={isTiny ? 50 : 100}
|
||||||
|
thickness={isTiny ? 4 : 8}
|
||||||
|
label={
|
||||||
|
<Center style={{ flexDirection: "column" }}>
|
||||||
|
<Text
|
||||||
|
className="health-monitoring-gpu-utilization-value"
|
||||||
|
size={isTiny ? "8px" : "xs"}
|
||||||
|
>{`${gpu.processorUtilization.toFixed(0)}%`}</Text>
|
||||||
|
<IconDeviceDesktop className="health-monitoring-gpu-utilization-icon" size={isTiny ? 8 : 16} />
|
||||||
|
</Center>
|
||||||
|
}
|
||||||
|
sections={[
|
||||||
|
{
|
||||||
|
value: Number(gpu.processorUtilization.toFixed(2)),
|
||||||
|
color: progressColor(Number(gpu.processorUtilization.toFixed(2))),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -39,6 +39,7 @@ import { useI18n } from "@homarr/translation/client";
|
|||||||
import type { WidgetComponentProps } from "../definition";
|
import type { WidgetComponentProps } from "../definition";
|
||||||
import { CpuRing } from "./rings/cpu-ring";
|
import { CpuRing } from "./rings/cpu-ring";
|
||||||
import { CpuTempRing } from "./rings/cpu-temp-ring";
|
import { CpuTempRing } from "./rings/cpu-temp-ring";
|
||||||
|
import { GpuRing } from "./rings/gpu-ring";
|
||||||
import { formatMemoryUsage, MemoryRing } from "./rings/memory-ring";
|
import { formatMemoryUsage, MemoryRing } from "./rings/memory-ring";
|
||||||
import classes from "./system-health.module.css";
|
import classes from "./system-health.module.css";
|
||||||
|
|
||||||
@@ -187,6 +188,10 @@ export const SystemHealthMonitoring = ({
|
|||||||
isTiny={isTiny}
|
isTiny={isTiny}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{options.gpu &&
|
||||||
|
healthInfo.gpu.map((gpu) => (
|
||||||
|
<GpuRing key={gpu.gpuId} gpu={gpu} isTiny={isTiny} fahrenheit={options.fahrenheit} />
|
||||||
|
))}
|
||||||
</Flex>
|
</Flex>
|
||||||
{
|
{
|
||||||
<Text className="health-monitoring-status-update-time" c="dimmed" size="xs" ta="center">
|
<Text className="health-monitoring-status-update-time" c="dimmed" size="xs" ta="center">
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ const getSandboxFlags = (
|
|||||||
baseSandbox.push("allow-popups-to-escape-sandbox");
|
baseSandbox.push("allow-popups-to-escape-sandbox");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (permissions.allowModals) {
|
||||||
|
baseSandbox.push("allow-modals");
|
||||||
|
}
|
||||||
|
|
||||||
return baseSandbox;
|
return baseSandbox;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,4 +119,5 @@ const permissionMapping = {
|
|||||||
allowGeolocation: "geolocation",
|
allowGeolocation: "geolocation",
|
||||||
allowMicrophone: "microphone",
|
allowMicrophone: "microphone",
|
||||||
allowPayment: "payment",
|
allowPayment: "payment",
|
||||||
|
allowModals: "allow-modals",
|
||||||
} satisfies Record<keyof Omit<WidgetComponentProps<"iframe">["options"], "embedUrl" | "allowScrolling">, string>;
|
} satisfies Record<keyof Omit<WidgetComponentProps<"iframe">["options"], "embedUrl" | "allowScrolling">, string>;
|
||||||
@@ -17,6 +17,7 @@ export const { definition, componentLoader } = createWidgetDefinition("iframe",
|
|||||||
allowMicrophone: factory.switch(),
|
allowMicrophone: factory.switch(),
|
||||||
allowCamera: factory.switch(),
|
allowCamera: factory.switch(),
|
||||||
allowGeolocation: factory.switch(),
|
allowGeolocation: factory.switch(),
|
||||||
|
allowModals: factory.switch(),
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
}).withDynamicImport(() => import("./component"));
|
}).withDynamicImport(() => import("./component"));
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
import { cache } from "react";
|
import { cache } from "react";
|
||||||
import type { QueryClient } from "@tanstack/react-query";
|
import type { QueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
|
||||||
import { db } from "@homarr/db";
|
import { db } from "@homarr/db";
|
||||||
import { getServerSettingsAsync } from "@homarr/db/queries";
|
import { getServerSettingsAsync } from "@homarr/db/queries";
|
||||||
import type { WidgetKind } from "@homarr/definitions";
|
import type { WidgetKind } from "@homarr/definitions";
|
||||||
import { createWidgetPrefetchCache } from "@homarr/redis";
|
|
||||||
import { createSettings } from "@homarr/settings/creator";
|
import { createSettings } from "@homarr/settings/creator";
|
||||||
|
|
||||||
import { reduceWidgetOptionsWithDefaultValues } from ".";
|
import { reduceWidgetOptionsWithDefaultValues } from ".";
|
||||||
@@ -14,7 +12,6 @@ import prefetchForBookmarks from "./bookmarks/prefetch";
|
|||||||
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
|
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
|
||||||
import type { inferOptionsFromCreator } from "./options";
|
import type { inferOptionsFromCreator } from "./options";
|
||||||
|
|
||||||
const logger = createLogger({ module: "widgetPrefetch" });
|
|
||||||
const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);
|
const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);
|
||||||
|
|
||||||
const prefetchCallbacks: Partial<{
|
const prefetchCallbacks: Partial<{
|
||||||
@@ -24,16 +21,6 @@ const prefetchCallbacks: Partial<{
|
|||||||
app: prefetchForApps,
|
app: prefetchForApps,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* POC: Try to read widget prefetch data from Redis cache first.
|
|
||||||
* Falls back to the original database-backed prefetch on cache miss.
|
|
||||||
*
|
|
||||||
* When Redis has cached data (populated by cron jobs or previous page loads),
|
|
||||||
* this avoids database queries entirely — estimated 2-5x faster TTFB.
|
|
||||||
*
|
|
||||||
* The cache is populated after a successful database prefetch (write-through).
|
|
||||||
* TTL is 5 minutes to match cron job intervals.
|
|
||||||
*/
|
|
||||||
export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
||||||
kind: TKind,
|
kind: TKind,
|
||||||
queryClient: QueryClient,
|
queryClient: QueryClient,
|
||||||
@@ -54,41 +41,5 @@ export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
|||||||
options: reduceWidgetOptionsWithDefaultValues(kind, createSettings({ user: null, serverSettings }), item.options),
|
options: reduceWidgetOptionsWithDefaultValues(kind, createSettings({ user: null, serverSettings }), item.options),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// POC: Try Redis cache first for widget prefetch data
|
|
||||||
try {
|
|
||||||
const cacheChannel = createWidgetPrefetchCache(kind);
|
|
||||||
const cached = await cacheChannel.getAsync();
|
|
||||||
if (cached) {
|
|
||||||
// Cache hit: populate query client from Redis instead of database
|
|
||||||
for (const [key, value] of Object.entries(cached.data)) {
|
|
||||||
queryClient.setQueryData(JSON.parse(key), value);
|
|
||||||
}
|
|
||||||
logger.debug(`Widget prefetch cache hit for kind '${kind}'`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
// Redis unavailable or parse error — fall through to database
|
|
||||||
logger.debug(`Widget prefetch cache miss/error for kind '${kind}', falling back to database`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache miss: prefetch from database (original path)
|
|
||||||
await callback(queryClient, itemsWithDefaultOptions as never[]);
|
await callback(queryClient, itemsWithDefaultOptions as never[]);
|
||||||
|
|
||||||
// POC: Write-through — cache the prefetched data for next request
|
|
||||||
try {
|
|
||||||
const cacheChannel = createWidgetPrefetchCache(kind);
|
|
||||||
const queryCache = queryClient.getQueryCache().getAll();
|
|
||||||
const cacheData: Record<string, unknown> = {};
|
|
||||||
for (const query of queryCache) {
|
|
||||||
if (query.state.data !== undefined) {
|
|
||||||
cacheData[JSON.stringify(query.queryKey)] = query.state.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Object.keys(cacheData).length > 0) {
|
|
||||||
await cacheChannel.setAsync(cacheData);
|
|
||||||
logger.debug(`Widget prefetch cache populated for kind '${kind}' (${Object.keys(cacheData).length} entries)`);
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// Non-critical: cache write failure doesn't affect the user
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { Paper, Text } from "@mantine/core";
|
||||||
|
import { IconDeviceDesktop } from "@tabler/icons-react";
|
||||||
|
|
||||||
|
import { useScopedI18n } from "@homarr/translation/client";
|
||||||
|
|
||||||
|
import type { LabelDisplayModeOption } from "..";
|
||||||
|
import { CommonChart } from "./common-chart";
|
||||||
|
|
||||||
|
export const SystemResourceGPUChart = ({
|
||||||
|
gpuUsageOverTime,
|
||||||
|
hasShadow,
|
||||||
|
labelDisplayMode,
|
||||||
|
}: {
|
||||||
|
gpuUsageOverTime: number[];
|
||||||
|
hasShadow: boolean;
|
||||||
|
labelDisplayMode: LabelDisplayModeOption;
|
||||||
|
}) => {
|
||||||
|
const chartData = gpuUsageOverTime.map((usage, index) => ({ index, usage }));
|
||||||
|
const t = useScopedI18n("widget.systemResources.card");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CommonChart
|
||||||
|
data={chartData}
|
||||||
|
dataKey={"index"}
|
||||||
|
series={[{ name: "usage", color: "grape.5" }]}
|
||||||
|
title={t("gpu")}
|
||||||
|
icon={IconDeviceDesktop}
|
||||||
|
lastValue={
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
gpuUsageOverTime.length > 0 ? `${Math.round(gpuUsageOverTime[gpuUsageOverTime.length - 1]!)}%` : undefined
|
||||||
|
}
|
||||||
|
chartType={hasShadow ? "area" : "line"}
|
||||||
|
yAxisProps={{ domain: [0, 100] }}
|
||||||
|
labelDisplayMode={labelDisplayMode}
|
||||||
|
tooltipProps={{
|
||||||
|
content: ({ payload }) => {
|
||||||
|
if (!payload) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const value = payload[0] ? Number(payload[0].value) : 0;
|
||||||
|
return (
|
||||||
|
<Paper px={3} py={2} withBorder shadow="md" radius="md">
|
||||||
|
<Text c="dimmed" size="xs">
|
||||||
|
{value.toFixed(0)}%
|
||||||
|
</Text>
|
||||||
|
</Paper>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -9,6 +9,7 @@ import { clientApi } from "@homarr/api/client";
|
|||||||
import type { WidgetComponentProps } from "../definition";
|
import type { WidgetComponentProps } from "../definition";
|
||||||
import { CombinedNetworkTrafficChart } from "./chart/combined-network-traffic";
|
import { CombinedNetworkTrafficChart } from "./chart/combined-network-traffic";
|
||||||
import { SystemResourceCPUChart } from "./chart/cpu-chart";
|
import { SystemResourceCPUChart } from "./chart/cpu-chart";
|
||||||
|
import { SystemResourceGPUChart } from "./chart/gpu-chart";
|
||||||
import { SystemResourceMemoryChart } from "./chart/memory-chart";
|
import { SystemResourceMemoryChart } from "./chart/memory-chart";
|
||||||
import { NetworkTrafficChart } from "./chart/network-traffic";
|
import { NetworkTrafficChart } from "./chart/network-traffic";
|
||||||
|
|
||||||
@@ -23,10 +24,16 @@ export default function SystemResources({ integrationIds, options }: WidgetCompo
|
|||||||
const memoryCapacityInBytes =
|
const memoryCapacityInBytes =
|
||||||
(data[0]?.healthInfo.memAvailableInBytes ?? 0) + (data[0]?.healthInfo.memUsedInBytes ?? 0);
|
(data[0]?.healthInfo.memAvailableInBytes ?? 0) + (data[0]?.healthInfo.memUsedInBytes ?? 0);
|
||||||
|
|
||||||
const [items, setItems] = useState<{ cpu: number; memory: number; network: { up: number; down: number } | null }[]>(
|
const [items, setItems] = useState<
|
||||||
|
{ cpu: number; memory: number; gpu: number; network: { up: number; down: number } | null }[]
|
||||||
|
>(
|
||||||
data.map((item) => ({
|
data.map((item) => ({
|
||||||
cpu: item.healthInfo.cpuUtilization,
|
cpu: item.healthInfo.cpuUtilization,
|
||||||
memory: item.healthInfo.memUsedInBytes,
|
memory: item.healthInfo.memUsedInBytes,
|
||||||
|
gpu:
|
||||||
|
item.healthInfo.gpu.length > 0
|
||||||
|
? item.healthInfo.gpu.reduce((acc, g) => acc + g.processorUtilization, 0) / item.healthInfo.gpu.length
|
||||||
|
: 0,
|
||||||
network: item.healthInfo.network,
|
network: item.healthInfo.network,
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
@@ -41,6 +48,10 @@ export default function SystemResources({ integrationIds, options }: WidgetCompo
|
|||||||
const next = {
|
const next = {
|
||||||
cpu: data.healthInfo.cpuUtilization,
|
cpu: data.healthInfo.cpuUtilization,
|
||||||
memory: data.healthInfo.memUsedInBytes,
|
memory: data.healthInfo.memUsedInBytes,
|
||||||
|
gpu:
|
||||||
|
data.healthInfo.gpu.length > 0
|
||||||
|
? data.healthInfo.gpu.reduce((acc, g) => acc + g.processorUtilization, 0) / data.healthInfo.gpu.length
|
||||||
|
: 0,
|
||||||
network: data.healthInfo.network,
|
network: data.healthInfo.network,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,6 +86,15 @@ export default function SystemResources({ integrationIds, options }: WidgetCompo
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
{options.visibleCharts.includes("gpu") && (
|
||||||
|
<Box h={rowHeight}>
|
||||||
|
<SystemResourceGPUChart
|
||||||
|
gpuUsageOverTime={items.map((item) => item.gpu)}
|
||||||
|
hasShadow={options.hasShadow}
|
||||||
|
labelDisplayMode={options.labelDisplayMode}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
{showNetwork &&
|
{showNetwork &&
|
||||||
(width > 256 ? (
|
(width > 256 ? (
|
||||||
<Group h={rowHeight} gap="xs" grow>
|
<Group h={rowHeight} gap="xs" grow>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const { definition, componentLoader } = createWidgetDefinition("systemRes
|
|||||||
return optionsBuilder.from((factory) => ({
|
return optionsBuilder.from((factory) => ({
|
||||||
hasShadow: factory.switch({ defaultValue: true }),
|
hasShadow: factory.switch({ defaultValue: true }),
|
||||||
visibleCharts: factory.multiSelect({
|
visibleCharts: factory.multiSelect({
|
||||||
options: (["cpu", "memory", "network"] as const).map((key) => ({
|
options: (["cpu", "memory", "gpu", "network"] as const).map((key) => ({
|
||||||
value: key,
|
value: key,
|
||||||
label: (t) => t(`widget.systemResources.option.visibleCharts.option.${key}`),
|
label: (t) => t(`widget.systemResources.option.visibleCharts.option.${key}`),
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ const Feed = ({ options }: Pick<WidgetComponentProps<"video">, "options">) => {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
// All other properties are updated with other useEffect
|
// All other properties are updated with other useEffect
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [videoRef]);
|
}, [videoRef]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Generated
+2067
-1972
File diff suppressed because it is too large.
Load diff
@@ -1,148 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Benchmark memory usage: separate ws server vs integrated custom Next.js server
|
|
||||||
# Usage: ./scripts/benchmark-memory.sh [approach] [wait_seconds]
|
|
||||||
# approach: "separate" | "integrated" | "both" (default: both)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
APPROACH="${1:-both}"
|
|
||||||
WAIT_SECONDS="${2:-15}"
|
|
||||||
|
|
||||||
measure_process_tree_memory() {
|
|
||||||
local root_pid=$1
|
|
||||||
local label=$2
|
|
||||||
local total_rss=0
|
|
||||||
|
|
||||||
if [ -z "$root_pid" ] || ! kill -0 "$root_pid" 2>/dev/null; then
|
|
||||||
echo "$label: not running"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Measure root process
|
|
||||||
local root_rss
|
|
||||||
root_rss=$(grep VmRSS /proc/$root_pid/status 2>/dev/null | awk '{print $2}')
|
|
||||||
root_rss=${root_rss:-0}
|
|
||||||
total_rss=$root_rss
|
|
||||||
local root_mb
|
|
||||||
root_mb=$(echo "scale=2; $root_rss / 1024" | bc)
|
|
||||||
echo " $label (PID $root_pid): ${root_mb} MB"
|
|
||||||
|
|
||||||
# Measure child processes recursively
|
|
||||||
for cpid in $(pgrep -P "$root_pid" 2>/dev/null); do
|
|
||||||
if kill -0 "$cpid" 2>/dev/null; then
|
|
||||||
local child_rss
|
|
||||||
child_rss=$(grep VmRSS /proc/$cpid/status 2>/dev/null | awk '{print $2}')
|
|
||||||
child_rss=${child_rss:-0}
|
|
||||||
total_rss=$((total_rss + child_rss))
|
|
||||||
local child_mb
|
|
||||||
child_mb=$(echo "scale=2; $child_rss / 1024" | bc)
|
|
||||||
local child_cmd
|
|
||||||
child_cmd=$(cat /proc/$cpid/cmdline 2>/dev/null | tr '\0' ' ' | head -c 60)
|
|
||||||
echo " Child (PID $cpid): ${child_mb} MB - $child_cmd"
|
|
||||||
|
|
||||||
# Grandchildren
|
|
||||||
for gpid in $(pgrep -P "$cpid" 2>/dev/null); do
|
|
||||||
if kill -0 "$gpid" 2>/dev/null; then
|
|
||||||
local gchild_rss
|
|
||||||
gchild_rss=$(grep VmRSS /proc/$gpid/status 2>/dev/null | awk '{print $2}')
|
|
||||||
gchild_rss=${gchild_rss:-0}
|
|
||||||
total_rss=$((total_rss + gchild_rss))
|
|
||||||
local gchild_mb
|
|
||||||
gchild_mb=$(echo "scale=2; $gchild_rss / 1024" | bc)
|
|
||||||
local gchild_cmd
|
|
||||||
gchild_cmd=$(cat /proc/$gpid/cmdline 2>/dev/null | tr '\0' ' ' | head -c 60)
|
|
||||||
echo " Grandchild (PID $gpid): ${gchild_mb} MB - $gchild_cmd"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
local total_mb
|
|
||||||
total_mb=$(echo "scale=2; $total_rss / 1024" | bc)
|
|
||||||
echo " Subtotal: ${total_mb} MB"
|
|
||||||
# Export for caller
|
|
||||||
eval "${label}_TOTAL_RSS=$total_rss"
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup_pids() {
|
|
||||||
for pid in "$@"; do
|
|
||||||
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
|
|
||||||
kill "$pid" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
wait 2>/dev/null || true
|
|
||||||
}
|
|
||||||
|
|
||||||
run_separate() {
|
|
||||||
echo "============================================"
|
|
||||||
echo "SEPARATE APPROACH (Current: WS + Next.js)"
|
|
||||||
echo "============================================"
|
|
||||||
|
|
||||||
# Start WS server
|
|
||||||
node apps/websocket/wssServer.cjs &
|
|
||||||
WS_PID=$!
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
WS_LISTEN_PID=$(lsof -i :3001 -t 2>/dev/null | head -1)
|
|
||||||
echo "WS server listening PID: $WS_LISTEN_PID"
|
|
||||||
|
|
||||||
WS_RSS=$(grep VmRSS /proc/${WS_LISTEN_PID}/status 2>/dev/null | awk '{print $2}')
|
|
||||||
WS_RSS=${WS_RSS:-0}
|
|
||||||
WS_MB=$(echo "scale=2; $WS_RSS / 1024" | bc)
|
|
||||||
echo " WebSocket Server: ${WS_MB} MB"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "TOTAL (Separate WS only): ${WS_MB} MB"
|
|
||||||
echo "Note: Next.js dev server not included (would add ~1.5-2.5 GB)"
|
|
||||||
echo "============================================"
|
|
||||||
|
|
||||||
cleanup_pids "$WS_PID"
|
|
||||||
SEPARATE_RSS=$WS_RSS
|
|
||||||
}
|
|
||||||
|
|
||||||
run_integrated() {
|
|
||||||
echo "============================================"
|
|
||||||
echo "INTEGRATED APPROACH (Custom Next.js Server)"
|
|
||||||
echo "============================================"
|
|
||||||
|
|
||||||
cd apps/nextjs
|
|
||||||
node customServer.cjs &
|
|
||||||
CUSTOM_PID=$!
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
echo "Waiting ${WAIT_SECONDS}s for server to stabilize..."
|
|
||||||
sleep "$WAIT_SECONDS"
|
|
||||||
|
|
||||||
measure_process_tree_memory "$CUSTOM_PID" "CustomServer"
|
|
||||||
echo ""
|
|
||||||
INTEGRATED_RSS=${CustomServer_TOTAL_RSS:-0}
|
|
||||||
INTEGRATED_MB=$(echo "scale=2; $INTEGRATED_RSS / 1024" | bc)
|
|
||||||
echo "TOTAL (Integrated): ${INTEGRATED_MB} MB"
|
|
||||||
echo "============================================"
|
|
||||||
|
|
||||||
cleanup_pids "$CUSTOM_PID"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$APPROACH" = "separate" ] || [ "$APPROACH" = "both" ]; then
|
|
||||||
run_separate
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$APPROACH" = "integrated" ] || [ "$APPROACH" = "both" ]; then
|
|
||||||
# Clean up lock from previous run
|
|
||||||
rm -rf apps/nextjs/.next/dev/lock
|
|
||||||
run_integrated
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$APPROACH" = "both" ]; then
|
|
||||||
echo "============================================"
|
|
||||||
echo "COMPARISON"
|
|
||||||
echo "============================================"
|
|
||||||
SEP_MB=$(echo "scale=2; ${SEPARATE_RSS:-0} / 1024" | bc)
|
|
||||||
INT_MB=$(echo "scale=2; ${INTEGRATED_RSS:-0} / 1024" | bc)
|
|
||||||
echo "Separate WS server only: ${SEP_MB} MB"
|
|
||||||
echo "Integrated custom server: ${INT_MB} MB"
|
|
||||||
echo "(The integrated server includes both Next.js AND WebSocket)"
|
|
||||||
echo "============================================"
|
|
||||||
fi
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Docker build + run integration test
|
|
||||||
# Tests that the Docker image builds and starts successfully on the current architecture.
|
|
||||||
# Works on both x86_64 and arm64 without requiring multi-platform builders.
|
|
||||||
#
|
|
||||||
# Usage: ./scripts/docker-test.sh [--skip-build]
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
IMAGE_NAME="homarr:test"
|
|
||||||
CONTAINER_NAME="homarr-docker-test"
|
|
||||||
PORT=7575
|
|
||||||
HEALTH_ENDPOINT="/api/health/ready"
|
|
||||||
MAX_WAIT=60
|
|
||||||
POLL_INTERVAL=3
|
|
||||||
|
|
||||||
# Colors for output
|
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m'
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
if docker ps -q --filter "name=${CONTAINER_NAME}" | grep -q .; then
|
|
||||||
echo -e "${YELLOW}Cleaning up container...${NC}"
|
|
||||||
docker stop "${CONTAINER_NAME}" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
docker rm -f "${CONTAINER_NAME}" 2>/dev/null || true
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
# Detect architecture
|
|
||||||
ARCH=$(uname -m)
|
|
||||||
echo "🏗️ Architecture: ${ARCH}"
|
|
||||||
|
|
||||||
# Step 1: Build
|
|
||||||
if [ "${1:-}" != "--skip-build" ]; then
|
|
||||||
echo "🔨 Building Docker image..."
|
|
||||||
docker build -t "${IMAGE_NAME}" . || {
|
|
||||||
echo -e "${RED}❌ Docker build failed${NC}"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
echo -e "${GREEN}✅ Docker build succeeded${NC}"
|
|
||||||
else
|
|
||||||
echo "⏭️ Skipping build (--skip-build)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 2: Start container
|
|
||||||
echo "🚀 Starting container..."
|
|
||||||
cleanup
|
|
||||||
docker run --rm -d \
|
|
||||||
--name "${CONTAINER_NAME}" \
|
|
||||||
-p "${PORT}:7575" \
|
|
||||||
-e SECRET_ENCRYPTION_KEY="$(head -c 32 /dev/urandom | xxd -p | tr -d '\n')" \
|
|
||||||
"${IMAGE_NAME}"
|
|
||||||
|
|
||||||
# Step 3: Wait for health endpoint
|
|
||||||
echo "⏳ Waiting for health endpoint (max ${MAX_WAIT}s)..."
|
|
||||||
ELAPSED=0
|
|
||||||
while [ $ELAPSED -lt $MAX_WAIT ]; do
|
|
||||||
if curl -sf "http://localhost:${PORT}${HEALTH_ENDPOINT}" > /dev/null 2>&1; then
|
|
||||||
echo -e "${GREEN}✅ Health check passed after ${ELAPSED}s${NC}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep $POLL_INTERVAL
|
|
||||||
ELAPSED=$((ELAPSED + POLL_INTERVAL))
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $ELAPSED -ge $MAX_WAIT ]; then
|
|
||||||
echo -e "${RED}❌ Health check failed after ${MAX_WAIT}s${NC}"
|
|
||||||
echo "--- Container logs ---"
|
|
||||||
docker logs "${CONTAINER_NAME}" 2>&1 | tail -50
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 4: Verify key endpoints
|
|
||||||
echo "🔍 Verifying endpoints..."
|
|
||||||
|
|
||||||
# Home page
|
|
||||||
HOME_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/")
|
|
||||||
if [ "$HOME_STATUS" = "200" ]; then
|
|
||||||
echo -e "${GREEN} ✅ Home page: ${HOME_STATUS}${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED} ❌ Home page: ${HOME_STATUS}${NC}"
|
|
||||||
docker logs "${CONTAINER_NAME}" 2>&1 | tail -30
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Health live
|
|
||||||
LIVE_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/api/health/live")
|
|
||||||
if [ "$LIVE_STATUS" = "200" ]; then
|
|
||||||
echo -e "${GREEN} ✅ Health live: ${LIVE_STATUS}${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED} ❌ Health live: ${LIVE_STATUS}${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Health ready
|
|
||||||
READY_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/api/health/ready")
|
|
||||||
if [ "$READY_STATUS" = "200" ]; then
|
|
||||||
echo -e "${GREEN} ✅ Health ready: ${READY_STATUS}${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED} ❌ Health ready: ${READY_STATUS}${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 5: Verify WebSocket upgrade is possible (should get 426 without proper headers, or 101 with them)
|
|
||||||
WS_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
||||||
-H "Upgrade: websocket" \
|
|
||||||
-H "Connection: Upgrade" \
|
|
||||||
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
|
|
||||||
-H "Sec-WebSocket-Version: 13" \
|
|
||||||
"http://localhost:${PORT}/websockets" 2>/dev/null || echo "000")
|
|
||||||
if [ "$WS_STATUS" = "101" ] || [ "$WS_STATUS" = "426" ] || [ "$WS_STATUS" = "400" ]; then
|
|
||||||
echo -e "${GREEN} ✅ WebSocket endpoint reachable: ${WS_STATUS}${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW} ⚠️ WebSocket endpoint status: ${WS_STATUS} (may be expected behind nginx)${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 6: Print container info
|
|
||||||
echo ""
|
|
||||||
echo "📊 Container info:"
|
|
||||||
docker inspect "${CONTAINER_NAME}" --format=' Image: {{.Config.Image}}' 2>/dev/null || true
|
|
||||||
docker inspect "${CONTAINER_NAME}" --format=' Platform: {{.Platform}}' 2>/dev/null || true
|
|
||||||
echo " Architecture: ${ARCH}"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo -e "${GREEN}✅ All Docker tests passed!${NC}"
|
|
||||||
+8
-3
@@ -45,14 +45,19 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Tasks/cron and WebSocket servers are now integrated into the custom Next.js server
|
node apps/tasks/tasks.cjs &
|
||||||
node apps/nextjs/customServer.cjs &
|
TASKS_PID=$!
|
||||||
|
|
||||||
|
node apps/websocket/wssServer.cjs &
|
||||||
|
WSS_PID=$!
|
||||||
|
|
||||||
|
node apps/nextjs/server.js &
|
||||||
NEXTJS_PID=$!
|
NEXTJS_PID=$!
|
||||||
|
|
||||||
# Function to handle SIGTERM and shut down services
|
# Function to handle SIGTERM and shut down services
|
||||||
terminate() {
|
terminate() {
|
||||||
echo "Received SIGTERM. Shutting down..."
|
echo "Received SIGTERM. Shutting down..."
|
||||||
kill -TERM $NGINX_PID $NEXTJS_PID 2>/dev/null
|
kill -TERM $NGINX_PID $TASKS_PID $WSS_PID $NEXTJS_PID 2>/dev/null
|
||||||
wait
|
wait
|
||||||
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
|
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
|
||||||
if [ -n "$REDIS_PID" ]; then
|
if [ -n "$REDIS_PID" ]; then
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[{"login":"ajnart","avatar_url":"https://avatars.githubusercontent.com/u/49837342?v=4"},{"login":"manuel-rw","avatar_url":"https://avatars.githubusercontent.com/u/30572287?v=4"},{"login":"Meierschlumpf","avatar_url":"https://avatars.githubusercontent.com/u/63781622?v=4"},{"login":"SeDemal","avatar_url":"https://avatars.githubusercontent.com/u/26098587?v=4"},{"login":"lammersbjorn","avatar_url":"https://avatars.githubusercontent.com/u/71191962?v=4"},{"login":"LarveyOfficial","avatar_url":"https://avatars.githubusercontent.com/u/39219859?v=4"},{"login":"c00ldude1oo","avatar_url":"https://avatars.githubusercontent.com/u/15677803?v=4"},{"login":"InterN0te","avatar_url":"https://avatars.githubusercontent.com/u/10882916?v=4"},{"login":"Aimsucks","avatar_url":"https://avatars.githubusercontent.com/u/1828486?v=4"},{"login":"JannesV","avatar_url":"https://avatars.githubusercontent.com/u/5984244?v=4"},{"login":"MauriceNino","avatar_url":"https://avatars.githubusercontent.com/u/18658092?v=4"},{"login":"hillaliy","avatar_url":"https://avatars.githubusercontent.com/u/950010?v=4"},{"login":"Skeeww","avatar_url":"https://avatars.githubusercontent.com/u/9639992?v=4"},{"login":"RichyHBM","avatar_url":"https://avatars.githubusercontent.com/u/5472275?v=4"},{"login":"Bonfire","avatar_url":"https://avatars.githubusercontent.com/u/5704760?v=4"},{"login":"wieli99","avatar_url":"https://avatars.githubusercontent.com/u/46794825?v=4"},{"login":"ishaanparlikar","avatar_url":"https://avatars.githubusercontent.com/u/43013132?v=4"},{"login":"Zareix","avatar_url":"https://avatars.githubusercontent.com/u/29818713?v=4"},{"login":"tuggan","avatar_url":"https://avatars.githubusercontent.com/u/4325608?v=4"},{"login":"Spillebulle","avatar_url":"https://avatars.githubusercontent.com/u/46653946?v=4"},{"login":"tancak","avatar_url":"https://avatars.githubusercontent.com/u/11760749?v=4"},{"login":"spkesDE","avatar_url":"https://avatars.githubusercontent.com/u/1682314?v=4"},{"login":"j3lte","avatar_url":"https://avatars.githubusercontent.com/u/2557568?v=4"},{"login":"dslatt","avatar_url":"https://avatars.githubusercontent.com/u/5211001?v=4"},{"login":"Malong11-007","avatar_url":"https://avatars.githubusercontent.com/u/40298510?v=4"},{"login":"StefanB7","avatar_url":"https://avatars.githubusercontent.com/u/22056509?v=4"},{"login":"souravghosh01","avatar_url":"https://avatars.githubusercontent.com/u/37548139?v=4"},{"login":"SR3u","avatar_url":"https://avatars.githubusercontent.com/u/2380522?v=4"},{"login":"Rikpat","avatar_url":"https://avatars.githubusercontent.com/u/33869814?v=4"},{"login":"NormanJS","avatar_url":"https://avatars.githubusercontent.com/u/83409549?v=4"},{"login":"No-Maines-Land","avatar_url":"https://avatars.githubusercontent.com/u/20687725?v=4"},{"login":"stark1tty","avatar_url":"https://avatars.githubusercontent.com/u/69326376?v=4"},{"login":"Momcilo42","avatar_url":"https://avatars.githubusercontent.com/u/10118137?v=4"},{"login":"marius-arch","avatar_url":"https://avatars.githubusercontent.com/u/72494359?v=4"},{"login":"Lumilias","avatar_url":"https://avatars.githubusercontent.com/u/10852161?v=4"},{"login":"Havock94","avatar_url":"https://avatars.githubusercontent.com/u/7635248?v=4"},{"login":"Lollyde","avatar_url":"https://avatars.githubusercontent.com/u/11347524?v=4"},{"login":"krishnamuppaneni","avatar_url":"https://avatars.githubusercontent.com/u/4703366?v=4"},{"login":"devtobi","avatar_url":"https://avatars.githubusercontent.com/u/28538704?v=4"},{"login":"TyxTang","avatar_url":"https://avatars.githubusercontent.com/u/90897955?v=4"},{"login":"alotlikebeans","avatar_url":"https://avatars.githubusercontent.com/u/19630511?v=4"},{"login":"WillyJL","avatar_url":"https://avatars.githubusercontent.com/u/49810075?v=4"},{"login":"anonysoul","avatar_url":"https://avatars.githubusercontent.com/u/105715150?v=4"},{"login":"cospeedster","avatar_url":"https://avatars.githubusercontent.com/u/52749645?v=4"},{"login":"diederbert","avatar_url":"https://avatars.githubusercontent.com/u/162878798?v=4"},{"login":"digdilem","avatar_url":"https://avatars.githubusercontent.com/u/4052275?v=4"},{"login":"dinghino","avatar_url":"https://avatars.githubusercontent.com/u/14729459?v=4"},{"login":"gfomichev","avatar_url":"https://avatars.githubusercontent.com/u/1596146?v=4"},{"login":"gnattu","avatar_url":"https://avatars.githubusercontent.com/u/12995396?v=4"},{"login":"tuxpizza","avatar_url":"https://avatars.githubusercontent.com/u/84710786?v=4"},{"login":"xmarkurion","avatar_url":"https://avatars.githubusercontent.com/u/46654687?v=4"},{"login":"huanga","avatar_url":"https://avatars.githubusercontent.com/u/732970?v=4"},{"login":"taos15","avatar_url":"https://avatars.githubusercontent.com/u/122130728?v=4"},{"login":"arghyadipchak","avatar_url":"https://avatars.githubusercontent.com/u/32430374?v=4"},{"login":"AuthorShin","avatar_url":"https://avatars.githubusercontent.com/u/4959043?v=4"},{"login":"benniblot","avatar_url":"https://avatars.githubusercontent.com/uLine truncated
|
[{"login":"ajnart","avatar_url":"https://avatars.githubusercontent.com/u/49837342?v=4"},{"login":"manuel-rw","avatar_url":"https://avatars.githubusercontent.com/u/30572287?v=4"},{"login":"Meierschlumpf","avatar_url":"https://avatars.githubusercontent.com/u/63781622?v=4"},{"login":"SeDemal","avatar_url":"https://avatars.githubusercontent.com/u/26098587?v=4"},{"login":"lammersbjorn","avatar_url":"https://avatars.githubusercontent.com/u/71191962?v=4"},{"login":"LarveyOfficial","avatar_url":"https://avatars.githubusercontent.com/u/39219859?v=4"},{"login":"c00ldude1oo","avatar_url":"https://avatars.githubusercontent.com/u/15677803?v=4"},{"login":"InterN0te","avatar_url":"https://avatars.githubusercontent.com/u/10882916?v=4"},{"login":"Aimsucks","avatar_url":"https://avatars.githubusercontent.com/u/1828486?v=4"},{"login":"JannesV","avatar_url":"https://avatars.githubusercontent.com/u/5984244?v=4"},{"login":"MauriceNino","avatar_url":"https://avatars.githubusercontent.com/u/18658092?v=4"},{"login":"hillaliy","avatar_url":"https://avatars.githubusercontent.com/u/950010?v=4"},{"login":"Skeeww","avatar_url":"https://avatars.githubusercontent.com/u/9639992?v=4"},{"login":"RichyHBM","avatar_url":"https://avatars.githubusercontent.com/u/5472275?v=4"},{"login":"Bonfire","avatar_url":"https://avatars.githubusercontent.com/u/5704760?v=4"},{"login":"wieli99","avatar_url":"https://avatars.githubusercontent.com/u/46794825?v=4"},{"login":"ishaanparlikar","avatar_url":"https://avatars.githubusercontent.com/u/43013132?v=4"},{"login":"Zareix","avatar_url":"https://avatars.githubusercontent.com/u/29818713?v=4"},{"login":"tuggan","avatar_url":"https://avatars.githubusercontent.com/u/4325608?v=4"},{"login":"Spillebulle","avatar_url":"https://avatars.githubusercontent.com/u/46653946?v=4"},{"login":"tancak","avatar_url":"https://avatars.githubusercontent.com/u/11760749?v=4"},{"login":"spkesDE","avatar_url":"https://avatars.githubusercontent.com/u/1682314?v=4"},{"login":"j3lte","avatar_url":"https://avatars.githubusercontent.com/u/2557568?v=4"},{"login":"dslatt","avatar_url":"https://avatars.githubusercontent.com/u/5211001?v=4"},{"login":"Malong11-007","avatar_url":"https://avatars.githubusercontent.com/u/40298510?v=4"},{"login":"StefanB7","avatar_url":"https://avatars.githubusercontent.com/u/22056509?v=4"},{"login":"souravghosh01","avatar_url":"https://avatars.githubusercontent.com/u/37548139?v=4"},{"login":"SR3u","avatar_url":"https://avatars.githubusercontent.com/u/2380522?v=4"},{"login":"Rikpat","avatar_url":"https://avatars.githubusercontent.com/u/33869814?v=4"},{"login":"NormanJS","avatar_url":"https://avatars.githubusercontent.com/u/83409549?v=4"},{"login":"No-Maines-Land","avatar_url":"https://avatars.githubusercontent.com/u/20687725?v=4"},{"login":"stark1tty","avatar_url":"https://avatars.githubusercontent.com/u/69326376?v=4"},{"login":"Momcilo42","avatar_url":"https://avatars.githubusercontent.com/u/10118137?v=4"},{"login":"marius-arch","avatar_url":"https://avatars.githubusercontent.com/u/72494359?v=4"},{"login":"Lumilias","avatar_url":"https://avatars.githubusercontent.com/u/10852161?v=4"},{"login":"Havock94","avatar_url":"https://avatars.githubusercontent.com/u/7635248?v=4"},{"login":"Lollyde","avatar_url":"https://avatars.githubusercontent.com/u/11347524?v=4"},{"login":"krishnamuppaneni","avatar_url":"https://avatars.githubusercontent.com/u/4703366?v=4"},{"login":"devtobi","avatar_url":"https://avatars.githubusercontent.com/u/28538704?v=4"},{"login":"TyxTang","avatar_url":"https://avatars.githubusercontent.com/u/90897955?v=4"},{"login":"alotlikebeans","avatar_url":"https://avatars.githubusercontent.com/u/19630511?v=4"},{"login":"WillyJL","avatar_url":"https://avatars.githubusercontent.com/u/49810075?v=4"},{"login":"anonysoul","avatar_url":"https://avatars.githubusercontent.com/u/105715150?v=4"},{"login":"cospeedster","avatar_url":"https://avatars.githubusercontent.com/u/52749645?v=4"},{"login":"diederbert","avatar_url":"https://avatars.githubusercontent.com/u/162878798?v=4"},{"login":"digdilem","avatar_url":"https://avatars.githubusercontent.com/u/4052275?v=4"},{"login":"dinghino","avatar_url":"https://avatars.githubusercontent.com/u/14729459?v=4"},{"login":"gfomichev","avatar_url":"https://avatars.githubusercontent.com/u/1596146?v=4"},{"login":"gnattu","avatar_url":"https://avatars.githubusercontent.com/u/12995396?v=4"},{"login":"tuxpizza","avatar_url":"https://avatars.githubusercontent.com/u/84710786?v=4"},{"login":"xmarkurion","avatar_url":"https://avatars.githubusercontent.com/u/46654687?v=4"},{"login":"huanga","avatar_url":"https://avatars.githubusercontent.com/u/732970?v=4"},{"login":"taos15","avatar_url":"https://avatars.githubusercontent.com/u/122130728?v=4"},{"login":"arghyadipchak","avatar_url":"https://avatars.githubusercontent.com/u/32430374?v=4"},{"login":"AuthorShin","avatar_url":"https://avatars.githubusercontent.com/u/4959043?v=4"},{"login":"benniblot","avatar_url":"https://avatars.githubusercontent.com/uLine truncated
|
||||||
@@ -1 +1 @@
|
|||||||
[{"username":"carlchina","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/6697/medium/d22bbe7797bbeb30dbdc73a5648d329a_default.png"},{"username":"zielmann","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/7795/medium/ad22b8b8d5eb33e4154d53a454c862fd_default.png"},{"username":"Thalyn","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12494028/medium/5faf5acc945a874ed116c4567edaa09f_default.png"},{"username":"magnushj","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12503488/medium/68f32e33ea7b891960055c9f831f7344_default.png"},{"username":"almontegil","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12580457/medium/f4136cacbdfdb4c28ae7f85dc5f840db_default.png"},{"username":"andibing","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12664938/medium/b8be63e4dcb2e791ced1ffc9e3a049a5.jpg"},{"username":"gronare","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12680911/medium/c6eb14d1504156f34a158e507f73aa3d_default.png"},{"username":"SmartPhoneLover","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12701640/medium/ec95486662ec875cda080e778c3ff702.jpg"},{"username":"marcelotk_15","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12773227/medium/ecf6bea16ab0c873c131df2154ee9718_default.png"},{"username":"S3OD177","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13051544/medium/11dd990837f61f7e8f7d36b041a7fddb_default.png"},{"username":"marcg","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13153301/medium/ebcf60fbf27deb148ec40a659566c6ff_default.png"},{"username":"BeersTeddy","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13185230/medium/2f1f4e1effe74a23422b195cbefb2a95_default.png"},{"username":"jamesmcmahon0","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13245578/medium/586aa873b4abddbd9abc6f3de99ab70e.jpeg"},{"username":"b1nar10","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13286752/medium/249b02e3368752cb175446082015737c_default.png"},{"username":"vannCN","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13330448/medium/9b8a9ee3611e51e951e22d5fd4eb7d8d.jpg"},{"username":"binswm","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13343482/medium/45dde0e6097b9b72705d2eba9dbbc276_default.png"},{"username":"SkewRam","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13496556/medium/188f5c2deb7938eda51eb786cc4539ca.jpeg"},{"username":"raphcatarino","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13547726/medium/b003511e67df13a4b4b5689488fa8099.jpg"},{"username":"shillos5","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13600557/medium/b17650b2b84f829d54fa548c44c1ab27.jpeg"},{"username":"wolong98","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13641407/medium/f4634edc58c7857a357e5293543c15cf.jpg"},{"username":"spair0039","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14012333/medium/72430e96027c09c19141cac38eae4617.png"},{"username":"MajorMarcin","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14072183/medium/0a197e64bb92b6ea94cecbb607512c45.jpg"},{"username":"KosmoMoustache","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14103535/medium/51c438cdd9f86e8811c75f4869de479c.png"},{"username":"Soochaehwa","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14118689/medium/496a1ce63111547bf455a1e0a7ac75f1_default.png"},{"username":"garryfield","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14187035/medium/520c964706676045f6eeec1b08edc880.jpg"},{"username":"droidenko","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14444264/medium/4aa3a8e824f72bc9e5ec0d8de307095e.jpeg"},{"username":"maathis","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14489950/medium/6eeddf13a757ee35f78f1763f94d95e1.jpeg"},{"username":"bukvam","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14546502/medium/a819dc40a13c57395a17dc46e847d3ce.jpg"},{"username":"gm.cinalli","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14670666/medium/2d466a0fdbda40764526be86c97c0ab4.jpeg"},{"username":"antoine2tt","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14722148/medium/f88d926900862dd59007ea4b3419cb9d.png"},{"username":"cretzen","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14799754/medium/3ba5c1805ec20c000d5810c07985afe9.jpg"},{"username":"ktKongTong","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14817246/medium/97cfc3c028dbdaf85ebd1102da71e58c.jpeg"},{"username":"marinkaberg","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14861042/medium/2d5c4e62613f03082f3e645fa92efd59.jpeg"},{"username":"djismgaming","avatarUrl":"httpsLine truncated
|
[{"username":"carlchina","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/6697/medium/d22bbe7797bbeb30dbdc73a5648d329a_default.png"},{"username":"zielmann","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/7795/medium/ad22b8b8d5eb33e4154d53a454c862fd_default.png"},{"username":"Thalyn","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12494028/medium/5faf5acc945a874ed116c4567edaa09f_default.png"},{"username":"magnushj","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12503488/medium/68f32e33ea7b891960055c9f831f7344_default.png"},{"username":"almontegil","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12580457/medium/f4136cacbdfdb4c28ae7f85dc5f840db_default.png"},{"username":"andibing","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12664938/medium/b8be63e4dcb2e791ced1ffc9e3a049a5.jpg"},{"username":"gronare","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12680911/medium/c6eb14d1504156f34a158e507f73aa3d_default.png"},{"username":"SmartPhoneLover","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12701640/medium/ec95486662ec875cda080e778c3ff702.jpg"},{"username":"marcelotk_15","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/12773227/medium/ecf6bea16ab0c873c131df2154ee9718_default.png"},{"username":"S3OD177","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13051544/medium/11dd990837f61f7e8f7d36b041a7fddb_default.png"},{"username":"marcg","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13153301/medium/ebcf60fbf27deb148ec40a659566c6ff_default.png"},{"username":"BeersTeddy","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13185230/medium/2f1f4e1effe74a23422b195cbefb2a95_default.png"},{"username":"jamesmcmahon0","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13245578/medium/586aa873b4abddbd9abc6f3de99ab70e.jpeg"},{"username":"b1nar10","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13286752/medium/249b02e3368752cb175446082015737c_default.png"},{"username":"vannCN","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13330448/medium/9b8a9ee3611e51e951e22d5fd4eb7d8d.jpg"},{"username":"binswm","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13343482/medium/45dde0e6097b9b72705d2eba9dbbc276_default.png"},{"username":"SkewRam","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13496556/medium/188f5c2deb7938eda51eb786cc4539ca.jpeg"},{"username":"raphcatarino","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13547726/medium/b003511e67df13a4b4b5689488fa8099.jpg"},{"username":"shillos5","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13600557/medium/b17650b2b84f829d54fa548c44c1ab27.jpeg"},{"username":"wolong98","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/13641407/medium/f4634edc58c7857a357e5293543c15cf.jpg"},{"username":"spair0039","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14012333/medium/72430e96027c09c19141cac38eae4617.png"},{"username":"MajorMarcin","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14072183/medium/0a197e64bb92b6ea94cecbb607512c45.jpg"},{"username":"KosmoMoustache","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14103535/medium/51c438cdd9f86e8811c75f4869de479c.png"},{"username":"Soochaehwa","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14118689/medium/496a1ce63111547bf455a1e0a7ac75f1_default.png"},{"username":"garryfield","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14187035/medium/520c964706676045f6eeec1b08edc880.jpg"},{"username":"droidenko","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14444264/medium/4aa3a8e824f72bc9e5ec0d8de307095e.jpeg"},{"username":"maathis","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14489950/medium/6eeddf13a757ee35f78f1763f94d95e1.jpeg"},{"username":"bukvam","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14546502/medium/a819dc40a13c57395a17dc46e847d3ce.jpg"},{"username":"gm.cinalli","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14670666/medium/2d466a0fdbda40764526be86c97c0ab4.jpeg"},{"username":"antoine2tt","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14722148/medium/f88d926900862dd59007ea4b3419cb9d.png"},{"username":"cretzen","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14799754/medium/3ba5c1805ec20c000d5810c07985afe9.jpg"},{"username":"ktKongTong","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14817246/medium/97cfc3c028dbdaf85ebd1102da71e58c.jpeg"},{"username":"marinkaberg","avatarUrl":"https://crowdin-static.cf-downloads.crowdin.com/avatar/14861042/medium/2d5c4e62613f03082f3e645fa92efd59.jpeg"},{"username":"djismgaming","avatarUrl":"httpsLine truncated
|
||||||
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user