Compare commits
19
Commits
No files matched your search
@@ -33,6 +33,7 @@ body:
|
||||
options:
|
||||
# The below comment is used to insert a new version with on-release.yml
|
||||
#NEXT_VERSION#
|
||||
- 1.56.0
|
||||
- 1.55.0
|
||||
- 1.54.0
|
||||
- 1.53.0
|
||||
|
||||
+5
-1
@@ -57,6 +57,7 @@ apps/tasks/tasks.cjs
|
||||
apps/tasks/tasks.css
|
||||
apps/websocket/wssServer.cjs
|
||||
apps/websocket/wssServer.css
|
||||
apps/nextjs/customServer.cjs
|
||||
apps/nextjs/.million/
|
||||
packages/cli/cli.cjs
|
||||
|
||||
@@ -67,4 +68,7 @@ e2e/shared/tmp
|
||||
apps/nextjs/public/images/background.png
|
||||
|
||||
# next-intl
|
||||
en.d.json.ts
|
||||
en.d.json.ts
|
||||
|
||||
# Custom server build artifacts
|
||||
apps/nextjs/customServer.css
|
||||
+369
@@ -0,0 +1,369 @@
|
||||
# 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
-2
@@ -43,8 +43,7 @@ RUN mkdir -p /var/cache/nginx && \
|
||||
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
||||
COPY --from=builder /app/apps/nextjs/package.json .
|
||||
|
||||
COPY --from=builder /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs
|
||||
COPY --from=builder /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs
|
||||
COPY --from=builder /app/apps/nextjs/customServer.cjs ./apps/nextjs/customServer.cjs
|
||||
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
||||
|
||||
COPY --from=builder /app/packages/db/migrations ./db/migrations
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm with-env next build",
|
||||
"build": "pnpm with-env next build && pnpm build:custom-server",
|
||||
"build:custom-server": "esbuild server.ts --bundle --platform=node --outfile=customServer.cjs --external:next --external:fastify --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
|
||||
"clean": "git clean -xdf .next .turbo node_modules",
|
||||
"dev": "pnpm with-env next dev",
|
||||
"dev": "pnpm with-env tsx ./server.ts",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint",
|
||||
"start": "pnpm with-env next start",
|
||||
"start": "pnpm with-env node customServer.cjs",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --"
|
||||
},
|
||||
@@ -25,7 +26,10 @@
|
||||
"@homarr/boards": "workspace:^0.1.0",
|
||||
"@homarr/common": "workspace:^0.1.0",
|
||||
"@homarr/core": "workspace:^0.1.0",
|
||||
"@homarr/cron-job-api": "workspace:^0.1.0",
|
||||
"@homarr/cron-job-status": "workspace:^0.1.0",
|
||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||
"@homarr/cron-jobs-core": "workspace:^0.1.0",
|
||||
"@homarr/db": "workspace:^0.1.0",
|
||||
"@homarr/definitions": "workspace:^0.1.0",
|
||||
"@homarr/docker": "workspace:^0.1.0",
|
||||
@@ -40,7 +44,9 @@
|
||||
"@homarr/notifications": "workspace:^0.1.0",
|
||||
"@homarr/old-import": "workspace:^0.1.0",
|
||||
"@homarr/old-schema": "workspace:^0.1.0",
|
||||
"@homarr/ping": "workspace:^0.1.0",
|
||||
"@homarr/redis": "workspace:^0.1.0",
|
||||
"@homarr/request-handler": "workspace:^0.1.0",
|
||||
"@homarr/server-settings": "workspace:^0.1.0",
|
||||
"@homarr/settings": "workspace:^0.1.0",
|
||||
"@homarr/spotlight": "workspace:^0.1.0",
|
||||
@@ -71,10 +77,11 @@
|
||||
"clsx": "^2.1.1",
|
||||
"dayjs": "^1.11.19",
|
||||
"dotenv": "^17.3.1",
|
||||
"fastify": "^5.7.4",
|
||||
"flag-icons": "^7.5.0",
|
||||
"glob": "^13.0.6",
|
||||
"isomorphic-dompurify": "^3.0.0",
|
||||
"jotai": "^2.18.0",
|
||||
"isomorphic-dompurify": "^3.1.0",
|
||||
"jotai": "^2.18.1",
|
||||
"mantine-react-table": "2.0.0-beta.9",
|
||||
"next": "16.1.6",
|
||||
"postcss-preset-mantine": "^1.18.0",
|
||||
@@ -87,6 +94,7 @@
|
||||
"superjson": "2.2.6",
|
||||
"swagger-ui-react": "^5.32.0",
|
||||
"use-deep-compare-effect": "^1.8.1",
|
||||
"ws": "^8.19.0",
|
||||
"zod": "^4.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -99,10 +107,13 @@
|
||||
"@types/react": "19.2.14",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"@types/swagger-ui-react": "^5.18.0",
|
||||
"@types/ws": "^8.18.1",
|
||||
"concurrently": "^9.2.1",
|
||||
"esbuild": "^0.27.3",
|
||||
"eslint": "^9.39.4",
|
||||
"node-loader": "^2.1.0",
|
||||
"prettier": "^3.8.1",
|
||||
"tsx": "4.20.4",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
// 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,13 +32,12 @@ const getWebSocketProtocol = () => {
|
||||
};
|
||||
|
||||
const constructWebsocketUrl = () => {
|
||||
const fallback = `${getWebSocketProtocol()}://localhost:3001/websockets`;
|
||||
if (typeof window === "undefined") {
|
||||
return fallback;
|
||||
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
|
||||
}
|
||||
|
||||
if (env.NODE_ENV === "development") {
|
||||
return fallback;
|
||||
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
|
||||
}
|
||||
|
||||
return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": [".", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules", ".next"]
|
||||
"exclude": ["node_modules", ".next", "customServer.cjs", "customServer.css"]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [
|
||||
{
|
||||
ignores: ["tasks.cjs"],
|
||||
},
|
||||
...baseConfig,
|
||||
];
|
||||
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"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.19",
|
||||
"dotenv": "^17.3.1",
|
||||
"fastify": "^5.8.2",
|
||||
"superjson": "2.2.6",
|
||||
"undici": "7.18.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/node": "^24.12.0",
|
||||
"dotenv-cli": "^11.0.0",
|
||||
"esbuild": "^0.27.3",
|
||||
"eslint": "^9.39.4",
|
||||
"prettier": "^3.8.1",
|
||||
"tsx": "4.20.4",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
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,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// 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);
|
||||
}
|
||||
})();
|
||||
@@ -1,7 +0,0 @@
|
||||
import { invalidateUpdateCheckerCacheAsync } from "./invalidate-update-checker-cache";
|
||||
import { cleanupSessionsAsync } from "./session-cleanup";
|
||||
|
||||
export async function onStartAsync() {
|
||||
await cleanupSessionsAsync();
|
||||
await invalidateUpdateCheckerCacheAsync();
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
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 }));
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
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 }));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import { setGlobalDispatcher } from "undici";
|
||||
|
||||
import { UndiciHttpAgent } from "@homarr/core/infrastructure/http";
|
||||
|
||||
setGlobalDispatcher(new UndiciHttpAgent());
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"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"]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [
|
||||
{
|
||||
ignores: ["wssServer.cjs"],
|
||||
},
|
||||
...baseConfig,
|
||||
];
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "@homarr/websocket",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"main": "./src/main.ts",
|
||||
"types": "./src/main.ts",
|
||||
"scripts": {
|
||||
"build": "esbuild src/main.ts --bundle --platform=node --outfile=wssServer.cjs --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --"
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@homarr/api": "workspace:^0.1.0",
|
||||
"@homarr/auth": "workspace:^0.1.0",
|
||||
"@homarr/common": "workspace:^0.1.0",
|
||||
"@homarr/core": "workspace:^",
|
||||
"@homarr/db": "workspace:^0.1.0",
|
||||
"@homarr/definitions": "workspace:^0.1.0",
|
||||
"@homarr/redis": "workspace:^0.1.0",
|
||||
"@homarr/validation": "workspace:^0.1.0",
|
||||
"dotenv": "^17.3.1",
|
||||
"tsx": "4.20.4",
|
||||
"ws": "^8.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/ws": "^8.18.1",
|
||||
"esbuild": "^0.27.3",
|
||||
"eslint": "^9.39.4",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
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();
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"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": {
|
||||
"better-sqlite3": "^12.6.2"
|
||||
},
|
||||
"packageManager": "pnpm@10.31.0",
|
||||
"packageManager": "pnpm@10.32.0",
|
||||
"engines": {
|
||||
"node": ">=24.14.0",
|
||||
"pnpm": ">=10.31.0"
|
||||
"pnpm": ">=10.32.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
|
||||
+2
-2
@@ -356,8 +356,8 @@
|
||||
<br/>
|
||||
<p align="center">Unifi<br/>Controller</p>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
</td></tr>
|
||||
<tr><td align="center">
|
||||
<a href="https://homarr.dev/docs/integrations/unraid" target="_blank" rel="noreferrer noopener">
|
||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg" alt="Unraid" width="90" height="90" />
|
||||
<br/>
|
||||
|
||||
+2
-2
@@ -7,9 +7,9 @@ http {
|
||||
listen 7575;
|
||||
listen [::]:7575;
|
||||
|
||||
# Route websockets traffic to port 3001
|
||||
# Route websockets traffic to port 3000 (integrated custom server)
|
||||
location /websockets {
|
||||
proxy_pass http://${HOSTNAME}:3001;
|
||||
proxy_pass http://${HOSTNAME}:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
|
||||
+8
-5
@@ -17,6 +17,9 @@
|
||||
"db:studio": "pnpm -F db studio",
|
||||
"dev": "turbo dev --parallel",
|
||||
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
||||
"docker:build": "docker build -t homarr:test .",
|
||||
"docker:test": "bash scripts/docker-test.sh",
|
||||
"docker:test:skip-build": "bash scripts/docker-test.sh --skip-build",
|
||||
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
||||
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
||||
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
|
||||
@@ -26,7 +29,7 @@
|
||||
"release": "semantic-release",
|
||||
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
|
||||
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
|
||||
"start": "concurrently \"pnpm with-env node apps/tasks/tasks.cjs\" \"pnpm with-env node apps/websocket/wssServer.cjs\" \"pnpm -F nextjs start\"",
|
||||
"start": "pnpm -F nextjs start",
|
||||
"test": "cross-env NODE_ENV=development CI=true vitest run --exclude e2e --coverage.enabled ",
|
||||
"test:e2e": "cross-env NODE_ENV=development CI=true vitest e2e",
|
||||
"test:ui": "cross-env NODE_ENV=development CI=true vitest --exclude e2e --ui --coverage.enabled",
|
||||
@@ -43,7 +46,7 @@
|
||||
"@semantic-release/npm": "^13.1.5",
|
||||
"@semantic-release/release-notes-generator": "^14.1.0",
|
||||
"@testcontainers/redis": "^11.12.0",
|
||||
"@turbo/gen": "^2.8.14",
|
||||
"@turbo/gen": "^2.8.15",
|
||||
"@vitejs/plugin-react": "^5.1.4",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/ui": "^4.0.18",
|
||||
@@ -54,15 +57,15 @@
|
||||
"prettier": "^3.8.1",
|
||||
"semantic-release": "^25.0.3",
|
||||
"testcontainers": "^11.12.0",
|
||||
"turbo": "^2.8.14",
|
||||
"turbo": "^2.8.15",
|
||||
"typescript": "^5.9.3",
|
||||
"vite-tsconfig-paths": "^6.1.1",
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"packageManager": "pnpm@10.31.0",
|
||||
"packageManager": "pnpm@10.32.0",
|
||||
"engines": {
|
||||
"node": ">=24.14.0",
|
||||
"pnpm": ">=10.31.0"
|
||||
"pnpm": ">=10.32.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"dns-caching": "^0.2.9",
|
||||
"drizzle-orm": "^0.45.1",
|
||||
"ioredis": "5.10.0",
|
||||
"mysql2": "3.19.0",
|
||||
"mysql2": "3.19.1",
|
||||
"pg": "^8.20.0",
|
||||
"superjson": "2.2.6",
|
||||
"winston": "3.19.0",
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
"drizzle-kit": "^0.31.9",
|
||||
"drizzle-orm": "^0.45.1",
|
||||
"drizzle-zod": "^0.8.3",
|
||||
"mysql2": "3.19.0",
|
||||
"mysql2": "3.19.1",
|
||||
"pg": "^8.20.0",
|
||||
"superjson": "2.2.6"
|
||||
},
|
||||
|
||||
@@ -109,7 +109,9 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/tags/variables"
|
||||
| "/docs/advanced/command-line"
|
||||
| "/docs/advanced/command-line/fix-usernames"
|
||||
| "/docs/advanced/command-line/integrations"
|
||||
| "/docs/advanced/command-line/password-recovery"
|
||||
| "/docs/advanced/command-line/users"
|
||||
| "/docs/advanced/development/getting-started"
|
||||
| "/docs/advanced/development/kubernetes"
|
||||
| "/docs/advanced/environment-variables"
|
||||
@@ -164,6 +166,7 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/integrations/glances"
|
||||
| "/docs/integrations/home-assistant"
|
||||
| "/docs/integrations/ical"
|
||||
| "/docs/integrations/immich"
|
||||
| "/docs/integrations/jellyfin"
|
||||
| "/docs/integrations/jellyseerr"
|
||||
| "/docs/integrations/kubernetes"
|
||||
@@ -189,6 +192,7 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/integrations/slskd"
|
||||
| "/docs/integrations/sonarr"
|
||||
| "/docs/integrations/tdarr"
|
||||
| "/docs/integrations/tracearr"
|
||||
| "/docs/integrations/transmission"
|
||||
| "/docs/integrations/truenas"
|
||||
| "/docs/integrations/unifi-controller"
|
||||
@@ -214,6 +218,8 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/widgets/firewall"
|
||||
| "/docs/widgets/health-monitoring"
|
||||
| "/docs/widgets/iframe"
|
||||
| "/docs/widgets/immich-album-carousel"
|
||||
| "/docs/widgets/immich-server-stats"
|
||||
| "/docs/widgets/indexer-manager"
|
||||
| "/docs/widgets/media-releases"
|
||||
| "/docs/widgets/media-request-list"
|
||||
@@ -231,6 +237,7 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/widgets/smart-home-execute-automation"
|
||||
| "/docs/widgets/stock-price"
|
||||
| "/docs/widgets/system-resources"
|
||||
| "/docs/widgets/tracearr"
|
||||
| "/docs/widgets/video"
|
||||
| "/docs/widgets/weather"
|
||||
| ""
|
||||
|
||||
@@ -339,7 +339,6 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/immich.svg",
|
||||
category: ["photoService"],
|
||||
// @ts-expect-error TS2345
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/immich"),
|
||||
},
|
||||
tracearr: {
|
||||
@@ -347,7 +346,6 @@ export const integrationDefs = {
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/tracearr.svg",
|
||||
category: ["mediaMonitoring"],
|
||||
// @ts-expect-error - docs page will be created when integration is merged
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/tracearr"),
|
||||
},
|
||||
// This integration only returns mock data, it is used during development (but can also be used in production by directly going to the create page)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LogLevel } from "@homarr/core/infrastructure/logs/constants";
|
||||
|
||||
import { createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
|
||||
import { createCacheChannel, createListChannel, createQueueChannel, createSubPubChannel } from "./lib/channel";
|
||||
|
||||
export {
|
||||
createCacheChannel,
|
||||
@@ -40,3 +40,14 @@ export interface LoggerMessage {
|
||||
}
|
||||
|
||||
export const loggingChannel = createSubPubChannel<LoggerMessage>("logging");
|
||||
|
||||
/**
|
||||
* POC: Redis cache for widget prefetch data.
|
||||
* Caches serialized query data per widget kind to avoid database queries on every page load.
|
||||
* Default TTL: 5 minutes (matches existing cron job intervals).
|
||||
*
|
||||
* Usage: see packages/widgets/src/prefetch.ts
|
||||
* This can be reverted by reverting this commit.
|
||||
*/
|
||||
export const createWidgetPrefetchCache = (widgetKind: string) =>
|
||||
createCacheChannel<Record<string, unknown>>(`widget-prefetch:${widgetKind}`, 5 * 60 * 1000);
|
||||
@@ -37,7 +37,7 @@
|
||||
"@mantine/hooks": "^8.3.16",
|
||||
"@mantine/spotlight": "^8.3.16",
|
||||
"@tabler/icons-react": "^3.40.0",
|
||||
"jotai": "^2.18.0",
|
||||
"jotai": "^2.18.1",
|
||||
"next": "16.1.6",
|
||||
"react": "19.2.4",
|
||||
"react-dom": "19.2.4",
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "实例"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "城市/邮编",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "天气"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "crwdns3876:0crwdne3876:0"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "crwdns3928:0crwdne3928:0",
|
||||
"description": "crwdns3930:0crwdne3930:0",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": "crwdns3932:0crwdne3932:0"
|
||||
},
|
||||
"showStats": {
|
||||
"label": "crwdns3934:0crwdne3934:0"
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": "crwdns3936:0crwdne3936:0"
|
||||
},
|
||||
"showViolations": {
|
||||
"label": "crwdns3938:0crwdne3938:0"
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "crwdns3940:0crwdne3940:0",
|
||||
"totalUsers": "crwdns3942:0crwdne3942:0",
|
||||
"transcodes": "crwdns3944:0crwdne3944:0",
|
||||
"bandwidth": "crwdns3946:0crwdne3946:0"
|
||||
},
|
||||
"streams": {
|
||||
"empty": "crwdns3948:0crwdne3948:0",
|
||||
"user": "crwdns3950:0crwdne3950:0",
|
||||
"media": "crwdns3952:0crwdne3952:0",
|
||||
"state": "crwdns3954:0crwdne3954:0",
|
||||
"quality": "crwdns3956:0crwdne3956:0",
|
||||
"device": "crwdns3958:0crwdne3958:0",
|
||||
"progress": "crwdns3960:0crwdne3960:0",
|
||||
"videoDecision": {
|
||||
"directPlay": "crwdns3962:0crwdne3962:0",
|
||||
"transcode": "crwdns3964:0crwdne3964:0",
|
||||
"directStream": "crwdns3966:0crwdne3966:0"
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "crwdns3968:0crwdne3968:0",
|
||||
"empty": "crwdns3970:0crwdne3970:0",
|
||||
"watched": "crwdns3972:0crwdne3972:0",
|
||||
"partial": "crwdns3974:0crwdne3974:0"
|
||||
},
|
||||
"violations": {
|
||||
"title": "crwdns3976:0crwdne3976:0",
|
||||
"empty": "crwdns3978:0crwdne3978:0",
|
||||
"rule": "crwdns3980:0crwdne3980:0",
|
||||
"user": "crwdns3982:0crwdne3982:0"
|
||||
},
|
||||
"noSectionsEnabled": "crwdns3984:0crwdne3984:0",
|
||||
"error": {
|
||||
"noIntegration": "crwdns3986:0crwdne3986:0",
|
||||
"internalServerError": "crwdns3988:0crwdne3988:0"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "crwdns1110:0crwdne1110:0",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "crwdns3724:0crwdne3724:0"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": "crwdns3990:0crwdne3990:0"
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "By / Postnummer",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Vejr"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Stadt / Postleitzahl",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Instanzen"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Stadt / Postleitzahl",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Wetter"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -2033,7 +2033,6 @@
|
||||
"directStream": "Direct Stream"
|
||||
}
|
||||
},
|
||||
|
||||
"recentActivity": {
|
||||
"title": "Recent Activity",
|
||||
"empty": "No recent activity",
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Instancias"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Ciudad / Código postal",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Tiempo"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Instances"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Ville / Code Postal",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Météo"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "עיר / מיקוד",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "מזג אוויר"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Istanze"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "Utenti Totali",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "Utente",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "Dispositivo",
|
||||
"progress": "Avanzamento",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": "Parziale"
|
||||
},
|
||||
"violations": {
|
||||
"title": "Violazioni",
|
||||
"empty": "Nessuna violazione recente",
|
||||
"rule": "Regola",
|
||||
"user": "Utente"
|
||||
},
|
||||
"noSectionsEnabled": "Nessuna sezione abilitata",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Città / Codice postale",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Meteo"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "都市/郵便番号",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "天気"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Stad / postcode",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Weer"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Instanser"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "By / Postnummer",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Vær"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Miasto / kod pocztowy",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Pogoda"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Instâncias"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Cidade / CEP",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Clima"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": "Экземпляры"
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Город / Почтовый индекс",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Погода"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Mesto / PSČ",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Şehir / Posta kodu",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": "Hava Durumu"
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "Місто / Поштовий індекс",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1996,6 +1996,61 @@
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"tracearr": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"option": {
|
||||
"showStreams": {
|
||||
"label": ""
|
||||
},
|
||||
"showStats": {
|
||||
"label": ""
|
||||
},
|
||||
"showRecentActivity": {
|
||||
"label": ""
|
||||
},
|
||||
"showViolations": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"activeStreams": "",
|
||||
"totalUsers": "",
|
||||
"transcodes": "",
|
||||
"bandwidth": ""
|
||||
},
|
||||
"streams": {
|
||||
"empty": "",
|
||||
"user": "",
|
||||
"media": "",
|
||||
"state": "",
|
||||
"quality": "",
|
||||
"device": "",
|
||||
"progress": "",
|
||||
"videoDecision": {
|
||||
"directPlay": "",
|
||||
"transcode": "",
|
||||
"directStream": ""
|
||||
}
|
||||
},
|
||||
"recentActivity": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"watched": "",
|
||||
"partial": ""
|
||||
},
|
||||
"violations": {
|
||||
"title": "",
|
||||
"empty": "",
|
||||
"rule": "",
|
||||
"user": ""
|
||||
},
|
||||
"noSectionsEnabled": "",
|
||||
"error": {
|
||||
"noIntegration": "",
|
||||
"internalServerError": ""
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"location": {
|
||||
"query": "城市 / 郵遞區號",
|
||||
@@ -3518,6 +3573,9 @@
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
},
|
||||
"tracearr": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { cache } from "react";
|
||||
import type { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
import { db } from "@homarr/db";
|
||||
import { getServerSettingsAsync } from "@homarr/db/queries";
|
||||
import type { WidgetKind } from "@homarr/definitions";
|
||||
import { createWidgetPrefetchCache } from "@homarr/redis";
|
||||
import { createSettings } from "@homarr/settings/creator";
|
||||
|
||||
import { reduceWidgetOptionsWithDefaultValues } from ".";
|
||||
@@ -12,6 +14,7 @@ import prefetchForBookmarks from "./bookmarks/prefetch";
|
||||
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
|
||||
import type { inferOptionsFromCreator } from "./options";
|
||||
|
||||
const logger = createLogger({ module: "widgetPrefetch" });
|
||||
const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);
|
||||
|
||||
const prefetchCallbacks: Partial<{
|
||||
@@ -21,6 +24,16 @@ const prefetchCallbacks: Partial<{
|
||||
app: prefetchForApps,
|
||||
};
|
||||
|
||||
/**
|
||||
* POC: Try to read widget prefetch data from Redis cache first.
|
||||
* Falls back to the original database-backed prefetch on cache miss.
|
||||
*
|
||||
* When Redis has cached data (populated by cron jobs or previous page loads),
|
||||
* this avoids database queries entirely — estimated 2-5x faster TTFB.
|
||||
*
|
||||
* The cache is populated after a successful database prefetch (write-through).
|
||||
* TTL is 5 minutes to match cron job intervals.
|
||||
*/
|
||||
export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
||||
kind: TKind,
|
||||
queryClient: QueryClient,
|
||||
@@ -41,5 +54,41 @@ export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
||||
options: reduceWidgetOptionsWithDefaultValues(kind, createSettings({ user: null, serverSettings }), item.options),
|
||||
}));
|
||||
|
||||
// POC: Try Redis cache first for widget prefetch data
|
||||
try {
|
||||
const cacheChannel = createWidgetPrefetchCache(kind);
|
||||
const cached = await cacheChannel.getAsync();
|
||||
if (cached) {
|
||||
// Cache hit: populate query client from Redis instead of database
|
||||
for (const [key, value] of Object.entries(cached.data)) {
|
||||
queryClient.setQueryData(JSON.parse(key), value);
|
||||
}
|
||||
logger.debug(`Widget prefetch cache hit for kind '${kind}'`);
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
// Redis unavailable or parse error — fall through to database
|
||||
logger.debug(`Widget prefetch cache miss/error for kind '${kind}', falling back to database`);
|
||||
}
|
||||
|
||||
// Cache miss: prefetch from database (original path)
|
||||
await callback(queryClient, itemsWithDefaultOptions as never[]);
|
||||
|
||||
// POC: Write-through — cache the prefetched data for next request
|
||||
try {
|
||||
const cacheChannel = createWidgetPrefetchCache(kind);
|
||||
const queryCache = queryClient.getQueryCache().getAll();
|
||||
const cacheData: Record<string, unknown> = {};
|
||||
for (const query of queryCache) {
|
||||
if (query.state.data !== undefined) {
|
||||
cacheData[JSON.stringify(query.queryKey)] = query.state.data;
|
||||
}
|
||||
}
|
||||
if (Object.keys(cacheData).length > 0) {
|
||||
await cacheChannel.setAsync(cacheData);
|
||||
logger.debug(`Widget prefetch cache populated for kind '${kind}' (${Object.keys(cacheData).length} entries)`);
|
||||
}
|
||||
} catch {
|
||||
// Non-critical: cache write failure doesn't affect the user
|
||||
}
|
||||
};
|
||||
Generated
+337
-704
File diff suppressed because it is too large.
Load diff
Executable
+148
@@ -0,0 +1,148 @@
|
||||
#!/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
|
||||
Executable
+129
@@ -0,0 +1,129 @@
|
||||
#!/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}"
|
||||
+3
-8
@@ -45,19 +45,14 @@ fi
|
||||
|
||||
|
||||
|
||||
node apps/tasks/tasks.cjs &
|
||||
TASKS_PID=$!
|
||||
|
||||
node apps/websocket/wssServer.cjs &
|
||||
WSS_PID=$!
|
||||
|
||||
node apps/nextjs/server.js &
|
||||
# Tasks/cron and WebSocket servers are now integrated into the custom Next.js server
|
||||
node apps/nextjs/customServer.cjs &
|
||||
NEXTJS_PID=$!
|
||||
|
||||
# Function to handle SIGTERM and shut down services
|
||||
terminate() {
|
||||
echo "Received SIGTERM. Shutting down..."
|
||||
kill -TERM $NGINX_PID $TASKS_PID $WSS_PID $NEXTJS_PID 2>/dev/null
|
||||
kill -TERM $NGINX_PID $NEXTJS_PID 2>/dev/null
|
||||
wait
|
||||
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
|
||||
if [ -n "$REDIS_PID" ]; then
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "16.1.6",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-config-turbo": "^2.8.14",
|
||||
"eslint-config-turbo": "^2.8.15",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^6.1.1",
|
||||
"typescript-eslint": "^8.56.1"
|
||||
"typescript-eslint": "^8.57.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
|
||||
Reference in new issue
Block a user