feat: Add Support of Docker Host as the Provider #1010
Closed
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.
📚 新增和改变
在授权凭据的提供商中增加了一个
Docker 宿主机,允许那些通过 Docker 运行 Certimate 的用户以 SSH 的方式更加方便地连接到 Docker 宿主机。本质仍然是 SSH 连接,但允许那些不熟悉 Docker 的用户更容易使用。在使用 Dokcer 运行的时候需要增加
add-host参数:docker build -t certimate:dev . docker run -p 8090:8090 --add-host=host.docker.internal:host-gateway certimate:dev同样,在
docker-compose.yml配置文件中增加extra_hosts也可以使该改变生效:✨动机
service nginx reload之类的命令。所以目录挂载有用,但相比 SSH 作用有限。👩💻 截图
对于 Docker 容器环境
对于非 Docker 环境
Copilot Summary
This pull request introduces support for Docker host access as a provider, enabling the system to detect and utilize the Docker host address for certificate deployment and management. It also adds backend and frontend mechanisms for environment detection and improves the user experience by auto-filling Docker host information in relevant forms. The changes span backend service registration, environment detection utilities, API endpoints, and UI integration.Backend: Docker Host Provider Support
internal/domain/provider.goand registered them in both certificate application and deployment workflows, allowing Docker Host to be used similarly to SSH for ACME challenges and deployments. [1] [2] [3] [4] [5] [6] [7]Backend: Environment Detection and API
pkg/utils/netutil/dockerhost.go) to resolve the Docker host address, with tests for various scenarios. [1] [2]EnvironmentServiceand REST handler to expose environment information (specifically Docker host reachability and address) via/api/system/environment. [1] [2] [3] [4] [5] [6]Frontend: Environment Awareness and Docker Host Integration
AccessConfigFieldsProviderDockerHostcomponent that auto-fills the Docker host address if available. [1] [2] [3] [4] [5] [6]Infrastructure: Docker Compose
host.docker.internal, improving Docker host detection reliability.