T-2: Add DockerConfig, GitConfig, ProfileConfig to config#54
T-2: Add DockerConfig, GitConfig, ProfileConfig to config#54kirich1409 merged 6 commits intomainfrom
Conversation
Add new configuration sections to support Docker container execution, Git clone operations, and profile-based session templates: - [docker] section with socket_path, allowed_images (SSRF whitelist), and exec_timeout_secs - [git] section with clone_timeout_secs and allowed_hosts (SSRF whitelist) - [[profiles]] array for predefined terminal session templates with environment variable overrides - Top-level rest_port (default: 8080) for REST API - Top-level data_dir (default: ~/.local/share/relay) for data storage All new fields have #[serde(default)] for backward compatibility. Empty allowed_images/allowed_hosts lists mean all images/hosts are permitted. Includes comprehensive unit tests covering deserialization, defaults, and backward compatibility with existing configs. Closes #16
There was a problem hiding this comment.
Pull request overview
Adds extensible TOML configuration sections for Docker, Git, and session profiles (plus new top-level rest_port and data_dir) to address issue #16 and keep configs backward-compatible via defaults.
Changes:
- Extend
Configwith newdocker,git, andprofilessections, plusrest_portanddata_dir. - Introduce
DockerConfig,GitConfig, andProfileConfigstructs with defaults for backward compatibility. - Add unit tests covering empty/minimal TOML parsing and the new sections’ default/custom deserialization behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Implement issue #16: Add extensible configuration support for Docker, Git, and session profiles.
This eliminates architectural blocker C1 (non-extensible Config) by introducing new TOML sections with full backward compatibility.
Changes
New Configuration Sections
[docker]
socket_path— Docker daemon socket (default:/var/run/docker.sock)allowed_images— Whitelist of permitted image refs; empty list = all allowedexec_timeout_secs— Timeout for exec operations (default: 30s)[git]
clone_timeout_secs— Timeout for clone operations (default: 300s)allowed_hosts— SSRF whitelist of allowed hosts; empty list = all allowed[[profiles]]
name— Profile identifier (e.g., "claude-default")image— Docker image reference for this profileenv_overrides— Environment variable overrides (HashMap<String, String>)Top-level
rest_port— REST API port (default: 8080)data_dir— Data storage directory (default:~/.local/share/relay)Backward Compatibility
All new fields use
#[serde(default)]. Existing configs without these sections parse successfully with sensible defaults.Tests
9 new unit tests verify:
Verification
cargo test— 73/73 tests passcargo clippy -- -D warnings— 0 warningscargo fmt— No formatting issuesAcceptance Criteria
config.tomlwithout new sections reads without error (backward compat)DockerConfigdeserializes from TOML with defaultsGitConfigcontains timeout and SSRF allowlistProfileConfigsupports list with overridesallowed_imagesdeserializes from TOML, empty = all allowedCloses #16