Skip to content

T-2: Add DockerConfig, GitConfig, ProfileConfig to config#54

Merged
kirich1409 merged 6 commits intomainfrom
feature/t2-config-extensions
Apr 13, 2026
Merged

T-2: Add DockerConfig, GitConfig, ProfileConfig to config#54
kirich1409 merged 6 commits intomainfrom
feature/t2-config-extensions

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

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 allowed
  • exec_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 profile
  • env_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:

  • Empty TOML deserialization
  • Docker config defaults and custom values
  • Git config defaults and SSRF allowlist
  • Profile deserialization with env_overrides
  • Top-level rest_port and data_dir
  • Empty allowlist semantics (= all allowed)
  • Backward compatibility with minimal config

Verification

  • cargo test — 73/73 tests pass
  • cargo clippy -- -D warnings — 0 warnings
  • cargo fmt — No formatting issues

Acceptance Criteria

  • Existing config.toml without new sections reads without error (backward compat)
  • DockerConfig deserializes from TOML with defaults
  • GitConfig contains timeout and SSRF allowlist
  • ProfileConfig supports list with overrides
  • allowed_images deserializes from TOML, empty = all allowed
  • Tests pass, clippy clean

Closes #16

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
Copilot AI review requested due to automatic review settings April 13, 2026 13:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Config with new docker, git, and profiles sections, plus rest_port and data_dir.
  • Introduce DockerConfig, GitConfig, and ProfileConfig structs 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.

Comment thread runner/src/config.rs
Comment thread runner/src/config.rs Outdated
Comment thread runner/src/config.rs Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 13:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread runner/src/config.rs
Comment thread runner/src/config.rs
Comment thread runner/src/config.rs
Comment thread runner/src/config.rs
Copilot AI review requested due to automatic review settings April 13, 2026 14:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread runner/src/config.rs
@kirich1409 kirich1409 merged commit 0d53f78 into main Apr 13, 2026
14 checks passed
@kirich1409 kirich1409 deleted the feature/t2-config-extensions branch April 13, 2026 14:10
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.

T-2: Добавить DockerConfig, GitConfig, ProfileConfig, data_dir в конфигурацию

2 participants