Skip to content

Feat/docker sock listener#2

Merged
imggion merged 52 commits intomainfrom
feat/docker-sock-listener
Jul 4, 2025
Merged

Feat/docker sock listener#2
imggion merged 52 commits intomainfrom
feat/docker-sock-listener

Conversation

@imggion
Copy link
Owner

@imggion imggion commented Jun 30, 2025

No description provided.

imggion added 30 commits June 8, 2025 21:20
- Updated the main Cargo.toml to specify workspace members and set the edition to 2021.
- Added a new Cargo.toml for the docker crate with dependencies on reqwest, tokio, and serde.
- Introduced a new `docker.rs` file containing the `DockerClient` struct and associated data structures for managing Docker containers, volumes, and versions.
- Implemented methods for retrieving containers, version information, and volume details from the Docker API.
- Added error handling through a custom `DockerError` enum to manage various error states.
- Included tests for the implemented methods to ensure functionality across different operating systems.
- Introduced a new `lib.rs` file in the Docker crate, containing modules for Docker interactions and test cases.
- Implemented tests for connecting to the Docker Unix socket and sending HTTP requests to the Docker API.
- Configured socket paths for Linux and macOS environments to facilitate testing across different operating systems.
- Introduced a new `requests.rs` file in the Docker crate, defining the `DockerApi` and `DockerRequestMethod` enums for API endpoints and request methods.
- Implemented the `TeusRequestBuilder` struct to facilitate Unix socket connections and format HTTP requests to the Docker API.
- Added methods for building requests and parsing responses, including handling chunked responses.
- Included unit tests to verify the correctness of request formatting for different HTTP methods.
- Created a new `handlers.rs` file in the Docker module to define API endpoints for retrieving Docker version, containers, and volumes.
- Implemented asynchronous handlers for each endpoint, returning JSON responses with appropriate error handling.
- Added a generic response structure for error messages to standardize API responses.
- Added a path dependency for the docker crate in the Cargo.toml file to facilitate integration with the Docker module.
- Updated the Docker socket path configuration to support macOS and Unix environments.
- Introduced a new `DockerErrorResponse` struct for better error message parsing.
- Refactored response handling in the Docker client methods to utilize a generic parsing function, enhancing error management across API calls.
- Added additional fields to the `Labels` struct for Docker Compose compatibility.
- Improved test socket path retrieval for macOS by using the environment variable for the home directory.
- Added `ContainerDetails` variant to the `DockerApi` enum for retrieving specific container information.
- Updated the `endpoint` method to format the endpoint string for the new container details API call.
- Minor formatting adjustments in the `TeusRequestBuilder` for improved readability.
- Integrated new API endpoint handlers for retrieving Docker version, container details, and volumes in the webserver.
- Updated the API service configuration to include these new handlers, enhancing the Docker module's functionality.
- Added a new `docker` module to the webserver, enhancing the structure for Docker-related functionality.
- Created a `mod.rs` file in the `docker` directory to define the `handlers` module for future API endpoint implementations.
- Included the `auth` module in the webserver for improved organization of authentication-related features.
- Configured release profile settings to optimize for size, enabling link-time optimization and stripping symbols from the binary.
- Set panic behavior to abort and reduced code generation units for improved build efficiency.
- Created a new `REFERENCES.md` file to document the Docker API, including a link to the official Docker API documentation.
- This addition aims to provide developers with quick access to relevant resources for Docker integration.
…k settings

- Changed the `labels` field in the `Container` struct from a custom `Labels` type to a `HashMap<String, String>` to accommodate missing labels.
- Updated the `networks` field in the `NetworkSettings` struct to use a `HashMap<String, NetworkDetails>` for better flexibility.
- Modified several fields in the `NetworkDetails` struct to be `Option<String>` to handle cases where values may be absent.
- Adjusted API request methods to include an optional parameter for improved request handling.
…I requests

- Updated the `format_url_request` method to include an optional `query` parameter, allowing for dynamic query string generation.
- Modified the `make_request` method to accept the new `query` parameter and adjusted related tests to ensure correct request formatting with and without query strings.
- Added debug print statements to log the constructed request and query string for easier troubleshooting.
…ions

- Updated test cases to use immutable `temp_file` declarations instead of mutable ones for better clarity and consistency.
- Removed unused import of `std::env` to clean up the code.
…g structs

- Added `#[allow(dead_code)]` annotations to the `as_str` method in the `Environment` implementation and the `environment` field in the `ServerConfig` struct to suppress warnings for unused code.
- This change improves code clarity while maintaining the current functionality.
- Added `#[allow(dead_code)]` annotations to the `DiskInfo` and `SysInfo` structs, as well as the `create_test_config` function in the tests module to suppress warnings for unused code.
- This change enhances code clarity while preserving existing functionality.
The commit thoroughly documents the Docker API data structures with
detailed type documentation, including:

- Full documentation for Container, Port, NetworkDetails and other core
types - Field-level documentation explaining each property's purpose and
format - Usage examples showing how to work with the types - JSON format
examples showing the API response structure - Cross-references between
related types and fields - Parameter validation rules and constraints -
Common values and formats for important fields
The changes add support for query parameters when listing Docker
containers, including proper handling and serialization of the `all`
parameter.
The changes add comprehensive documentation to configuration types and
database schema structures. This includes detailed field descriptions,
usage examples, and best practices for configuration settings.

Various improvements include: - Document all public types and fields
with examples - Add security considerations for sensitive settings -
Include performance recommendations for monitoring intervals - Clarify
relationships between database entities - Add TODO note about API
organization
imggion added 22 commits June 24, 2025 00:43
The new modules implement bookmark CRUD operations with SQLite storage
and API endpoints for authenticated users.
This commit reformats all Rust source code files using Rustfmt, the
standard Rust code formatting tool. The changes include:

- Fix indentation and line wrapping - Remove extra newlines and trailing
whitespace - Organize imports alphabetically - Format struct/enum
declarations consistently - No functional changes - code behavior
remains the same
The commit updates the container inspection response struct and related
types to more closely match the Docker Engine API v1.50 spec, with
comprehensive documentation and proper optional fields.
@imggion imggion merged commit 5a87a53 into main Jul 4, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant