Skip to content

Feature/use docker proxy - #1

Merged
mcsdodo merged 3 commits into
mcsdodo:mainfrom
dyay108:feature/use-docker-proxy
Jan 30, 2026
Merged

mcsdodo merged 3 commits into
mcsdodo:mainfrom
dyay108:feature/use-docker-proxy

Conversation

@dyay108

@dyay108 dyay108 commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor
  • Use DOCKER_PROXY_URL (fall back to DOCKER_HOST, then unix socket) for Docker client connection.
  • Document DOCKER_PROXY_URL in the README.

Summary by CodeRabbit

  • New Features

    • Support for configuring a Docker API proxy via the DOCKER_PROXY_URL environment variable, with automatic fallback to existing Docker connection settings.
  • Documentation

    • README updated to document the new DOCKER_PROXY_URL environment variable and its behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 30, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a new DOCKER_PROXY_URL environment variable to README and updates the Python agent to resolve the Docker client base URL from DOCKER_PROXY_URL, then DOCKER_HOST, then a default unix:///var/run/docker.sock.

Changes

Cohort / File(s) Summary
Documentation
README.md
Adds DOCKER_PROXY_URL environment variable to environment variables table (descriptive only).
Docker Client Configuration
caddy-agent-watch.py
Replaces hardcoded Docker socket with dynamic base URL resolution: use trimmed DOCKER_PROXY_URL if set, else DOCKER_HOST, else default unix:///var/run/docker.sock.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble on code and sniff the air,
A proxy hop brings Docker near or far,
Env vars guide where connections pair,
Fallbacks snug like carrots in a jar —
Hooray for flexible endpoints, hip-hip-hurrah!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature being added - support for using a Docker proxy URL to configure Docker client connections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@caddy-agent-watch.py`:
- Around line 44-45: The default Docker socket URL uses the old double-slash
form; update the fallback in the _docker_base_url assignment to use the modern
triple-slash form "unix:///var/run/docker.sock" so that _docker_base_url =
DOCKER_PROXY_URL.strip() or os.getenv("DOCKER_HOST",
"unix:///var/run/docker.sock"); leave the DockerClient creation (client =
docker.DockerClient(base_url=_docker_base_url)) unchanged so it picks up the
corrected URL.
🧹 Nitpick comments (1)
caddy-agent-watch.py (1)

44-45: Consider logging the Docker base URL at startup for debugging.

When troubleshooting Docker connectivity issues, it would be helpful to see which Docker endpoint is being used. The startup logging section (around line 1590) could include this information.

💡 Suggested addition to startup logging

Add after line 1590:

    logger.info(f"   Docker URL: {_docker_base_url}")

Comment thread caddy-agent-watch.py Outdated
@mcsdodo
mcsdodo merged commit c1d3899 into mcsdodo:main Jan 30, 2026
1 of 2 checks passed
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.

2 participants