By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
The new parseDockerHost function extracts the protocol and address, allowing CheckSocket to validate reachability for multiple Docker API endpoints, not just local UNIX sockets.
Verify container listing loads successfully in the Pangolin UI.
Optionally, test with invalid or unreachable paths to ensure graceful error handling.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/fosrl/newt/pull/97
**Author:** [@Nemental](https://github.com/Nemental)
**Created:** 7/30/2025
**Status:** ✅ Merged
**Merged:** 8/30/2025
**Merged by:** [@oschwartz10612](https://github.com/oschwartz10612)
**Base:** `main` ← **Head:** `feat/docker-socket-protocol`
---
### 📝 Commits (4)
- [`42dfb6b`](https://github.com/fosrl/newt/commit/42dfb6b3d85a3d9f7bcfc7d6023e58e148778877) feat: add type and function for docker endpoint parsing
- [`a79dccc`](https://github.com/fosrl/newt/commit/a79dccc0e497d3ac0cb56dc17f74b12599fb9419) feat: checksocket protocol support
- [`e9dbfb2`](https://github.com/fosrl/newt/commit/e9dbfb239b045671a76f864ac9cf328ec294751b) fix: remove hardcoded protocol from socket path
- [`a9d8ec0`](https://github.com/fosrl/newt/commit/a9d8ec0b1e36bfb1da0e13000fe656590774bd07) docs: update docker socket part
### 📊 Changes
**3 files changed** (+63 additions, -10 deletions)
<details>
<summary>View changed files</summary>
📝 `README.md` (+23 -2)
📝 `docker/client.go` (+39 -7)
📝 `main.go` (+1 -1)
</details>
### 📄 Description
## Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
## Description
Closes #62
This PR enhances Docker socket path handling in Newt by adding support for protocol-prefixed socket paths, such as:
- unix:///var/run/docker.sock
- tcp://localhost:2375
- http://127.0.0.1:2375
- ssh://user@host
The new parseDockerHost function extracts the protocol and address, allowing CheckSocket to validate reachability for multiple Docker API endpoints, not just local UNIX sockets.
## How to test?
### TCP Example with [linuxserver/docker-socket-proxy](https://github.com/linuxserver/docker-socket-proxy)
1. **Add socket proxy service to your newt-compose**
* Example snippet
```yaml
socket-proxy:
image: ghcr.io/linuxserver/socket-proxy:3.2.3
restart: unless-stopped
environment:
CONTAINERS: 1
EVENTS: 1
INFO: 1
NETWORKS: 1
PING: 1
VERSION: 1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
read_only: true
tmpfs:
- /run
networks:
- pangolin
```
2. **Run Newt with different socket protocols**
* Command Argument:
```yaml
command:
- --docker-socket tcp://socket-proxy:2375
```
* Environment Variable
```yaml
environment:
DOCKER_SOCKET: tcp://socket-proxy:2375
```
3. **Trigger the socket check from Pangolin**
* Navigate to "Resources"
* Edit a Resource
* Targets Configuration -> IP / Hostname -> View Docker Containers
* Observe logs for messages like:
* Pangolin
```
[info]: Docker socket availability for Newt id12345abc: available=true, socketPath=http://socket-proxy:2375
```
* Newt
```
DEBUG: 2025/07/30 12:41:15 Received Docker socket check request
DEBUG: 2025/07/30 12:41:15 Docker reachable via tcp at socket-proxy:2375
DEBUG: 2025/07/30 12:41:15 Sending message: newt/socket/status, data: map[available:true socketPath:http://socket-proxy:2375]
INFO: 2025/07/30 12:41:15 Docker socket check response sent: available=true
```
4. **Verify container listing loads successfully in the Pangolin UI.**
5. **Optionally, test with invalid or unreachable paths to ensure graceful error handling.**
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/97
Author: @Nemental
Created: 7/30/2025
Status: ✅ Merged
Merged: 8/30/2025
Merged by: @oschwartz10612
Base:
main← Head:feat/docker-socket-protocol📝 Commits (4)
42dfb6bfeat: add type and function for docker endpoint parsinga79dcccfeat: checksocket protocol supporte9dbfb2fix: remove hardcoded protocol from socket patha9d8ec0docs: update docker socket part📊 Changes
3 files changed (+63 additions, -10 deletions)
View changed files
📝
README.md(+23 -2)📝
docker/client.go(+39 -7)📝
main.go(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Closes #62
This PR enhances Docker socket path handling in Newt by adding support for protocol-prefixed socket paths, such as:
The new parseDockerHost function extracts the protocol and address, allowing CheckSocket to validate reachability for multiple Docker API endpoints, not just local UNIX sockets.
How to test?
TCP Example with linuxserver/docker-socket-proxy
Verify container listing loads successfully in the Pangolin UI.
Optionally, test with invalid or unreachable paths to ensure graceful error handling.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.