Skip to content

Conversation

Nemental
Copy link

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

  1. Add socket proxy service to your newt-compose
  • Example snippet
      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
  1. Run Newt with different socket protocols
  • Command Argument:
        command:
          - --docker-socket tcp://socket-proxy:2375
  • Environment Variable
        environment:
          DOCKER_SOCKET: tcp://socket-proxy:2375
  1. 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
      
  1. Verify container listing loads successfully in the Pangolin UI.

  2. Optionally, test with invalid or unreachable paths to ensure graceful error handling.

@Nemental Nemental force-pushed the feat/docker-socket-protocol branch from 95fbb84 to a9d8ec0 Compare July 30, 2025 13:29
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.

[Feature Request] Make Docker Socket feature protocol aware
1 participant