[PR #802] [MERGED] 🐳 Add Docker Socket Integration #9109

Closed
opened 2026-04-30 05:22:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/802
Author: @improbableone
Created: 5/29/2025
Status: ✅ Merged
Merged: 6/2/2025
Merged by: @oschwartz10612

Base: dev ← Head: hub-dev


📝 Commits (2)

  • 948eb7f docker socket
  • ea0ab0e Merge branch 'dev' into improbableone-hub-dev

📊 Changes

20 files changed (+1624 additions, -128 deletions)

View changed files

📝 package.json (+1 -0)
📝 server/db/schemas/schema.ts (+4 -1)
📝 server/routers/external.ts (+32 -1)
📝 server/routers/messageHandlers.ts (+8 -2)
➕ server/routers/newt/dockerSocket.ts (+22 -0)
➕ server/routers/newt/handleSocketMessages.ts (+57 -0)
📝 server/routers/newt/index.ts (+2 -1)
📝 server/routers/site/index.ts (+3 -2)
➕ server/routers/site/socketIntegration.ts (+278 -0)
📝 server/routers/site/updateSite.ts (+1 -0)
📝 src/app/[orgId]/settings/resources/[resourceId]/ResourceInfoBox.tsx (+30 -7)
📝 src/app/[orgId]/settings/resources/[resourceId]/layout.tsx (+20 -10)
📝 src/app/[orgId]/settings/resources/[resourceId]/proxy/page.tsx (+22 -2)
📝 src/app/[orgId]/settings/sites/[niceId]/general/page.tsx (+37 -5)
➕ src/components/ContainersSelector.tsx (+723 -0)
➕ src/components/ui/scroll-area.tsx (+58 -0)
📝 src/components/ui/table.tsx (+110 -93)
📝 src/contexts/resourceContext.ts (+2 -0)
➕ src/hooks/useDockerSocket.ts (+207 -0)
📝 src/providers/ResourceProvider.tsx (+7 -4)

📄 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

This PR introduces Docker socket integration functionality that allows the system to communicate with Docker (for now) containers running on remote hosts through the Newt.

I have raised a corresponding PR for newt as well.

Backend Changes

  • Added caching mechanism for Docker socket data with 1-hour TTL

  • Implemented fetchContainers() and dockerSocket() functions for communication with Newt clients

  • Integrated with existing WebSocket messaging system

  • Socket Integration API (socketIntegration.ts)

    • Added Docker socket related endpoints
    • Defined TypeScript interfaces for containers, networks, and ports
    • Implemented real-time container status monitoring
  • Database Schema Updates

    • Added dockerSocketEnabled boolean field to sites table
    • Enables per-site Docker socket functionality control

Frontend Changes

  • Custom React hook for managing Docker socket connections
  • Handle container fetching, status polling, and error management
  • Rich table-based UI for browsing and selecting Docker containers

Integration Points

  • Resource Info: Updated resource info boxes and layouts to show Docker socket integration
  • Site Settings: Added Docker socket configuration to site general settings
  • Proxy Configuration: Added a container selection button for adding targets.

How to Test?

  • do the database migrations so that the new column is added.
  • start pangolin.
  • Create a new site based on newt
  • In site settings, turn on Docker Socket
  • Build the corresponding newt PR branch for newt configuration and run it with above site.

Site Settings
Selector Button
Containers List


🔄 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/pangolin/pull/802 **Author:** [@improbableone](https://github.com/improbableone) **Created:** 5/29/2025 **Status:** ✅ Merged **Merged:** 6/2/2025 **Merged by:** [@oschwartz10612](https://github.com/oschwartz10612) **Base:** `dev` ← **Head:** `hub-dev` --- ### 📝 Commits (2) - [`948eb7f`](https://github.com/fosrl/pangolin/commit/948eb7f6d0c510db0d8386e1178f6ac7a753fe6a) docker socket - [`ea0ab0e`](https://github.com/fosrl/pangolin/commit/ea0ab0e63c675556f099e70d7dca0ce7f0a0ed0c) Merge branch 'dev' into improbableone-hub-dev ### 📊 Changes **20 files changed** (+1624 additions, -128 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -0) 📝 `server/db/schemas/schema.ts` (+4 -1) 📝 `server/routers/external.ts` (+32 -1) 📝 `server/routers/messageHandlers.ts` (+8 -2) ➕ `server/routers/newt/dockerSocket.ts` (+22 -0) ➕ `server/routers/newt/handleSocketMessages.ts` (+57 -0) 📝 `server/routers/newt/index.ts` (+2 -1) 📝 `server/routers/site/index.ts` (+3 -2) ➕ `server/routers/site/socketIntegration.ts` (+278 -0) 📝 `server/routers/site/updateSite.ts` (+1 -0) 📝 `src/app/[orgId]/settings/resources/[resourceId]/ResourceInfoBox.tsx` (+30 -7) 📝 `src/app/[orgId]/settings/resources/[resourceId]/layout.tsx` (+20 -10) 📝 `src/app/[orgId]/settings/resources/[resourceId]/proxy/page.tsx` (+22 -2) 📝 `src/app/[orgId]/settings/sites/[niceId]/general/page.tsx` (+37 -5) ➕ `src/components/ContainersSelector.tsx` (+723 -0) ➕ `src/components/ui/scroll-area.tsx` (+58 -0) 📝 `src/components/ui/table.tsx` (+110 -93) 📝 `src/contexts/resourceContext.ts` (+2 -0) ➕ `src/hooks/useDockerSocket.ts` (+207 -0) 📝 `src/providers/ResourceProvider.tsx` (+7 -4) </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 This PR introduces Docker socket integration functionality that allows the system to communicate with Docker (for now) containers running on remote hosts through the Newt. I have raised a corresponding [PR](https://github.com/fosrl/newt/pull/46) for newt as well. #### Backend Changes - Added caching mechanism for Docker socket data with 1-hour TTL - Implemented `fetchContainers()` and `dockerSocket()` functions for communication with Newt clients - Integrated with existing WebSocket messaging system - **Socket Integration API** (socketIntegration.ts) - Added Docker socket related endpoints - Defined TypeScript interfaces for containers, networks, and ports - Implemented real-time container status monitoring - **Database Schema Updates** - Added `dockerSocketEnabled` boolean field to sites table - Enables per-site Docker socket functionality control #### Frontend Changes - Custom React hook for managing Docker socket connections - Handle container fetching, status polling, and error management - Rich table-based UI for browsing and selecting Docker containers #### Integration Points - **Resource Info**: Updated resource info boxes and layouts to show Docker socket integration - **Site Settings**: Added Docker socket configuration to site general settings - **Proxy Configuration**: Added a container selection button for adding targets. ## How to Test? - do the database migrations so that the new column is added. - start pangolin. - Create a new site based on [newt](https://github.com/fosrl/newt/pull/46) - In site settings, turn on Docker Socket - Build the corresponding `newt` PR branch for newt configuration and run it with above site. ![Site Settings](https://github.com/user-attachments/assets/3f14a9d1-512a-475c-a8f3-09e40ce787c0) ![Selector Button](https://github.com/user-attachments/assets/c1094286-3bc5-4a95-8a9f-d216bef3c65f) ![Containers List](https://github.com/user-attachments/assets/530429c3-f4c6-497d-a9f8-e69a5cb13367) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 05:22:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#9109