Conversation
* ✨ Refactor: Improve JSON column handling and table creation
This commit improves the handling of JSON columns within the sqlite-wrapper. It refactors the table creation process to accept a `jsonConfig` option, enabling automatic JSON serialization/deserialization for specified columns.
- Adds `jsonConfig` to the `createTable` options, allowing specification of JSON columns.
- Updates `transformRowToDb` to automatically serialize JSON columns before insertion/update.
- Improves logging for debugging purposes.
- Updates the example in the README to reflect the changes.
* 📝 Update README and package version
Updates the README with more detailed features, switches to MPL-2.0 license and bumps package version to 1.2.7.
* ✨ Feature: Implement Plugin Support and Theme Enhancements
This commit introduces plugin support to DockStat, allowing for extending functionality through external plugins. It also enhances theme capabilities and improves code organization.
- Implemented PluginHandler for managing plugins, including registration, updates, and deletion.
- Added database table for storing plugin metadata and configurations.
- Enhanced ThemeHandler to provide access to the theme table.
- Updated dependencies and scripts for building plugins.
- Moved and renamed existing plugin handler to prevent naming collisions
The `pluginHandler` now handles registration, updates, and deletions of plugins. It also creates a plugin table, for storing information about plugins, such as version number, the plugin component, and plugin settings.
BREAKING CHANGE: The original plugin handler was renamed to prevent naming collisions when new packages are built.
* feat(core): Plugin handler and runtime
This commit introduces a comprehensive plugin handling system, enabling dynamic loading, management, and execution of plugins within the dockstat application.
The key features include:
- Plugin Registry: The core functionality is encapsulated in the PluginHandler class, responsible for registering, loading, updating, and deleting plugins.
- Plugin API: introduces typings for plugin metadata, API, config and actions.
- Dynamic Execution: Support for executing plugin actions and routes, allowing for dynamic interaction with plugins.
BREAKING CHANGE: The plugin backend api has been changed
* feat(lockfile): Remove bun.lock file
This commit removes the `bun.lock` file. This file is no longer needed and is being removed to cleanup the codebase.
The `bun.lock` file tracked the versions of dependencies used in the project.
This is being moved to another file.
* feat(sqlite-wrapper): Enhance create table and add metadata handling
This commit introduces several enhancements to the create table functionality, including comprehensive type-safe column definitions using TableSchema, support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY), and the ability to add table comments as metadata. Additionally, the commit includes bug fixes and improvements.
- Implemented comprehensive type-safe column definitions using TableSchema
- Added support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY)
- Added ability to add table comments as metadata
- Improved error handling and validation for column definitions
- Fixed issue with AUTOINCREMENT usage validation
- Added utility functions for building SQL column definitions and table constraints
* feat(dockstore): Initial commit for dockstore app
This commit adds the basic scaffolding for the dockstore app.
It also includes the installation of js-yaml and associated types
and the sqlite-wrapper for local plugin data persistence.
Some files from DockStacks were removed and the app code was added
Body:
- Created a simple index.ts file for the dockstore app.
- Added a .gitignore file.
- Added placeholder dependencies.
- Updated package.json with updated dependencies and metadata for local plugin data persistence.
- Removed files related to DockStacks templates and themes.
- Added dockstacks plugin scaffolding
* feat(dockstacks): Remove writeStackToDisk function call
The `writeStackToDisk` function call was removed from the insertStack action. This function was responsible for writing the stack configuration to disk, but this functionality is no longer required.
* feat(docknode): Implement Dockstack deployment endpoint
This commit introduces the dockstack deployment endpoint, enabling dynamic deployment of Docker Compose stacks via API calls.
- Adds .gitignore for ignoring node_modules, build artifacts, logs and other non-essential files.
- Adds README.md for basic usage
- Implements the `/dockstack/deploy/:id/:name` endpoint to handle stack deployments.
- Includes file handling functions to write YAML configuration files.
- Introduces a logger for the dockstack module for better traceability and error handling.
- Includes a sample Elysia app with the dockstack endpoint integrated.
- Adds a tsconfig.json file with compiler options configured for the project.
* feat(docknode): Refactor dockstack deployment and add auth plugin
This commit refactors the dockstack deployment process, introduces an authentication plugin, and includes several improvements to logging and configuration.
The following changes were made:
- Replaced the deprecated `bun.lock` file with `package.json` dependencies
- Implemented a new Docker Compose file writing mechanism with variable parsing.
- Added an authentication plugin to secure API endpoints.
- Introduced more detailed logging for debugging and operational insights.
- Add the ability to delete Dockstacks
- Add Openapi integration
* feat(logger): Refactor logger to support hierarchical logging
This commit refactors the logger to support hierarchical logging using a Logger class. The Logger class allows for the creation of child loggers with a parent-child relationship, enabling more granular control over logging output. The logging format is updated to include the logger's prefix and a hierarchy of parent prefixes.
* feat(dockstore): Implement plugin architecture and initial plugins
This commit introduces a plugin architecture for DockStore, allowing for extensible functionality through plugins, themes, and stacks. It includes initial implementations for processing and building plugins, themes, and stacks, generating a manifest file, and updating the README with plugin details.
The following changes were made:
- Added .gitignore entry for .dist directory
- Updated README to include DockStore description and plugin information
- Implemented plugin architecture in index.ts to process plugins, themes, and stacks
- Added utility functions for manifest processing and file system operations
- Introduced a build process for plugins using Bun.build
- Created new components including the actions and supporting files for the docknode-plugin and dockstacks plugin
- Added a manifest.json file to showcase sample plugin metadata
- Updated package.json with new dependencies
- Created a util function for rendering markdown from manifest.json
* fix(dockstat): update dependencies and add elysia-react-router
This commit updates the dependencies in the dockstat package.json file. It also adds the elysia-react-router dependency.
* feat(docknode): Implement docknode application
This commit introduces the core functionality of the docknode application. It includes:
- Dockerfile and .dockerignore for containerization
- Environment type definitions
- Updated package.json with build script and dependencies
- Builder script for production builds
- Authentication model and adapter
- Dockstack handler with instance UUID generation
- Removed the old auth handler (replaced with elysia-basic-auth)
- Updated index.ts to include the auth plugin
- Includes a basic test call
This commit lays the foundation for deploying and managing docker stacks with authentication.
* feat(bun.lock): Add docknode app and update dependencies
This commit adds the docknode application to the bun.lock file, including its dependencies and development dependencies. It also updates various dependencies for other applications and includes an override for elysia to version 1.4.12. Finally, it updates the typings for the plugin action handler.
* feat(dockstat): Refactor DockStat API with Elysia and backend routes
This commit introduces Elysia as the backend framework for the DockStat API and includes restructuring the server for better modularity and scalability.
The following changes were made:
- Integrated Elysia for API routing and middleware management.
- Created adapter routes using Elysia to handle Docker host configurations.
- Refactored the .server/index.ts to prepare for Elysia integration.
- Updated dependencies for elysia and react-router.
- Minor edits to docstrings and README.md
This change sets the foundation for future API enhancements and plugin support.
* feat(docknode): Refactor docknode application
This commit includes several changes to the docknode application:
- Updates .dockerignore to exclude unnecessary files and directories.
- Modifies the Dockerfile to improve build process and use bun.
- Updates environment type definitions and builders.
- Updates dockstack handler and its dependencies.
- Removes unused or deprecated files related to archive data, front end, and docker setup
The changes aim to improve code organization, reduce Docker image size, improve handling environment variables and auth
Fixes: None
* ✨ Refactor: Modernize DockStat app and server
This commit introduces significant changes to modernize the DockStat application, focusing on server-side logic, API structure, and component architecture.
- 🗑️ Removed outdated server-side logic and legacy routing mechanisms.
- ✨ Introduced an Elysia-based API layer with OpenAPI documentation.
- 📝 Implemented API handlers and consolidated data handling.
- ♻️ Refactored server-side code for improved modularity and maintainability.
- 🔥 Removed deprecated UI components and streamlined styling.
- 🚀 Implemented updated dependency structure
- ✅ Simplified routing setup
These changes enhance the application's performance, scalability, and maintainability.
* 🐛 Fix: Correctly derive file and line number in logger
This commit fixes an issue where the file and line number reported by the logger were incorrect in certain environments.
The fix involves:
- Allowing the `DOCKSTAT_LOGGER_FULL_FILE_PATH` environment variable to influence how the caller information is derived.
- Using the correct depth when extracting the line number from the stack trace.
- Adding support for logger chaining using "@" as a separator
This ensures that the logger reports the correct file and line number, even when source maps are used or when the code is run in a production environment.
Also incremented the package version to 1.0.1.
* ✨ Initial commit: React Router × ElysiaJS template
This commit introduces a new template for building React Router v7 applications with an ElysiaJS backend.
The template includes:
- Dockerfile and `.dockerignore` for containerization
- `.gitignore` for excluding files
- README.md with project overview and instructions
- ElysiaJS server setup with WebSocket example
- React Router setup with example routes
- Tailwind CSS configuration
- Type safety and build configurations
This template aims to provide a modern and efficient full-stack development experience with type safety and speed.
* 📝 Update template package details and installation instructions
This commit updates the package name, description, keywords, and files included in the template package. It also corrects the installation instruction in the README file to point to the correct GitHub repository URL. Finally, it adds a thank you message with a link to the repository upon installation.
* ⬆️ Bump version to 1.0.2
Removes a misleading note about WebSocket support.
* ```
🐛 Fix(dockstat): Implement config updates and API request IDs
This commit addresses several issues and introduces new features:
- **elysia:** Updates the elysia version in docknode's package.json
- **Database Updates:** Implements database config updates for dockstat, allowing modifications to the DockStatConfigTable and returning a comprehensive response including update status and the new configuration.
- **API Request IDs:** Adds request IDs to API requests, improving traceability and debugging.
- **Database Initialization:** Provides a more robust database initialization process with comprehensive default settings.
- **Logger Context:** Adds request IDs to logger calls for better context.
```
* ✨ API: Enhance API Functionality and Structure
This commit introduces several enhancements to the API, including:
- Adds API documentation through OpenAPI and Scalar.
- Implements request logging for debugging and monitoring.
- Introduces a new endpoint to retrieve DockStat configuration.
- Improves the way RequestIDs are handled and passed between the App and API
- Removes `welcome.tsx`
These changes aim to provide a more robust and well-documented API for DockStat.
- Introduces Elysia Plugins and Handlers for enhanced organization
* feat(plugin-handler): Implement PluginHandler class and update dependencies
This commit introduces the `PluginHandler` class in `@dockstat/plugin-handler` and updates the dependencies to use workspace references.
The `PluginHandler` class is responsible for managing plugins and interacting with the database and logger. It initializes a new `Logger` instance and uses `DB` and `QueryBuilder` classes from `@dockstat/sqlite-wrapper`.
The `@dockstat/plugin-handler` package's dependencies are updated to use `workspace:*` for `@dockstat/logger` and `@dockstat/sqlite-wrapper`. This ensures that the package uses the latest versions of these dependencies from the workspace.
The `bun.lock` file is updated to reflect the changes in the package dependencies. Additionally, the `@dockstat/typings` package is updated to export plugin-related types.
* ✨ Implement Plugin Handler
This commit introduces a PluginHandler class to manage and interact with plugins. The handler provides functionality for saving, deleting, loading, and unloading plugins from a database. It also includes a mechanism for triggering actions on loaded plugins based on Docker events.
Key changes:
- Created `PluginHandler` class with methods for managing plugins.
- Implemented database interaction for plugin persistence.
- Added event triggering mechanism to invoke plugin actions.
- Introduced `definePlugin` helper function.
- Updated typings to reflect new plugin structure
* 🔥 Remove code: Delete unused plugin types
The plugin types were moved to the plugins.ts file. This commit removes the duplicated types from the _types.ts file.
* ✨ Refactor: Enhance plugin handler and SQLite wrapper
This commit refactors the plugin handler and SQLite wrapper to improve functionality and maintainability.
- Updates .gitignore to include .test-setup and exclude backup files.
- Modifies PluginHandler to include tags, function column handling, and event triggering.
- Deletes unused builder.ts file.
- Updates test plugin example.
- Enhances SQLite wrapper for better JSON and function column management.
- Updates typings for plugins to include ID and refined table definitions.
These changes enhance the plugin system's flexibility and robustness.
* ✨ Add module and JSON parsing to query builder
This commit introduces functionality for parsing and transforming JSON and MODULE columns in the query builder. It enhances data handling for both fetching (transformRowFromDb, transformRowsFromDb) and inserting/updating (transformRowToDb) operations.
- Added logic to parse JSON columns when fetching data from the database, handling potential parsing errors gracefully.
- Implemented support for MODULE columns, utilizing Bun.Transpiler to transform and compile function strings into object URLs for dynamic importing.
- Updated the transformRowToDb method to serialize JSON columns before insertion/update.
- Added comprehensive logging for debugging and monitoring the transformation processes.
- Modified types to work with both JSON and Transpiler
* ✨ feat: Introduce Plugin System with Database Integration
This commit introduces a plugin system with database integration, allowing for dynamic loading and unloading of plugins.
- Implemented a new `PluginHandler` class in `@dockstat/plugin-handler` to manage plugin loading, unloading, and event triggering.
- Added a new API endpoint `/plugins` in `apps/dockstat/app/.server/api/plugins/index.ts` to fetch all plugins from the database.
- Modified the database schema to include a `plugins` table with necessary metadata like name, version, manifest, author, and event hooks.
- Updated `DockStatDB` to include a reference to the `pluginTable` QueryBuilder.
- Modified `sqlite-wrapper` to include module support.
* ```
feat(dockstat): Upgrade Bun runtime and enhance plugin handling
This commit upgrades the Bun runtime from 1.2.20 to 1.3.1. It also includes enhancements to plugin handling within DockStat, including adding routes for plugin status, installation, deletion, and custom routes. API documentation has been kept up to date through scalar openapi for consistency
```
* ✨ Feature: Enhance plugin system and API with new functionalities and structure
Adds plugin management API endpoints for installing, deleting, and activating plugins. Introduces bundling for dockstore plugins and improves logging for API requests. Adds DockStore route to React Router.
- Implements plugin bundling via `bun` to `apps/dockstore`
- Enhances API for plugin management:
- Adds routes in Elysia for retrieving, installing, deleting, and activating plugins.
- Adds proxy route
- Adds handlers for saving, deleting, loading, and handling routes for plugins.
- Adds manifest URL installation for plugins.
- Improves API logging for requests and responses.
- Adds new `DockStore` route to `app/routes.ts`
- Adds `tags` and `detail` to the `database` route
- Enhances DB with default config
This commit restructures the plugin system, provides functionalities to manage plugins, improve the plugin loading/installation experience, API route management, and enhances logging for API requests.
* feat(deps): Update dependencies and add bunfig.toml files
This commit updates dependencies in `package.json` and `bun.lock` to their latest versions. It also adds `bunfig.toml` files to various packages and apps to configure bun with `linker = "isolated"`
The `install-deps.sh` script was removed.
* ✨ feat: Add UI package with shared components
This commit introduces a new `ui` package that contains reusable UI components built with React, TypeScript, and Vite. This package will be used across multiple applications within the monorepo to maintain a consistent look and feel.
The following components are included:
- Badge
- Button
- Card
- Checkbox
- CheckboxGroup
- Divider
- HoverBubble
- Input
- Link
- Modal
- Table
- Toggle
These components provide basic building blocks for creating user interfaces, including styling with tailwindcss.
🔥 Remove CI/CD pipelines and images
This commit removes the old CI/CD pipelines.
It also removes images from the .github directory that are no longer needed.
* ✨ feat: Theme provider and component styling updates
Adds a theme provider using tailwind's @theme directive
Updates component styles to use theme variables for consistent theming.
Updates dependencies.
Removes react logo from packages/ui/src/assets
* 🚀 Bump @biomejs/biome to v2.3.3
This commit updates the `@biomejs/biome` dependency from version 1.9.4 to 2.3.3.
This includes updating the `bun.lock` and `package.json` files to reflect the new version.
A new `biome.json` file has been added to the `packages/ui` directory with linting, formatting, and assist configurations.
The `eslint.config.js` file has been removed from the `packages/ui` directory.
A new `DockStat2-06.png` file has been added to the `packages/ui/public` directory.
Several component updates and new components has been added to the `packages/ui/src/components` directory.
A new `Intro.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Slider.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Welcome.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
The `tailwind.css` file has been updated with slider styling and animations.
Several welcome components have been added to the `packages/ui/src/welcome` directory.
* ✨ Improve intro screen animation and add message prop
The intro screen animation has been tweaked to improve the floating stripes and logo appearance. Also added a message property to the Intro screen to show a message in the Card.
* 🚀 Implement Plugin Store UI with UI Package
This commit introduces a Plugin Store UI in the dockstat app, leveraging components from the `@dockstat/ui` package. It also fixes an issue where the default config was not correctly written to the DB.
- Updates the app's styling to use Tailwind CSS from the `@dockstat/ui` package, and removes unused CSS.
- Implements DockStore component that fetches repos and installed plugins from the API to display plugin installation options.
- Adds basic utility for pulling repository data from Github
- Includes new dev tool configs
* ✨ Implement Extension Browser and related actions
This commit introduces the Extension Browser, allowing users to browse, install, and uninstall extensions. It includes:
- New server actions for handling extension installation and uninstallation.
- New server loaders for fetching extension data.
- API endpoints for retrieving remote plugin manifests.
- Parsers for different repository types (currently only GitHub).
- UI components for displaying and interacting with extensions.
- Updated the DockStore route to use the new Extension Browser.
This also introduces a new react component @dockstat/ui ExtensionBrowser, and small changes to the db typings.
* ✨ Implement repo manifest endpoint and plugin fetching
This commit introduces a new `/repo/manifest` endpoint to fetch a repository's manifest file (manifest.yml) and updates the `/plugin/manifest` endpoint to accept a plugin name parameter. It also introduces the logic to retrieve and display a plugins metadata from various repositories in the Dockstore route.
The following changes were made:
- Added `getRepoManifest` function to fetch and parse the repository manifest file.
- Modified the `/extensions/plugin/manifest` endpoint to expect a plugin name in the params.
- Implemented API calls and logic to fetch and display plugin metadata in the Dockstore route, dynamically retrieving plugins from configured repositories.
- Fixed a schema error in the plugin get all endpoint.
* ✨ Feat: Reworked Plugin System and added frontend support
This commit introduces several significant changes to the plugin system:
- **Frontend Integration:** A new `/extensions` route is added to display available and installed plugins. This includes loaders and actions for fetching and managing plugins.
- **Manifest Handling:** Modified how plugin manifests are fetched and processed. Removed unused code for remote plugin manifests. The system now focuses on retrieving a repository manifest containing a list of plugins.
- **Elysia Plugins:** Added `@elysiajs/server-timing` for improved performance monitoring.
- **Type Updates:** Changed the type definition for PluginMeta to allow for better data structure.
- **Repo Manifest Type:** Added a type for the manifest repo to allow for more information.
- **Dockstore:** Removed old dockstore code.
* feat(dockstore): Improve plugin management and add schema validation
This commit introduces several enhancements to the plugin management system in Dockstore, including:
- Adds schema validation for plugin metadata using AJV to ensure data integrity and consistency.
- Implements concurrent building of plugins with progress UI and enhanced error handling.
- Introduces schema generation for plugin metadata to improve type safety and documentation.
- Refactors and improves Extension Browser UI to display remote plugins and display associated metadata.
- Updates plugin manifest format.
These changes enhance the developer experience and improve the reliability of Dockstore's plugin system.
* feat(extensions): Add plugin proxy and repo type to plugin metadata
Adds a proxy endpoint for plugins to allow fetching manifest files from different sources. Also adds `repoType` to plugin metadata to specify the type of repository the plugin is hosted on.
- Added a new proxy endpoint for plugins
- Added `repoType` to plugin metadata schema
- Updated plugin metadata in manifest files to include `repoType`
- Updated plugin metadata type to include `repoType`
- Updated UI components to display plugins and install them
- Updated modal component to prevent background scroll when modal is open and to close on Escape key press
* feat(extensions): Implement extension proxy and manifest fetching
This commit introduces the following changes:
- Implemented an extension proxy that redirects to GitHub raw content for plugin manifests.
- Added a utility function to build GitHub raw content URLs.
- Updated the extension API to use the proxy.
- Updated the manifest files to use `.yml` extension.
The extension proxy allows fetching plugin manifests directly from GitHub repositories, enabling dynamic plugin loading and updates. The manifest fetching functionality is updated to support the new proxy.
* Adding Plugin bundle.js
* feat(app): Refactor React Router integration and enhance plugin management
This commit introduces significant changes to improve the integration between React Router and Elysia, as well as enhance the plugin management process. It includes a new API convention document, proxy actions and loaders, refactored extension actions and loaders, and various enhancements to API endpoints.
The key changes include:
- Introduction of an API convention document (`README.md`) that explains the integration pattern between Elysia, Eden Treaty, and React Router.
- Implementation of proxy actions and loaders (`proxy.ts`) to handle API requests through React Router.
- Refactoring of extension actions and loaders to improve code organization and maintainability.
- Addition of a server entry point (`index.ts`) to explicitly start the Elysia server.
- Enhancements to the plugin management process, including the ability to install plugins from URLs and proxy plugin API requests.
- Update dependencies.
- Update biome config.
* feat(api): Enhanced logging and request ID handling
This commit introduces several improvements to the DockStat API:
- Added a global derive function in `DockStatElysiaHandlers` to extract the `x-dockstatapi-requestid` from headers and make it available globally.
- Replaced `Elogger` with `ElysiaLogger` in `apps/dockstat/app/.server/api/handlers.ts` and `apps/dockstat/app/.server/api/plugins/index.ts` for more consistent logging.
- Updated logging messages to include the request ID for easier debugging.
- Added a new `ElysiaLogger` in `apps/dockstat/app/.server/api/logger.ts` to centralize logging for Elysia-related events.
- Added `x-dockstatapi-requestid` header generation for treaty for easier end-to-end debugging
These changes improve the API's observability and make it easier to track requests.
* fix(dockstore): Remove sourcemap due to the insane size increase
* feat(plugin-handler): Implement plugin installation and validation
This commit introduces several changes to improve plugin installation and validation:
- Adds error handling for plugin saving, returning a success/failure message.
- Updates the plugin installation endpoint to accept a stringified JSON object for the plugin data.
- Modifies the DB schema to store the plugin as a module instead of JSON, allowing for executable code.
- Implements better validation of JSON parse errors in the backend for more comprehensive error handling.
- Updates the UI to correctly format the plugin object before sending it to the backend.
These changes enhance the stability and usability of the plugin installation process.
* feat(api): Add metrics endpoint and plugin management UI
This commit introduces a metrics endpoint for monitoring API usage and adds a basic UI for managing plugins.
The following changes were made:
- Added a metrics endpoint () that exposes Prometheus-formatted metrics.
- Implemented middleware to track request metrics such as total requests, requests by method/path/status, request durations, and errors.
- Collected database metrics such as size, page count, and table row counts.
- Included process metrics such as memory usage and uptime.
- Added a plugins route that currently allows to install, update and delete plugins via a manifest link.
The following new files were added:
- : Contains helper functions for collecting and formatting metrics.
- : Implements the metrics endpoint.
- : data loader for plugins page
- : UI for plugin management.
- : Prometheus configuration file for scraping metrics.
* feat(api): Refactor API endpoints for clarity and metrics
This commit refactors the API endpoints to improve code clarity and integrates metrics tracking for better performance monitoring.
The changes include:
- Updated imports and file formatting for consistency.
- Added metrics middleware to track request durations, methods, paths, and status codes.
- Enhanced error handling and logging for API requests.
- Improved code readability and maintainability.
* feat(plugins): Implement plugin list UI and navigation
This commit introduces a new UI for displaying and managing plugins. It includes:
- A new `PluginsPage` component in `@dockstat/ui` that displays a list of installed plugins, active repositories, and loaded plugins.
- A `Navbar` component in `@dockstat/ui` for navigating between different sections of the app (Extensions and Plugins).
- Updates to the `plugins` route in `apps/dockstat` to use the new `PluginsPage` component.
- An overview card for plugin counts
- A repo list displaying active repositories
- Plugin cards displaying information about the plugin
The commit also includes changes to the plugin loading logic to fetch dockstat config.
The UI is built using components from `@dockstat/ui` such as `Card`, `Badge`, `LinkWithIcon` and `Table`.
The overall experience is improved with a new logo.
The commit also enhances the Table component with search, sorting, and filtering functionality.
* feat(docker-client): Implement worker-based architecture and UI enhancements
This commit introduces a worker-based architecture for the docker-client to improve performance and stability.
It includes UI enhancements for extension browsing, such as a table view for plugins.
The following changes were made:
- Implemented a worker-based architecture for the docker-client.
- Added a manager class to handle worker creation, initialization, and communication.
- Created a new worker file to handle DockerClient instances in a separate thread.
- Modified the DockerClient class to be compatible with the worker environment.
- Added types for worker requests and responses.
- Added utility functions for mapping container information and stats.
- Added retry logic for Docker API operations.
- Enhanced the UI for extension browsing with a table view for plugins.
- Updated dependencies in package.json and bun.lock.
The new architecture provides the following benefits:
- Improved performance by offloading Docker API calls to separate threads.
- Increased stability by isolating DockerClient instances from the main thread.
- Enhanced scalability by allowing multiple workers to handle Docker API calls concurrently.
The UI enhancements provide the following benefits:
- Improved usability by allowing users to view plugin information in a table format.
- Enhanced discoverability by making it easier to browse and filter plugins.
* ```
feat(docker): Implement Docker Client Management API
This commit introduces a new API endpoint for managing Docker clients. It allows registering, deleting, and listing Docker clients. It includes the ability to fetch host information for registered clients.
The changes include:
- Creation of a DockerClientManager class to handle Docker client registration, deletion, and listing.
- Creation of `/api/docker` routes for managing Docker clients.
- Modification DockerEventEmitter and StreamManager to adopt new Logger Chain
- Integration of the DockerClientManager with an SQLite database for persistent storage.
- Use DockerAdapterOptionsSchema for validation
```
* feat(api): Add endpoint to create Docker hosts
Adds a POST endpoint `/api/docker/add` to allow creating new Docker host configurations. The endpoint expects a JSON payload containing clientId, hostname, name, secure, and port. This allows for dynamic creation of new Docker host connections.
* feat(metrics): Implement persistent Prometheus metrics and refactor formatting
This commit introduces persistent metrics storage using SQLite, allowing for tracking of total metrics across server sessions. It also refactors the Prometheus metrics formatting to improve readability and maintainability.
The following changes were made:
- Implemented SQLite-backed persistent metrics, including initialization, saving, and updating.
- Added `DockStatDB` initialization to ensure DB is available.
- Refactored metrics collection to track both session and persistent metrics.
- Added error tracking.
- Created `prometheus.ts` to handle prometheus metrics formatting.
- Updated Prometheus metrics formatting to use a structured approach with MetricFamily and MetricSample interfaces.
- Summarize durations to include p50, p95 and p99 values.
- Separated Prometheus formatting from metrics collection.
- Add support for labels.
* feat(api): Implement docker host management and container retrieval
This commit introduces several new features and improvements to the Docker API, focusing on host management and container retrieval:
- Added endpoint for getting all containers for a specific client
- Added endpoint for updating a host
- Modified the register client endpoint to allow nullable options
- Added a status endpoint for the docker API
- Fixed a bug in the error handling where the error message was not correctly displayed
- Fixed the table name in the metrics helper
- Changed the way the origin port is handled in the treaty module
- Removed the oldHost parameter from the updateHost method in the docker client
- Refactored the removeHost method in the docker client to use the hostId instead of the host object
- Refactored the host table name in the host handler
- Updated the docker client options schema
These changes provide more comprehensive control over Docker clients and their associated resources, enabling better monitoring and management capabilities.
* feat(api): Implement docker status endpoint
This commit introduces a new endpoint `/docker/status` that retrieves and returns the status of the Docker pool. It also adds an `initialized` property to the `WorkerMetrics` interface and sets it in the `DockerClientManager`. The docker client init function is now called upon initialisation. This helps ensure that the API can accurately report the health and state of the Docker environment.
The commit includes:
- Implementation of the `/docker/status` endpoint in the `dockstat` app.
- Addition of the `initialized` property to the `WorkerMetrics` interface in the `docker-client` package.
- Setting `initialized` value.
- Calling init function.
* feat(docker): Enhance host management and monitoring
This commit introduces several enhancements to host management and monitoring within the Docker integration.
The changes include:
- **API Endpoint for Monitoring Control:** Added new API endpoints to start and stop monitoring for specific clients.
- **Improved Host Fetching with Error Handling:** The API now returns hosts per client, including error messages if fetching hosts for a client fails.
- **Host Update Functionality:** Implemented a mechanism to update existing Docker hosts, including updating the database record and restarting streams.
- **Enhanced Error Logging:** Improved error logging throughout the application, providing more context for debugging.
- **Worker Error Tracking:** The `DockerClientManager` now tracks worker errors, including the last error message and the number of errors encountered. This helps in diagnosing and resolving issues with worker processes.
- **Docker status:** added more data to the return of the /status endpoint
- **Worker Initialization Timeout:** Added a 30-second timeout for worker initialization. If a worker fails to initialize within this time, an error is reported and the worker is terminated.
These changes improve the reliability and usability of the Docker integration, providing better insights into the status of Docker hosts and containers.
* fix(api): Formatting and cleanup of API endpoints
This commit addresses several formatting issues and performs general cleanup across various API endpoint files. Changes include:
- Standardizing import statements.
- Consistent use of semicolons and trailing commas.
- Improving code readability and consistency by applying biome formatting.
- Fixed type import for app load context and entrycontext in entry.server.tsx
- Added format script to package.json
* feat(plugin-handler): Add Docker client events and trigger hooks for plugins
This commit introduces the ability for plugins to subscribe to Docker client events. It includes:
- Added a `dockerClientEvents` property to the `Plugin` interface to allow plugins to define event handlers.
- Added a `triggerDockerClientHooks` method to the `PluginHandler` class to trigger event handlers in loaded plugins.
- Passed a `triggerHook` function to the DockerClientManager to trigger the hooks on the PluginHandler
- Added formatting scripts to the docker-client and plugin-handler packages
This allows plugins to react to Docker client events and perform custom actions based on those events.
* feat(docker-client): Refactor event handling and update dependencies
This commit refactors the event handling mechanism in the docker-client package by:
- Removing the DockerEventEmitter class.
- Introducing a proxyEvent function that posts events to the parent thread.
- Updating dependencies, specifically referencing logger with workspace:*.
These changes improve performance and simplify event handling within the docker-client package.
* feat(core): Add plugin events and worker event proxy
This commit introduces a new feature that allows plugins to register event handlers for Docker client events. This is achieved by:
- Adding a new `events` property to the `Plugin` interface in `@dockstat/typings`.
- Updating the `DockerClientManager` in `@dockstat/docker-client` to listen for events from workers and trigger the corresponding plugin event handlers.
- Adding a new `proxyEvent` function in `@dockstat/docker-client` to proxy events from the worker to the main process.
- Adding a new `@dockstat/utils` package to provide utility functions for building messages.
- Upgrading bun-types to 1.3.3
The new `events` property in the `Plugin` interface allows plugins to specify a set of event handlers that will be called when the corresponding Docker client events are triggered.
The `DockerClientManager` has been updated to listen for events from workers. When an event is received, the `DockerClientManager` will iterate over the registered plugins and call the corresponding event handler, if one exists.
The `proxyEvent` function is used to proxy events from the worker to the main process. This function takes the event type, the event context, and an optional additional context as arguments. It then posts a message to the main process containing the event data.
The `@dockstat/utils` package provides utility functions for building messages. This package is used by the `proxyEvent` function to build the message that is posted to the main process.
* feat(docker-client): Refactor DockerClientManager for improved worker management and plugin event handling
This commit introduces significant refactoring to the DockerClientManager, focusing on enhanced worker management, plugin event handling, and overall code structure.
The key changes include:
- **Migration to Worker Pool Pattern:** The DockerClientManager now manages a pool of workers for executing Docker client operations, improving concurrency and resource utilization.
- **Mixin-Based Architecture:** The DockerClientManager is now structured using mixins to separate concerns such as host management, container management, image management, and monitoring, resulting in a more modular and maintainable codebase.
- **Event-Driven Architecture:** Improved event handling using plugins by proxying the event through the in the Docker Client, using a typed message builder
- **Improved Client Lifecycle Management:** Enhanced worker lifecycle management, including worker creation, initialization, error handling, and cleanup.
- **Centralized worker logic in ** This file is the only entrypoint for Workers
- **Expose on endpoint of route.** This method is called directly, instead of fetching all clients and then fetching each client
- **Refactor API endpoint to accept a query parameter.** This allows retrieving the stored clients and merging them with the initialized ones
- **Refactor API endpoint to use the function.**
- **Enhance Worker Error Handling:** Improved worker error handling with detailed error logging and automatic worker termination upon critical errors.
The diff includes the following major components:
- : New directory containing the core logic of the DockerClientManager, split into mixins for different functionalities.
- : New file containing the entry point for worker processes.
- : Updated exports to reflect the new directory structure.
- : Update API endpoints
- : Import from the new path
- : Caching Docker client event handlers.
- : Added a method to build the message data when an event is dispatched
These changes improve the scalability, maintainability, and reliability of the DockerClientManager, making it better suited for handling a large number of Docker clients and hosts.
* feat(docker-client): Implement Docker host and container monitoring
This commit introduces a comprehensive monitoring system for Docker hosts and containers. It includes health checks, event monitoring, and metric collection, leveraging separate monitors for each aspect.
The changes include:
- Refactored `MonitoringManager` into seperate monitors for healthchecks, container events and metrics.
- Implemented `HealthCheckMonitor` to periodically ping Docker hosts and emit `host:health:changed` events.
- Implemented `ContainerEventMonitor` to monitor container state changes (created, started, stopped, removed) and emit corresponding events.
- Implemented `HostMetricsMonitor` to collect host-level metrics (CPU, memory, OS, Docker version) and emit `host:metrics` events.
- Implemented `DockerEventStreamManager` which streams docker events from the docker daemon and emits container events in almost real time (without polling).
- Added retry logic to handle temporary connection issues with Docker daemons.
- Added various logging improvements and fixes.
The new monitoring system provides a foundation for real-time insights into the health and performance of Docker environments.
* feat(docker-client): Improve Monitoring and Logging
This commit introduces several enhancements to the docker-client package, focusing on improved monitoring capabilities and more detailed logging. The changes include:
- Enhanced logging within the MonitoringManager and related classes by passing logger parents for better context.
- Added debug logging for container mapping.
- Corrected typo in proxy logger.
- Improved retry logic in the `withRetry` function.
- Added a base utils logger
These changes provide more visibility into the monitoring process and aid in debugging potential issues.
* feat(dockstore): Plugin Architecture Refactor and New DockMon Plugin
This commit introduces a major refactor of the DockStore plugin architecture to improve maintainability and add new features. This includes:
- Improved progress UI with clear task status and error highlighting.
- Concurrent plugin building for faster build times.
- Error tracking and detailed summaries for debugging.
- Enhanced validation and schema generation.
- Introduction of a new DockMon plugin for metrics and monitoring.
- Improved error handling
- Implemented UI clearing
The architecture is now more resilient and easier to extend, paving the way for new plugins and features.
The new DockMon plugin introduces a default plugin that collects container and host metrics and stores them in the DockStat database.
This change required a migration to:
- Chalk (for progress output colors)
- Errors list (for error tracking)
* feat(plugin): Implement DockMon plugin and save default plugins during startup
This commit introduces the DockMon plugin, a default plugin for DockStat that enables monitoring and metrics pages. This plugin listens for and events and saves the data in a table in the main DockStat DB.
Additionally, this commit includes changes to save default plugins during startup. The function scans the directory for plugins and saves them to the database.
The following changes were made:
- Created the DockMon plugin in .
- Implemented the function in .
- Modified the method in to include the in the host object.
- Updated dependencies in various files.
- Fixed a bug in where the was not being passed to the event.
- Added logging for validation of plugins.
- Changed Plugin Column from column.module() to column.text()
The commit also includes:
- Fixed a bug with missing handler logs
- Changed imports to not fail the build on the first attempt
- Fixed a bug where reqID was not always shown
- Reduced logs in production and added truncate to reduce load for parsing and debugging
- Added ignore messages and the option to disable individual loggers
These changes enable DockStat to collect and store monitoring and metrics data from Docker hosts and containers, and provide a mechanism for extending DockStat with plugins.
* feat(dockstat): enhance database and plugin handling
This commit introduces several enhancements to the database layer and plugin handling within DockStat, including:
- Implemented WAL mode and caching for SQLite to improve performance and reliability.
- Added database revisioning to ensure smooth migrations and prevent data corruption during updates.
- Introduced BOOLEAN parser to improve bool conversion
- Improved Plugin Handler to correctly load and assign IDs to plugins.
- Fixed a bug in the DockMon plugin that prevented host metrics from being properly saved.
- Updated the docker-client manager to use `PluginHandler` when applying the events to the workers
This commit enhances the overall stability and performance of DockStat, while also providing a more robust and flexible plugin system.
* Add standalone DockStat API app and update client integration (#11)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging and plugin bundling.
- Removes deprecated code and proxies to improve React Router integration.
- Adds Onboarding route and moves files around
The main goal of this commit is to improve the API's reliability, maintainability, and developer experience.
* chore(dockstat): Untrack bundled output and update gitignore
The '.bundled/index.js' file has been removed from version control, and the '.gitignore' file updated to explicitly ignore the entire '.bundled' directory. This ensures that generated build artifacts are not committed to the repository.
* refactor(api, docker-client): improve configuration, plugin loading, and client data handling
Refine API server timing enablement logic to correctly interpret `DOCKSTATAPI_SHOW_TRACES` environment variable, allowing explicit disabling with "false".
Enhance default plugin loading by using `node:url` and `node:path` for robust directory resolution, and a more specific glob pattern to find `index.ts/js` files.
Overhaul `DockerClientManagerCore.getAllClients` to accurately merge live worker data with stored client information, ensuring consistent `initialized` status and reliable client naming.
* refactor(api): Enhance plugin management, bundling, and add hook discovery
- **Plugin Handling Improvements**:
- Refactored `PluginHandler.loadPlugins` and `PluginHandler.loadPlugin` for more robust error reporting and immediate activation of newly saved plugins.
- Adjusted plugin bundling with `Bun.build` to use ESM format, disable aggressive minification, and include a banner for `import.meta.require` compatibility.
- Corrected the default directory path for loading default plugins.
- Modified temporary file creation for bundled plugins to utilize a dedicated subdirectory.
- Optimized `savePlugin` logging and refined the `saveDefaultPlugins` `id` increment logic.
- Enhanced `PluginHandler.getStatus` to exclude plugin source code, reducing API response payload size.
- **API Enhancements**:
- Introduced a new GET `/plugins/hooks` endpoint to provide a list of available event hooks from currently loaded plugins.
- **Docker Client Manager Refinements**:
- Improved `maxWorkers` environment variable parsing to correctly handle `0` or empty string values, ensuring proper numeric assignment.
- Streamlined event handler initialization to consistently use the PluginHandler for hook discovery.
- Added debug logging within `triggerHooks` for better visibility into event processing.
- **Code Quality & Maintenance**:
- Replaced nullish coalescing `??` with logical OR `||` in specific environment variable parsing for broader falsy value handling.
- Implemented `type` imports for `Logger` and `QueryBuilder` for improved type safety and potential tree-shaking benefits.
- Updated `.gitignore` to properly ignore new `.bundle` build artifacts and SQLite journal files.
- Updated `bun.lock` to reflect dependency changes.
* feat(plugin-api): Implement action-based plugin API routes
Reworked plugin API routing to be declarative and action-based. This centralizes route handling within the `PluginHandler` and provides a clearer interface for plugins.
* **Plugin API Rework**:
* Removed direct `Elysia` route instances from plugins (`routes?: AnyElysia` in `Plugin` interface).
* Plugins now define `apiRoutes` and an `actions` map in their `PluginConfig`. API routes link paths and methods to specific actions defined in the plugin's `actions`.
* The `PluginHandler`'s `handleRoute` method was refactored to directly interpret `PluginConfig.apiRoutes` and execute the corresponding actions.
* **DockMon Plugin Enhancement**:
* Added a new `getSavedMetrics` action to the `DockMon` plugin, allowing retrieval of all saved metrics.
* Integrated `getSavedMetrics` with the `/all` API route for `DockMon`.
* Updated `host:metrics` event handler to use the provided `logger` instead of `console.info`.
* **Docker Client Refactor**:
* Removed the unused `clientId` property from `DockerClient`.
* Changed monitoring manager initialization failures from a `warning` to an `error` event.
* Improved error logging in `withRetry` utility to handle non-Error objects gracefully.
* Added type assertions for `additionalCtx` in `DockerClientManagerCore.handleEvent` to address typing issues.
* **Plugin Loading & Stability**:
* Ensured `pluginHandlerFactory.loadAllPlugins()` is properly awaited in `saveDefaultPlugins` for correct asynchronous behavior.
* Removed `this.loadPlugins(success)` from `installPlugin`, as `loadAllPlugins` now manages the loading process.
* **Typing Updates**: Updated `PluginRoute` and `PluginConfig` types to align with the new action-based architecture.
* chore(lint, workflows): Added new turbo based lint workflow
* ci(lint): Configure GitHub Actions to use Biome's GitHub reporter
* ci(lint): Install Bun dependencies for lint workflow
* ci(lint): Automatically fix lint issues and commit changes
* Lint
* chore(ci): Update lint workflow's commit author and message format
* feat(plugins): Implement generic parser, route discovery, and refactor API handling
- Refactor plugin API route handling (`/:id/routes/*`) to support all HTTP methods.
- Introduce a generic `Parser` configuration for plugin tables, enabling custom transformations for JSON, module code, and boolean column types.
- Centralize plugin action execution into a new `triggerRouteAction` method for better modularity.
- Add a new `/plugins/routes` endpoint to allow discovery of all active plugin API routes.
- Streamline the `PluginActionContext` to simplify the interface for plugin action handlers.
* feat(dockmon): Implement action chaining and specialized metric retrieval
- Renamed `getSavedMetrics` to `getAllMetrics` for improved clarity.
- Added `getContainerMetrics` and `getHostMetrics` actions to allow retrieval of metrics based on their type.
- Introduced a new API route `/test` that demonstrates chaining multiple plugin actions (`test1`, `test2`) together.
- Refactored the plugin configuration by moving `jsonColumns` to a more generic `parser.JSON` property, enabling future expansion of parser types.
- Updated the `Parser` interface in `@sqlite-wrapper` to make `JSON`, `BOOLEAN`, and `MODULE` properties optional.
* chore(ci): Lint
* ci(lint): Run lint workflow only on push
* chore(dockstat): Remove generated bundle file
This file appears to be a generated bundle output that was mistakenly committed. Generated files should not be part of the source control to prevent unnecessary diffs and ensure clean builds.
* feat(readme): Introduce comprehensive project documentation and guides
This commit significantly revamps the project's `README.md` to provide a detailed overview and essential guides for both new users and contributors.
Key updates include:
- Expanded project overview, core features, and technology stack.
- New dedicated sections covering repository structure, developer getting started, plugin system architecture, stack management, multi-node adapters, and development workflow guidelines.
- Clear articulation of known limitations, a high-level roadmap, contributing guidelines, and documentation resources.
- Integration of technology badges for quick reference.
- Addition of `DockStat2-04.png` as a visual asset, likely for workflow illustration.
- Updated `@dockstat/typings` package metadata (added `private` flag, `author` info) and bumped the version to `1.1.0`.
- Removed `tsconfig.tsbuildinfo` from `packages/typings`.
* docs(github): Add DockStat2-04 screenshot
* chore(lint): Allow empty commits in lint workflow
* chore(ci): Lint
* refactor(monorepo): Modernize JS/TS, enhance types, and cleanup code
Code Modernization:
- Replaced string concatenations with template literals for enhanced readability.
- Standardized strict equality (===) and optional chaining (?.).
- Adopted `Number.isFinite()`, `Number.isNaN()`, and explicit radix in `Number.parseInt()`.
Type Safety Enhancements:
- Upgraded `any` to `unknown` in various TypeScript type definitions.
- Improved mixin types and added Biome ignore comments for intentional `any` usage.
Dependency & Code Cleanup:
- Removed numerous unused imports and variables across `apps/api`, `apps/docknode`, `apps/dockstat`, `apps/dockstore`, and various `packages/`.
- Deleted outdated example files from `packages/docker-client/examples/`.
- Eliminated redundant code elements, such as empty JSX fragments in React components.
Tooling:
- Updated `biome.json` to refine file inclusion/exclusion for linting and formatting.
* chore(ci): Lint
* feat(outline-sync): Re-implement and simplify sync logic
This commit completely re-implements the `outline-sync` package, moving from a complex, multi-collection, file-based configuration system to a simpler, CLI-driven approach.
Key changes include:
* **Simplified Architecture**: The entire core logic (e.g., `lib/config`, `lib/init`, `lib/outlineApi`, `lib/syncEngine`, `lib/types`) has been replaced with a new, more modular `src/` structure.
* **New CLI Commands**: Introduces `sync`, `watch`, and `ci` commands for one-time pull, bidirectional watching, and CI/CD integration, respectively, powered by `commander`.
* **Direct Configuration**: Configuration is now primarily driven by CLI options (`--url`, `--token`, `--output`) and environment variables, reducing reliance on local config files.
* **Package Renaming**: The package name has been updated from `@dockstat/outline-sync` to `outline-sync`.
* **Dependency Updates**: Removed `@dockstat/logger` and `typescript` peer dependency. Added `commander`, `chokidar`, `front-matter`, and `yaml` for the new implementation, along with updated `bun-types` and `@types/node`.
* **License Change**: Switched the package license from MPL-2.0 to MIT.
* **Updated README**: The documentation has been completely rewritten to reflect the new features and usage.
* **Bundling**: The CLI is now bundled into `dist/index.js` for simpler distribution and execution.
This refactor aims to make `outline-sync` easier to use, understand, and integrate into various workflows, especially for CI/CD environments.
* feat(outline-sync): Introduce config file support and init command
Introduces a flexible configuration system for `outline-sync`, allowing settings to be defined via:
- A dedicated `outline-sync.config.json` file (recommended)
- Environment variables
- CLI arguments
Adds a new `outline-sync init` command to easily generate a sample `outline-sync.config.json` file. This streamlines initial setup and encourages best practices for configuration.
Detailed changes:
- **Configuration Precedence**: CLI arguments now take precedence over config file settings, which take precedence over environment variables.
- **`init` Command**: New command to scaffold `outline-sync.config.json`.
- **Enhanced `customPaths`**: `customPaths` in the config file now support paths relative to the current working directory (e.g., `../../README.md`).
- **Improved CLI Options**: `sync`, `watch`, and `ci` commands now accept a `--config <path>` option.
- **Package Name Update**: Renamed package from `outline-sync` to `@dockstat/outline-sync` in `package.json`.
- **Extensive Documentation**: README updated to reflect all new configuration methods, custom path examples, document ID discovery, and CI/CD best practices for config files.
This enhancement significantly improves the usability and configurability of the `outline-sync` tool.
* refactor(docs): clear local content and enhance Outline sync
Removed all existing documentation files and sync configurations from `apps/docs`. This prepares the directory for a fresh documentation structure, likely to be managed more actively via the Outline sync tool.
The `@dockstat/outline-sync` package has been updated (v1.2.1) with significant enhancements:
- **Collection Filtering**: Introduced `includeCollections` and `excludeCollections` options, allowing users to specify which Outline collections should be synchronized. This can be configured via CLI (`--include`, `--exclude`) or in `outline-sync.config.json`.
- **Improved Package Management**: The `package.json` now includes a `files` field for better control over published assets.
- **Internal Refinements**: Updated `fs` and `path` imports for Bun compatibility and `Bun.write` to `writeFile`.
- **Documentation Update**: The package's `README.md` has been revised to reflect the new features and installation methods.
A new `apps/docs/outline-sync.config.json` is introduced to serve as the initial configuration for the restructured documentation setup.
* feat(docs): Automate Outline documentation sync with hierarchical structure
Implement a new GitHub Actions workflow (`docs-sync.yaml`) to automatically synchronize documentation from Outline.
The workflow runs on pushes to `main`, a 6-hour schedule, and manual dispatch.
Enhance `@dockstat/outline-sync` to support hierarchical document syncing, mirroring Outline's parent-child structure in the local filesystem. Each document is now stored in a `README.md` within a directory representing its title.
Update `apps/docs/outline-sync.config.json` to store documents directly in the `apps/docs` root and to filter for the "DockStat" collection only.
Bump `@dockstat/outline-sync` version to `1.2.3` and add a `prepublishOnly` script for build automation.
* chore(ci): Lint
---------
Co-authored-by: actions user <your-username@users.noreply.github.com>
Co-authored-by: actions-user <its4nik@users.noreply.github.com>
* chore(ci): Lint
* Merge current dev branch into Review (#12)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging and plugin bundling.
- Removes deprecated code and proxies …
…tion Adds a new 'dockstat' documentation collection, providing detailed information on: * Core architecture (Adapters, Plugins) * Public packages: '@dockstat/outline-sync', '@dockstat/sqlite-wrapper', '@dockstat/theme-handler' * Private packages: '[PRIVATE] @dockstat/db Features' Removes the outdated 'apps/docs/dockstat/archive/contribute/README.md' document. Updates 'outline-sync.config.json' to include the new 'dockstat' collection and map its root README to a custom path. Includes various timestamp updates and minor whitespace adjustments resulting from the sync process.
…fix folder naming Introduce a new `outline-sync push` command for pushing local changes directly to Outline without a prior `syncDown`. This command compares local file timestamps (preferring frontmatter `updatedAt` over file `mtime`) against live remote document `updatedAt` values to determine which files to upload. Enhance the `ci` command's change detection to also prioritize frontmatter `updatedAt` timestamps when comparing against cached remote states. Fix an issue where a collection and a root-level document with the same sanitized title would create a redundant nested folder structure (e.g., `./collection/collection/README.md`). Now, such documents are correctly placed directly within the collection folder (e.g., `./collection/README.md`). Update the `README.md` significantly to reflect these new features, explain the refined change detection logic, and simplify other documentation sections.
* [ImgBot] Optimize images *Total -- 253.61kb -> 79.11kb (68.81%) /packages/ui/src/components/Navbar/DockStat2-06.png -- 81.10kb -> 20.42kb (74.82%) /packages/ui/public/DockStat2-06.png -- 81.10kb -> 20.42kb (74.82%) /.github/DockStat2-04.png -- 78.01kb -> 24.96kb (68%) /packages/ui/public/vite.svg -- 1.46kb -> 1.42kb (2.81%) /packages/react-router-elysia/app/welcome/logo-dark.svg -- 5.96kb -> 5.92kb (0.61%) /packages/react-router-elysia/app/welcome/logo-light.svg -- 5.99kb -> 5.96kb (0.39%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * chore(ci): Lint [skip ci] --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: actions-user <its4nik@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request represents a major development update with comprehensive changes across multiple packages, including refactoring the docker-client architecture, updating database configuration, and reorganizing documentation files.
Key Changes:
- Refactored docker-client to use a worker-based architecture with message passing
- Updated database schema and initialization with version management
- Removed several example files and outdated documentation
- Updated package dependencies and build configurations
Reviewed changes
Copilot reviewed 231 out of 476 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/docker-client/src/docker-client.ts | Major refactor: added worker support, event proxy system, improved host management, and disposal pattern |
| packages/docker-client/src/_worker.index.ts | New worker implementation for handling docker operations in separate thread |
| packages/db/index.ts | Refactored with new config schema, version management, and periodic task initialization |
| packages/db/defaults.ts | New file defining default configuration structure |
| package.json | Updated dependencies, added docker compose scripts, consolidated linting commands |
| biome.json | Updated formatting rules and added CSS/assist configuration |
| packages/docker-client/package.json | Updated dependency versions and added new exports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: ItsNik <info@itsnik.de>
Its4Nik
added a commit
that referenced
this pull request
Dec 17, 2025
* Update Dev (#19)
* Review of Changes since latest main update (wish me luck) (#9)
* ✨ Refactor: Improve JSON column handling and table creation
This commit improves the handling of JSON columns within the sqlite-wrapper. It refactors the table creation process to accept a `jsonConfig` option, enabling automatic JSON serialization/deserialization for specified columns.
- Adds `jsonConfig` to the `createTable` options, allowing specification of JSON columns.
- Updates `transformRowToDb` to automatically serialize JSON columns before insertion/update.
- Improves logging for debugging purposes.
- Updates the example in the README to reflect the changes.
* 📝 Update README and package version
Updates the README with more detailed features, switches to MPL-2.0 license and bumps package version to 1.2.7.
* ✨ Feature: Implement Plugin Support and Theme Enhancements
This commit introduces plugin support to DockStat, allowing for extending functionality through external plugins. It also enhances theme capabilities and improves code organization.
- Implemented PluginHandler for managing plugins, including registration, updates, and deletion.
- Added database table for storing plugin metadata and configurations.
- Enhanced ThemeHandler to provide access to the theme table.
- Updated dependencies and scripts for building plugins.
- Moved and renamed existing plugin handler to prevent naming collisions
The `pluginHandler` now handles registration, updates, and deletions of plugins. It also creates a plugin table, for storing information about plugins, such as version number, the plugin component, and plugin settings.
BREAKING CHANGE: The original plugin handler was renamed to prevent naming collisions when new packages are built.
* feat(core): Plugin handler and runtime
This commit introduces a comprehensive plugin handling system, enabling dynamic loading, management, and execution of plugins within the dockstat application.
The key features include:
- Plugin Registry: The core functionality is encapsulated in the PluginHandler class, responsible for registering, loading, updating, and deleting plugins.
- Plugin API: introduces typings for plugin metadata, API, config and actions.
- Dynamic Execution: Support for executing plugin actions and routes, allowing for dynamic interaction with plugins.
BREAKING CHANGE: The plugin backend api has been changed
* feat(lockfile): Remove bun.lock file
This commit removes the `bun.lock` file. This file is no longer needed and is being removed to cleanup the codebase.
The `bun.lock` file tracked the versions of dependencies used in the project.
This is being moved to another file.
* feat(sqlite-wrapper): Enhance create table and add metadata handling
This commit introduces several enhancements to the create table functionality, including comprehensive type-safe column definitions using TableSchema, support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY), and the ability to add table comments as metadata. Additionally, the commit includes bug fixes and improvements.
- Implemented comprehensive type-safe column definitions using TableSchema
- Added support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY)
- Added ability to add table comments as metadata
- Improved error handling and validation for column definitions
- Fixed issue with AUTOINCREMENT usage validation
- Added utility functions for building SQL column definitions and table constraints
* feat(dockstore): Initial commit for dockstore app
This commit adds the basic scaffolding for the dockstore app.
It also includes the installation of js-yaml and associated types
and the sqlite-wrapper for local plugin data persistence.
Some files from DockStacks were removed and the app code was added
Body:
- Created a simple index.ts file for the dockstore app.
- Added a .gitignore file.
- Added placeholder dependencies.
- Updated package.json with updated dependencies and metadata for local plugin data persistence.
- Removed files related to DockStacks templates and themes.
- Added dockstacks plugin scaffolding
* feat(dockstacks): Remove writeStackToDisk function call
The `writeStackToDisk` function call was removed from the insertStack action. This function was responsible for writing the stack configuration to disk, but this functionality is no longer required.
* feat(docknode): Implement Dockstack deployment endpoint
This commit introduces the dockstack deployment endpoint, enabling dynamic deployment of Docker Compose stacks via API calls.
- Adds .gitignore for ignoring node_modules, build artifacts, logs and other non-essential files.
- Adds README.md for basic usage
- Implements the `/dockstack/deploy/:id/:name` endpoint to handle stack deployments.
- Includes file handling functions to write YAML configuration files.
- Introduces a logger for the dockstack module for better traceability and error handling.
- Includes a sample Elysia app with the dockstack endpoint integrated.
- Adds a tsconfig.json file with compiler options configured for the project.
* feat(docknode): Refactor dockstack deployment and add auth plugin
This commit refactors the dockstack deployment process, introduces an authentication plugin, and includes several improvements to logging and configuration.
The following changes were made:
- Replaced the deprecated `bun.lock` file with `package.json` dependencies
- Implemented a new Docker Compose file writing mechanism with variable parsing.
- Added an authentication plugin to secure API endpoints.
- Introduced more detailed logging for debugging and operational insights.
- Add the ability to delete Dockstacks
- Add Openapi integration
* feat(logger): Refactor logger to support hierarchical logging
This commit refactors the logger to support hierarchical logging using a Logger class. The Logger class allows for the creation of child loggers with a parent-child relationship, enabling more granular control over logging output. The logging format is updated to include the logger's prefix and a hierarchy of parent prefixes.
* feat(dockstore): Implement plugin architecture and initial plugins
This commit introduces a plugin architecture for DockStore, allowing for extensible functionality through plugins, themes, and stacks. It includes initial implementations for processing and building plugins, themes, and stacks, generating a manifest file, and updating the README with plugin details.
The following changes were made:
- Added .gitignore entry for .dist directory
- Updated README to include DockStore description and plugin information
- Implemented plugin architecture in index.ts to process plugins, themes, and stacks
- Added utility functions for manifest processing and file system operations
- Introduced a build process for plugins using Bun.build
- Created new components including the actions and supporting files for the docknode-plugin and dockstacks plugin
- Added a manifest.json file to showcase sample plugin metadata
- Updated package.json with new dependencies
- Created a util function for rendering markdown from manifest.json
* fix(dockstat): update dependencies and add elysia-react-router
This commit updates the dependencies in the dockstat package.json file. It also adds the elysia-react-router dependency.
* feat(docknode): Implement docknode application
This commit introduces the core functionality of the docknode application. It includes:
- Dockerfile and .dockerignore for containerization
- Environment type definitions
- Updated package.json with build script and dependencies
- Builder script for production builds
- Authentication model and adapter
- Dockstack handler with instance UUID generation
- Removed the old auth handler (replaced with elysia-basic-auth)
- Updated index.ts to include the auth plugin
- Includes a basic test call
This commit lays the foundation for deploying and managing docker stacks with authentication.
* feat(bun.lock): Add docknode app and update dependencies
This commit adds the docknode application to the bun.lock file, including its dependencies and development dependencies. It also updates various dependencies for other applications and includes an override for elysia to version 1.4.12. Finally, it updates the typings for the plugin action handler.
* feat(dockstat): Refactor DockStat API with Elysia and backend routes
This commit introduces Elysia as the backend framework for the DockStat API and includes restructuring the server for better modularity and scalability.
The following changes were made:
- Integrated Elysia for API routing and middleware management.
- Created adapter routes using Elysia to handle Docker host configurations.
- Refactored the .server/index.ts to prepare for Elysia integration.
- Updated dependencies for elysia and react-router.
- Minor edits to docstrings and README.md
This change sets the foundation for future API enhancements and plugin support.
* feat(docknode): Refactor docknode application
This commit includes several changes to the docknode application:
- Updates .dockerignore to exclude unnecessary files and directories.
- Modifies the Dockerfile to improve build process and use bun.
- Updates environment type definitions and builders.
- Updates dockstack handler and its dependencies.
- Removes unused or deprecated files related to archive data, front end, and docker setup
The changes aim to improve code organization, reduce Docker image size, improve handling environment variables and auth
Fixes: None
* ✨ Refactor: Modernize DockStat app and server
This commit introduces significant changes to modernize the DockStat application, focusing on server-side logic, API structure, and component architecture.
- 🗑️ Removed outdated server-side logic and legacy routing mechanisms.
- ✨ Introduced an Elysia-based API layer with OpenAPI documentation.
- 📝 Implemented API handlers and consolidated data handling.
- ♻️ Refactored server-side code for improved modularity and maintainability.
- 🔥 Removed deprecated UI components and streamlined styling.
- 🚀 Implemented updated dependency structure
- ✅ Simplified routing setup
These changes enhance the application's performance, scalability, and maintainability.
* 🐛 Fix: Correctly derive file and line number in logger
This commit fixes an issue where the file and line number reported by the logger were incorrect in certain environments.
The fix involves:
- Allowing the `DOCKSTAT_LOGGER_FULL_FILE_PATH` environment variable to influence how the caller information is derived.
- Using the correct depth when extracting the line number from the stack trace.
- Adding support for logger chaining using "@" as a separator
This ensures that the logger reports the correct file and line number, even when source maps are used or when the code is run in a production environment.
Also incremented the package version to 1.0.1.
* ✨ Initial commit: React Router × ElysiaJS template
This commit introduces a new template for building React Router v7 applications with an ElysiaJS backend.
The template includes:
- Dockerfile and `.dockerignore` for containerization
- `.gitignore` for excluding files
- README.md with project overview and instructions
- ElysiaJS server setup with WebSocket example
- React Router setup with example routes
- Tailwind CSS configuration
- Type safety and build configurations
This template aims to provide a modern and efficient full-stack development experience with type safety and speed.
* 📝 Update template package details and installation instructions
This commit updates the package name, description, keywords, and files included in the template package. It also corrects the installation instruction in the README file to point to the correct GitHub repository URL. Finally, it adds a thank you message with a link to the repository upon installation.
* ⬆️ Bump version to 1.0.2
Removes a misleading note about WebSocket support.
* ```
🐛 Fix(dockstat): Implement config updates and API request IDs
This commit addresses several issues and introduces new features:
- **elysia:** Updates the elysia version in docknode's package.json
- **Database Updates:** Implements database config updates for dockstat, allowing modifications to the DockStatConfigTable and returning a comprehensive response including update status and the new configuration.
- **API Request IDs:** Adds request IDs to API requests, improving traceability and debugging.
- **Database Initialization:** Provides a more robust database initialization process with comprehensive default settings.
- **Logger Context:** Adds request IDs to logger calls for better context.
```
* ✨ API: Enhance API Functionality and Structure
This commit introduces several enhancements to the API, including:
- Adds API documentation through OpenAPI and Scalar.
- Implements request logging for debugging and monitoring.
- Introduces a new endpoint to retrieve DockStat configuration.
- Improves the way RequestIDs are handled and passed between the App and API
- Removes `welcome.tsx`
These changes aim to provide a more robust and well-documented API for DockStat.
- Introduces Elysia Plugins and Handlers for enhanced organization
* feat(plugin-handler): Implement PluginHandler class and update dependencies
This commit introduces the `PluginHandler` class in `@dockstat/plugin-handler` and updates the dependencies to use workspace references.
The `PluginHandler` class is responsible for managing plugins and interacting with the database and logger. It initializes a new `Logger` instance and uses `DB` and `QueryBuilder` classes from `@dockstat/sqlite-wrapper`.
The `@dockstat/plugin-handler` package's dependencies are updated to use `workspace:*` for `@dockstat/logger` and `@dockstat/sqlite-wrapper`. This ensures that the package uses the latest versions of these dependencies from the workspace.
The `bun.lock` file is updated to reflect the changes in the package dependencies. Additionally, the `@dockstat/typings` package is updated to export plugin-related types.
* ✨ Implement Plugin Handler
This commit introduces a PluginHandler class to manage and interact with plugins. The handler provides functionality for saving, deleting, loading, and unloading plugins from a database. It also includes a mechanism for triggering actions on loaded plugins based on Docker events.
Key changes:
- Created `PluginHandler` class with methods for managing plugins.
- Implemented database interaction for plugin persistence.
- Added event triggering mechanism to invoke plugin actions.
- Introduced `definePlugin` helper function.
- Updated typings to reflect new plugin structure
* 🔥 Remove code: Delete unused plugin types
The plugin types were moved to the plugins.ts file. This commit removes the duplicated types from the _types.ts file.
* ✨ Refactor: Enhance plugin handler and SQLite wrapper
This commit refactors the plugin handler and SQLite wrapper to improve functionality and maintainability.
- Updates .gitignore to include .test-setup and exclude backup files.
- Modifies PluginHandler to include tags, function column handling, and event triggering.
- Deletes unused builder.ts file.
- Updates test plugin example.
- Enhances SQLite wrapper for better JSON and function column management.
- Updates typings for plugins to include ID and refined table definitions.
These changes enhance the plugin system's flexibility and robustness.
* ✨ Add module and JSON parsing to query builder
This commit introduces functionality for parsing and transforming JSON and MODULE columns in the query builder. It enhances data handling for both fetching (transformRowFromDb, transformRowsFromDb) and inserting/updating (transformRowToDb) operations.
- Added logic to parse JSON columns when fetching data from the database, handling potential parsing errors gracefully.
- Implemented support for MODULE columns, utilizing Bun.Transpiler to transform and compile function strings into object URLs for dynamic importing.
- Updated the transformRowToDb method to serialize JSON columns before insertion/update.
- Added comprehensive logging for debugging and monitoring the transformation processes.
- Modified types to work with both JSON and Transpiler
* ✨ feat: Introduce Plugin System with Database Integration
This commit introduces a plugin system with database integration, allowing for dynamic loading and unloading of plugins.
- Implemented a new `PluginHandler` class in `@dockstat/plugin-handler` to manage plugin loading, unloading, and event triggering.
- Added a new API endpoint `/plugins` in `apps/dockstat/app/.server/api/plugins/index.ts` to fetch all plugins from the database.
- Modified the database schema to include a `plugins` table with necessary metadata like name, version, manifest, author, and event hooks.
- Updated `DockStatDB` to include a reference to the `pluginTable` QueryBuilder.
- Modified `sqlite-wrapper` to include module support.
* ```
feat(dockstat): Upgrade Bun runtime and enhance plugin handling
This commit upgrades the Bun runtime from 1.2.20 to 1.3.1. It also includes enhancements to plugin handling within DockStat, including adding routes for plugin status, installation, deletion, and custom routes. API documentation has been kept up to date through scalar openapi for consistency
```
* ✨ Feature: Enhance plugin system and API with new functionalities and structure
Adds plugin management API endpoints for installing, deleting, and activating plugins. Introduces bundling for dockstore plugins and improves logging for API requests. Adds DockStore route to React Router.
- Implements plugin bundling via `bun` to `apps/dockstore`
- Enhances API for plugin management:
- Adds routes in Elysia for retrieving, installing, deleting, and activating plugins.
- Adds proxy route
- Adds handlers for saving, deleting, loading, and handling routes for plugins.
- Adds manifest URL installation for plugins.
- Improves API logging for requests and responses.
- Adds new `DockStore` route to `app/routes.ts`
- Adds `tags` and `detail` to the `database` route
- Enhances DB with default config
This commit restructures the plugin system, provides functionalities to manage plugins, improve the plugin loading/installation experience, API route management, and enhances logging for API requests.
* feat(deps): Update dependencies and add bunfig.toml files
This commit updates dependencies in `package.json` and `bun.lock` to their latest versions. It also adds `bunfig.toml` files to various packages and apps to configure bun with `linker = "isolated"`
The `install-deps.sh` script was removed.
* ✨ feat: Add UI package with shared components
This commit introduces a new `ui` package that contains reusable UI components built with React, TypeScript, and Vite. This package will be used across multiple applications within the monorepo to maintain a consistent look and feel.
The following components are included:
- Badge
- Button
- Card
- Checkbox
- CheckboxGroup
- Divider
- HoverBubble
- Input
- Link
- Modal
- Table
- Toggle
These components provide basic building blocks for creating user interfaces, including styling with tailwindcss.
🔥 Remove CI/CD pipelines and images
This commit removes the old CI/CD pipelines.
It also removes images from the .github directory that are no longer needed.
* ✨ feat: Theme provider and component styling updates
Adds a theme provider using tailwind's @theme directive
Updates component styles to use theme variables for consistent theming.
Updates dependencies.
Removes react logo from packages/ui/src/assets
* 🚀 Bump @biomejs/biome to v2.3.3
This commit updates the `@biomejs/biome` dependency from version 1.9.4 to 2.3.3.
This includes updating the `bun.lock` and `package.json` files to reflect the new version.
A new `biome.json` file has been added to the `packages/ui` directory with linting, formatting, and assist configurations.
The `eslint.config.js` file has been removed from the `packages/ui` directory.
A new `DockStat2-06.png` file has been added to the `packages/ui/public` directory.
Several component updates and new components has been added to the `packages/ui/src/components` directory.
A new `Intro.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Slider.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Welcome.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
The `tailwind.css` file has been updated with slider styling and animations.
Several welcome components have been added to the `packages/ui/src/welcome` directory.
* ✨ Improve intro screen animation and add message prop
The intro screen animation has been tweaked to improve the floating stripes and logo appearance. Also added a message property to the Intro screen to show a message in the Card.
* 🚀 Implement Plugin Store UI with UI Package
This commit introduces a Plugin Store UI in the dockstat app, leveraging components from the `@dockstat/ui` package. It also fixes an issue where the default config was not correctly written to the DB.
- Updates the app's styling to use Tailwind CSS from the `@dockstat/ui` package, and removes unused CSS.
- Implements DockStore component that fetches repos and installed plugins from the API to display plugin installation options.
- Adds basic utility for pulling repository data from Github
- Includes new dev tool configs
* ✨ Implement Extension Browser and related actions
This commit introduces the Extension Browser, allowing users to browse, install, and uninstall extensions. It includes:
- New server actions for handling extension installation and uninstallation.
- New server loaders for fetching extension data.
- API endpoints for retrieving remote plugin manifests.
- Parsers for different repository types (currently only GitHub).
- UI components for displaying and interacting with extensions.
- Updated the DockStore route to use the new Extension Browser.
This also introduces a new react component @dockstat/ui ExtensionBrowser, and small changes to the db typings.
* ✨ Implement repo manifest endpoint and plugin fetching
This commit introduces a new `/repo/manifest` endpoint to fetch a repository's manifest file (manifest.yml) and updates the `/plugin/manifest` endpoint to accept a plugin name parameter. It also introduces the logic to retrieve and display a plugins metadata from various repositories in the Dockstore route.
The following changes were made:
- Added `getRepoManifest` function to fetch and parse the repository manifest file.
- Modified the `/extensions/plugin/manifest` endpoint to expect a plugin name in the params.
- Implemented API calls and logic to fetch and display plugin metadata in the Dockstore route, dynamically retrieving plugins from configured repositories.
- Fixed a schema error in the plugin get all endpoint.
* ✨ Feat: Reworked Plugin System and added frontend support
This commit introduces several significant changes to the plugin system:
- **Frontend Integration:** A new `/extensions` route is added to display available and installed plugins. This includes loaders and actions for fetching and managing plugins.
- **Manifest Handling:** Modified how plugin manifests are fetched and processed. Removed unused code for remote plugin manifests. The system now focuses on retrieving a repository manifest containing a list of plugins.
- **Elysia Plugins:** Added `@elysiajs/server-timing` for improved performance monitoring.
- **Type Updates:** Changed the type definition for PluginMeta to allow for better data structure.
- **Repo Manifest Type:** Added a type for the manifest repo to allow for more information.
- **Dockstore:** Removed old dockstore code.
* feat(dockstore): Improve plugin management and add schema validation
This commit introduces several enhancements to the plugin management system in Dockstore, including:
- Adds schema validation for plugin metadata using AJV to ensure data integrity and consistency.
- Implements concurrent building of plugins with progress UI and enhanced error handling.
- Introduces schema generation for plugin metadata to improve type safety and documentation.
- Refactors and improves Extension Browser UI to display remote plugins and display associated metadata.
- Updates plugin manifest format.
These changes enhance the developer experience and improve the reliability of Dockstore's plugin system.
* feat(extensions): Add plugin proxy and repo type to plugin metadata
Adds a proxy endpoint for plugins to allow fetching manifest files from different sources. Also adds `repoType` to plugin metadata to specify the type of repository the plugin is hosted on.
- Added a new proxy endpoint for plugins
- Added `repoType` to plugin metadata schema
- Updated plugin metadata in manifest files to include `repoType`
- Updated plugin metadata type to include `repoType`
- Updated UI components to display plugins and install them
- Updated modal component to prevent background scroll when modal is open and to close on Escape key press
* feat(extensions): Implement extension proxy and manifest fetching
This commit introduces the following changes:
- Implemented an extension proxy that redirects to GitHub raw content for plugin manifests.
- Added a utility function to build GitHub raw content URLs.
- Updated the extension API to use the proxy.
- Updated the manifest files to use `.yml` extension.
The extension proxy allows fetching plugin manifests directly from GitHub repositories, enabling dynamic plugin loading and updates. The manifest fetching functionality is updated to support the new proxy.
* Adding Plugin bundle.js
* feat(app): Refactor React Router integration and enhance plugin management
This commit introduces significant changes to improve the integration between React Router and Elysia, as well as enhance the plugin management process. It includes a new API convention document, proxy actions and loaders, refactored extension actions and loaders, and various enhancements to API endpoints.
The key changes include:
- Introduction of an API convention document (`README.md`) that explains the integration pattern between Elysia, Eden Treaty, and React Router.
- Implementation of proxy actions and loaders (`proxy.ts`) to handle API requests through React Router.
- Refactoring of extension actions and loaders to improve code organization and maintainability.
- Addition of a server entry point (`index.ts`) to explicitly start the Elysia server.
- Enhancements to the plugin management process, including the ability to install plugins from URLs and proxy plugin API requests.
- Update dependencies.
- Update biome config.
* feat(api): Enhanced logging and request ID handling
This commit introduces several improvements to the DockStat API:
- Added a global derive function in `DockStatElysiaHandlers` to extract the `x-dockstatapi-requestid` from headers and make it available globally.
- Replaced `Elogger` with `ElysiaLogger` in `apps/dockstat/app/.server/api/handlers.ts` and `apps/dockstat/app/.server/api/plugins/index.ts` for more consistent logging.
- Updated logging messages to include the request ID for easier debugging.
- Added a new `ElysiaLogger` in `apps/dockstat/app/.server/api/logger.ts` to centralize logging for Elysia-related events.
- Added `x-dockstatapi-requestid` header generation for treaty for easier end-to-end debugging
These changes improve the API's observability and make it easier to track requests.
* fix(dockstore): Remove sourcemap due to the insane size increase
* feat(plugin-handler): Implement plugin installation and validation
This commit introduces several changes to improve plugin installation and validation:
- Adds error handling for plugin saving, returning a success/failure message.
- Updates the plugin installation endpoint to accept a stringified JSON object for the plugin data.
- Modifies the DB schema to store the plugin as a module instead of JSON, allowing for executable code.
- Implements better validation of JSON parse errors in the backend for more comprehensive error handling.
- Updates the UI to correctly format the plugin object before sending it to the backend.
These changes enhance the stability and usability of the plugin installation process.
* feat(api): Add metrics endpoint and plugin management UI
This commit introduces a metrics endpoint for monitoring API usage and adds a basic UI for managing plugins.
The following changes were made:
- Added a metrics endpoint () that exposes Prometheus-formatted metrics.
- Implemented middleware to track request metrics such as total requests, requests by method/path/status, request durations, and errors.
- Collected database metrics such as size, page count, and table row counts.
- Included process metrics such as memory usage and uptime.
- Added a plugins route that currently allows to install, update and delete plugins via a manifest link.
The following new files were added:
- : Contains helper functions for collecting and formatting metrics.
- : Implements the metrics endpoint.
- : data loader for plugins page
- : UI for plugin management.
- : Prometheus configuration file for scraping metrics.
* feat(api): Refactor API endpoints for clarity and metrics
This commit refactors the API endpoints to improve code clarity and integrates metrics tracking for better performance monitoring.
The changes include:
- Updated imports and file formatting for consistency.
- Added metrics middleware to track request durations, methods, paths, and status codes.
- Enhanced error handling and logging for API requests.
- Improved code readability and maintainability.
* feat(plugins): Implement plugin list UI and navigation
This commit introduces a new UI for displaying and managing plugins. It includes:
- A new `PluginsPage` component in `@dockstat/ui` that displays a list of installed plugins, active repositories, and loaded plugins.
- A `Navbar` component in `@dockstat/ui` for navigating between different sections of the app (Extensions and Plugins).
- Updates to the `plugins` route in `apps/dockstat` to use the new `PluginsPage` component.
- An overview card for plugin counts
- A repo list displaying active repositories
- Plugin cards displaying information about the plugin
The commit also includes changes to the plugin loading logic to fetch dockstat config.
The UI is built using components from `@dockstat/ui` such as `Card`, `Badge`, `LinkWithIcon` and `Table`.
The overall experience is improved with a new logo.
The commit also enhances the Table component with search, sorting, and filtering functionality.
* feat(docker-client): Implement worker-based architecture and UI enhancements
This commit introduces a worker-based architecture for the docker-client to improve performance and stability.
It includes UI enhancements for extension browsing, such as a table view for plugins.
The following changes were made:
- Implemented a worker-based architecture for the docker-client.
- Added a manager class to handle worker creation, initialization, and communication.
- Created a new worker file to handle DockerClient instances in a separate thread.
- Modified the DockerClient class to be compatible with the worker environment.
- Added types for worker requests and responses.
- Added utility functions for mapping container information and stats.
- Added retry logic for Docker API operations.
- Enhanced the UI for extension browsing with a table view for plugins.
- Updated dependencies in package.json and bun.lock.
The new architecture provides the following benefits:
- Improved performance by offloading Docker API calls to separate threads.
- Increased stability by isolating DockerClient instances from the main thread.
- Enhanced scalability by allowing multiple workers to handle Docker API calls concurrently.
The UI enhancements provide the following benefits:
- Improved usability by allowing users to view plugin information in a table format.
- Enhanced discoverability by making it easier to browse and filter plugins.
* ```
feat(docker): Implement Docker Client Management API
This commit introduces a new API endpoint for managing Docker clients. It allows registering, deleting, and listing Docker clients. It includes the ability to fetch host information for registered clients.
The changes include:
- Creation of a DockerClientManager class to handle Docker client registration, deletion, and listing.
- Creation of `/api/docker` routes for managing Docker clients.
- Modification DockerEventEmitter and StreamManager to adopt new Logger Chain
- Integration of the DockerClientManager with an SQLite database for persistent storage.
- Use DockerAdapterOptionsSchema for validation
```
* feat(api): Add endpoint to create Docker hosts
Adds a POST endpoint `/api/docker/add` to allow creating new Docker host configurations. The endpoint expects a JSON payload containing clientId, hostname, name, secure, and port. This allows for dynamic creation of new Docker host connections.
* feat(metrics): Implement persistent Prometheus metrics and refactor formatting
This commit introduces persistent metrics storage using SQLite, allowing for tracking of total metrics across server sessions. It also refactors the Prometheus metrics formatting to improve readability and maintainability.
The following changes were made:
- Implemented SQLite-backed persistent metrics, including initialization, saving, and updating.
- Added `DockStatDB` initialization to ensure DB is available.
- Refactored metrics collection to track both session and persistent metrics.
- Added error tracking.
- Created `prometheus.ts` to handle prometheus metrics formatting.
- Updated Prometheus metrics formatting to use a structured approach with MetricFamily and MetricSample interfaces.
- Summarize durations to include p50, p95 and p99 values.
- Separated Prometheus formatting from metrics collection.
- Add support for labels.
* feat(api): Implement docker host management and container retrieval
This commit introduces several new features and improvements to the Docker API, focusing on host management and container retrieval:
- Added endpoint for getting all containers for a specific client
- Added endpoint for updating a host
- Modified the register client endpoint to allow nullable options
- Added a status endpoint for the docker API
- Fixed a bug in the error handling where the error message was not correctly displayed
- Fixed the table name in the metrics helper
- Changed the way the origin port is handled in the treaty module
- Removed the oldHost parameter from the updateHost method in the docker client
- Refactored the removeHost method in the docker client to use the hostId instead of the host object
- Refactored the host table name in the host handler
- Updated the docker client options schema
These changes provide more comprehensive control over Docker clients and their associated resources, enabling better monitoring and management capabilities.
* feat(api): Implement docker status endpoint
This commit introduces a new endpoint `/docker/status` that retrieves and returns the status of the Docker pool. It also adds an `initialized` property to the `WorkerMetrics` interface and sets it in the `DockerClientManager`. The docker client init function is now called upon initialisation. This helps ensure that the API can accurately report the health and state of the Docker environment.
The commit includes:
- Implementation of the `/docker/status` endpoint in the `dockstat` app.
- Addition of the `initialized` property to the `WorkerMetrics` interface in the `docker-client` package.
- Setting `initialized` value.
- Calling init function.
* feat(docker): Enhance host management and monitoring
This commit introduces several enhancements to host management and monitoring within the Docker integration.
The changes include:
- **API Endpoint for Monitoring Control:** Added new API endpoints to start and stop monitoring for specific clients.
- **Improved Host Fetching with Error Handling:** The API now returns hosts per client, including error messages if fetching hosts for a client fails.
- **Host Update Functionality:** Implemented a mechanism to update existing Docker hosts, including updating the database record and restarting streams.
- **Enhanced Error Logging:** Improved error logging throughout the application, providing more context for debugging.
- **Worker Error Tracking:** The `DockerClientManager` now tracks worker errors, including the last error message and the number of errors encountered. This helps in diagnosing and resolving issues with worker processes.
- **Docker status:** added more data to the return of the /status endpoint
- **Worker Initialization Timeout:** Added a 30-second timeout for worker initialization. If a worker fails to initialize within this time, an error is reported and the worker is terminated.
These changes improve the reliability and usability of the Docker integration, providing better insights into the status of Docker hosts and containers.
* fix(api): Formatting and cleanup of API endpoints
This commit addresses several formatting issues and performs general cleanup across various API endpoint files. Changes include:
- Standardizing import statements.
- Consistent use of semicolons and trailing commas.
- Improving code readability and consistency by applying biome formatting.
- Fixed type import for app load context and entrycontext in entry.server.tsx
- Added format script to package.json
* feat(plugin-handler): Add Docker client events and trigger hooks for plugins
This commit introduces the ability for plugins to subscribe to Docker client events. It includes:
- Added a `dockerClientEvents` property to the `Plugin` interface to allow plugins to define event handlers.
- Added a `triggerDockerClientHooks` method to the `PluginHandler` class to trigger event handlers in loaded plugins.
- Passed a `triggerHook` function to the DockerClientManager to trigger the hooks on the PluginHandler
- Added formatting scripts to the docker-client and plugin-handler packages
This allows plugins to react to Docker client events and perform custom actions based on those events.
* feat(docker-client): Refactor event handling and update dependencies
This commit refactors the event handling mechanism in the docker-client package by:
- Removing the DockerEventEmitter class.
- Introducing a proxyEvent function that posts events to the parent thread.
- Updating dependencies, specifically referencing logger with workspace:*.
These changes improve performance and simplify event handling within the docker-client package.
* feat(core): Add plugin events and worker event proxy
This commit introduces a new feature that allows plugins to register event handlers for Docker client events. This is achieved by:
- Adding a new `events` property to the `Plugin` interface in `@dockstat/typings`.
- Updating the `DockerClientManager` in `@dockstat/docker-client` to listen for events from workers and trigger the corresponding plugin event handlers.
- Adding a new `proxyEvent` function in `@dockstat/docker-client` to proxy events from the worker to the main process.
- Adding a new `@dockstat/utils` package to provide utility functions for building messages.
- Upgrading bun-types to 1.3.3
The new `events` property in the `Plugin` interface allows plugins to specify a set of event handlers that will be called when the corresponding Docker client events are triggered.
The `DockerClientManager` has been updated to listen for events from workers. When an event is received, the `DockerClientManager` will iterate over the registered plugins and call the corresponding event handler, if one exists.
The `proxyEvent` function is used to proxy events from the worker to the main process. This function takes the event type, the event context, and an optional additional context as arguments. It then posts a message to the main process containing the event data.
The `@dockstat/utils` package provides utility functions for building messages. This package is used by the `proxyEvent` function to build the message that is posted to the main process.
* feat(docker-client): Refactor DockerClientManager for improved worker management and plugin event handling
This commit introduces significant refactoring to the DockerClientManager, focusing on enhanced worker management, plugin event handling, and overall code structure.
The key changes include:
- **Migration to Worker Pool Pattern:** The DockerClientManager now manages a pool of workers for executing Docker client operations, improving concurrency and resource utilization.
- **Mixin-Based Architecture:** The DockerClientManager is now structured using mixins to separate concerns such as host management, container management, image management, and monitoring, resulting in a more modular and maintainable codebase.
- **Event-Driven Architecture:** Improved event handling using plugins by proxying the event through the in the Docker Client, using a typed message builder
- **Improved Client Lifecycle Management:** Enhanced worker lifecycle management, including worker creation, initialization, error handling, and cleanup.
- **Centralized worker logic in ** This file is the only entrypoint for Workers
- **Expose on endpoint of route.** This method is called directly, instead of fetching all clients and then fetching each client
- **Refactor API endpoint to accept a query parameter.** This allows retrieving the stored clients and merging them with the initialized ones
- **Refactor API endpoint to use the function.**
- **Enhance Worker Error Handling:** Improved worker error handling with detailed error logging and automatic worker termination upon critical errors.
The diff includes the following major components:
- : New directory containing the core logic of the DockerClientManager, split into mixins for different functionalities.
- : New file containing the entry point for worker processes.
- : Updated exports to reflect the new directory structure.
- : Update API endpoints
- : Import from the new path
- : Caching Docker client event handlers.
- : Added a method to build the message data when an event is dispatched
These changes improve the scalability, maintainability, and reliability of the DockerClientManager, making it better suited for handling a large number of Docker clients and hosts.
* feat(docker-client): Implement Docker host and container monitoring
This commit introduces a comprehensive monitoring system for Docker hosts and containers. It includes health checks, event monitoring, and metric collection, leveraging separate monitors for each aspect.
The changes include:
- Refactored `MonitoringManager` into seperate monitors for healthchecks, container events and metrics.
- Implemented `HealthCheckMonitor` to periodically ping Docker hosts and emit `host:health:changed` events.
- Implemented `ContainerEventMonitor` to monitor container state changes (created, started, stopped, removed) and emit corresponding events.
- Implemented `HostMetricsMonitor` to collect host-level metrics (CPU, memory, OS, Docker version) and emit `host:metrics` events.
- Implemented `DockerEventStreamManager` which streams docker events from the docker daemon and emits container events in almost real time (without polling).
- Added retry logic to handle temporary connection issues with Docker daemons.
- Added various logging improvements and fixes.
The new monitoring system provides a foundation for real-time insights into the health and performance of Docker environments.
* feat(docker-client): Improve Monitoring and Logging
This commit introduces several enhancements to the docker-client package, focusing on improved monitoring capabilities and more detailed logging. The changes include:
- Enhanced logging within the MonitoringManager and related classes by passing logger parents for better context.
- Added debug logging for container mapping.
- Corrected typo in proxy logger.
- Improved retry logic in the `withRetry` function.
- Added a base utils logger
These changes provide more visibility into the monitoring process and aid in debugging potential issues.
* feat(dockstore): Plugin Architecture Refactor and New DockMon Plugin
This commit introduces a major refactor of the DockStore plugin architecture to improve maintainability and add new features. This includes:
- Improved progress UI with clear task status and error highlighting.
- Concurrent plugin building for faster build times.
- Error tracking and detailed summaries for debugging.
- Enhanced validation and schema generation.
- Introduction of a new DockMon plugin for metrics and monitoring.
- Improved error handling
- Implemented UI clearing
The architecture is now more resilient and easier to extend, paving the way for new plugins and features.
The new DockMon plugin introduces a default plugin that collects container and host metrics and stores them in the DockStat database.
This change required a migration to:
- Chalk (for progress output colors)
- Errors list (for error tracking)
* feat(plugin): Implement DockMon plugin and save default plugins during startup
This commit introduces the DockMon plugin, a default plugin for DockStat that enables monitoring and metrics pages. This plugin listens for and events and saves the data in a table in the main DockStat DB.
Additionally, this commit includes changes to save default plugins during startup. The function scans the directory for plugins and saves them to the database.
The following changes were made:
- Created the DockMon plugin in .
- Implemented the function in .
- Modified the method in to include the in the host object.
- Updated dependencies in various files.
- Fixed a bug in where the was not being passed to the event.
- Added logging for validation of plugins.
- Changed Plugin Column from column.module() to column.text()
The commit also includes:
- Fixed a bug with missing handler logs
- Changed imports to not fail the build on the first attempt
- Fixed a bug where reqID was not always shown
- Reduced logs in production and added truncate to reduce load for parsing and debugging
- Added ignore messages and the option to disable individual loggers
These changes enable DockStat to collect and store monitoring and metrics data from Docker hosts and containers, and provide a mechanism for extending DockStat with plugins.
* feat(dockstat): enhance database and plugin handling
This commit introduces several enhancements to the database layer and plugin handling within DockStat, including:
- Implemented WAL mode and caching for SQLite to improve performance and reliability.
- Added database revisioning to ensure smooth migrations and prevent data corruption during updates.
- Introduced BOOLEAN parser to improve bool conversion
- Improved Plugin Handler to correctly load and assign IDs to plugins.
- Fixed a bug in the DockMon plugin that prevented host metrics from being properly saved.
- Updated the docker-client manager to use `PluginHandler` when applying the events to the workers
This commit enhances the overall stability and performance of DockStat, while also providing a more robust and flexible plugin system.
* Add standalone DockStat API app and update client integration (#11)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging and plugin bundling.
- Removes deprecated code and proxies to improve React Router integration.
- Adds Onboarding route and moves files around
The main goal of this commit is to improve the API's reliability, maintainability, and developer experience.
* chore(dockstat): Untrack bundled output and update gitignore
The '.bundled/index.js' file has been removed from version control, and the '.gitignore' file updated to explicitly ignore the entire '.bundled' directory. This ensures that generated build artifacts are not committed to the repository.
* refactor(api, docker-client): improve configuration, plugin loading, and client data handling
Refine API server timing enablement logic to correctly interpret `DOCKSTATAPI_SHOW_TRACES` environment variable, allowing explicit disabling with "false".
Enhance default plugin loading by using `node:url` and `node:path` for robust directory resolution, and a more specific glob pattern to find `index.ts/js` files.
Overhaul `DockerClientManagerCore.getAllClients` to accurately merge live worker data with stored client information, ensuring consistent `initialized` status and reliable client naming.
* refactor(api): Enhance plugin management, bundling, and add hook discovery
- **Plugin Handling Improvements**:
- Refactored `PluginHandler.loadPlugins` and `PluginHandler.loadPlugin` for more robust error reporting and immediate activation of newly saved plugins.
- Adjusted plugin bundling with `Bun.build` to use ESM format, disable aggressive minification, and include a banner for `import.meta.require` compatibility.
- Corrected the default directory path for loading default plugins.
- Modified temporary file creation for bundled plugins to utilize a dedicated subdirectory.
- Optimized `savePlugin` logging and refined the `saveDefaultPlugins` `id` increment logic.
- Enhanced `PluginHandler.getStatus` to exclude plugin source code, reducing API response payload size.
- **API Enhancements**:
- Introduced a new GET `/plugins/hooks` endpoint to provide a list of available event hooks from currently loaded plugins.
- **Docker Client Manager Refinements**:
- Improved `maxWorkers` environment variable parsing to correctly handle `0` or empty string values, ensuring proper numeric assignment.
- Streamlined event handler initialization to consistently use the PluginHandler for hook discovery.
- Added debug logging within `triggerHooks` for better visibility into event processing.
- **Code Quality & Maintenance**:
- Replaced nullish coalescing `??` with logical OR `||` in specific environment variable parsing for broader falsy value handling.
- Implemented `type` imports for `Logger` and `QueryBuilder` for improved type safety and potential tree-shaking benefits.
- Updated `.gitignore` to properly ignore new `.bundle` build artifacts and SQLite journal files.
- Updated `bun.lock` to reflect dependency changes.
* feat(plugin-api): Implement action-based plugin API routes
Reworked plugin API routing to be declarative and action-based. This centralizes route handling within the `PluginHandler` and provides a clearer interface for plugins.
* **Plugin API Rework**:
* Removed direct `Elysia` route instances from plugins (`routes?: AnyElysia` in `Plugin` interface).
* Plugins now define `apiRoutes` and an `actions` map in their `PluginConfig`. API routes link paths and methods to specific actions defined in the plugin's `actions`.
* The `PluginHandler`'s `handleRoute` method was refactored to directly interpret `PluginConfig.apiRoutes` and execute the corresponding actions.
* **DockMon Plugin Enhancement**:
* Added a new `getSavedMetrics` action to the `DockMon` plugin, allowing retrieval of all saved metrics.
* Integrated `getSavedMetrics` with the `/all` API route for `DockMon`.
* Updated `host:metrics` event handler to use the provided `logger` instead of `console.info`.
* **Docker Client Refactor**:
* Removed the unused `clientId` property from `DockerClient`.
* Changed monitoring manager initialization failures from a `warning` to an `error` event.
* Improved error logging in `withRetry` utility to handle non-Error objects gracefully.
* Added type assertions for `additionalCtx` in `DockerClientManagerCore.handleEvent` to address typing issues.
* **Plugin Loading & Stability**:
* Ensured `pluginHandlerFactory.loadAllPlugins()` is properly awaited in `saveDefaultPlugins` for correct asynchronous behavior.
* Removed `this.loadPlugins(success)` from `installPlugin`, as `loadAllPlugins` now manages the loading process.
* **Typing Updates**: Updated `PluginRoute` and `PluginConfig` types to align with the new action-based architecture.
* chore(lint, workflows): Added new turbo based lint workflow
* ci(lint): Configure GitHub Actions to use Biome's GitHub reporter
* ci(lint): Install Bun dependencies for lint workflow
* ci(lint): Automatically fix lint issues and commit changes
* Lint
* chore(ci): Update lint workflow's commit author and message format
* feat(plugins): Implement generic parser, route discovery, and refactor API handling
- Refactor plugin API route handling (`/:id/routes/*`) to support all HTTP methods.
- Introduce a generic `Parser` configuration for plugin tables, enabling custom transformations for JSON, module code, and boolean column types.
- Centralize plugin action execution into a new `triggerRouteAction` method for better modularity.
- Add a new `/plugins/routes` endpoint to allow discovery of all active plugin API routes.
- Streamline the `PluginActionContext` to simplify the interface for plugin action handlers.
* feat(dockmon): Implement action chaining and specialized metric retrieval
- Renamed `getSavedMetrics` to `getAllMetrics` for improved clarity.
- Added `getContainerMetrics` and `getHostMetrics` actions to allow retrieval of metrics based on their type.
- Introduced a new API route `/test` that demonstrates chaining multiple plugin actions (`test1`, `test2`) together.
- Refactored the plugin configuration by moving `jsonColumns` to a more generic `parser.JSON` property, enabling future expansion of parser types.
- Updated the `Parser` interface in `@sqlite-wrapper` to make `JSON`, `BOOLEAN`, and `MODULE` properties optional.
* chore(ci): Lint
* ci(lint): Run lint workflow only on push
* chore(dockstat): Remove generated bundle file
This file appears to be a generated bundle output that was mistakenly committed. Generated files should not be part of the source control to prevent unnecessary diffs and ensure clean builds.
* feat(readme): Introduce comprehensive project documentation and guides
This commit significantly revamps the project's `README.md` to provide a detailed overview and essential guides for both new users and contributors.
Key updates include:
- Expanded project overview, core features, and technology stack.
- New dedicated sections covering repository structure, developer getting started, plugin system architecture, stack management, multi-node adapters, and development workflow guidelines.
- Clear articulation of known limitations, a high-level roadmap, contributing guidelines, and documentation resources.
- Integration of technology badges for quick reference.
- Addition of `DockStat2-04.png` as a visual asset, likely for workflow illustration.
- Updated `@dockstat/typings` package metadata (added `private` flag, `author` info) and bumped the version to `1.1.0`.
- Removed `tsconfig.tsbuildinfo` from `packages/typings`.
* docs(github): Add DockStat2-04 screenshot
* chore(lint): Allow empty commits in lint workflow
* chore(ci): Lint
* refactor(monorepo): Modernize JS/TS, enhance types, and cleanup code
Code Modernization:
- Replaced string concatenations with template literals for enhanced readability.
- Standardized strict equality (===) and optional chaining (?.).
- Adopted `Number.isFinite()`, `Number.isNaN()`, and explicit radix in `Number.parseInt()`.
Type Safety Enhancements:
- Upgraded `any` to `unknown` in various TypeScript type definitions.
- Improved mixin types and added Biome ignore comments for intentional `any` usage.
Dependency & Code Cleanup:
- Removed numerous unused imports and variables across `apps/api`, `apps/docknode`, `apps/dockstat`, `apps/dockstore`, and various `packages/`.
- Deleted outdated example files from `packages/docker-client/examples/`.
- Eliminated redundant code elements, such as empty JSX fragments in React components.
Tooling:
- Updated `biome.json` to refine file inclusion/exclusion for linting and formatting.
* chore(ci): Lint
* feat(outline-sync): Re-implement and simplify sync logic
This commit completely re-implements the `outline-sync` package, moving from a complex, multi-collection, file-based configuration system to a simpler, CLI-driven approach.
Key changes include:
* **Simplified Architecture**: The entire core logic (e.g., `lib/config`, `lib/init`, `lib/outlineApi`, `lib/syncEngine`, `lib/types`) has been replaced with a new, more modular `src/` structure.
* **New CLI Commands**: Introduces `sync`, `watch`, and `ci` commands for one-time pull, bidirectional watching, and CI/CD integration, respectively, powered by `commander`.
* **Direct Configuration**: Configuration is now primarily driven by CLI options (`--url`, `--token`, `--output`) and environment variables, reducing reliance on local config files.
* **Package Renaming**: The package name has been updated from `@dockstat/outline-sync` to `outline-sync`.
* **Dependency Updates**: Removed `@dockstat/logger` and `typescript` peer dependency. Added `commander`, `chokidar`, `front-matter`, and `yaml` for the new implementation, along with updated `bun-types` and `@types/node`.
* **License Change**: Switched the package license from MPL-2.0 to MIT.
* **Updated README**: The documentation has been completely rewritten to reflect the new features and usage.
* **Bundling**: The CLI is now bundled into `dist/index.js` for simpler distribution and execution.
This refactor aims to make `outline-sync` easier to use, understand, and integrate into various workflows, especially for CI/CD environments.
* feat(outline-sync): Introduce config file support and init command
Introduces a flexible configuration system for `outline-sync`, allowing settings to be defined via:
- A dedicated `outline-sync.config.json` file (recommended)
- Environment variables
- CLI arguments
Adds a new `outline-sync init` command to easily generate a sample `outline-sync.config.json` file. This streamlines initial setup and encourages best practices for configuration.
Detailed changes:
- **Configuration Precedence**: CLI arguments now take precedence over config file settings, which take precedence over environment variables.
- **`init` Command**: New command to scaffold `outline-sync.config.json`.
- **Enhanced `customPaths`**: `customPaths` in the config file now support paths relative to the current working directory (e.g., `../../README.md`).
- **Improved CLI Options**: `sync`, `watch`, and `ci` commands now accept a `--config <path>` option.
- **Package Name Update**: Renamed package from `outline-sync` to `@dockstat/outline-sync` in `package.json`.
- **Extensive Documentation**: README updated to reflect all new configuration methods, custom path examples, document ID discovery, and CI/CD best practices for config files.
This enhancement significantly improves the usability and configurability of the `outline-sync` tool.
* refactor(docs): clear local content and enhance Outline sync
Removed all existing documentation files and sync configurations from `apps/docs`. This prepares the directory for a fresh documentation structure, likely to be managed more actively via the Outline sync tool.
The `@dockstat/outline-sync` package has been updated (v1.2.1) with significant enhancements:
- **Collection Filtering**: Introduced `includeCollections` and `excludeCollections` options, allowing users to specify which Outline collections should be synchronized. This can be configured via CLI (`--include`, `--exclude`) or in `outline-sync.config.json`.
- **Improved Package Management**: The `package.json` now includes a `files` field for better control over published assets.
- **Internal Refinements**: Updated `fs` and `path` imports for Bun compatibility and `Bun.write` to `writeFile`.
- **Documentation Update**: The package's `README.md` has been revised to reflect the new features and installation methods.
A new `apps/docs/outline-sync.config.json` is introduced to serve as the initial configuration for the restructured documentation setup.
* feat(docs): Automate Outline documentation sync with hierarchical structure
Implement a new GitHub Actions workflow (`docs-sync.yaml`) to automatically synchronize documentation from Outline.
The workflow runs on pushes to `main`, a 6-hour schedule, and manual dispatch.
Enhance `@dockstat/outline-sync` to support hierarchical document syncing, mirroring Outline's parent-child structure in the local filesystem. Each document is now stored in a `README.md` within a directory representing its title.
Update `apps/docs/outline-sync.config.json` to store documents directly in the `apps/docs` root and to filter for the "DockStat" collection only.
Bump `@dockstat/outline-sync` version to `1.2.3` and add a `prepublishOnly` script for build automation.
* chore(ci): Lint
---------
Co-authored-by: actions user <your-username@users.noreply.github.com>
Co-authored-by: actions-user <its4nik@users.noreply.github.com>
* chore(ci): Lint
* Merge current dev branch into Review (#12)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging and plugin bundling.
- Rem…
Its4Nik
added a commit
that referenced
this pull request
Dec 23, 2025
* Update Dev (#19)
* Review of Changes since latest main update (wish me luck) (#9)
* ✨ Refactor: Improve JSON column handling and table creation
This commit improves the handling of JSON columns within the sqlite-wrapper. It refactors the table creation process to accept a `jsonConfig` option, enabling automatic JSON serialization/deserialization for specified columns.
- Adds `jsonConfig` to the `createTable` options, allowing specification of JSON columns.
- Updates `transformRowToDb` to automatically serialize JSON columns before insertion/update.
- Improves logging for debugging purposes.
- Updates the example in the README to reflect the changes.
* 📝 Update README and package version
Updates the README with more detailed features, switches to MPL-2.0 license and bumps package version to 1.2.7.
* ✨ Feature: Implement Plugin Support and Theme Enhancements
This commit introduces plugin support to DockStat, allowing for extending functionality through external plugins. It also enhances theme capabilities and improves code organization.
- Implemented PluginHandler for managing plugins, including registration, updates, and deletion.
- Added database table for storing plugin metadata and configurations.
- Enhanced ThemeHandler to provide access to the theme table.
- Updated dependencies and scripts for building plugins.
- Moved and renamed existing plugin handler to prevent naming collisions
The `pluginHandler` now handles registration, updates, and deletions of plugins. It also creates a plugin table, for storing information about plugins, such as version number, the plugin component, and plugin settings.
BREAKING CHANGE: The original plugin handler was renamed to prevent naming collisions when new packages are built.
* feat(core): Plugin handler and runtime
This commit introduces a comprehensive plugin handling system, enabling dynamic loading, management, and execution of plugins within the dockstat application.
The key features include:
- Plugin Registry: The core functionality is encapsulated in the PluginHandler class, responsible for registering, loading, updating, and deleting plugins.
- Plugin API: introduces typings for plugin metadata, API, config and actions.
- Dynamic Execution: Support for executing plugin actions and routes, allowing for dynamic interaction with plugins.
BREAKING CHANGE: The plugin backend api has been changed
* feat(lockfile): Remove bun.lock file
This commit removes the `bun.lock` file. This file is no longer needed and is being removed to cleanup the codebase.
The `bun.lock` file tracked the versions of dependencies used in the project.
This is being moved to another file.
* feat(sqlite-wrapper): Enhance create table and add metadata handling
This commit introduces several enhancements to the create table functionality, including comprehensive type-safe column definitions using TableSchema, support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY), and the ability to add table comments as metadata. Additionally, the commit includes bug fixes and improvements.
- Implemented comprehensive type-safe column definitions using TableSchema
- Added support for table constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY)
- Added ability to add table comments as metadata
- Improved error handling and validation for column definitions
- Fixed issue with AUTOINCREMENT usage validation
- Added utility functions for building SQL column definitions and table constraints
* feat(dockstore): Initial commit for dockstore app
This commit adds the basic scaffolding for the dockstore app.
It also includes the installation of js-yaml and associated types
and the sqlite-wrapper for local plugin data persistence.
Some files from DockStacks were removed and the app code was added
Body:
- Created a simple index.ts file for the dockstore app.
- Added a .gitignore file.
- Added placeholder dependencies.
- Updated package.json with updated dependencies and metadata for local plugin data persistence.
- Removed files related to DockStacks templates and themes.
- Added dockstacks plugin scaffolding
* feat(dockstacks): Remove writeStackToDisk function call
The `writeStackToDisk` function call was removed from the insertStack action. This function was responsible for writing the stack configuration to disk, but this functionality is no longer required.
* feat(docknode): Implement Dockstack deployment endpoint
This commit introduces the dockstack deployment endpoint, enabling dynamic deployment of Docker Compose stacks via API calls.
- Adds .gitignore for ignoring node_modules, build artifacts, logs and other non-essential files.
- Adds README.md for basic usage
- Implements the `/dockstack/deploy/:id/:name` endpoint to handle stack deployments.
- Includes file handling functions to write YAML configuration files.
- Introduces a logger for the dockstack module for better traceability and error handling.
- Includes a sample Elysia app with the dockstack endpoint integrated.
- Adds a tsconfig.json file with compiler options configured for the project.
* feat(docknode): Refactor dockstack deployment and add auth plugin
This commit refactors the dockstack deployment process, introduces an authentication plugin, and includes several improvements to logging and configuration.
The following changes were made:
- Replaced the deprecated `bun.lock` file with `package.json` dependencies
- Implemented a new Docker Compose file writing mechanism with variable parsing.
- Added an authentication plugin to secure API endpoints.
- Introduced more detailed logging for debugging and operational insights.
- Add the ability to delete Dockstacks
- Add Openapi integration
* feat(logger): Refactor logger to support hierarchical logging
This commit refactors the logger to support hierarchical logging using a Logger class. The Logger class allows for the creation of child loggers with a parent-child relationship, enabling more granular control over logging output. The logging format is updated to include the logger's prefix and a hierarchy of parent prefixes.
* feat(dockstore): Implement plugin architecture and initial plugins
This commit introduces a plugin architecture for DockStore, allowing for extensible functionality through plugins, themes, and stacks. It includes initial implementations for processing and building plugins, themes, and stacks, generating a manifest file, and updating the README with plugin details.
The following changes were made:
- Added .gitignore entry for .dist directory
- Updated README to include DockStore description and plugin information
- Implemented plugin architecture in index.ts to process plugins, themes, and stacks
- Added utility functions for manifest processing and file system operations
- Introduced a build process for plugins using Bun.build
- Created new components including the actions and supporting files for the docknode-plugin and dockstacks plugin
- Added a manifest.json file to showcase sample plugin metadata
- Updated package.json with new dependencies
- Created a util function for rendering markdown from manifest.json
* fix(dockstat): update dependencies and add elysia-react-router
This commit updates the dependencies in the dockstat package.json file. It also adds the elysia-react-router dependency.
* feat(docknode): Implement docknode application
This commit introduces the core functionality of the docknode application. It includes:
- Dockerfile and .dockerignore for containerization
- Environment type definitions
- Updated package.json with build script and dependencies
- Builder script for production builds
- Authentication model and adapter
- Dockstack handler with instance UUID generation
- Removed the old auth handler (replaced with elysia-basic-auth)
- Updated index.ts to include the auth plugin
- Includes a basic test call
This commit lays the foundation for deploying and managing docker stacks with authentication.
* feat(bun.lock): Add docknode app and update dependencies
This commit adds the docknode application to the bun.lock file, including its dependencies and development dependencies. It also updates various dependencies for other applications and includes an override for elysia to version 1.4.12. Finally, it updates the typings for the plugin action handler.
* feat(dockstat): Refactor DockStat API with Elysia and backend routes
This commit introduces Elysia as the backend framework for the DockStat API and includes restructuring the server for better modularity and scalability.
The following changes were made:
- Integrated Elysia for API routing and middleware management.
- Created adapter routes using Elysia to handle Docker host configurations.
- Refactored the .server/index.ts to prepare for Elysia integration.
- Updated dependencies for elysia and react-router.
- Minor edits to docstrings and README.md
This change sets the foundation for future API enhancements and plugin support.
* feat(docknode): Refactor docknode application
This commit includes several changes to the docknode application:
- Updates .dockerignore to exclude unnecessary files and directories.
- Modifies the Dockerfile to improve build process and use bun.
- Updates environment type definitions and builders.
- Updates dockstack handler and its dependencies.
- Removes unused or deprecated files related to archive data, front end, and docker setup
The changes aim to improve code organization, reduce Docker image size, improve handling environment variables and auth
Fixes: None
* ✨ Refactor: Modernize DockStat app and server
This commit introduces significant changes to modernize the DockStat application, focusing on server-side logic, API structure, and component architecture.
- 🗑️ Removed outdated server-side logic and legacy routing mechanisms.
- ✨ Introduced an Elysia-based API layer with OpenAPI documentation.
- 📝 Implemented API handlers and consolidated data handling.
- ♻️ Refactored server-side code for improved modularity and maintainability.
- 🔥 Removed deprecated UI components and streamlined styling.
- 🚀 Implemented updated dependency structure
- ✅ Simplified routing setup
These changes enhance the application's performance, scalability, and maintainability.
* 🐛 Fix: Correctly derive file and line number in logger
This commit fixes an issue where the file and line number reported by the logger were incorrect in certain environments.
The fix involves:
- Allowing the `DOCKSTAT_LOGGER_FULL_FILE_PATH` environment variable to influence how the caller information is derived.
- Using the correct depth when extracting the line number from the stack trace.
- Adding support for logger chaining using "@" as a separator
This ensures that the logger reports the correct file and line number, even when source maps are used or when the code is run in a production environment.
Also incremented the package version to 1.0.1.
* ✨ Initial commit: React Router × ElysiaJS template
This commit introduces a new template for building React Router v7 applications with an ElysiaJS backend.
The template includes:
- Dockerfile and `.dockerignore` for containerization
- `.gitignore` for excluding files
- README.md with project overview and instructions
- ElysiaJS server setup with WebSocket example
- React Router setup with example routes
- Tailwind CSS configuration
- Type safety and build configurations
This template aims to provide a modern and efficient full-stack development experience with type safety and speed.
* 📝 Update template package details and installation instructions
This commit updates the package name, description, keywords, and files included in the template package. It also corrects the installation instruction in the README file to point to the correct GitHub repository URL. Finally, it adds a thank you message with a link to the repository upon installation.
* ⬆️ Bump version to 1.0.2
Removes a misleading note about WebSocket support.
* ```
🐛 Fix(dockstat): Implement config updates and API request IDs
This commit addresses several issues and introduces new features:
- **elysia:** Updates the elysia version in docknode's package.json
- **Database Updates:** Implements database config updates for dockstat, allowing modifications to the DockStatConfigTable and returning a comprehensive response including update status and the new configuration.
- **API Request IDs:** Adds request IDs to API requests, improving traceability and debugging.
- **Database Initialization:** Provides a more robust database initialization process with comprehensive default settings.
- **Logger Context:** Adds request IDs to logger calls for better context.
```
* ✨ API: Enhance API Functionality and Structure
This commit introduces several enhancements to the API, including:
- Adds API documentation through OpenAPI and Scalar.
- Implements request logging for debugging and monitoring.
- Introduces a new endpoint to retrieve DockStat configuration.
- Improves the way RequestIDs are handled and passed between the App and API
- Removes `welcome.tsx`
These changes aim to provide a more robust and well-documented API for DockStat.
- Introduces Elysia Plugins and Handlers for enhanced organization
* feat(plugin-handler): Implement PluginHandler class and update dependencies
This commit introduces the `PluginHandler` class in `@dockstat/plugin-handler` and updates the dependencies to use workspace references.
The `PluginHandler` class is responsible for managing plugins and interacting with the database and logger. It initializes a new `Logger` instance and uses `DB` and `QueryBuilder` classes from `@dockstat/sqlite-wrapper`.
The `@dockstat/plugin-handler` package's dependencies are updated to use `workspace:*` for `@dockstat/logger` and `@dockstat/sqlite-wrapper`. This ensures that the package uses the latest versions of these dependencies from the workspace.
The `bun.lock` file is updated to reflect the changes in the package dependencies. Additionally, the `@dockstat/typings` package is updated to export plugin-related types.
* ✨ Implement Plugin Handler
This commit introduces a PluginHandler class to manage and interact with plugins. The handler provides functionality for saving, deleting, loading, and unloading plugins from a database. It also includes a mechanism for triggering actions on loaded plugins based on Docker events.
Key changes:
- Created `PluginHandler` class with methods for managing plugins.
- Implemented database interaction for plugin persistence.
- Added event triggering mechanism to invoke plugin actions.
- Introduced `definePlugin` helper function.
- Updated typings to reflect new plugin structure
* 🔥 Remove code: Delete unused plugin types
The plugin types were moved to the plugins.ts file. This commit removes the duplicated types from the _types.ts file.
* ✨ Refactor: Enhance plugin handler and SQLite wrapper
This commit refactors the plugin handler and SQLite wrapper to improve functionality and maintainability.
- Updates .gitignore to include .test-setup and exclude backup files.
- Modifies PluginHandler to include tags, function column handling, and event triggering.
- Deletes unused builder.ts file.
- Updates test plugin example.
- Enhances SQLite wrapper for better JSON and function column management.
- Updates typings for plugins to include ID and refined table definitions.
These changes enhance the plugin system's flexibility and robustness.
* ✨ Add module and JSON parsing to query builder
This commit introduces functionality for parsing and transforming JSON and MODULE columns in the query builder. It enhances data handling for both fetching (transformRowFromDb, transformRowsFromDb) and inserting/updating (transformRowToDb) operations.
- Added logic to parse JSON columns when fetching data from the database, handling potential parsing errors gracefully.
- Implemented support for MODULE columns, utilizing Bun.Transpiler to transform and compile function strings into object URLs for dynamic importing.
- Updated the transformRowToDb method to serialize JSON columns before insertion/update.
- Added comprehensive logging for debugging and monitoring the transformation processes.
- Modified types to work with both JSON and Transpiler
* ✨ feat: Introduce Plugin System with Database Integration
This commit introduces a plugin system with database integration, allowing for dynamic loading and unloading of plugins.
- Implemented a new `PluginHandler` class in `@dockstat/plugin-handler` to manage plugin loading, unloading, and event triggering.
- Added a new API endpoint `/plugins` in `apps/dockstat/app/.server/api/plugins/index.ts` to fetch all plugins from the database.
- Modified the database schema to include a `plugins` table with necessary metadata like name, version, manifest, author, and event hooks.
- Updated `DockStatDB` to include a reference to the `pluginTable` QueryBuilder.
- Modified `sqlite-wrapper` to include module support.
* ```
feat(dockstat): Upgrade Bun runtime and enhance plugin handling
This commit upgrades the Bun runtime from 1.2.20 to 1.3.1. It also includes enhancements to plugin handling within DockStat, including adding routes for plugin status, installation, deletion, and custom routes. API documentation has been kept up to date through scalar openapi for consistency
```
* ✨ Feature: Enhance plugin system and API with new functionalities and structure
Adds plugin management API endpoints for installing, deleting, and activating plugins. Introduces bundling for dockstore plugins and improves logging for API requests. Adds DockStore route to React Router.
- Implements plugin bundling via `bun` to `apps/dockstore`
- Enhances API for plugin management:
- Adds routes in Elysia for retrieving, installing, deleting, and activating plugins.
- Adds proxy route
- Adds handlers for saving, deleting, loading, and handling routes for plugins.
- Adds manifest URL installation for plugins.
- Improves API logging for requests and responses.
- Adds new `DockStore` route to `app/routes.ts`
- Adds `tags` and `detail` to the `database` route
- Enhances DB with default config
This commit restructures the plugin system, provides functionalities to manage plugins, improve the plugin loading/installation experience, API route management, and enhances logging for API requests.
* feat(deps): Update dependencies and add bunfig.toml files
This commit updates dependencies in `package.json` and `bun.lock` to their latest versions. It also adds `bunfig.toml` files to various packages and apps to configure bun with `linker = "isolated"`
The `install-deps.sh` script was removed.
* ✨ feat: Add UI package with shared components
This commit introduces a new `ui` package that contains reusable UI components built with React, TypeScript, and Vite. This package will be used across multiple applications within the monorepo to maintain a consistent look and feel.
The following components are included:
- Badge
- Button
- Card
- Checkbox
- CheckboxGroup
- Divider
- HoverBubble
- Input
- Link
- Modal
- Table
- Toggle
These components provide basic building blocks for creating user interfaces, including styling with tailwindcss.
🔥 Remove CI/CD pipelines and images
This commit removes the old CI/CD pipelines.
It also removes images from the .github directory that are no longer needed.
* ✨ feat: Theme provider and component styling updates
Adds a theme provider using tailwind's @theme directive
Updates component styles to use theme variables for consistent theming.
Updates dependencies.
Removes react logo from packages/ui/src/assets
* 🚀 Bump @biomejs/biome to v2.3.3
This commit updates the `@biomejs/biome` dependency from version 1.9.4 to 2.3.3.
This includes updating the `bun.lock` and `package.json` files to reflect the new version.
A new `biome.json` file has been added to the `packages/ui` directory with linting, formatting, and assist configurations.
The `eslint.config.js` file has been removed from the `packages/ui` directory.
A new `DockStat2-06.png` file has been added to the `packages/ui/public` directory.
Several component updates and new components has been added to the `packages/ui/src/components` directory.
A new `Intro.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Slider.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
A new `Welcome.stories.tsx` file has been added to the `packages/ui/src/stories` directory.
The `tailwind.css` file has been updated with slider styling and animations.
Several welcome components have been added to the `packages/ui/src/welcome` directory.
* ✨ Improve intro screen animation and add message prop
The intro screen animation has been tweaked to improve the floating stripes and logo appearance. Also added a message property to the Intro screen to show a message in the Card.
* 🚀 Implement Plugin Store UI with UI Package
This commit introduces a Plugin Store UI in the dockstat app, leveraging components from the `@dockstat/ui` package. It also fixes an issue where the default config was not correctly written to the DB.
- Updates the app's styling to use Tailwind CSS from the `@dockstat/ui` package, and removes unused CSS.
- Implements DockStore component that fetches repos and installed plugins from the API to display plugin installation options.
- Adds basic utility for pulling repository data from Github
- Includes new dev tool configs
* ✨ Implement Extension Browser and related actions
This commit introduces the Extension Browser, allowing users to browse, install, and uninstall extensions. It includes:
- New server actions for handling extension installation and uninstallation.
- New server loaders for fetching extension data.
- API endpoints for retrieving remote plugin manifests.
- Parsers for different repository types (currently only GitHub).
- UI components for displaying and interacting with extensions.
- Updated the DockStore route to use the new Extension Browser.
This also introduces a new react component @dockstat/ui ExtensionBrowser, and small changes to the db typings.
* ✨ Implement repo manifest endpoint and plugin fetching
This commit introduces a new `/repo/manifest` endpoint to fetch a repository's manifest file (manifest.yml) and updates the `/plugin/manifest` endpoint to accept a plugin name parameter. It also introduces the logic to retrieve and display a plugins metadata from various repositories in the Dockstore route.
The following changes were made:
- Added `getRepoManifest` function to fetch and parse the repository manifest file.
- Modified the `/extensions/plugin/manifest` endpoint to expect a plugin name in the params.
- Implemented API calls and logic to fetch and display plugin metadata in the Dockstore route, dynamically retrieving plugins from configured repositories.
- Fixed a schema error in the plugin get all endpoint.
* ✨ Feat: Reworked Plugin System and added frontend support
This commit introduces several significant changes to the plugin system:
- **Frontend Integration:** A new `/extensions` route is added to display available and installed plugins. This includes loaders and actions for fetching and managing plugins.
- **Manifest Handling:** Modified how plugin manifests are fetched and processed. Removed unused code for remote plugin manifests. The system now focuses on retrieving a repository manifest containing a list of plugins.
- **Elysia Plugins:** Added `@elysiajs/server-timing` for improved performance monitoring.
- **Type Updates:** Changed the type definition for PluginMeta to allow for better data structure.
- **Repo Manifest Type:** Added a type for the manifest repo to allow for more information.
- **Dockstore:** Removed old dockstore code.
* feat(dockstore): Improve plugin management and add schema validation
This commit introduces several enhancements to the plugin management system in Dockstore, including:
- Adds schema validation for plugin metadata using AJV to ensure data integrity and consistency.
- Implements concurrent building of plugins with progress UI and enhanced error handling.
- Introduces schema generation for plugin metadata to improve type safety and documentation.
- Refactors and improves Extension Browser UI to display remote plugins and display associated metadata.
- Updates plugin manifest format.
These changes enhance the developer experience and improve the reliability of Dockstore's plugin system.
* feat(extensions): Add plugin proxy and repo type to plugin metadata
Adds a proxy endpoint for plugins to allow fetching manifest files from different sources. Also adds `repoType` to plugin metadata to specify the type of repository the plugin is hosted on.
- Added a new proxy endpoint for plugins
- Added `repoType` to plugin metadata schema
- Updated plugin metadata in manifest files to include `repoType`
- Updated plugin metadata type to include `repoType`
- Updated UI components to display plugins and install them
- Updated modal component to prevent background scroll when modal is open and to close on Escape key press
* feat(extensions): Implement extension proxy and manifest fetching
This commit introduces the following changes:
- Implemented an extension proxy that redirects to GitHub raw content for plugin manifests.
- Added a utility function to build GitHub raw content URLs.
- Updated the extension API to use the proxy.
- Updated the manifest files to use `.yml` extension.
The extension proxy allows fetching plugin manifests directly from GitHub repositories, enabling dynamic plugin loading and updates. The manifest fetching functionality is updated to support the new proxy.
* Adding Plugin bundle.js
* feat(app): Refactor React Router integration and enhance plugin management
This commit introduces significant changes to improve the integration between React Router and Elysia, as well as enhance the plugin management process. It includes a new API convention document, proxy actions and loaders, refactored extension actions and loaders, and various enhancements to API endpoints.
The key changes include:
- Introduction of an API convention document (`README.md`) that explains the integration pattern between Elysia, Eden Treaty, and React Router.
- Implementation of proxy actions and loaders (`proxy.ts`) to handle API requests through React Router.
- Refactoring of extension actions and loaders to improve code organization and maintainability.
- Addition of a server entry point (`index.ts`) to explicitly start the Elysia server.
- Enhancements to the plugin management process, including the ability to install plugins from URLs and proxy plugin API requests.
- Update dependencies.
- Update biome config.
* feat(api): Enhanced logging and request ID handling
This commit introduces several improvements to the DockStat API:
- Added a global derive function in `DockStatElysiaHandlers` to extract the `x-dockstatapi-requestid` from headers and make it available globally.
- Replaced `Elogger` with `ElysiaLogger` in `apps/dockstat/app/.server/api/handlers.ts` and `apps/dockstat/app/.server/api/plugins/index.ts` for more consistent logging.
- Updated logging messages to include the request ID for easier debugging.
- Added a new `ElysiaLogger` in `apps/dockstat/app/.server/api/logger.ts` to centralize logging for Elysia-related events.
- Added `x-dockstatapi-requestid` header generation for treaty for easier end-to-end debugging
These changes improve the API's observability and make it easier to track requests.
* fix(dockstore): Remove sourcemap due to the insane size increase
* feat(plugin-handler): Implement plugin installation and validation
This commit introduces several changes to improve plugin installation and validation:
- Adds error handling for plugin saving, returning a success/failure message.
- Updates the plugin installation endpoint to accept a stringified JSON object for the plugin data.
- Modifies the DB schema to store the plugin as a module instead of JSON, allowing for executable code.
- Implements better validation of JSON parse errors in the backend for more comprehensive error handling.
- Updates the UI to correctly format the plugin object before sending it to the backend.
These changes enhance the stability and usability of the plugin installation process.
* feat(api): Add metrics endpoint and plugin management UI
This commit introduces a metrics endpoint for monitoring API usage and adds a basic UI for managing plugins.
The following changes were made:
- Added a metrics endpoint () that exposes Prometheus-formatted metrics.
- Implemented middleware to track request metrics such as total requests, requests by method/path/status, request durations, and errors.
- Collected database metrics such as size, page count, and table row counts.
- Included process metrics such as memory usage and uptime.
- Added a plugins route that currently allows to install, update and delete plugins via a manifest link.
The following new files were added:
- : Contains helper functions for collecting and formatting metrics.
- : Implements the metrics endpoint.
- : data loader for plugins page
- : UI for plugin management.
- : Prometheus configuration file for scraping metrics.
* feat(api): Refactor API endpoints for clarity and metrics
This commit refactors the API endpoints to improve code clarity and integrates metrics tracking for better performance monitoring.
The changes include:
- Updated imports and file formatting for consistency.
- Added metrics middleware to track request durations, methods, paths, and status codes.
- Enhanced error handling and logging for API requests.
- Improved code readability and maintainability.
* feat(plugins): Implement plugin list UI and navigation
This commit introduces a new UI for displaying and managing plugins. It includes:
- A new `PluginsPage` component in `@dockstat/ui` that displays a list of installed plugins, active repositories, and loaded plugins.
- A `Navbar` component in `@dockstat/ui` for navigating between different sections of the app (Extensions and Plugins).
- Updates to the `plugins` route in `apps/dockstat` to use the new `PluginsPage` component.
- An overview card for plugin counts
- A repo list displaying active repositories
- Plugin cards displaying information about the plugin
The commit also includes changes to the plugin loading logic to fetch dockstat config.
The UI is built using components from `@dockstat/ui` such as `Card`, `Badge`, `LinkWithIcon` and `Table`.
The overall experience is improved with a new logo.
The commit also enhances the Table component with search, sorting, and filtering functionality.
* feat(docker-client): Implement worker-based architecture and UI enhancements
This commit introduces a worker-based architecture for the docker-client to improve performance and stability.
It includes UI enhancements for extension browsing, such as a table view for plugins.
The following changes were made:
- Implemented a worker-based architecture for the docker-client.
- Added a manager class to handle worker creation, initialization, and communication.
- Created a new worker file to handle DockerClient instances in a separate thread.
- Modified the DockerClient class to be compatible with the worker environment.
- Added types for worker requests and responses.
- Added utility functions for mapping container information and stats.
- Added retry logic for Docker API operations.
- Enhanced the UI for extension browsing with a table view for plugins.
- Updated dependencies in package.json and bun.lock.
The new architecture provides the following benefits:
- Improved performance by offloading Docker API calls to separate threads.
- Increased stability by isolating DockerClient instances from the main thread.
- Enhanced scalability by allowing multiple workers to handle Docker API calls concurrently.
The UI enhancements provide the following benefits:
- Improved usability by allowing users to view plugin information in a table format.
- Enhanced discoverability by making it easier to browse and filter plugins.
* ```
feat(docker): Implement Docker Client Management API
This commit introduces a new API endpoint for managing Docker clients. It allows registering, deleting, and listing Docker clients. It includes the ability to fetch host information for registered clients.
The changes include:
- Creation of a DockerClientManager class to handle Docker client registration, deletion, and listing.
- Creation of `/api/docker` routes for managing Docker clients.
- Modification DockerEventEmitter and StreamManager to adopt new Logger Chain
- Integration of the DockerClientManager with an SQLite database for persistent storage.
- Use DockerAdapterOptionsSchema for validation
```
* feat(api): Add endpoint to create Docker hosts
Adds a POST endpoint `/api/docker/add` to allow creating new Docker host configurations. The endpoint expects a JSON payload containing clientId, hostname, name, secure, and port. This allows for dynamic creation of new Docker host connections.
* feat(metrics): Implement persistent Prometheus metrics and refactor formatting
This commit introduces persistent metrics storage using SQLite, allowing for tracking of total metrics across server sessions. It also refactors the Prometheus metrics formatting to improve readability and maintainability.
The following changes were made:
- Implemented SQLite-backed persistent metrics, including initialization, saving, and updating.
- Added `DockStatDB` initialization to ensure DB is available.
- Refactored metrics collection to track both session and persistent metrics.
- Added error tracking.
- Created `prometheus.ts` to handle prometheus metrics formatting.
- Updated Prometheus metrics formatting to use a structured approach with MetricFamily and MetricSample interfaces.
- Summarize durations to include p50, p95 and p99 values.
- Separated Prometheus formatting from metrics collection.
- Add support for labels.
* feat(api): Implement docker host management and container retrieval
This commit introduces several new features and improvements to the Docker API, focusing on host management and container retrieval:
- Added endpoint for getting all containers for a specific client
- Added endpoint for updating a host
- Modified the register client endpoint to allow nullable options
- Added a status endpoint for the docker API
- Fixed a bug in the error handling where the error message was not correctly displayed
- Fixed the table name in the metrics helper
- Changed the way the origin port is handled in the treaty module
- Removed the oldHost parameter from the updateHost method in the docker client
- Refactored the removeHost method in the docker client to use the hostId instead of the host object
- Refactored the host table name in the host handler
- Updated the docker client options schema
These changes provide more comprehensive control over Docker clients and their associated resources, enabling better monitoring and management capabilities.
* feat(api): Implement docker status endpoint
This commit introduces a new endpoint `/docker/status` that retrieves and returns the status of the Docker pool. It also adds an `initialized` property to the `WorkerMetrics` interface and sets it in the `DockerClientManager`. The docker client init function is now called upon initialisation. This helps ensure that the API can accurately report the health and state of the Docker environment.
The commit includes:
- Implementation of the `/docker/status` endpoint in the `dockstat` app.
- Addition of the `initialized` property to the `WorkerMetrics` interface in the `docker-client` package.
- Setting `initialized` value.
- Calling init function.
* feat(docker): Enhance host management and monitoring
This commit introduces several enhancements to host management and monitoring within the Docker integration.
The changes include:
- **API Endpoint for Monitoring Control:** Added new API endpoints to start and stop monitoring for specific clients.
- **Improved Host Fetching with Error Handling:** The API now returns hosts per client, including error messages if fetching hosts for a client fails.
- **Host Update Functionality:** Implemented a mechanism to update existing Docker hosts, including updating the database record and restarting streams.
- **Enhanced Error Logging:** Improved error logging throughout the application, providing more context for debugging.
- **Worker Error Tracking:** The `DockerClientManager` now tracks worker errors, including the last error message and the number of errors encountered. This helps in diagnosing and resolving issues with worker processes.
- **Docker status:** added more data to the return of the /status endpoint
- **Worker Initialization Timeout:** Added a 30-second timeout for worker initialization. If a worker fails to initialize within this time, an error is reported and the worker is terminated.
These changes improve the reliability and usability of the Docker integration, providing better insights into the status of Docker hosts and containers.
* fix(api): Formatting and cleanup of API endpoints
This commit addresses several formatting issues and performs general cleanup across various API endpoint files. Changes include:
- Standardizing import statements.
- Consistent use of semicolons and trailing commas.
- Improving code readability and consistency by applying biome formatting.
- Fixed type import for app load context and entrycontext in entry.server.tsx
- Added format script to package.json
* feat(plugin-handler): Add Docker client events and trigger hooks for plugins
This commit introduces the ability for plugins to subscribe to Docker client events. It includes:
- Added a `dockerClientEvents` property to the `Plugin` interface to allow plugins to define event handlers.
- Added a `triggerDockerClientHooks` method to the `PluginHandler` class to trigger event handlers in loaded plugins.
- Passed a `triggerHook` function to the DockerClientManager to trigger the hooks on the PluginHandler
- Added formatting scripts to the docker-client and plugin-handler packages
This allows plugins to react to Docker client events and perform custom actions based on those events.
* feat(docker-client): Refactor event handling and update dependencies
This commit refactors the event handling mechanism in the docker-client package by:
- Removing the DockerEventEmitter class.
- Introducing a proxyEvent function that posts events to the parent thread.
- Updating dependencies, specifically referencing logger with workspace:*.
These changes improve performance and simplify event handling within the docker-client package.
* feat(core): Add plugin events and worker event proxy
This commit introduces a new feature that allows plugins to register event handlers for Docker client events. This is achieved by:
- Adding a new `events` property to the `Plugin` interface in `@dockstat/typings`.
- Updating the `DockerClientManager` in `@dockstat/docker-client` to listen for events from workers and trigger the corresponding plugin event handlers.
- Adding a new `proxyEvent` function in `@dockstat/docker-client` to proxy events from the worker to the main process.
- Adding a new `@dockstat/utils` package to provide utility functions for building messages.
- Upgrading bun-types to 1.3.3
The new `events` property in the `Plugin` interface allows plugins to specify a set of event handlers that will be called when the corresponding Docker client events are triggered.
The `DockerClientManager` has been updated to listen for events from workers. When an event is received, the `DockerClientManager` will iterate over the registered plugins and call the corresponding event handler, if one exists.
The `proxyEvent` function is used to proxy events from the worker to the main process. This function takes the event type, the event context, and an optional additional context as arguments. It then posts a message to the main process containing the event data.
The `@dockstat/utils` package provides utility functions for building messages. This package is used by the `proxyEvent` function to build the message that is posted to the main process.
* feat(docker-client): Refactor DockerClientManager for improved worker management and plugin event handling
This commit introduces significant refactoring to the DockerClientManager, focusing on enhanced worker management, plugin event handling, and overall code structure.
The key changes include:
- **Migration to Worker Pool Pattern:** The DockerClientManager now manages a pool of workers for executing Docker client operations, improving concurrency and resource utilization.
- **Mixin-Based Architecture:** The DockerClientManager is now structured using mixins to separate concerns such as host management, container management, image management, and monitoring, resulting in a more modular and maintainable codebase.
- **Event-Driven Architecture:** Improved event handling using plugins by proxying the event through the in the Docker Client, using a typed message builder
- **Improved Client Lifecycle Management:** Enhanced worker lifecycle management, including worker creation, initialization, error handling, and cleanup.
- **Centralized worker logic in ** This file is the only entrypoint for Workers
- **Expose on endpoint of route.** This method is called directly, instead of fetching all clients and then fetching each client
- **Refactor API endpoint to accept a query parameter.** This allows retrieving the stored clients and merging them with the initialized ones
- **Refactor API endpoint to use the function.**
- **Enhance Worker Error Handling:** Improved worker error handling with detailed error logging and automatic worker termination upon critical errors.
The diff includes the following major components:
- : New directory containing the core logic of the DockerClientManager, split into mixins for different functionalities.
- : New file containing the entry point for worker processes.
- : Updated exports to reflect the new directory structure.
- : Update API endpoints
- : Import from the new path
- : Caching Docker client event handlers.
- : Added a method to build the message data when an event is dispatched
These changes improve the scalability, maintainability, and reliability of the DockerClientManager, making it better suited for handling a large number of Docker clients and hosts.
* feat(docker-client): Implement Docker host and container monitoring
This commit introduces a comprehensive monitoring system for Docker hosts and containers. It includes health checks, event monitoring, and metric collection, leveraging separate monitors for each aspect.
The changes include:
- Refactored `MonitoringManager` into seperate monitors for healthchecks, container events and metrics.
- Implemented `HealthCheckMonitor` to periodically ping Docker hosts and emit `host:health:changed` events.
- Implemented `ContainerEventMonitor` to monitor container state changes (created, started, stopped, removed) and emit corresponding events.
- Implemented `HostMetricsMonitor` to collect host-level metrics (CPU, memory, OS, Docker version) and emit `host:metrics` events.
- Implemented `DockerEventStreamManager` which streams docker events from the docker daemon and emits container events in almost real time (without polling).
- Added retry logic to handle temporary connection issues with Docker daemons.
- Added various logging improvements and fixes.
The new monitoring system provides a foundation for real-time insights into the health and performance of Docker environments.
* feat(docker-client): Improve Monitoring and Logging
This commit introduces several enhancements to the docker-client package, focusing on improved monitoring capabilities and more detailed logging. The changes include:
- Enhanced logging within the MonitoringManager and related classes by passing logger parents for better context.
- Added debug logging for container mapping.
- Corrected typo in proxy logger.
- Improved retry logic in the `withRetry` function.
- Added a base utils logger
These changes provide more visibility into the monitoring process and aid in debugging potential issues.
* feat(dockstore): Plugin Architecture Refactor and New DockMon Plugin
This commit introduces a major refactor of the DockStore plugin architecture to improve maintainability and add new features. This includes:
- Improved progress UI with clear task status and error highlighting.
- Concurrent plugin building for faster build times.
- Error tracking and detailed summaries for debugging.
- Enhanced validation and schema generation.
- Introduction of a new DockMon plugin for metrics and monitoring.
- Improved error handling
- Implemented UI clearing
The architecture is now more resilient and easier to extend, paving the way for new plugins and features.
The new DockMon plugin introduces a default plugin that collects container and host metrics and stores them in the DockStat database.
This change required a migration to:
- Chalk (for progress output colors)
- Errors list (for error tracking)
* feat(plugin): Implement DockMon plugin and save default plugins during startup
This commit introduces the DockMon plugin, a default plugin for DockStat that enables monitoring and metrics pages. This plugin listens for and events and saves the data in a table in the main DockStat DB.
Additionally, this commit includes changes to save default plugins during startup. The function scans the directory for plugins and saves them to the database.
The following changes were made:
- Created the DockMon plugin in .
- Implemented the function in .
- Modified the method in to include the in the host object.
- Updated dependencies in various files.
- Fixed a bug in where the was not being passed to the event.
- Added logging for validation of plugins.
- Changed Plugin Column from column.module() to column.text()
The commit also includes:
- Fixed a bug with missing handler logs
- Changed imports to not fail the build on the first attempt
- Fixed a bug where reqID was not always shown
- Reduced logs in production and added truncate to reduce load for parsing and debugging
- Added ignore messages and the option to disable individual loggers
These changes enable DockStat to collect and store monitoring and metrics data from Docker hosts and containers, and provide a mechanism for extending DockStat with plugins.
* feat(dockstat): enhance database and plugin handling
This commit introduces several enhancements to the database layer and plugin handling within DockStat, including:
- Implemented WAL mode and caching for SQLite to improve performance and reliability.
- Added database revisioning to ensure smooth migrations and prevent data corruption during updates.
- Introduced BOOLEAN parser to improve bool conversion
- Improved Plugin Handler to correctly load and assign IDs to plugins.
- Fixed a bug in the DockMon plugin that prevented host metrics from being properly saved.
- Updated the docker-client manager to use `PluginHandler` when applying the events to the workers
This commit enhances the overall stability and performance of DockStat, while also providing a more robust and flexible plugin system.
* Add standalone DockStat API app and update client integration (#11)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging and plugin bundling.
- Removes deprecated code and proxies to improve React Router integration.
- Adds Onboarding route and moves files around
The main goal of this commit is to improve the API's reliability, maintainability, and developer experience.
* chore(dockstat): Untrack bundled output and update gitignore
The '.bundled/index.js' file has been removed from version control, and the '.gitignore' file updated to explicitly ignore the entire '.bundled' directory. This ensures that generated build artifacts are not committed to the repository.
* refactor(api, docker-client): improve configuration, plugin loading, and client data handling
Refine API server timing enablement logic to correctly interpret `DOCKSTATAPI_SHOW_TRACES` environment variable, allowing explicit disabling with "false".
Enhance default plugin loading by using `node:url` and `node:path` for robust directory resolution, and a more specific glob pattern to find `index.ts/js` files.
Overhaul `DockerClientManagerCore.getAllClients` to accurately merge live worker data with stored client information, ensuring consistent `initialized` status and reliable client naming.
* refactor(api): Enhance plugin management, bundling, and add hook discovery
- **Plugin Handling Improvements**:
- Refactored `PluginHandler.loadPlugins` and `PluginHandler.loadPlugin` for more robust error reporting and immediate activation of newly saved plugins.
- Adjusted plugin bundling with `Bun.build` to use ESM format, disable aggressive minification, and include a banner for `import.meta.require` compatibility.
- Corrected the default directory path for loading default plugins.
- Modified temporary file creation for bundled plugins to utilize a dedicated subdirectory.
- Optimized `savePlugin` logging and refined the `saveDefaultPlugins` `id` increment logic.
- Enhanced `PluginHandler.getStatus` to exclude plugin source code, reducing API response payload size.
- **API Enhancements**:
- Introduced a new GET `/plugins/hooks` endpoint to provide a list of available event hooks from currently loaded plugins.
- **Docker Client Manager Refinements**:
- Improved `maxWorkers` environment variable parsing to correctly handle `0` or empty string values, ensuring proper numeric assignment.
- Streamlined event handler initialization to consistently use the PluginHandler for hook discovery.
- Added debug logging within `triggerHooks` for better visibility into event processing.
- **Code Quality & Maintenance**:
- Replaced nullish coalescing `??` with logical OR `||` in specific environment variable parsing for broader falsy value handling.
- Implemented `type` imports for `Logger` and `QueryBuilder` for improved type safety and potential tree-shaking benefits.
- Updated `.gitignore` to properly ignore new `.bundle` build artifacts and SQLite journal files.
- Updated `bun.lock` to reflect dependency changes.
* feat(plugin-api): Implement action-based plugin API routes
Reworked plugin API routing to be declarative and action-based. This centralizes route handling within the `PluginHandler` and provides a clearer interface for plugins.
* **Plugin API Rework**:
* Removed direct `Elysia` route instances from plugins (`routes?: AnyElysia` in `Plugin` interface).
* Plugins now define `apiRoutes` and an `actions` map in their `PluginConfig`. API routes link paths and methods to specific actions defined in the plugin's `actions`.
* The `PluginHandler`'s `handleRoute` method was refactored to directly interpret `PluginConfig.apiRoutes` and execute the corresponding actions.
* **DockMon Plugin Enhancement**:
* Added a new `getSavedMetrics` action to the `DockMon` plugin, allowing retrieval of all saved metrics.
* Integrated `getSavedMetrics` with the `/all` API route for `DockMon`.
* Updated `host:metrics` event handler to use the provided `logger` instead of `console.info`.
* **Docker Client Refactor**:
* Removed the unused `clientId` property from `DockerClient`.
* Changed monitoring manager initialization failures from a `warning` to an `error` event.
* Improved error logging in `withRetry` utility to handle non-Error objects gracefully.
* Added type assertions for `additionalCtx` in `DockerClientManagerCore.handleEvent` to address typing issues.
* **Plugin Loading & Stability**:
* Ensured `pluginHandlerFactory.loadAllPlugins()` is properly awaited in `saveDefaultPlugins` for correct asynchronous behavior.
* Removed `this.loadPlugins(success)` from `installPlugin`, as `loadAllPlugins` now manages the loading process.
* **Typing Updates**: Updated `PluginRoute` and `PluginConfig` types to align with the new action-based architecture.
* chore(lint, workflows): Added new turbo based lint workflow
* ci(lint): Configure GitHub Actions to use Biome's GitHub reporter
* ci(lint): Install Bun dependencies for lint workflow
* ci(lint): Automatically fix lint issues and commit changes
* Lint
* chore(ci): Update lint workflow's commit author and message format
* feat(plugins): Implement generic parser, route discovery, and refactor API handling
- Refactor plugin API route handling (`/:id/routes/*`) to support all HTTP methods.
- Introduce a generic `Parser` configuration for plugin tables, enabling custom transformations for JSON, module code, and boolean column types.
- Centralize plugin action execution into a new `triggerRouteAction` method for better modularity.
- Add a new `/plugins/routes` endpoint to allow discovery of all active plugin API routes.
- Streamline the `PluginActionContext` to simplify the interface for plugin action handlers.
* feat(dockmon): Implement action chaining and specialized metric retrieval
- Renamed `getSavedMetrics` to `getAllMetrics` for improved clarity.
- Added `getContainerMetrics` and `getHostMetrics` actions to allow retrieval of metrics based on their type.
- Introduced a new API route `/test` that demonstrates chaining multiple plugin actions (`test1`, `test2`) together.
- Refactored the plugin configuration by moving `jsonColumns` to a more generic `parser.JSON` property, enabling future expansion of parser types.
- Updated the `Parser` interface in `@sqlite-wrapper` to make `JSON`, `BOOLEAN`, and `MODULE` properties optional.
* chore(ci): Lint
* ci(lint): Run lint workflow only on push
* chore(dockstat): Remove generated bundle file
This file appears to be a generated bundle output that was mistakenly committed. Generated files should not be part of the source control to prevent unnecessary diffs and ensure clean builds.
* feat(readme): Introduce comprehensive project documentation and guides
This commit significantly revamps the project's `README.md` to provide a detailed overview and essential guides for both new users and contributors.
Key updates include:
- Expanded project overview, core features, and technology stack.
- New dedicated sections covering repository structure, developer getting started, plugin system architecture, stack management, multi-node adapters, and development workflow guidelines.
- Clear articulation of known limitations, a high-level roadmap, contributing guidelines, and documentation resources.
- Integration of technology badges for quick reference.
- Addition of `DockStat2-04.png` as a visual asset, likely for workflow illustration.
- Updated `@dockstat/typings` package metadata (added `private` flag, `author` info) and bumped the version to `1.1.0`.
- Removed `tsconfig.tsbuildinfo` from `packages/typings`.
* docs(github): Add DockStat2-04 screenshot
* chore(lint): Allow empty commits in lint workflow
* chore(ci): Lint
* refactor(monorepo): Modernize JS/TS, enhance types, and cleanup code
Code Modernization:
- Replaced string concatenations with template literals for enhanced readability.
- Standardized strict equality (===) and optional chaining (?.).
- Adopted `Number.isFinite()`, `Number.isNaN()`, and explicit radix in `Number.parseInt()`.
Type Safety Enhancements:
- Upgraded `any` to `unknown` in various TypeScript type definitions.
- Improved mixin types and added Biome ignore comments for intentional `any` usage.
Dependency & Code Cleanup:
- Removed numerous unused imports and variables across `apps/api`, `apps/docknode`, `apps/dockstat`, `apps/dockstore`, and various `packages/`.
- Deleted outdated example files from `packages/docker-client/examples/`.
- Eliminated redundant code elements, such as empty JSX fragments in React components.
Tooling:
- Updated `biome.json` to refine file inclusion/exclusion for linting and formatting.
* chore(ci): Lint
* feat(outline-sync): Re-implement and simplify sync logic
This commit completely re-implements the `outline-sync` package, moving from a complex, multi-collection, file-based configuration system to a simpler, CLI-driven approach.
Key changes include:
* **Simplified Architecture**: The entire core logic (e.g., `lib/config`, `lib/init`, `lib/outlineApi`, `lib/syncEngine`, `lib/types`) has been replaced with a new, more modular `src/` structure.
* **New CLI Commands**: Introduces `sync`, `watch`, and `ci` commands for one-time pull, bidirectional watching, and CI/CD integration, respectively, powered by `commander`.
* **Direct Configuration**: Configuration is now primarily driven by CLI options (`--url`, `--token`, `--output`) and environment variables, reducing reliance on local config files.
* **Package Renaming**: The package name has been updated from `@dockstat/outline-sync` to `outline-sync`.
* **Dependency Updates**: Removed `@dockstat/logger` and `typescript` peer dependency. Added `commander`, `chokidar`, `front-matter`, and `yaml` for the new implementation, along with updated `bun-types` and `@types/node`.
* **License Change**: Switched the package license from MPL-2.0 to MIT.
* **Updated README**: The documentation has been completely rewritten to reflect the new features and usage.
* **Bundling**: The CLI is now bundled into `dist/index.js` for simpler distribution and execution.
This refactor aims to make `outline-sync` easier to use, understand, and integrate into various workflows, especially for CI/CD environments.
* feat(outline-sync): Introduce config file support and init command
Introduces a flexible configuration system for `outline-sync`, allowing settings to be defined via:
- A dedicated `outline-sync.config.json` file (recommended)
- Environment variables
- CLI arguments
Adds a new `outline-sync init` command to easily generate a sample `outline-sync.config.json` file. This streamlines initial setup and encourages best practices for configuration.
Detailed changes:
- **Configuration Precedence**: CLI arguments now take precedence over config file settings, which take precedence over environment variables.
- **`init` Command**: New command to scaffold `outline-sync.config.json`.
- **Enhanced `customPaths`**: `customPaths` in the config file now support paths relative to the current working directory (e.g., `../../README.md`).
- **Improved CLI Options**: `sync`, `watch`, and `ci` commands now accept a `--config <path>` option.
- **Package Name Update**: Renamed package from `outline-sync` to `@dockstat/outline-sync` in `package.json`.
- **Extensive Documentation**: README updated to reflect all new configuration methods, custom path examples, document ID discovery, and CI/CD best practices for config files.
This enhancement significantly improves the usability and configurability of the `outline-sync` tool.
* refactor(docs): clear local content and enhance Outline sync
Removed all existing documentation files and sync configurations from `apps/docs`. This prepares the directory for a fresh documentation structure, likely to be managed more actively via the Outline sync tool.
The `@dockstat/outline-sync` package has been updated (v1.2.1) with significant enhancements:
- **Collection Filtering**: Introduced `includeCollections` and `excludeCollections` options, allowing users to specify which Outline collections should be synchronized. This can be configured via CLI (`--include`, `--exclude`) or in `outline-sync.config.json`.
- **Improved Package Management**: The `package.json` now includes a `files` field for better control over published assets.
- **Internal Refinements**: Updated `fs` and `path` imports for Bun compatibility and `Bun.write` to `writeFile`.
- **Documentation Update**: The package's `README.md` has been revised to reflect the new features and installation methods.
A new `apps/docs/outline-sync.config.json` is introduced to serve as the initial configuration for the restructured documentation setup.
* feat(docs): Automate Outline documentation sync with hierarchical structure
Implement a new GitHub Actions workflow (`docs-sync.yaml`) to automatically synchronize documentation from Outline.
The workflow runs on pushes to `main`, a 6-hour schedule, and manual dispatch.
Enhance `@dockstat/outline-sync` to support hierarchical document syncing, mirroring Outline's parent-child structure in the local filesystem. Each document is now stored in a `README.md` within a directory representing its title.
Update `apps/docs/outline-sync.config.json` to store documents directly in the `apps/docs` root and to filter for the "DockStat" collection only.
Bump `@dockstat/outline-sync` version to `1.2.3` and add a `prepublishOnly` script for build automation.
* chore(ci): Lint
---------
Co-authored-by: actions user <your-username@users.noreply.github.com>
Co-authored-by: actions-user <its4nik@users.noreply.github.com>
* chore(ci): Lint
* Merge current dev branch into Review (#12)
* feat(api): Implement component and page API endpoints
This commit introduces API endpoints for managing components and pages.
- Added `/api/components` endpoint to retrieve component JavaScript and library information.
- Added `/api/pages` endpoint to retrieve all pages.
- Implemented PageHandler class to manage page data and interact with the database.
- Implemented ComponentLibrary class to manage registered components and interact with the database.
- Created database tables for components and pages using `@dockstat/sqlite-wrapper`.
* feat(api): Initial DockStat API setup
This commit introduces the initial setup for the DockStat API. It includes:
- API project setup with basic files (.gitignore, README.md, package.json)
- Core API functionality (database interaction, docker client management, plugin handling)
- API routes for DB configuration, Docker management, metrics, and plugins
- ElysiaJS integration for API server and plugin management
- Middleware for metrics collection
- Default plugins for DockStat core functionality
Diff:
This commit includes a significant amount of new code, laying the foundation for the DockStat API. It introduces the basic structure, dependencies, and initial functionality for interacting with the database, managing Docker clients, handling plugins, and exposing API endpoints.
* feat(api): Refactor and Enhance API Structure
This commit introduces several key changes to enhance the API's structure, error handling, and plugin management.
- Updates package dependencies, including elysia to version 1.4.12, and adds @elysiajs/cors.
- Modifies elysia-plugins.ts to enable server timing based on the DOCKSTATAPI_SHOW_TRACES environment variable.
- Adds a new error handling middleware in onError.ts to provide structured error responses for validation, parsing, and not found errors.
- Refactors index.ts to include cors middleware and the new errorHandler.
- Updates database and docker models to improve type safety and consistency.
- Modifies plugin utilities, logger and saveDefaultPlugins, to enhance logging…
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.
No description provided.