Conversation
…n system This commit introduces a comprehensive system for managing plugin repositories and verifying plugin integrity within DockStat. - **New `repositories` Database Table:** A dedicated table `repositories` is created to store plugin repository configurations, including name, source, type, verification policy, verification API endpoint, and verification status. This replaces the `registered_repos` field previously stored in `DockStatConfigTable`. - **API Endpoints:** New CRUD (Create, Read, Update, Delete) API endpoints (`/api/v2/db/repositories`, `/api/v2/db/repositories/:id`) are added to manage repository configurations. - **Frontend UI (`/plugins`):** A new "Plugins" page provides a user interface for: - Listing all configured plugin repositories with their status and policies. - Adding, editing, deleting, and toggling the verification status of repositories. - Displaying a list of installed plugins with detailed information (author, manifest, tags, routes, actions, hooks). - Showing real-time plugin verification status and security warnings based on repository policies. - **Plugin Verification Logic:** - Integrates a client-side verification mechanism that computes plugin hashes and compares them against a configurable verification API (defaulting to `http://localhost:3100`). - Supports different verification policies (`strict` or `relaxed`) defined per repository. - Displays security status (`safe`, `unsafe`, `unknown`, `unverified`) for each plugin. - **Database Initialization:** Updates the database factory to initialize default repositories if none exist. - **Improved Boolean Parsing:** Enhanced the `sqlite-wrapper` to robustly parse boolean values from various database representations (e.g., "1", "0", "true", "false", 1, 0) into proper boolean types. - **Navigation Integration:** Added a "Plugins" link to the main application navigation. - **Minor:** Removed direct API listening logic from `apps/api/src/index.ts` to allow for external orchestration. This feature lays the groundwork for a more secure and manageable plugin ecosystem.
…tion service DB
- **API (`apps/api`)**:
- Restructured the `/plugins/hooks` API response from an array of `[pluginId, Map<string, unknown>]` to a more structured `Array<{ pluginId: number; hooks: string[] }>`. This improves API clarity and ease of consumption.
- **Frontend (`apps/dockstat`)**:
- Updated `PluginDetailModal` to correctly parse and display the new `/plugins/hooks` API response format.
- Minor cleanup in `verifyPluginsBatch` error handling (`catch (_) `).
- **Verification Service (`apps/dockstore-verification`)**:
- **Database Refactor**: Centralized database initialization and table accessors. The `db` instance and all table objects (e.g., `repositoriesTable`, `pluginsTable`) are now directly exported as singletons from `src/db/index.ts`, simplifying DB dependency management across the service.
- **Route Refactor**: Modified all API and page routes (`src/routes/*.ts(x)`) to directly import the centralized `db` and table accessors, removing the need to pass the `db` instance as an argument to route creation functions.
- **Configuration**: Updated the service to read `VERIFICATION_DB_PATH` from environment variables (with a default) and explicitly set the server `PORT` to `3000`.
- **Dockerfile**: Aligned `EXPOSE` port to `3000`.
- **Plugin Handler (`packages/plugin-handler`)**:
- Improved logging for plugin hook caching to include the count of hooks per plugin, enhancing clarity.
…erification API (#31) * Initial plan * Fix TypeScript types, Docker build, and add manual plugin addition Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * Improve manual plugin addition with tag parsing and better UI feedback Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * Fix code review issues: remove duplicate API docs and improve SVG title Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * Address code review feedback: remove unused variable and add error handling Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * Add validation for database insert operations and fix formatting Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * Fix insertId validation and HTML rows attribute syntax Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> * build(dockstore-verification): Refactor Docker build and update port Refactor Docker build process: The Dockerfile for the DockStore Verification API has been transitioned from a multi-stage build to a local build followed by a simplified Docker image creation. The `bun run build` step is now executed locally before `docker build`, enabling direct copying of the pre-built `dist` directory into the final image. This simplifies the Dockerfile and streamlines the build process. Update default port: The application's default listening port has been updated from `3000` to `3200`, as reflected in `src/index.tsx`, the `Dockerfile`'s `EXPOSE` instruction, and the `VERIFICATION_PORT` environment variable. Add Docker environment variables: Several `DOCKSTAT_LOGGER_*` environment variables have been added to the Dockerfile to provide more granular control over logging behavior within the container. Clean up: Removed unused `outline-sync.json` and `sync.sh` files. * feat(logger, dockstore-verification): Enhance logging with configurable levels and optimize app startup Implemented support for the `DOCKSTAT_LOGGER_LEVEL` environment variable in the `@dockstat/logger` package, allowing runtime control over the minimum logging level (error, warn, info, debug). This improves log verbosity management. Refactored the `dockstore-verification` application to use `_start.ts` as its main entry point, addressing an issue where Bun's direct execution of `.tsx` files could produce unwanted log messages. This change required updates to the Dockerfile and package.json scripts. Centralized logger instantiation within `dockstore-verification` by introducing a `BaseLogger` and spawning specific loggers from it. This ensures a consistent logging structure and prefixing across different modules. Additionally, improved error logging in `api.tsx` for consistency and added `<strong safe>` for enhanced security when displaying dynamic content. * chore(ci): Lint [skip ci] * chore(ci): Lint [skip ci] * Update apps/dockstore-verification/src/routes/api.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ItsNik <info@itsnik.de> * chore(ci): Lint [skip ci] * Update apps/dockstore-verification/src/routes/api.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ItsNik <info@itsnik.de> * chore(ci): Lint [skip ci] * refactor(verification-app): Enhance UI security, resolve linter warnings, and update gitignore * build(dockstore-verification): Migrate to multi-stage distroless Docker image - **Docker & Build System:** - Implemented a multi-stage Docker build process using `oven/bun:canary` for the base stage and `oven/bun:canary-distroless` for the final runtime image. This significantly reduces image size and enhances security. - Updated Bun runtime prerequisite to v1.3+ and Dockerfile base images to `canary`. - Modified default server port from `3100` to `3200` across `README.md` and Docker run commands. - Changed `WORKDIR` in Dockerfile for base stage to align with new structure. - Removed `DOCKSTAT_LOGGER_ONLY_SHOW` environment variable. - **API Enhancements & Refactoring:** - Improved type safety in API routes by removing unnecessary non-null assertions (`!`) and explicitly casting IDs to `Number`. - Adopted `insertOrIgnore` for creating the "Manual Entries" repository, preventing errors on re-insertion. - Introduced stricter input validation for `hash` and `bundle_hash` fields in API requests, now requiring a SHA-256 pattern. - **Documentation & Project Structure:** - Updated `README.md` to reflect the new default port and added comprehensive documentation for `DOCKSTAT_LOGGER` environment variables. - Clarified project entry points (`_start.ts` as main) and added new components like `PublicDashboard` and `url` service. * chore(ci): Lint [skip ci] * chore(ci): Prevent empty and unconditional lint commits * refactor(core): Improve type safety, styling, and code consistency - Replaced non-null assertions with optional chaining and explicit type casting in `template-renderer` and `auth` middleware for enhanced type safety. - Added standard `line-clamp` CSS properties for improved cross-browser compatibility in `dockstore-verification`. - Standardized `ProgressDots` checkmark icon using `lucide-react` for UI consistency. - Refined `onClick` prop type for `Button` component to `React.MouseEventHandler` for better event handling. - Converted string concatenations to template literals in `outline-sync` package for modern syntax. - Cleaned up HTMX loading indicator CSS rules in `dockstore-verification`. - Removed unnecessary `stopPropagation` from `PluginCard` actions in `dockstat`. * chore(ci): Allow no-op lint commits --------- Signed-off-by: ItsNik <info@itsnik.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com> Co-authored-by: Its4Nik <info@itsnik.de> Co-authored-by: actions-user <its4nik@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…, backup/restore, and expanded APIs
- Implemented automatic detection and handling for `column.json()` and `column.boolean()` definitions directly from the schema. This removes the need for manual parser configuration for these types, streamlining the usage of JSON objects and boolean values (0/1).
- Introduced a robust backup and restore system:
- `backup()`: Creates manual database backups to a specified or generated path.
- `listBackups()`: Lists all managed backup files with metadata.
- `restore()`: Restores the database from a backup file, either to the original path or a new target path.
- `AutoBackupOptions`: Enables configurable automatic periodic backups with retention policies, including an initial backup on DB open and automatic cleanup of old backups.
- `stopAutoBackup()`: Provides explicit control to halt the automatic backup timer.
- Greatly expanded `README.md` with comprehensive examples for `QueryBuilder` operations (SELECT, INSERT, UPDATE, DELETE, WHERE conditions), new utility methods, and various `column` helpers.
- Added new utility methods for database management and introspection, including `getPath()`, `vacuum()`, `analyze()`, `integrityCheck()`, `getSchema()`, `getTableInfo()`, `getIndexes()`, and `getForeignKeys()`.
- Enhanced `column` helpers with new definitions such as `date`, `datetime`, `timestamp`, `varchar`, `char`, `numeric`, `uuid`, and `enum`.
- Migrated the internal testing infrastructure from a custom `test.ts` runner to dedicated `bun:test` files, improving test organization and reliability for new features like auto-detection, backup, restore, and parsing.
…vements - feat: Auto-detect JSON & Boolean columns from schema, eliminating manual parser config - feat: Introduce automatic database backups with configurable retention policies - feat: Add new backup and restore API (backup(), restore(), listBackups()) - feat: Provide `DB.getPath()` method to retrieve the database file path - fix: Correct Boolean column parsing to accurately convert SQLite's `0`/`1` to JavaScript `true`/`false` - refactor: Create new `utils/` module to centralize SQL building, logging, and row transformation logic - refactor: Implement structured, component-specific logging using a dedicated SqliteLogger - refactor: Consolidate identifier quoting and SQL clause building into `utils/sql.ts` - refactor: Encapsulate row serialization/deserialization logic in `utils/transformer.ts` - refactor: Enhance QueryBuilder base class to use new utilities, reducing code duplication and improving maintainability - refactor: Update Node.js module imports from 'fs' and 'path' to 'node:fs' and 'node:path' - perf: Optimize `SELECT` queries (`get()`, `count()`, `exists()`) to leverage direct SQL for efficiency when no client-side regex filtering is required - perf: Ensure batch operations (insertBatch, updateBatch, deleteBatch) are atomic by wrapping them in explicit database transactions - test: Add comprehensive new test suites for the DB class, all QueryBuilder methods (select, insert, update, delete, where), and the new `utils/` module
Updates the @dockstat/sqlite-wrapper dependency to version 1.3.0, along with minor import reordering in test files.
This commit introduces the ability to check and display the reachability status of Docker hosts. - **api(docker):** - Added new GET endpoints `/docker/ping` and `/docker/ping/:clientId` to return host reachability across clients. - Utilized Elysia's `t` for request parameter validation on `clientId`. - **docker-client:** - Enhanced `getAllHosts` to include a `reachable` status for each host. - Explicitly typed the `ping` method's response to include `reachableInstances` and `unreachableInstances`. - Added `enableContainerMetrics` to default DockerClient options. - **app(dockstat):** - Updated `Host` interface with `reachable: boolean`. - `HostsList` now displays "Reachable" or "Unreachable" badges for each Docker host. Refactor: Removed plugin management UI and related code - Completely removed the plugin management UI, including all related components, forms, types, and the `/plugins` route in `apps/dockstat`. This indicates a deprecation or significant overhaul of the plugin system.
…ation, and optimize API calls Delegates complex plugin and repository management logic to the backend API, introduces request-response correlation for Docker client workers, and optimizes API fetches for improved application performance. **Plugins & Repositories** * Removed extensive client-side logic for plugin verification, installation, deletion, activation, and repository CRUD operations. * All complex plugin and repository management functions are now handled by the backend API. * Simplified `Plugins.loader` to fetch only essential status and routes, removing verification and repository data processing from the client. * Eliminated the `Plugins.action` entirely, as form-based actions are now deprecated in favor of direct API calls. * Updated database schema and typings for repositories, removing `isVerified` and `hashes` fields, and setting a default policy to "relaxed". **Docker Client** * Implemented a unique `requestId` for worker communication to enable robust request-response correlation. * Ensures that responses from worker threads are precisely matched to their corresponding requests, preventing data mix-ups in concurrent operations. * Added `requestId` to `WorkerRequest` and `WorkerResponse` types and incorporated it into the `sendRequest` mechanism within the `DockerClientManagerCore`. * Improved logging for container fetching and added an early return for `getAllContainers` when no hosts are configured. **Application Adapters** * Optimized `Adapter.loader` to use `Promise.all` for concurrent fetching of Docker status and container information, significantly improving initial load times for these components. **Database** * Changed `config_table` initialization to `insertOrIgnore` to prevent errors on subsequent runs and ensure more resilient default configuration setup.
Adds a new `--force` (or `-f`) option to the `outline-sync` command. This option allows users to force push local document changes to Outline, bypassing the default timestamp comparison (local `mtime` or frontmatter `updatedAt` vs. remote `updatedAt`). When `--force` is enabled, local files are always marked as changed and pushed, regardless of whether the local version is considered newer than the remote one. This is useful for scenarios where timestamp discrepancies might occur or when an explicit overwrite of remote content is desired.
Replaces the simple server listening message with a detailed ASCII art banner. This banner provides quick links to the API endpoint, API documentation, and project documentation when the server starts.
…orker event parsing
- The `enableContainerMetrics` option has been moved from the top-level `DockerAdapterOptions` to `monitoringOptions` for better logical grouping and consistency.
- `monitoringOptions` is now a required property within `DockerAdapterOptions`, with comprehensive default values initialized in the `DockerClient` constructor. This ensures all monitoring settings are consistently defined.
- The `retryAttempts` for `listContainers` now correctly utilizes `monitoringOptions.retryAttempts`.
- Updated `apps/dockstat` adapter logic to correctly parse and apply `enableContainerMetrics` within the `monitoringOptions` object.
- Improved the `DockerClientManagerCore` event listener to robustly handle messages from worker threads. This includes:
- Introducing new `isProxyEventMessage` and `tryBuildMessageFromProxy` utilities in `@dockstat/utils` for more reliable and type-safe message parsing.
- Simplifying the `isProxyEventEnvelope` check in the manager.
- Added a `console.log` for client registration in the API.
- Implemented `console.error` logging for 'error' type events originating from workers, aiding in debugging.
- Updated typings and Zod schema to reflect the structural changes in `DockerAdapterOptions` and `MonitoringOptions`.
Improve error messages for missing Docker instances, providing more context on available instances. Refine error logging in the worker event proxy to include detailed error objects (name, message, stack) and additional contextual information. Introduce log truncation for large JSON objects in manager and core components to prevent excessive log output. Ensure consistent numeric typing for host IDs across monitoring modules, particularly when interacting with Docker instances and internal maps. - **docker-client**: Improve error messages for missing Docker instances, including available keys. - **workerEventProxy**: Elaborate error logging to differentiate between Error objects and other contexts, including stack traces and additional context. - **manager/containers & manager/core**: Apply truncation to JSON logged info messages to limit verbosity. - **monitoring modules**: Cast host IDs to Number for consistent usage with Maps and API calls. - **apps/dockstat**: Minor import reordering.
Introduce `@dockstat/plugin-builder` package to provide a type-safe API for developing DockStat plugins. This includes `definePlugin`, `pluginBuilder`, `createActions`, and other helper functions for improved developer experience and TypeScript inference. Refactor `@dockstat/plugin-handler` to expose the new builder utilities and update its documentation to reflect the new plugin development paradigm. Remove the `DockMon` default plugin and its associated automatic loading mechanism (`saveDefaultPlugins`). Default plugins are no longer bundled directly with the API, promoting a more modular installation process. Update `@dockstat/typings` to support enhanced type inference for plugin actions. BREAKING CHANGE: 1. The `DockMon` default plugin and the automatic `saveDefaultPlugins` mechanism have been removed. Monitoring functionality must now be installed as a separate plugin. 2. The recommended way to develop DockStat plugins has shifted to using the new type-safe builder utilities from the `@dockstat/plugin-builder` package. Existing plugin definitions might need updates to conform to the new API structure.
…t DockMon plugin moved to DockStore -> default plugin installation has to be re-added to DockStatAPI
…hancement
Introduce `generate-readme.ts` script to dynamically generate the `README.md` for the DockStore application.
This change includes:
- A new `generate-readme.ts` script that reads from a manifest (not included in this diff, but inferred) to create the `README.md`.
- Significant updates to `README.md` content, now featuring:
- Summary badges for plugin, theme, and stack counts.
- A table of contents for improved navigation.
- Detailed, structured entries for plugins (e.g., DockMon), replacing previous brief descriptions.
- Dedicated sections for Themes and Stacks, indicating future expansion.
- Addition of `readme` and `b:r` (bundle & readme) scripts to `package.json` to facilitate the generation process.
- Removal of unused `chalk` and `elysia` dependencies from `package.json`.
- **New Extensions Browser:** A new page at `/extensions/browser` has been added, providing a dedicated interface for discovering and managing extensions. It utilizes the new `ExtensionBrowserLoader` to fetch relevant data. - **Enhanced Plugin Page:** The `/plugins` page now features a refactored `PluginLoader` that fetches comprehensive plugin metrics, including installed plugins, loaded plugins, hooks, API routes, and frontend routes. A new `StatusBar` component visually presents these statistics, offering a detailed overview of the plugin ecosystem. - **Repositories API:** A new `GET /api/v2/repositories/all` endpoint has been introduced. This API provides a list of all configured plugin repositories from the database, essential for the extensions browsing functionality.
* refactor(frontend, apps): Refactor DockStat to Vite frontend, remove DockNode
- The `docknode` application and all its associated files have been entirely removed, streamlining the monorepo structure.
- The `dockstat` application has undergone a complete architectural overhaul and has been renamed to `@dockstat/frontend`.
- This refactoring transitions `@dockstat/frontend` from a full-stack React Router-based server-side rendered application to a dedicated, pure client-side rendered React application, powered by Vite.
- All server-side rendering components, API route definitions, and the `react-router` backend infrastructure previously located in `apps/dockstat/app/.server` have been removed.
- Data fetching for the frontend now exclusively leverages `@tanstack/react-query` for improved state management and caching.
- Introduced the new `@dockstat/contracts` package, which serves as a centralized source for re-exporting API types (specifically `TreatyType` from `@dockstat/api`). This ensures robust, end-to-end type safety between the frontend and the API.
- `package.json` scripts have been updated to utilize Vite's build and development commands, and various dependencies no longer needed for a pure frontend application have been removed.
- Configuration files (`tsconfig.json`, `vite.config.ts`, `bunfig.toml`, `.gitignore`, `.dockerignore`, `Dockerfile`) have been updated to reflect the new, simplified frontend architecture.
* refactor(contracts): Remove @dockstat/contracts package
The `@dockstat/contracts` package was an intermediary responsible for re-exporting types, primarily `TreatyType`, from the `@dockstat/api` package. Frontend applications, such as `apps/dockstat`, can now directly import these types from `@dockstat/api`, making the contracts package redundant.
This removal also leads to a significant cleanup of the `bun.lock` file, eliminating numerous transitive dependencies. Notably, the entire `msw` stack and its related development dependencies are removed, reducing overall project bloat and simplifying the dependency graph.
* feat(frontend,api): Setup core frontend architecture and API server listening
This commit lays the foundation for the DockStat frontend application and
finalizes the initial API server setup.
Frontend (apps/dockstat):
- Implemented React Router for client-side navigation and routing.
- Integrated TailwindCSS for styling, along with the @tailwindcss/vite plugin.
- Incorporated the @dockstat/ui component library.
- Established a structured data fetching pattern with TanStack React Query,
including dedicated `lib/queries` and `lib/actions` directories with READMEs
for guidance.
- Created a core `Layout` component that wraps application routes and integrates
the new Navbar and global loading indicators.
- Added utility hooks for global busy state and current location.
- Refactored `main.tsx` to use the new routing and layout structure, removing
the previous `App.tsx` and related boilerplate.
- Configured Biome and `tsconfig.json` aliases (`@Queries`) for improved developer
experience.
- Removed default Vite SVG and boilerplate styles.
API (apps/api):
- Enabled the Elysia API server to listen on a configurable port
(`DOCKSTATAPI_PORT` environment variable or default `3030`).
- Added detailed startup logging with ASCII art branding and key URLs
(API endpoint, docs).
- Included a temporary 10-second sleep in the `/api/v2/status` endpoint for
testing frontend loading states and UI feedback.
UI (packages/ui):
- Updated the `Navbar` component to utilize `react-router`'s `NavLink`
and respond to a global `isBusy` prop for visual feedback during fetching/mutations.
* perf(api/status): Remove artificial delay from status endpoint
* style(formatting): Apply consistent code formatting
Standardize indentation from tabs to spaces across TypeScript and JSON files.
This change ensures consistent code style within `apps/dockstat` and `apps/dockstore` and refactors JSON array formatting for improved readability. The `apps/dockstat/biome.json` file was removed as its configuration is now inherited from a higher-level Biome config.
* refactor(dockstat): Extract global busy state and location logic into dedicated hooks
Moves logic for determining global application busy state (fetching/mutating) and current router location into new, reusable custom hooks: `useGlobalBusy` and `useCurrentLocation`.
Updates `layout.tsx` to consume these new hooks.
Removes an obsolete CSS link from `index.html`.
* style(imports): Sort import declarations
* refactor(error-handling, ui): Standardize API error messages and simplify Navbar active state
- Introduce `@dockstat/utils` package to the `dockstat` app for a centralized `extractEdenError` utility.
- Update `fetchStatus.ts` to use `extractEdenError` for more consistent and structured error handling when interacting with the backend API.
- Refactor the `Navbar` component in `@dockstat/ui`:
- Remove the `location` prop, as its functionality is now natively handled by `react-router-dom`'s `NavLink`.
- Update `NavLink` usage to leverage its render prop `isActive` for styling the active navigation item badge, simplifying the component logic.
- Update `package.json` and `bun.lock` for the new dependency.
…host logging
This commit introduces a dynamic sidebar navigation system and enhances API startup logging for better accuracy.
**Dynamic Sidebar Navigation:**
- Implements a new `Sidebar` component in `@dockstat/ui`, accessible via a toggle button in the `Navbar`.
- The `Navbar` now dynamically fetches its navigation links from the API using `@tanstack/react-query` and a new `fetchNavLinks` query. This replaces hardcoded paths, making the navigation configurable.
- Updates the `nav_links` type definition in `@dockstat/typings` to support an array of objects `{ slug: string, path: string }`, allowing for structured navigation.
- Adds `@icons-pack/react-simple-icons` dependency to `@dockstat/ui` for displaying various external links (GitHub, Docs, NPM) and a busy indicator within the sidebar.
- Ensures the main layout in `apps/dockstat` uses `min-h-screen` to properly contain content.
**API Host Logging:**
- Modifies the API startup logger output in `apps/api` to display the actual `hostname` and `port` the server is running on, instead of the static `localhost:${PORT}`. This provides more accurate connection details, especially in containerized or networked environments.
**Other Changes:**
- Adds a temporary 10-second `sleep` to the `/api/v2/status` endpoint, likely for development or testing purposes.
- Includes a crucial comment in `apps/dockstat/src/index.css` highlighting a theme import.
…ble settings
* **feat(api):** Add `/misc/stats/rss` WebSocket endpoint for real-time process RSS memory usage.
* The endpoint streams formatted memory usage every 2 seconds.
* **feat(frontend):** Display live backend RSS memory in the Navbar.
* A new `AdditionalSettingsContext` and provider allow configuring this feature.
* Utilizes a new `rssFeedEffect` for WebSocket subscription and state updates.
* Navbar component updated to conditionally render the RAM usage badge.
* **feat(config):** Introduce `addtionalSettings` to the `DockStatConfigTable`.
* Allows toggling `showBackendRamUsageInNavbar` with a default value of `true`.
* Updates DB schema (`packages/db`) and typings (`packages/typings`).
* **refactor(frontend):** Consolidate React providers into `DockStatProviders`.
* Abstracts `QueryClientProvider` and the new `AdditionalSettingsProvider`.
* **refactor(frontend):** Enhance homepage UI for service display.
* Services are now rendered as individual cards with improved badge logic for status.
* Renamed `FetchBackendStatus` to `fetchBackendStatus`.
* **fix(docker):** Correct `dockstat-api` volume mount in `docker-compose.dev.yaml`.
* Ensures the API container correctly mounts its source code for development.
* **chore(scripts):** Add `dev:dockstat` script for filtered development startup.
* Simplifies starting frontend and API services together.
* Updated bun.lock and package dependencies.
The `rssFeedEffect` now correctly returns a cleanup function that closes the WebSocket subscription when the component unmounts. This prevents potential memory leaks and ensures resources are properly released. Additionally, the subscription variable was renamed from `usub` to `rssFeed` for better clarity. Removed redundant `refetchInterval: false` from `useQuery` in `layout.tsx`.
Reordered import statements across multiple files in `apps/dockstat` and `packages/ui` to establish a more consistent and readable import organization. This change solely focuses on code structure and does not alter any functional behavior.
… table component
This commit introduces real-time backend log streaming via WebSockets and significantly refactors the UI table component for improved functionality and performance.
**Key Changes:**
* **Real-time Backend Logs:**
* **`@dockstat/api`**: Added `/ws/logs` and `/ws/rss` WebSocket endpoints. The API's logger now utilizes a new `LogHook` to stream log entries to connected clients. The previous polling mechanism for RSS memory usage has been replaced with a WebSocket.
* **`@dockstat/logger`**: Refactored the internal structure (v2.0.0) to introduce a `LogHook` mechanism, allowing external components to subscribe to log entries programmatically.
* **`@dockstat/dockstat`**: Implemented client-side logic to subscribe to `/ws/logs` and `/ws/rss` endpoints. Backend logs are now displayed in a new modal accessible from the sidebar, and backend RAM usage is updated in real-time.
* **Enhanced Table Component:**
* **`@dockstat/ui`**: Performed a major refactor of the `Table` component, breaking it down into `TableHeader`, `TableBody`, `TableRow`, and `TableToolbar` sub-components, powered by a `useTable` hook. This significantly improves modularity, extensibility, and introduces features like:
* **Virtualization**: Efficiently renders large datasets, preventing UI slowdowns.
* **Toolbar**: Integrated search, sort, and filter functionalities directly into the table header.
* The new `Table` component is used to display real-time backend logs in the `@dockstat/dockstat` application.
* **Utilities & Dependencies:**
* **`@dockstat/utils`**: Added `arrayUtils.pushWithLimit` for managing array size, used for log message buffering.
* Updated `@dockstat/logger` to version `2.0.0` across all dependent workspaces.
* Updated `bun.lock` to reflect all dependency changes.
* **Minor UI Improvements:**
* Added `hover:underline` to `LinkWithIcon` in `@dockstat/ui`.
This extensive update provides a more dynamic and performant user experience, especially for monitoring backend activity and handling large data displays.
…ocumentation
- Created a new `apps/docs/dockstat/patterns/README.md` to house common development patterns.
- Integrated existing `apps/dockstat/src/lib/actions/README.md`, `apps/dockstat/src/lib/queries/README.md`, and `apps/dockstat/src/lib/websocketEffects/README.md` into the main documentation system under the new 'Patterns' section.
- Updated `apps/docs/outline-sync.config.json` to include these new documentation entries and custom paths.
- Performed a significant refactor of `apps/docs/dockstat/packages/@dockstat-plugin-handler/README.md`, which involved:
- Removing deprecated "Plugin Builder API" and "Frontend Methods" sections.
- Simplifying plugin definition examples for clarity.
- Improving formatting of lists (from hyphens to asterisks).
- Adding new integration examples (e.g., Elysia API).
- Refreshed `updatedAt` timestamps across various documentation files as part of the documentation sync process.
Refactored Outline Sync's configuration system for improved flexibility and robustness, alongside general documentation formatting and content corrections.
* **`packages/outline-sync`:**
* Implemented robust configuration discovery, supporting `.js`, `.cjs`, `.yaml`, `.yml` files, and the `outline` key within `package.json`.
* Added support for `OUTLINE_CONFIG` environment variable to explicitly specify the config file path.
* Refactored config loading into `findConfigPath` and `loadConfigFilePath` for clearer logic.
* Improved date parsing and comparison for local vs. remote document updates using a new `parseToDate` helper.
* Removed the `--force` CLI option and the `verify` command.
* Corrected a typo in `outline-sync.config.json` for the `websocketEffects` README path.
* Enhanced document path resolution to prevent redundant subfolders for root-level documents in the output directory.
* Normalized `updatedAt` frontmatter property to ISO string for consistent parsing.
* **`apps/dockstat/src/lib/actions/README.md`**:
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Standardized quotation marks from smart quotes (`“ ”`) to straight quotes (`" "`).
* Changed TypeScript code block language from `ts` to `tsx`.
* **`apps/dockstat/src/lib/queries/README.md`**:
* Corrected an accidental duplication of frontmatter content.
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Standardized quotation marks from smart quotes (`“ ”`) to straight quotes (`" "`).
* Changed TypeScript code block language from `ts` to `tsx`.
* **`apps/dockstat/src/lib/websocketEffects/README.md`**:
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Changed TypeScript code block language from `ts` to `tsx` for frontend examples and to `typescript` for backend examples.
* Adjusted newline formatting for improved readability.
* **`apps/docs/dockstat/**`**:
* Updated `updatedAt` timestamps across various documentation files (auto-generated during sync).
* **`packages/template-renderer/README.md`**:
* Minor formatting adjustments within code blocks.
The `push` command now supports a `--force` option, allowing users to forcefully synchronize all local markdown files with Outline, bypassing remote timestamp comparisons. A new `verify` command has been introduced to validate the `outline-sync` configuration and custom path resolution, aiding in setup and debugging. Minor cosmetic adjustment to the "Pulled" status message in the sync summary table.
Enhance user experience on `/p/:pluginId/:routePath` by completely overhauling the UI for loading, error, not found, and no template states.
- Introduce `framer-motion` for smooth card animations and transitions.
- Integrate `lucide-react` icons (`Loader2`, `AlertTriangle`, `Search`, `FileX`) for clearer visual feedback in each state.
- Implement `InfoBlock` component to display structured plugin and route details in error and not-found messages.
- Dynamically set the page heading using `PageHeadingContext` based on plugin metadata or URL.
- Refactor navigation buttons in error states to be more consistent and user-friendly.
fix(plugin-handler): Corrected the plugin bundle fetching logic by appending `/${plugin.manifest}` to the repository path when retrieving plugin bundles. This ensures the correct bundle is fetched when a manifest file is specified within the repository.
…component variant
This commit introduces dynamic navigation for frontend plugins and refactors the `Slides` UI component, enhancing application extensibility and UI flexibility.
- **Frontend Plugin Route Integration:**
- A new query, `fetchFrontendPluginRoutes`, was added to retrieve frontend-defined routes from the backend's `/api/v2/plugins/frontend/routes/by-plugin` endpoint.
- These plugin routes are now dynamically fetched and passed to the `Navbar` and `Sidebar` components.
- The `Sidebar` component has been updated to render these plugin routes under their respective plugin names, allowing plugins to extend the application's navigation.
- **`Slides` Component Refactor:**
- The `Slides` component in `@dockstat/ui` now supports a `variant` prop, introducing a `minimal` display option.
- The `minimal` variant removes the `Card` wrapper and adjusts internal styling, providing a more lightweight and versatile presentation for different UI contexts.
- Button styling and collapse animations were also adjusted to accommodate the new variant.
- **Minor Enhancements:**
- In `layout.tsx`, the `useQuery` data for `fetchNavLinks` was explicitly named `navLinks` for better clarity.
- Error styling in `pluginId.tsx` was updated to use semantic CSS classes (`bg-error/10` and `text-error`) for consistency.
Introduces an API endpoint and handler for dynamically unloading plugins, enhancing plugin management capabilities. Reworks the frontend plugin route API (`/api/v2/plugins/frontend/routes`) to return pre-grouped and formatted paths, simplifying client-side data consumption. Significantly improves the frontend sidebar user experience by: - Updating the `LinkWithIcon` component to natively support `react-router`'s `NavLink` for active state styling. - Integrating `framer-motion` for smoother UI animations. - Redesigning the display of plugin routes in the sidebar to use `SidebarItem` for consistent styling, pinning, and active state feedback. - Grouping plugin routes by their respective plugin names. Additionally: - Shortens the base path prefix for frontend plugin routes from `/plugins` to `/p`. - Removes the generic "API Request running..." busy indicator from the sidebar.
… component Moves the plugin browsing functionality from 'pages/extensions/index.tsx' to a new, dedicated component in 'pages/extensions/plugins.tsx'. This refactoring: - Creates a new `PluginBrowser` component and moves all plugin browsing logic into it. - Updates the application routing to establish '/extensions' as a parent route and '/extensions/plugins' as the new entry point for browsing plugins. - Modifies the sidebar navigation to reflect this hierarchy, displaying 'Browse Plugins' as a child link under 'Extensions'. - Prepares the '/extensions' route to host future extensions management features, such as repository configuration, by making it a dedicated parent page.
…ization (#47) - Refactors plugin loading mechanism to utilize in-memory Blob objects and `URL.createObjectURL` instead of writing to temporary files. This improves security, performance, and resource management by eliminating filesystem I/O. - Updates the `PluginHandler` constructor to directly accept a `Logger` instance, simplifying logger configuration and promoting consistency. - Implements eager loading of all registered plugins during API startup, ensuring plugins are available immediately upon service initialization.
- **apps/dockstore-verification**: - Renamed package to `@dockstat/store-verification`. - Integrated OpenAPI documentation with Scalar UI, accessible at `/docs`. - Migrated `hashString` utility to `@dockstat/utils`. - Enhanced XSS protection in `Verify.tsx` views by adding `safe` attribute. - Passed logger instance to `sqlite-wrapper`'s `DB` constructor. - Adjusted plugin source hashing logic for consistency. - **packages/plugin-handler**: - Introduced comprehensive plugin verification logic in `savePlugin`. - Added `verificationApi` field to the `repositories` table for dynamic endpoint configuration. - Implemented `verifyPlugin` to fetch verification status from an external API using configured `verificationApi`. - Enforced security policies (`relaxed`, `strict`) based on repository settings. - Utilized `hashString` from `@dockstat/utils` for consistent hashing. - Added retry mechanism for plugin bundle fetching if initial attempt fails. - Defined `CompareResult` interface for standardizing verification API responses. - **packages/utils**: - Extracted `hashString` utility into `@dockstat/utils/src/string.ts` for monorepo-wide use. - Refactored module exports for better organization. - **packages/sqlite-wrapper**: - Made `logger` an optional parameter in `DB` constructor, providing a default logger if none is supplied. - **Root `package.json`**: - Updated `dev:dockstat` script to include the `@dockstat/store-verification` app.
Rename the `dockstore-verification` application to `@dockstat/store-verification` in `bun.lock` to align with monorepo naming conventions. This commit also includes minor cleanups: - Reordered import statements in various files for consistency. - Removed a debugging `console.log` statement from the extension browser component.
#49) * feat(dockstat): Add custom toast notifications and global error alerts * chore(ci): Lint [skip ci] * feat(toast): Allow ReactNode for toast descriptions - Enhance `ToastProps.description` to accept `string | ReactNode`, providing more flexible content options for toast messages. - Conditionally apply the `title` attribute to the toast description paragraph, ensuring it is only rendered when the description is a string to prevent invalid HTML with React elements. - Fix a typo in the server error toast message, changing "occured" to "occurred". - Adjust import orders in `toast.tsx` and `layout.tsx` for consistency. --------- Co-authored-by: actions-user <its4nik@users.noreply.github.com>
#51) * feat(plugins): Add UI feedback for plugin operations and refactor handler Implemented toast notifications in the UI for plugin installation and uninstallation, providing immediate user feedback with success or error messages. This improves the user experience by making plugin operations more transparent. Refactored the plugin handler's `savePlugin` method to enhance readability, maintainability, and error handling. Key logic has been extracted into dedicated private helper functions: `isDuplicatePlugin`, `ensurePluginBundle`, `checkPluginSafety`, `updateExistingPlugin`, and `insertNewPlugin`. All plugin operation results now return a consistent `{ success: boolean, message: string }` object. Additionally, the `verificationApi` column was removed from the plugin database schema, and the `Toast` component's default button variant was updated from "outline" to "secondary" for non-error messages. * fix(plugins): Enhance plugin update reliability and user feedback - Ensure correct `installedId` is passed when attempting to update/reinstall an existing plugin. - Add robust error handling during plugin updates to prevent inconsistent states if the previous version fails to uninstall. - Improve toast messages for plugin install/uninstall success and failure scenarios, providing clearer feedback to the user. - Format error messages more gracefully when fetching plugin bundles, displaying the error message directly instead of stringifying the entire error object.
…nload and UI refresh (#52) This commit enhances the plugin management workflow by introducing automatic loading and unloading of plugins. - **Automatic Loading**: Newly installed plugins are now automatically loaded into memory via `loadPlugin` after insertion, ensuring they are immediately active without requiring a restart. - **Automatic Unloading**: Deleted plugins are now automatically unloaded from memory via `unloadPlugin`, ensuring resources are freed and their routes are removed from the system. - **Frontend UI Refresh**: On plugin installation or deletion, `fetchFrontendPluginRoutes` is invalidated, ensuring the UI immediately reflects changes in available plugin routes and extensions. - Removed a debug `console.log` from `getPluginBundle`.
* feat(app, ui): Enhance sidebar navigation with animations and refine toast
- Refactors the `toast` utility function into `lib/toast.tsx`, separating it from the `Toast` component definition.
- Updates the default dismiss button in the `Toast` component to use an 'X' icon from `lucide-react` and apply `sm` size styling.
- Introduces animated toggling between 'Main routes' and 'Plugin routes' in the Sidebar using `framer-motion`'s `AnimatePresence`.
- Adds a new `xs` button size to the `@dockstat/ui` package, utilized by the new sidebar route selection buttons.
- Simplifies the `isPinned` check for sidebar items within plugin routes.
* chore(ci): Lint [skip ci]
* feat(ui): Make Navbar logo clickable for home navigation
The DockStat logo in the application's Navbar component now functions as a clickable link, directing users to the root path ("/"). This change improves user experience by providing a quick way to return to the home screen from any page.
Additionally, this commit updates the import path for the 'toast' utility in `apps/dockstat/src/pages/extensions/plugins.tsx` from `@/components/toast` to `@/lib/toast`, reflecting a refactor in the project's utility structure.
* feat(ui): Implement global search (CMD+K) and UI component enhancements
Introduces a global search modal, accessible via CMD/CTRL+K, allowing users to quickly navigate across DockStat. This feature aggregates all available links, including pinned items, plugin-provided routes, and standard sidebar pages, for efficient access.
This commit also includes significant UI component enhancements and structural improvements:
- **Global Search (`SearchLinkModal`):**
- Aggregates links from pins, plugins, and sidebar paths.
- Provides fuzzy filtering and animated result display.
- Implements keyboard shortcuts (CMD/CTRL+K to open, Escape to close).
- **Card Component:**
- Adds a new `glass` prop to enable a frosted glass background effect (`backdrop-blur-lg`) across all card variants.
- **Modal Component:**
- Introduces a `transparent` prop to render modals with a frosted glass backdrop.
- Extracts modal animation variants into a dedicated `variants.ts` file for better modularity.
- Enhances `AnimatePresence` and event handling for smoother modal interactions.
- **Input Component:**
- Adds an `autoFocus` prop for programmatic focus, utilized in the new search modal.
- **HoverBubble Component:**
- Increases its z-index (`z-100`) to ensure it always appears above other elements.
- **Sidebar & Navbar:**
- Refines styling for active navigation links and the pin button for improved visual clarity and interactivity.
- Adds subtle dotted dividers between top-level sidebar items for better structure.
- Implements an Escape key handler to easily close the sidebar.
- Integrates the new `SearchLinkModal` into the Navbar.
- **Extension Paths:**
- Expands the sidebar's "Extensions" section with new default paths: "Explore themes" and "Stacks".
- **Code Organization:**
- Reorders import statements in several files for consistency (likely due to automated formatting).
* refactor(ui): Sort imports and cleanup type declarations
Sorted imports alphabetically across several UI components including Modal, Navbar, SearchLinks, and SidebarItem to improve code consistency.
Removed the unused 'type Variants' import from Modal.tsx as it was no longer directly required, reducing unnecessary dependencies.
* feat(ui): Implement global link lookup modal and refactor sidebar
Introduce a new global link lookup modal (`LinkLookup`) accessible via `Ctrl/Cmd + K` for quick navigation. This component provides fuzzy searching across pinned links, plugin routes, and default sidebar pages, featuring `framer-motion` animations for a smooth user experience. It replaces the previous `SearchLinkModal`.
The `Sidebar` component has been refactored and moved to its own dedicated directory (`components/Sidebar`). This refactor includes:
- Moving `SidebarItem` and `SidebarAnimatedNav` to separate files for better modularity.
- Integrating `framer-motion` for animated transitions within the sidebar navigation.
- Enhancing overall organization and maintainability of navigation-related components.
* chore(ci): Lint [skip ci]
---------
Co-authored-by: actions-user <its4nik@users.noreply.github.com>
Introduce a dedicated UI and API for managing Docker clients and their associated hosts, alongside significant API updates for Bun compatibility and graceful shutdown.
* **API Enhancements & Bun Compatibility:**
* Adopt native Bun APIs (`bun:jsc`, `Bun.nanoseconds()`) for memory, heap, and uptime metrics across `/misc` stats and Prometheus exports. This improves accuracy and performance by leveraging Bun's internal APIs.
* Refactor the RSS websocket into a dedicated module (`websockets/rssSocket.ts`), also leveraging Bun's `memoryUsage().current` for direct memory reporting.
* Add graceful shutdown handlers for `SIGINT` and `SIGTERM` signals to the database module, ensuring proper resource closure upon API termination.
* **Docker Client & Host Management UI:**
* Add a new `/clients/configure` page, accessible via a sub-navigation item under "Clients", providing a centralized interface for infrastructure setup.
* Introduce new components (`AddClient`, `AddHost`) for defining Docker clients with detailed options (connection timeouts, retry logic, execution environment, granular monitoring settings) and registering new hosts with specific connection details (hostname, port, TLS, client assignment).
* Implement corresponding actions (`createNewClient`, `addHost`, `deleteClient`) to interact with the API, enabling full CRUD operations for client and host entities.
* Refine the styling and information presentation of `ClientCard`, `HostsList`, and `PoolStatsCard` components to enhance readability and user experience.
* **UI/UX Refinements:**
* Update card components across the `dockstat` app (ClientCard, HostsList, PoolStatsCard) to utilize new `flat` and `dark` variants and updated styling for improved visual hierarchy.
* Adjust the hover border thickness for `outlined` card variants in the `ui` package.
* Standardize toggle label colors to use theme variables for consistency.
* feat(ui/slides): Modularize Slides component and extract state/logic Refactors the `Slides` component into a more maintainable and composable architecture. This commit introduces: - A new `useSlidesState` hook to centralize all slide state management, including active slide, animation direction, and collapse logic. - `ButtonRow` component for rendering slide navigation buttons, supporting both connected and disconnected styles. - `SlidesHeader` and `MinimalSlidesHeader` components to encapsulate header and button row rendering for default and minimal variants, respectively. - `SlideContent` component (implied for content rendering) to handle slide transitions and collapse animations using Framer Motion. - Extraction of Framer Motion variants into `animations.ts` for better organization and improved animation handling (e.g., `position: absolute` for transitions). - Dedicated `types.ts` file for component-specific types. This refactoring significantly improves the separation of concerns, making the `Slides` component easier to understand, maintain, and extend. It also lays the groundwork for more robust and dynamic slide content and collapse animations. * chore(ci): Lint [skip ci] * Proxy host added to dcm and register a set (#55) * feat(multiple): Introduce SlideContent component and enhance Docker client host tracking This commit introduces a new `SlideContent` component for animated UI transitions and enhances the Docker client manager's ability to track host IDs. - **UI Components:** - Added a new `SlideContent` component to `@ui/components/Slides` that utilizes `framer-motion` for animated transitions between different content slides, improving user experience in dynamic interfaces. - Re-exported the `Column` type from `@ui/components/Table` to facilitate easier type imports for consumers. - **Docker Client Manager:** - Implemented `internalListeners` in `DockerClientManagerCore` to proactively manage `WorkerWrapper`'s `hostIds` set. - This new mechanism tracks `host:init`, `host:added`, and `host:removed` events, ensuring the `hostIds` set accurately reflects connected hosts. - The `host:init` event type has been added to `@typings/docker-client`. - **Dockstat Application:** - Refactored `WorkersTable` by removing redundant explicit type annotations from `render` function parameters, leveraging TypeScript's type inference. - Explicit type assertions (`as Type`) were introduced internally within the `render` functions for clarity and type safety where inference was not sufficient. * chore(ci): Lint [skip ci] * Update packages/docker-client/src/manager/core.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: ItsNik <info@itsnik.de> * Update packages/ui/src/components/Slides/SlideContent.tsx Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: ItsNik <info@itsnik.de> * chore(ci): Lint [skip ci] * refactor(docker-client): Remove 'host:init' event and clarify host lifecycle logging The 'host:init' event type has been removed from `DockerClientEvents` and its handling logic from `DockerClientManagerCore`. This simplifies the event API and ensures consistency with host lifecycle management. Additionally, debug logging for 'host:added' and 'host:removed' events has been enhanced to include the specific host ID and the exact Set operation (`.add()` or `.delete()`) being performed, improving observability during host lifecycle changes. --------- Signed-off-by: ItsNik <info@itsnik.de> Co-authored-by: actions-user <its4nik@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * refactor(ui/slides): Improve slide animation and content handling - Refactor `slideVariants` to utilize Framer Motion's `custom` prop for passing animation direction, simplifying its usage in `SlideContent`. - Introduce `mode="popLayout"` to `AnimatePresence` for more robust and smoother transitions, ensuring better layout management during animations. - Enhance the `hasContent` check in `SlideContent.tsx` to explicitly account for `null` `activeKey` and use `Object.hasOwn` for precise property validation. - Implement null safety when updating `contentRefs.current`, preventing potential runtime errors if `activeSlide` is `null`. - Remove the redundant `previousSlideIndex` ref from `useSlideState`, streamlining state management. --------- Signed-off-by: ItsNik <info@itsnik.de> Co-authored-by: actions-user <its4nik@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* refactor(page-heading): Use useEffect for setting page titles Moved the `setHeading` calls from `PageHeadingContext` into `useEffect` hooks across various pages. Previously, `setHeading` was invoked directly during the component's render phase. While often appearing to work, this can lead to subtle bugs, unnecessary re-renders, or warnings in strict mode, as it is a side effect. By wrapping `setHeading` in `useEffect`, we ensure that: - The heading is set only after the component mounts. - It re-sets only when its dependencies (e.g., `setHeading` function itself, or the derived `heading` variable in `pluginId.tsx`) change. - This aligns with React's best practices for managing side effects, improving component stability and preventing potential issues with render cycles. * refactor(dockstat): consolidate page heading logic with custom hook The `usePageHeading` hook is introduced to abstract away the `useContext(PageHeadingContext)` and `useEffect` pattern used for setting page titles. This simplifies page components by replacing boilerplate code with a single hook call, improving maintainability and readability. The change also includes: - Removal of the `useCurrentLocation` hook from `locations.ts` as it's no longer used. - Cleanup of unused `CardBody` and `CardHeader` imports in `HostsList` and `PoolStatsCard` components.
Its4Nik
commented
Jan 9, 2026
Owner
Author
Its4Nik
left a comment
There was a problem hiding this comment.
A refactor of the docker-client & typings packages would be much appreciated.
Its4Nik
added a commit
that referenced
this pull request
Jan 9, 2026
* Update main branch (again) (#39)
* feat(plugins): Implement plugin repository management and verification system
This commit introduces a comprehensive system for managing plugin repositories and verifying plugin integrity within DockStat.
- **New `repositories` Database Table:** A dedicated table `repositories` is created to store plugin repository configurations, including name, source, type, verification policy, verification API endpoint, and verification status. This replaces the `registered_repos` field previously stored in `DockStatConfigTable`.
- **API Endpoints:** New CRUD (Create, Read, Update, Delete) API endpoints (`/api/v2/db/repositories`, `/api/v2/db/repositories/:id`) are added to manage repository configurations.
- **Frontend UI (`/plugins`):** A new "Plugins" page provides a user interface for:
- Listing all configured plugin repositories with their status and policies.
- Adding, editing, deleting, and toggling the verification status of repositories.
- Displaying a list of installed plugins with detailed information (author, manifest, tags, routes, actions, hooks).
- Showing real-time plugin verification status and security warnings based on repository policies.
- **Plugin Verification Logic:**
- Integrates a client-side verification mechanism that computes plugin hashes and compares them against a configurable verification API (defaulting to `http://localhost:3100`).
- Supports different verification policies (`strict` or `relaxed`) defined per repository.
- Displays security status (`safe`, `unsafe`, `unknown`, `unverified`) for each plugin.
- **Database Initialization:** Updates the database factory to initialize default repositories if none exist.
- **Improved Boolean Parsing:** Enhanced the `sqlite-wrapper` to robustly parse boolean values from various database representations (e.g., "1", "0", "true", "false", 1, 0) into proper boolean types.
- **Navigation Integration:** Added a "Plugins" link to the main application navigation.
- **Minor:** Removed direct API listening logic from `apps/api/src/index.ts` to allow for external orchestration.
This feature lays the groundwork for a more secure and manageable plugin ecosystem.
* refactor(plugins): Standardize plugin hooks API response and verification service DB
- **API (`apps/api`)**:
- Restructured the `/plugins/hooks` API response from an array of `[pluginId, Map<string, unknown>]` to a more structured `Array<{ pluginId: number; hooks: string[] }>`. This improves API clarity and ease of consumption.
- **Frontend (`apps/dockstat`)**:
- Updated `PluginDetailModal` to correctly parse and display the new `/plugins/hooks` API response format.
- Minor cleanup in `verifyPluginsBatch` error handling (`catch (_) `).
- **Verification Service (`apps/dockstore-verification`)**:
- **Database Refactor**: Centralized database initialization and table accessors. The `db` instance and all table objects (e.g., `repositoriesTable`, `pluginsTable`) are now directly exported as singletons from `src/db/index.ts`, simplifying DB dependency management across the service.
- **Route Refactor**: Modified all API and page routes (`src/routes/*.ts(x)`) to directly import the centralized `db` and table accessors, removing the need to pass the `db` instance as an argument to route creation functions.
- **Configuration**: Updated the service to read `VERIFICATION_DB_PATH` from environment variables (with a default) and explicitly set the server `PORT` to `3000`.
- **Dockerfile**: Aligned `EXPOSE` port to `3000`.
- **Plugin Handler (`packages/plugin-handler`)**:
- Improved logging for plugin hook caching to include the count of hooks per plugin, enhancing clarity.
* chore(ci): Lint [skip ci]
* Fix type inference, Docker build, and add manual plugin addition to verification API (#31)
* Initial plan
* Fix TypeScript types, Docker build, and add manual plugin addition
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* Improve manual plugin addition with tag parsing and better UI feedback
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* Fix code review issues: remove duplicate API docs and improve SVG title
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* Address code review feedback: remove unused variable and add error handling
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* Add validation for database insert operations and fix formatting
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* Fix insertId validation and HTML rows attribute syntax
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
* build(dockstore-verification): Refactor Docker build and update port
Refactor Docker build process: The Dockerfile for the DockStore Verification API has been transitioned from a multi-stage build to a local build followed by a simplified Docker image creation. The `bun run build` step is now executed locally before `docker build`, enabling direct copying of the pre-built `dist` directory into the final image. This simplifies the Dockerfile and streamlines the build process.
Update default port: The application's default listening port has been updated from `3000` to `3200`, as reflected in `src/index.tsx`, the `Dockerfile`'s `EXPOSE` instruction, and the `VERIFICATION_PORT` environment variable.
Add Docker environment variables: Several `DOCKSTAT_LOGGER_*` environment variables have been added to the Dockerfile to provide more granular control over logging behavior within the container.
Clean up: Removed unused `outline-sync.json` and `sync.sh` files.
* feat(logger, dockstore-verification): Enhance logging with configurable levels and optimize app startup
Implemented support for the `DOCKSTAT_LOGGER_LEVEL` environment variable in the `@dockstat/logger` package, allowing runtime control over the minimum logging level (error, warn, info, debug). This improves log verbosity management.
Refactored the `dockstore-verification` application to use `_start.ts` as its main entry point, addressing an issue where Bun's direct execution of `.tsx` files could produce unwanted log messages. This change required updates to the Dockerfile and package.json scripts.
Centralized logger instantiation within `dockstore-verification` by introducing a `BaseLogger` and spawning specific loggers from it. This ensures a consistent logging structure and prefixing across different modules.
Additionally, improved error logging in `api.tsx` for consistency and added `<strong safe>` for enhanced security when displaying dynamic content.
* chore(ci): Lint [skip ci]
* chore(ci): Lint [skip ci]
* Update apps/dockstore-verification/src/routes/api.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ItsNik <info@itsnik.de>
* chore(ci): Lint [skip ci]
* Update apps/dockstore-verification/src/routes/api.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ItsNik <info@itsnik.de>
* chore(ci): Lint [skip ci]
* refactor(verification-app): Enhance UI security, resolve linter warnings, and update gitignore
* build(dockstore-verification): Migrate to multi-stage distroless Docker image
- **Docker & Build System:**
- Implemented a multi-stage Docker build process using `oven/bun:canary` for the base stage and `oven/bun:canary-distroless` for the final runtime image. This significantly reduces image size and enhances security.
- Updated Bun runtime prerequisite to v1.3+ and Dockerfile base images to `canary`.
- Modified default server port from `3100` to `3200` across `README.md` and Docker run commands.
- Changed `WORKDIR` in Dockerfile for base stage to align with new structure.
- Removed `DOCKSTAT_LOGGER_ONLY_SHOW` environment variable.
- **API Enhancements & Refactoring:**
- Improved type safety in API routes by removing unnecessary non-null assertions (`!`) and explicitly casting IDs to `Number`.
- Adopted `insertOrIgnore` for creating the "Manual Entries" repository, preventing errors on re-insertion.
- Introduced stricter input validation for `hash` and `bundle_hash` fields in API requests, now requiring a SHA-256 pattern.
- **Documentation & Project Structure:**
- Updated `README.md` to reflect the new default port and added comprehensive documentation for `DOCKSTAT_LOGGER` environment variables.
- Clarified project entry points (`_start.ts` as main) and added new components like `PublicDashboard` and `url` service.
* chore(ci): Lint [skip ci]
* chore(ci): Prevent empty and unconditional lint commits
* refactor(core): Improve type safety, styling, and code consistency
- Replaced non-null assertions with optional chaining and explicit type casting in `template-renderer` and `auth` middleware for enhanced type safety.
- Added standard `line-clamp` CSS properties for improved cross-browser compatibility in `dockstore-verification`.
- Standardized `ProgressDots` checkmark icon using `lucide-react` for UI consistency.
- Refined `onClick` prop type for `Button` component to `React.MouseEventHandler` for better event handling.
- Converted string concatenations to template literals in `outline-sync` package for modern syntax.
- Cleaned up HTMX loading indicator CSS rules in `dockstore-verification`.
- Removed unnecessary `stopPropagation` from `PluginCard` actions in `dockstat`.
* chore(ci): Allow no-op lint commits
---------
Signed-off-by: ItsNik <info@itsnik.de>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Its4Nik <106100177+Its4Nik@users.noreply.github.com>
Co-authored-by: Its4Nik <info@itsnik.de>
Co-authored-by: actions-user <its4nik@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(sqlite-wrapper): Introduce automatic JSON/Boolean type detection, backup/restore, and expanded APIs
- Implemented automatic detection and handling for `column.json()` and `column.boolean()` definitions directly from the schema. This removes the need for manual parser configuration for these types, streamlining the usage of JSON objects and boolean values (0/1).
- Introduced a robust backup and restore system:
- `backup()`: Creates manual database backups to a specified or generated path.
- `listBackups()`: Lists all managed backup files with metadata.
- `restore()`: Restores the database from a backup file, either to the original path or a new target path.
- `AutoBackupOptions`: Enables configurable automatic periodic backups with retention policies, including an initial backup on DB open and automatic cleanup of old backups.
- `stopAutoBackup()`: Provides explicit control to halt the automatic backup timer.
- Greatly expanded `README.md` with comprehensive examples for `QueryBuilder` operations (SELECT, INSERT, UPDATE, DELETE, WHERE conditions), new utility methods, and various `column` helpers.
- Added new utility methods for database management and introspection, including `getPath()`, `vacuum()`, `analyze()`, `integrityCheck()`, `getSchema()`, `getTableInfo()`, `getIndexes()`, and `getForeignKeys()`.
- Enhanced `column` helpers with new definitions such as `date`, `datetime`, `timestamp`, `varchar`, `char`, `numeric`, `uuid`, and `enum`.
- Migrated the internal testing infrastructure from a custom `test.ts` runner to dedicated `bun:test` files, improving test organization and reliability for new features like auto-detection, backup, restore, and parsing.
* feat(sqlite-wrapper): Implement v1.3 features and architectural improvements
- feat: Auto-detect JSON & Boolean columns from schema, eliminating manual parser config
- feat: Introduce automatic database backups with configurable retention policies
- feat: Add new backup and restore API (backup(), restore(), listBackups())
- feat: Provide `DB.getPath()` method to retrieve the database file path
- fix: Correct Boolean column parsing to accurately convert SQLite's `0`/`1` to JavaScript `true`/`false`
- refactor: Create new `utils/` module to centralize SQL building, logging, and row transformation logic
- refactor: Implement structured, component-specific logging using a dedicated SqliteLogger
- refactor: Consolidate identifier quoting and SQL clause building into `utils/sql.ts`
- refactor: Encapsulate row serialization/deserialization logic in `utils/transformer.ts`
- refactor: Enhance QueryBuilder base class to use new utilities, reducing code duplication and improving maintainability
- refactor: Update Node.js module imports from 'fs' and 'path' to 'node:fs' and 'node:path'
- perf: Optimize `SELECT` queries (`get()`, `count()`, `exists()`) to leverage direct SQL for efficiency when no client-side regex filtering is required
- perf: Ensure batch operations (insertBatch, updateBatch, deleteBatch) are atomic by wrapping them in explicit database transactions
- test: Add comprehensive new test suites for the DB class, all QueryBuilder methods (select, insert, update, delete, where), and the new `utils/` module
* chore(deps): Bump @dockstat/sqlite-wrapper to 1.3.0
Updates the @dockstat/sqlite-wrapper dependency to version 1.3.0, along with minor import reordering in test files.
* feat(docker): Introduce host reachability API and UI
This commit introduces the ability to check and display the reachability status of Docker hosts.
- **api(docker):**
- Added new GET endpoints `/docker/ping` and `/docker/ping/:clientId` to return host reachability across clients.
- Utilized Elysia's `t` for request parameter validation on `clientId`.
- **docker-client:**
- Enhanced `getAllHosts` to include a `reachable` status for each host.
- Explicitly typed the `ping` method's response to include `reachableInstances` and `unreachableInstances`.
- Added `enableContainerMetrics` to default DockerClient options.
- **app(dockstat):**
- Updated `Host` interface with `reachable: boolean`.
- `HostsList` now displays "Reachable" or "Unreachable" badges for each Docker host.
Refactor: Removed plugin management UI and related code
- Completely removed the plugin management UI, including all related components, forms, types, and the `/plugins` route in `apps/dockstat`. This indicates a deprecation or significant overhaul of the plugin system.
* refactor(core): streamline plugin management, improve worker communication, and optimize API calls
Delegates complex plugin and repository management logic to the backend API, introduces request-response correlation for Docker client workers, and optimizes API fetches for improved application performance.
**Plugins & Repositories**
* Removed extensive client-side logic for plugin verification, installation, deletion, activation, and repository CRUD operations.
* All complex plugin and repository management functions are now handled by the backend API.
* Simplified `Plugins.loader` to fetch only essential status and routes, removing verification and repository data processing from the client.
* Eliminated the `Plugins.action` entirely, as form-based actions are now deprecated in favor of direct API calls.
* Updated database schema and typings for repositories, removing `isVerified` and `hashes` fields, and setting a default policy to "relaxed".
**Docker Client**
* Implemented a unique `requestId` for worker communication to enable robust request-response correlation.
* Ensures that responses from worker threads are precisely matched to their corresponding requests, preventing data mix-ups in concurrent operations.
* Added `requestId` to `WorkerRequest` and `WorkerResponse` types and incorporated it into the `sendRequest` mechanism within the `DockerClientManagerCore`.
* Improved logging for container fetching and added an early return for `getAllContainers` when no hosts are configured.
**Application Adapters**
* Optimized `Adapter.loader` to use `Promise.all` for concurrent fetching of Docker status and container information, significantly improving initial load times for these components.
**Database**
* Changed `config_table` initialization to `insertOrIgnore` to prevent errors on subsequent runs and ensure more resilient default configuration setup.
* feat(sync): Add --force option to bypass mtime comparison
Adds a new `--force` (or `-f`) option to the `outline-sync` command.
This option allows users to force push local document changes to Outline, bypassing the default timestamp comparison (local `mtime` or frontmatter `updatedAt` vs. remote `updatedAt`).
When `--force` is enabled, local files are always marked as changed and pushed, regardless of whether the local version is considered newer than the remote one. This is useful for scenarios where timestamp discrepancies might occur or when an explicit overwrite of remote content is desired.
* chore(cleanup): Remove weird copy artifact :shrug:
* feat(dockstat): Add server startup ASCII art banner
Replaces the simple server listening message with a detailed ASCII art banner.
This banner provides quick links to the API endpoint, API documentation, and project documentation when the server starts.
* refactor(docker-client): Consolidate monitoring options and enhance worker event parsing
- The `enableContainerMetrics` option has been moved from the top-level `DockerAdapterOptions` to `monitoringOptions` for better logical grouping and consistency.
- `monitoringOptions` is now a required property within `DockerAdapterOptions`, with comprehensive default values initialized in the `DockerClient` constructor. This ensures all monitoring settings are consistently defined.
- The `retryAttempts` for `listContainers` now correctly utilizes `monitoringOptions.retryAttempts`.
- Updated `apps/dockstat` adapter logic to correctly parse and apply `enableContainerMetrics` within the `monitoringOptions` object.
- Improved the `DockerClientManagerCore` event listener to robustly handle messages from worker threads. This includes:
- Introducing new `isProxyEventMessage` and `tryBuildMessageFromProxy` utilities in `@dockstat/utils` for more reliable and type-safe message parsing.
- Simplifying the `isProxyEventEnvelope` check in the manager.
- Added a `console.log` for client registration in the API.
- Implemented `console.error` logging for 'error' type events originating from workers, aiding in debugging.
- Updated typings and Zod schema to reflect the structural changes in `DockerAdapterOptions` and `MonitoringOptions`.
* feat(docker-client): Enhance logging for errors and verbosity control
Improve error messages for missing Docker instances, providing more context on available instances.
Refine error logging in the worker event proxy to include detailed error objects (name, message, stack) and additional contextual information.
Introduce log truncation for large JSON objects in manager and core components to prevent excessive log output.
Ensure consistent numeric typing for host IDs across monitoring modules, particularly when interacting with Docker instances and internal maps.
- **docker-client**: Improve error messages for missing Docker instances, including available keys.
- **workerEventProxy**: Elaborate error logging to differentiate between Error objects and other contexts, including stack traces and additional context.
- **manager/containers & manager/core**: Apply truncation to JSON logged info messages to limit verbosity.
- **monitoring modules**: Cast host IDs to Number for consistent usage with Maps and API calls.
- **apps/dockstat**: Minor import reordering.
* feat(plugins): Implement type-safe builder and remove bundled defaults
Introduce `@dockstat/plugin-builder` package to provide a type-safe API for developing DockStat plugins. This includes `definePlugin`, `pluginBuilder`, `createActions`, and other helper functions for improved developer experience and TypeScript inference.
Refactor `@dockstat/plugin-handler` to expose the new builder utilities and update its documentation to reflect the new plugin development paradigm.
Remove the `DockMon` default plugin and its associated automatic loading mechanism (`saveDefaultPlugins`). Default plugins are no longer bundled directly with the API, promoting a more modular installation process.
Update `@dockstat/typings` to support enhanced type inference for plugin actions.
BREAKING CHANGE:
1. The `DockMon` default plugin and the automatic `saveDefaultPlugins` mechanism have been removed. Monitoring functionality must now be installed as a separate plugin.
2. The recommended way to develop DockStat plugins has shifted to using the new type-safe builder utilities from the `@dockstat/plugin-builder` package. Existing plugin definitions might need updates to conform to the new API structure.
* feat(dockstore, dockmon): Simplify and update plugin building; Default DockMon plugin moved to DockStore -> default plugin installation has to be re-added to DockStatAPI
* feat(dockstore): Implement automated README generation and content enhancement
Introduce `generate-readme.ts` script to dynamically generate the `README.md` for the DockStore application.
This change includes:
- A new `generate-readme.ts` script that reads from a manifest (not included in this diff, but inferred) to create the `README.md`.
- Significant updates to `README.md` content, now featuring:
- Summary badges for plugin, theme, and stack counts.
- A table of contents for improved navigation.
- Detailed, structured entries for plugins (e.g., DockMon), replacing previous brief descriptions.
- Dedicated sections for Themes and Stacks, indicating future expansion.
- Addition of `readme` and `b:r` (bundle & readme) scripts to `package.json` to facilitate the generation process.
- Removal of unused `chalk` and `elysia` dependencies from `package.json`.
* feat(plugins): Introduce extensions browser and enhance plugin overview
- **New Extensions Browser:** A new page at `/extensions/browser` has been added, providing a dedicated interface for discovering and managing extensions. It utilizes the new `ExtensionBrowserLoader` to fetch relevant data.
- **Enhanced Plugin Page:** The `/plugins` page now features a refactored `PluginLoader` that fetches comprehensive plugin metrics, including installed plugins, loaded plugins, hooks, API routes, and frontend routes. A new `StatusBar` component visually presents these statistics, offering a detailed overview of the plugin ecosystem.
- **Repositories API:** A new `GET /api/v2/repositories/all` endpoint has been introduced. This API provides a list of all configured plugin repositories from the database, essential for the extensions browsing functionality.
* Rebuild DockStat frontend as Vite SPA with typed API client (#33)
* refactor(frontend, apps): Refactor DockStat to Vite frontend, remove DockNode
- The `docknode` application and all its associated files have been entirely removed, streamlining the monorepo structure.
- The `dockstat` application has undergone a complete architectural overhaul and has been renamed to `@dockstat/frontend`.
- This refactoring transitions `@dockstat/frontend` from a full-stack React Router-based server-side rendered application to a dedicated, pure client-side rendered React application, powered by Vite.
- All server-side rendering components, API route definitions, and the `react-router` backend infrastructure previously located in `apps/dockstat/app/.server` have been removed.
- Data fetching for the frontend now exclusively leverages `@tanstack/react-query` for improved state management and caching.
- Introduced the new `@dockstat/contracts` package, which serves as a centralized source for re-exporting API types (specifically `TreatyType` from `@dockstat/api`). This ensures robust, end-to-end type safety between the frontend and the API.
- `package.json` scripts have been updated to utilize Vite's build and development commands, and various dependencies no longer needed for a pure frontend application have been removed.
- Configuration files (`tsconfig.json`, `vite.config.ts`, `bunfig.toml`, `.gitignore`, `.dockerignore`, `Dockerfile`) have been updated to reflect the new, simplified frontend architecture.
* refactor(contracts): Remove @dockstat/contracts package
The `@dockstat/contracts` package was an intermediary responsible for re-exporting types, primarily `TreatyType`, from the `@dockstat/api` package. Frontend applications, such as `apps/dockstat`, can now directly import these types from `@dockstat/api`, making the contracts package redundant.
This removal also leads to a significant cleanup of the `bun.lock` file, eliminating numerous transitive dependencies. Notably, the entire `msw` stack and its related development dependencies are removed, reducing overall project bloat and simplifying the dependency graph.
* feat(frontend,api): Setup core frontend architecture and API server listening
This commit lays the foundation for the DockStat frontend application and
finalizes the initial API server setup.
Frontend (apps/dockstat):
- Implemented React Router for client-side navigation and routing.
- Integrated TailwindCSS for styling, along with the @tailwindcss/vite plugin.
- Incorporated the @dockstat/ui component library.
- Established a structured data fetching pattern with TanStack React Query,
including dedicated `lib/queries` and `lib/actions` directories with READMEs
for guidance.
- Created a core `Layout` component that wraps application routes and integrates
the new Navbar and global loading indicators.
- Added utility hooks for global busy state and current location.
- Refactored `main.tsx` to use the new routing and layout structure, removing
the previous `App.tsx` and related boilerplate.
- Configured Biome and `tsconfig.json` aliases (`@Queries`) for improved developer
experience.
- Removed default Vite SVG and boilerplate styles.
API (apps/api):
- Enabled the Elysia API server to listen on a configurable port
(`DOCKSTATAPI_PORT` environment variable or default `3030`).
- Added detailed startup logging with ASCII art branding and key URLs
(API endpoint, docs).
- Included a temporary 10-second sleep in the `/api/v2/status` endpoint for
testing frontend loading states and UI feedback.
UI (packages/ui):
- Updated the `Navbar` component to utilize `react-router`'s `NavLink`
and respond to a global `isBusy` prop for visual feedback during fetching/mutations.
* perf(api/status): Remove artificial delay from status endpoint
* style(formatting): Apply consistent code formatting
Standardize indentation from tabs to spaces across TypeScript and JSON files.
This change ensures consistent code style within `apps/dockstat` and `apps/dockstore` and refactors JSON array formatting for improved readability. The `apps/dockstat/biome.json` file was removed as its configuration is now inherited from a higher-level Biome config.
* refactor(dockstat): Extract global busy state and location logic into dedicated hooks
Moves logic for determining global application busy state (fetching/mutating) and current router location into new, reusable custom hooks: `useGlobalBusy` and `useCurrentLocation`.
Updates `layout.tsx` to consume these new hooks.
Removes an obsolete CSS link from `index.html`.
* style(imports): Sort import declarations
* refactor(error-handling, ui): Standardize API error messages and simplify Navbar active state
- Introduce `@dockstat/utils` package to the `dockstat` app for a centralized `extractEdenError` utility.
- Update `fetchStatus.ts` to use `extractEdenError` for more consistent and structured error handling when interacting with the backend API.
- Refactor the `Navbar` component in `@dockstat/ui`:
- Remove the `location` prop, as its functionality is now natively handled by `react-router-dom`'s `NavLink`.
- Update `NavLink` usage to leverage its render prop `isActive` for styling the active navigation item badge, simplifying the component logic.
- Update `package.json` and `bun.lock` for the new dependency.
* feat(ui, api): Introduce dynamic sidebar navigation and accurate API host logging
This commit introduces a dynamic sidebar navigation system and enhances API startup logging for better accuracy.
**Dynamic Sidebar Navigation:**
- Implements a new `Sidebar` component in `@dockstat/ui`, accessible via a toggle button in the `Navbar`.
- The `Navbar` now dynamically fetches its navigation links from the API using `@tanstack/react-query` and a new `fetchNavLinks` query. This replaces hardcoded paths, making the navigation configurable.
- Updates the `nav_links` type definition in `@dockstat/typings` to support an array of objects `{ slug: string, path: string }`, allowing for structured navigation.
- Adds `@icons-pack/react-simple-icons` dependency to `@dockstat/ui` for displaying various external links (GitHub, Docs, NPM) and a busy indicator within the sidebar.
- Ensures the main layout in `apps/dockstat` uses `min-h-screen` to properly contain content.
**API Host Logging:**
- Modifies the API startup logger output in `apps/api` to display the actual `hostname` and `port` the server is running on, instead of the static `localhost:${PORT}`. This provides more accurate connection details, especially in containerized or networked environments.
**Other Changes:**
- Adds a temporary 10-second `sleep` to the `/api/v2/status` endpoint, likely for development or testing purposes.
- Includes a crucial comment in `apps/dockstat/src/index.css` highlighting a theme import.
* perf(api): Remove artificial delay from status endpoint
* feat(dockstat): Display backend and service status badges; add main content padding
* feat(system): Implement live backend RSS memory display and configurable settings
* **feat(api):** Add `/misc/stats/rss` WebSocket endpoint for real-time process RSS memory usage.
* The endpoint streams formatted memory usage every 2 seconds.
* **feat(frontend):** Display live backend RSS memory in the Navbar.
* A new `AdditionalSettingsContext` and provider allow configuring this feature.
* Utilizes a new `rssFeedEffect` for WebSocket subscription and state updates.
* Navbar component updated to conditionally render the RAM usage badge.
* **feat(config):** Introduce `addtionalSettings` to the `DockStatConfigTable`.
* Allows toggling `showBackendRamUsageInNavbar` with a default value of `true`.
* Updates DB schema (`packages/db`) and typings (`packages/typings`).
* **refactor(frontend):** Consolidate React providers into `DockStatProviders`.
* Abstracts `QueryClientProvider` and the new `AdditionalSettingsProvider`.
* **refactor(frontend):** Enhance homepage UI for service display.
* Services are now rendered as individual cards with improved badge logic for status.
* Renamed `FetchBackendStatus` to `fetchBackendStatus`.
* **fix(docker):** Correct `dockstat-api` volume mount in `docker-compose.dev.yaml`.
* Ensures the API container correctly mounts its source code for development.
* **chore(scripts):** Add `dev:dockstat` script for filtered development startup.
* Simplifies starting frontend and API services together.
* Updated bun.lock and package dependencies.
* fix(dockstat): Ensure proper WebSocket subscription cleanup for RSS feed
The `rssFeedEffect` now correctly returns a cleanup function that closes the WebSocket subscription when the component unmounts. This prevents potential memory leaks and ensures resources are properly released.
Additionally, the subscription variable was renamed from `usub` to `rssFeed` for better clarity.
Removed redundant `refetchInterval: false` from `useQuery` in `layout.tsx`.
* refactor(imports): Standardize import order
Reordered import statements across multiple files in `apps/dockstat` and `packages/ui` to establish a more consistent and readable import organization. This change solely focuses on code structure and does not alter any functional behavior.
* feat(api, logger, ui, dockstat): Implement real-time logs and enhance table component
This commit introduces real-time backend log streaming via WebSockets and significantly refactors the UI table component for improved functionality and performance.
**Key Changes:**
* **Real-time Backend Logs:**
* **`@dockstat/api`**: Added `/ws/logs` and `/ws/rss` WebSocket endpoints. The API's logger now utilizes a new `LogHook` to stream log entries to connected clients. The previous polling mechanism for RSS memory usage has been replaced with a WebSocket.
* **`@dockstat/logger`**: Refactored the internal structure (v2.0.0) to introduce a `LogHook` mechanism, allowing external components to subscribe to log entries programmatically.
* **`@dockstat/dockstat`**: Implemented client-side logic to subscribe to `/ws/logs` and `/ws/rss` endpoints. Backend logs are now displayed in a new modal accessible from the sidebar, and backend RAM usage is updated in real-time.
* **Enhanced Table Component:**
* **`@dockstat/ui`**: Performed a major refactor of the `Table` component, breaking it down into `TableHeader`, `TableBody`, `TableRow`, and `TableToolbar` sub-components, powered by a `useTable` hook. This significantly improves modularity, extensibility, and introduces features like:
* **Virtualization**: Efficiently renders large datasets, preventing UI slowdowns.
* **Toolbar**: Integrated search, sort, and filter functionalities directly into the table header.
* The new `Table` component is used to display real-time backend logs in the `@dockstat/dockstat` application.
* **Utilities & Dependencies:**
* **`@dockstat/utils`**: Added `arrayUtils.pushWithLimit` for managing array size, used for log message buffering.
* Updated `@dockstat/logger` to version `2.0.0` across all dependent workspaces.
* Updated `bun.lock` to reflect all dependency changes.
* **Minor UI Improvements:**
* Added `hover:underline` to `LinkWithIcon` in `@dockstat/ui`.
This extensive update provides a more dynamic and performant user experience, especially for monitoring backend activity and handling large data displays.
* refactor(imports): Reorder and sort imports
* feat(docs): Introduce frontend patterns and refactor plugin-handler documentation
- Created a new `apps/docs/dockstat/patterns/README.md` to house common development patterns.
- Integrated existing `apps/dockstat/src/lib/actions/README.md`, `apps/dockstat/src/lib/queries/README.md`, and `apps/dockstat/src/lib/websocketEffects/README.md` into the main documentation system under the new 'Patterns' section.
- Updated `apps/docs/outline-sync.config.json` to include these new documentation entries and custom paths.
- Performed a significant refactor of `apps/docs/dockstat/packages/@dockstat-plugin-handler/README.md`, which involved:
- Removing deprecated "Plugin Builder API" and "Frontend Methods" sections.
- Simplifying plugin definition examples for clarity.
- Improving formatting of lists (from hyphens to asterisks).
- Adding new integration examples (e.g., Elysia API).
- Refreshed `updatedAt` timestamps across various documentation files as part of the documentation sync process.
* feat(outline-sync): Enhance configuration loading and sync logic
Refactored Outline Sync's configuration system for improved flexibility and robustness, alongside general documentation formatting and content corrections.
* **`packages/outline-sync`:**
* Implemented robust configuration discovery, supporting `.js`, `.cjs`, `.yaml`, `.yml` files, and the `outline` key within `package.json`.
* Added support for `OUTLINE_CONFIG` environment variable to explicitly specify the config file path.
* Refactored config loading into `findConfigPath` and `loadConfigFilePath` for clearer logic.
* Improved date parsing and comparison for local vs. remote document updates using a new `parseToDate` helper.
* Removed the `--force` CLI option and the `verify` command.
* Corrected a typo in `outline-sync.config.json` for the `websocketEffects` README path.
* Enhanced document path resolution to prevent redundant subfolders for root-level documents in the output directory.
* Normalized `updatedAt` frontmatter property to ISO string for consistent parsing.
* **`apps/dockstat/src/lib/actions/README.md`**:
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Standardized quotation marks from smart quotes (`“ ”`) to straight quotes (`" "`).
* Changed TypeScript code block language from `ts` to `tsx`.
* **`apps/dockstat/src/lib/queries/README.md`**:
* Corrected an accidental duplication of frontmatter content.
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Standardized quotation marks from smart quotes (`“ ”`) to straight quotes (`" "`).
* Changed TypeScript code block language from `ts` to `tsx`.
* **`apps/dockstat/src/lib/websocketEffects/README.md`**:
* Updated list markers from hyphens (`-`) to asterisks (`*`) for consistency.
* Changed TypeScript code block language from `ts` to `tsx` for frontend examples and to `typescript` for backend examples.
* Adjusted newline formatting for improved readability.
* **`apps/docs/dockstat/**`**:
* Updated `updatedAt` timestamps across various documentation files (auto-generated during sync).
* **`packages/template-renderer/README.md`**:
* Minor formatting adjustments within code blocks.
* feat(outline-sync): Add force push and verify commands
The `push` command now supports a `--force` option, allowing users to forcefully synchronize all local markdown files with Outline, bypassing remote timestamp comparisons.
A new `verify` command has been introduced to validate the `outline-sync` configuration and custom path resolution, aiding in setup and debugging.
Minor cosmetic adjustment to the "Pulled" status message in the sync summary table.
* feat(outline-sync): Record explicit local mtime and frontmatter timestamp
This change enhances the sync table by introducing separate fields for the local filesystem modification time ("Local mtime") and the timestamp derived from the document's frontmatter ("Frontmatter").
Previously, the "Local Date" field was ambiguous. By explicitly distinguishing between the file's last modification time on disk and its remote/frontmatter timestamp, the sync status provides clearer and more detailed information for monitoring document synchronization.
* docs(readme): Overhaul documentation for v1.3.0 release
Rewrites the project description for clarity and detail.
Restructures and expands sections for Features, Quick Install, Getting Started, Configuration, and Commands.
Adds new dedicated sections: Example Usage, Notes on Collisions, Contributing, and License.
Removes the "What's new" section as existing features are now fully integrated into the main content.
Enhances explanations for change detection logic, safety notes, and troubleshooting.
Updates the `package.json` version to `1.3.0`.
Adjusts build and prepublishOnly scripts in `package.json` for consistency.
* chore(fix): Fix build to dist folder
* feat(outline-sync): Add init command; streamline config parsing
Introducing the `init` command, allowing users to quickly generate a sample `outline-sync.config.json` file. This command provides a boilerplate configuration to simplify initial setup.
This commit also includes several refinements to the configuration loading mechanism:
- Simplified CommonJS/JavaScript module loading logic by removing a redundant `mod &&` check.
- Corrected the `getConfig` function to consistently return the loaded configuration object instead of `null`, resolving a potential functional issue.
- Removed obsolete or redundant configuration parsing logic for JSON and `package.json` files, consolidating config handling within `loadConfigFilePath`.
- Cleaned up minor comments for improved code clarity.
* chore(ci): Stage linter changes before commit
* chore(ci): Lint [skip ci]
* refactor(sync): Use Number.isNaN and template literals
* refactor(docs): Enhance project overview and structure in README
Removed the deprecated `react-router-elysia` example package from the monorepo.
Performed a comprehensive overhaul of `README.md` to improve clarity and provide detailed, up-to-date information on the project:
- Replaced the project logo and updated navigation links to reflect current resources.
- Streamlined section headers for better readability (e.g., "Project overview", "Key features").
- Updated the listed tech stack to include Framer-Motion and Simple-Icons-React, and removed GSAP.
- Provided an expanded and more granular description of the monorepo structure, including new `apps/` and `packages/` entries with their purpose.
- Revised developer getting started instructions, simplifying the local development command.
- Clarified the plugin system and DockStore functionalities.
- Added a new "Multi-node" section with an aggregation diagram for Docker client lifecycle.
- Removed the outdated "Roadmap" section.
- Updated contributing guidelines and external documentation links.
* docs(README): Update logo and enhance navigation with shield badges
* docs(readme): Improve badge presentation and layout
Update navigation links with descriptive titles, concise text, and relevant logos.
Reformat technology stack badges from a markdown table to a centered, multi-row display for better visual flow and readability.
* chore(bun.lock): Remove @dockstat/create-rr-elysia package and regenerate
Removed the `@dockstat/create-rr-elysia` package and its extensive dependency tree from the Bun lockfile. This cleanup streamlines the project's dependencies by eliminating a no-longer-used module.
This lockfile regeneration also includes several dependency version updates:
- `@dockstat/outline-sync`: 1.2.9 -> 1.3.0
- `@borewit/text-codec`: 0.1.1 -> 0.2.1
- `@sinclair/typebox`: 0.34.45 -> 0.34.46
- `@types/node`: 22.19.3 -> 24.10.4
- `@types/send`: 1.2.1 -> 0.17.6
- `jsesc`: 3.0.2 -> 3.1.0
- `react-refresh`: 0.14.2 -> 0.18.0
And other minor internal dependency resolutions.
* docs(readme): Standardize internal anchor links
* docs(update): Update a coupple of documentation files
* feat(logging, db, sqlite-wrapper): Enhance logging system with unified LogHook propagation
Refactors the logging system to enable seamless LogHook inheritance and centralized log handling across all core modules.
Previously, loggers often relied on passing parent names as strings or individual setup. This update changes constructor signatures (e.g., in `DockStatDB`, `sqlite-wrapper`'s `DB` and `QueryBuilder`s) to accept a `Logger` instance directly. This allows child loggers to automatically inherit the `LogHook` and parent chain from their base logger, simplifying global log processing (e.g., sending to WebSocket clients).
Key changes include:
- `Logger` (from `@dockstat/logger`) now accepts an optional `LogHook` directly in its constructor.
- `DockStatDB` and `sqlite-wrapper`'s `DB` class now take a `baseLogger` instance and spawn their internal loggers from it.
- `sqlite-wrapper`'s `QueryBuilder`s also inherit a `baseLogger` for their internal logging, ensuring all database operations are part of the main log stream.
- `apps/api/src/logger.ts` refactored to simplify BaseLogger setup and hook assignment.
- `apps/api/.env.example` updated with new logger configuration environment variables (`DOCKSTAT_LOGGER_DISABLED_LOGGERS`, `DOCKSTAT_LOGGER_ONLY_SHOW`, `DOCKSTAT_LOGGER_IGNORE_MESSAGES`, `DOCKSTAT_LOGGER_FULL_FILE_PATH`).
- Fixes `DOCKSTAT_MAX_WORKERS` environment variable parsing in `apps/api/src/docker/index.ts` to correctly default to `200` when the variable is empty or not set.
- Minor UI adjustment in `packages/ui` to reposition the "View Backend Logs" button and modal within the sidebar for better organization.
* refactor(table): Migrate styling to CSS variables
Replaces hardcoded Tailwind CSS utility classes with custom CSS variables for enhanced themeability. This change abstracts styling for backgrounds, text colors, borders, and dividers across the table component and its sub-components (TableHeader, TableBody, TableRow, TableToolbar).
This allows for more consistent design system integration and easier customization, including future dark mode support.
* feat(client-management): Introduce Clients & Workers management page
This commit introduces a new "Clients & Workers" page within the DockStat application, providing a comprehensive overview and management interface for Docker clients, worker processes, and monitored hosts.
Key changes include:
* **New `ClientsPage`:** A dedicated page (`/clients`) to display Docker client configurations, worker pool status, and lists of managed hosts.
* **Client Information Components:**
* `ClientCard`: Displays detailed information about a Docker client, including its configuration options and associated worker's runtime metrics (uptime, active streams, monitoring status).
* `HostsList`: Presents a clear list of configured Docker hosts, showing their connection status and client association.
* `PoolStatsCard`: Provides an at-a-glance summary of the Docker worker pool, including total workers, active workers, clients, hosts, and average load.
* `WorkersTable`: A detailed, searchable, and sortable table showing metrics for each active worker in the pool (memory usage, uptime, client name, host count, streams).
* **Data Fetching:** Implemented new `react-query` hooks (`fetchClients`, `fetchHosts`, `fetchPoolStatus`) to retrieve real-time data from the backend API.
* **Dynamic Page Heading:** Introduced `PageHeadingContext` to allow pages to dynamically set the heading displayed in the application's Navbar, improving navigation clarity.
* **`docker-client` Enhancements:**
* Updated `WorkerMetrics` to use `bun:jsc.HeapStats` for more accurate memory usage reporting.
* Modified `getAllClients` to include client `options`.
* Exported `types` from `docker-client` for better type integration.
* **`sqlite-wrapper` Logging:** Enhanced transformer utility to accept and use an explicit logger, improving debugging capabilities for data transformations.
* **UI Component Refinements:**
* Adjusted `Card` and `CardHeader` sizing options (`xs` size added to Card, `size` prop added to CardHeader).
* Improved `HoverBubble` arrow styling and replaced the `Triangle` icon with `ArrowBigDown`.
* Added support for dynamic `heading` in `Navbar`.
* **Dependencies:** Added `lucide-react` for new icons and `@dockstat/docker-client` for shared types.
This feature significantly enhances the visibility and manageability of the Docker integration within DockStat.
* feat(client): Introduce and display host reachability status
Add 'reachable' boolean property to DockerModel.ClientHost, indicating the connectivity status of a client host.
Update the HostsList component in 'dockstat' to dynamically display connection status (Connected/Disconnected) and color based on the 'reachable' property.
Refactor DockerClientManagerCore to use heapStats() for memory usage reporting instead of process.memoryUsage().
* refactor(imports): Standardize import order
Reorders imports across several files in `dockstat` and `docker-client` to follow a consistent pattern. Type imports are now generally placed first, followed by other named imports, improving code readability and maintainability.
* 40 uiux implement page pins (#41)
* feat(system): Parallelize Docker hosts, enhance logging, and add UI nav link pinning
This commit introduces significant performance improvements, comprehensive error logging, and a new UI feature for pinning navigation links.
Performance Enhancements:
* **Parallelized Docker Host Retrieval:** The `/api/v2/docker/hosts` endpoint now processes requests to multiple Docker instances in parallel within `packages/docker-client/src/manager/hosts.ts`. This change replaces sequential processing with `Promise.all()`, drastically reducing response times for environments with multiple clients. Each client's operations are now handled with individual error handling to prevent single failures from blocking the entire request.
Improved Logging & Error Handling:
* **Enhanced Error Object Serialization:** The metrics middleware in `apps/api/src/middleware/metrics/helper.ts` now properly serializes Error objects, extracting `name`, `message`, `stack`, and `cause` to provide richer error details in logs, replacing generic '{}' outputs.
* **Detailed Ping Error Reporting:** `packages/docker-client/src/docker-client.ts` now logs ping failures at a `warn` level with more detailed error messages, including error type and stack traces, making it easier to diagnose unreachable Docker instances. Summary logs for unreachable instances are also added.
* **Worker Error Logging:** Added logging in `packages/docker-client/src/manager/core.ts` for errors returned by worker processes, improving visibility into worker communication issues.
* **New Request Logging Middleware:** A dedicated `RequestLogger` middleware has been introduced in `apps/api` to log incoming requests with unique IDs for better traceablity.
UI & Configuration Features:
* **Navigation Link Pinning:** Implemented new API endpoints (`/api/v2/db/config/pinItem` and `/api/v2/db/config/unpinItem`) in `apps/api/src/routes/db.ts` to allow users to pin and unpin frequently used navigation links.
* **UI Integration for Pinning:** The `Navbar` and `Sidebar` components in `@dockstat/ui` have been updated to display pinned links and provide controls for pinning/unpinning, enhancing user customization.
Documentation:
* **Performance Fix Summary Document:** Added `PERFORMANCE_FIX_SUMMARY.md` to comprehensively detail the identified performance bottlenecks, the implemented solutions, and expected improvements.
Dependency Updates:
* Added `@tanstack/react-query` to `@dockstat/ui` for improved data fetching and mutation management.
* feat(frontend): Separate navigation pin/unpin actions and enhance sidebar logic
This commit introduces distinct `pinNavLink` and `unPinNavLink` actions, improving the clarity and management of navigation item states. These actions are now centralized and accessible via the new `@Actions` alias for streamlined imports.
Key improvements to the frontend navigation sidebar (`Sidebar.tsx`) include:
- Implementing `useMemo` to accurately determine and pass the `isPinned` status to all `SidebarItem` components, ensuring consistent UI representation.
- Refactoring `SidebarItem` to directly utilize the `isPinned` property from its item data.
Additional changes:
- Standardized import order across several `api` and `docker-client` files for code consistency.
- Refined error stack message formatting within `docker-client.ts` to use template literals.
- Added `react-devtools` as a development dependency for improved debugging.
* refactor(ui): Modularize sidebar components and enhance pinning experience
- Extract `SidebarItem` component from `Sidebar` into its own file (`SidebarItem.tsx`) for better separation of concerns and maintainability.
- Introduce `usePinnedPaths` custom hook to encapsulate the logic for checking and adding pin status to navigation paths, improving readability and reusability.
- Refine `SidebarItem` interaction, including improved styling for the pin/unpin button and better animation.
- **fix(api):** Corrected the unpinning logic in `apps/api/src/routes/db.ts` by changing the logical operator from `&&` to `||`. This ensures that a navigation link is correctly unpinned when *either* its path or slug matches, preventing unintended behavior where links were not removed.
- **fix(docker-client):** Enhanced error propagation in `packages/docker-client/src/docker-client.ts` ping operations by passing the original error object as the `cause` when throwing a new `Error`. This provides richer context and improved traceability for debugging ping failures.
- **chore(docs):** Remove `PERFORMANCE_FIX_SUMMARY.md` as its content is likely integrated or no longer relevant.
* refactor(api, docker-client, ui): Refine API logging, refactor host fetching, fix UI button
Refactor various parts of the codebase to improve logging, enhance maintainability, and fix a UI interaction issue.
- **API Request Logging**: Removed request body from info level logs in `requestLogger.ts` to reduce log verbosity and avoid logging sensitive data by default.
- **API Metrics Middleware**: Updated header access method in `MetricsMiddleware` from `request.headers.get()` to direct `headers` object access for better Elysia context integration.
- **Docker Client Host Management**: Extracted host fetching logic and error handling into a new private `fetchClientHostsSafely` method in `Hosts` manager, improving readability and error management within `getHostsForClients`.
- **UI Sidebar Item**: Changed the `type` attribute of the pin/unpin button in `SidebarItem.tsx` from `submit` to `button` to prevent accidental form submissions. Also adjusted the CSS for the pin button's visibility transition.
* refactor(api-metrics): Remove unused request parameter from metrics middleware
* feat(core, ui): Enhance logging, refine theming, and improve UI structure
feat(api): Implement `onAfterResponse` hook to log request completion for better visibility, including method, URL, and request ID.
feat(dockstat):
- Add `bg-main-bg` class to `index.html` for global theme consistency.
- Remove hardcoded navigation fallback in `Layout.tsx`, relying on dynamic data.
- Introduce `pluginId.tsx` as a placeholder for a new plugin details page.
feat(ui):
- Refine `Card` dark variant styling for improved visual consistency.
- Add "Clients" to the default sidebar navigation paths.
- Enhance log entries table to display `requestId` using a `Badge` component.
- Update `Table` component with `w-full max-w-full` styling and add type constraint `T extends Record<string, unknown>`.
- Fix `TableToolbar` sort and filter menus layering by increasing their `z-index`.
chore(deps): Update various dependencies in `bun.lock` to their latest minor versions.
* feat(plugins): Implement dynamic frontend pages
Introduce dynamic frontend pages for plugins, enabling them to render custom user interfaces based on templates provided by the backend.
Key changes include:
- Integrate `@dockstat/template-renderer` for parsing and rendering plugin page templates and fragments.
- Add a new route `/p/:pluginId/*` to serve as the entry point for plugin pages.
- Implement the core plugin page logic in `pluginId.tsx` to handle:
- Fetching initial page data (template, fragments, loaders, actions) via `fetchPluginTemplate`.
- Managing component local state and external data for the rendered template.
- Handling various action types (setState, navigate, API calls via `executePluginAction`, loader reloads).
- Implementing polling for loaders to keep data up-to-date.
- Introduce new API client functions for plugin actions (`executePluginAction`, `executePluginLoader`) and queries (`fetchPluginTemplate`, `fetchPluginNavigation`, `fetchPluginFrontendRoutes`).
- Define new frontend types (`LoaderResult`, `ResolvedLoader`, `ResolvedAction`, `PluginPageData`) to manage plugin-related data structures.
- Add `useGlobalBusy` hook to track global data fetching and mutating status using `@tanstack/react-query`.
- Refine import aliases (`@Actions`, `@Queries`, `@WSS`) to point directly to `index.ts` files for a cleaner import experience.
* refactor(dockstat): Update imports to use path aliases
Consolidates import paths in `layout.tsx` and `addtionalSettings.tsx` to use `@WSS` and `@Queries` aliases respectively. This improves module resolution consistency and maintainability.
* chore(ci): Lint [skip ci]
* refactor(core): Refactor plugin page logic and SQLite logger integration
- **Refactor `PluginIdPage` into `usePluginPage` hook:**
- Extracted all data fetching, state management, action handling, and navigation logic from `apps/dockstat/src/pages/pluginId.tsx` into a new, reusable custom hook, `usePluginPage`.
- This significantly simplifies the `PluginIdPage` component, making it a thin wrapper around the `TemplateRenderer` and the new hook.
- Improves modularity, testability, and separation of concerns for plugin page rendering.
- Updated `apps/dockstat/src/router.tsx` to include the `PluginIdPage` route, leveraging the simplified component.
- **Enhance SQLite Wrapper Logging System:**
- Refactored `packages/sqlite-wrapper` to allow an external `@dockstat/logger` instance to be injected into the `DB` class and its `QueryBuilder` components.
- This provides greater flexibility for integrating `sqlite-wrapper`'s logging with application-wide logging hooks and configurations.
- Removed hardcoded internal loggers in `sqlite-wrapper` and its sub-modules, replacing them with child loggers derived from the injected base logger.
- `SqliteLogger` now supports `LogHook` in its constructor, further customizing log output.
- Propagated logger instances to transformer functions for more detailed debug logging.
- **Resolved Merge Conflicts:**
- Addressed and resolved various merge conflicts across `apps/api`, `apps/dockstat`, `apps/docs`, `packages/logger`, and `packages/sqlite-wrapper`. These resolutions primarily involved consolidating changes and adopting the most up-to-date code.
* feat(plugins): Implement extensions page with plugin browsing and installation
- Add `/api/v2/repositories/all-manifests` endpoint to fetch and parse plugin manifests from configured repositories (GitHub, GitLab, Gitea, HTTP).
- Rename `/api/v2/plugins/activate` to `/api/v2/plugins/loadPlugins` for improved clarity in the plugin API.
- Introduce a new `/extensions` page in `dockstat` for browsing, searching, and installing plugins from available repositories.
- Implement client-side `TanStack Query` hooks and actions for fetching all plugins, repositories, and manifests, and for initiating plugin installations.
- Create `@dockstat/utils/repo/parseFromDBToRepoLink` to consistently generate manifest URLs from database repository types and sources.
- Update the `dockstat` router to include the new extensions page route.
- Apply minor text refinements to plugin error and not-found pages in `dockstat`.
* chore(ci): Lint [skip ci]
* feat(extensions): Implement plugin deletion and auto-bundle fetching
- Introduce `deletePlugin` action for removing installed plugins.
- Integrate plugin deletion into the Extensions page UI with a dedicated delete button.
- Enhance `plugin-handler` to automatically fetch and persist plugin bundles from repositories if not already present.
- Add `getPluginBundle` utility in `@dockstat/utils` to facilitate fetching plugin bundles.
- Extend `parseFromDBToRepoLink` to support fetching arbitrary files (e.g., plugin bundles) from repository sources.
- Refine the visual presentation and styling of plugin cards and modals on the Extensions page.
- Add "Extensions" to the main sidebar navigation paths for easier access.
- Update the `plugins` database table schema to ensure the `plugin` column is not null.
- Improve logger robustness in `@dockstat/sqlite-wrapper` with error handling.
- Finalize the `DockMon` plugin definition with `.build()`.
- Update various dependencies, including `@typescript-eslint/*` packages and `framer-motion`.
* build(plugin-bundler): Standardize plugin output to index.js
The plugin bundling process now generates a single 'index.js' file within each plugin's output directory. The internal bundler logic is updated to import plugins from this standardized path (`${outdir}/index.js`).
The DockMon plugin is the first to adopt this new bundling structure, with its bundled output and source map now committed. This change also removes 'bundle' from .gitignore as bundled plugin artifacts are now tracked.
* chore(ci): Lint [skip ci]
* feat(dockstore): Enable DockMon plugin via manifest and fix module import
* fix(bundler): Remove import.meta from dynamic plugin import
* style(schema): Reformat plugin-meta JSON schema
* chore(ci): Lint [skip ci]
* feat(plugin-page): Redesign loading, error, and empty states
Enhance user experience on `/p/:pluginId/:routePath` by completely overhauling the UI for loading, error, not found, and no template states.
- Introduce `framer-motion` for smooth card animations and transitions.
- Integrate `lucide-react` icons (`Loader2`, `AlertTriangle`, `Search`, `FileX`) for clearer visual feedback in each state.
- Implement `InfoBlock` component to display structured plugin and route details in error and not-found messages.
- Dynamically set the page heading using `PageHeadingContext` based on plugin metadata or URL.
- Refactor navigation buttons in error states to be more consistent and user-friendly.
fix(plugin-handler): Corrected the plugin bundle fetching logic by appending `/${plugin.manifest}` to the repository path when retrieving plugin bundles. This ensures the correct bundle is fetched when a manifest file is specified within the repository.
* chore(ci): Lint [skip ci]
* feat(plugins, ui): Add frontend plugin route navigation and `Slides` component variant
This commit introduces dynamic navigation for frontend plugins and refactors the `Slides` UI component, enhancing application extensibility and UI flexibility.
- **Frontend Plugin Route Integration:**
- A new query, `fetchFrontendPluginRoutes`, was added to retrieve frontend-defined routes from the backend's `/api/v2/plugins/frontend/routes/by-plugin` endpoint.
- These plugin routes are now dynamically fetched and passed to the `Navbar` and `Sidebar` components.
- The `Sidebar` component has been updated to render these plugin routes under their respective plugin names, allowing plugins to extend the application's navigation.
- **`Slides` Component Refactor:**
- The `Slides` component in `@dockstat/ui` now supports a `variant` prop, introducing a `minimal` display option.
- The `minimal` variant removes the `Card` wrapper and adjusts internal styling, providing a more lightweight and versatile presentation for different UI contexts.
- Button styling and collapse animations were also adjusted to accommodate the new variant.
- **Minor Enhancements:**
- In `layout.tsx`, the `useQuery` data for `fetchNavLinks` was explicitly named `navLinks` for better clarity.
- Error styling in `pluginId.tsx` was updated to use semantic CSS classes (`bg-error/10` and `text-error`) for consistency.
* chore(ci): Lint [skip ci]
* feat(plugins): Implement plugin unloading and revamp frontend routing UX
Introduces an API endpoint and handler for dynamically unloading plugins, enhancing plugin management capabilities.
Reworks the frontend plugin route API (`/api/v2/plugins/frontend/routes`) to return pre-grouped and formatted paths, simplifying client-side data consumption.
Significantly improves the frontend sidebar user experience by:
- Updating the `LinkWithIcon` component to natively support `react-router`'s `NavLink` for active state styling.
- Integrating `framer-motion` for smoother UI animations.
- Redesigning the display of plugin routes in the sidebar to use `SidebarItem` for consistent styling, pinning, and active state feedback.
- Grouping plugin routes by their respective plugin names.
Additionally:
- Shortens the base path prefix for frontend plugin routes from `/plugins` to `/p`.
- Removes the generic "API Request running..." busy indicator from the sidebar.
* refactor(extensions): Isolate plugin browser into dedicated route and component
Moves the plugin browsing functionality from 'pages/extensions/index.tsx' to a new, dedicated component in 'pages/extensions/plugins.tsx'.
This refactoring:
- Creates a new `PluginBrowser` component and moves all plugin browsing logic into it.
- Updates the application routing to establish '/extensions' as a parent route and '/extensions/plugins' as the new entry point for browsing plugins.
- Modifies the sidebar navigation to reflect this hierarchy, displaying 'Browse Plugins' as a child link under 'Extensions'.
- Prepares the '/extensions' route to host future extensions management features, such as repository configuration, by making it a dedicated parent page.
* chore(ci): Lint [skip ci]
* fix(extensions): Correct 'Managa' typo in comment
* refactor(plugins): use Blob URLs for plugin loading and eager initialization (#47)
- Refactors plugin loading mechanism to utilize in-memory Blob objects and `URL.createObjectURL` instead of writing to temporary files. This improves security, performance, and resource management by eliminating filesystem I/O.
- Updates the `PluginHandler` constructor to directly accept a `Logger` instance, simplifying logger configuration and promoting consistency.
- Implements eager loading of all registered plugins during API startup, ensuring plugins are available immediately upon service initialization.
* feat(plugin-verification): Implement plugin verification system
- **apps/dockstore-verification**:
- Renamed package to `@dockstat/store…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why didnt the first pr work as expected.... idk 🤷♂️ its late here tho gonna fix tomorrow