Skip to content

Allow Portainer to detect Droidspaces#133

Merged
ravindu644 merged 3 commits into
ravindu644:devfrom
yoshi3jp:web
May 18, 2026
Merged

Allow Portainer to detect Droidspaces#133
ravindu644 merged 3 commits into
ravindu644:devfrom
yoshi3jp:web

Conversation

@yoshi3jp
Copy link
Copy Markdown
Contributor

Summary

This introduces the first public-facing droidspaces-socketd API surface
intended for Portainer/WebUI integration.

It builds on the already-merged private backend bridge and adds a standalone
C++ socket daemon that can be pointed at by Portainer over TCP.

Implemented

  • backend startup handshake:
    • PING
    • CAPABILITIES
  • public TCP listener:
    • --listen-tcp
    • default 0.0.0.0:2375
  • Docker-compatible discovery routes:
    • GET / HEAD /_ping
    • GET /version
    • GET /info
    • versioned /vX.Y/... forms
  • compatibility headers:
    • Server: Droidspaces
    • Api-Version: 1.40
    • Ostype: linux
  • temporary request-header debug logging during bring-up

Notes

/version reports Droidspaces-specific truthful metadata and omits
Docker-specific fields such as GoVersion.

/info is currently synthesized locally in socketd to allow Portainer
environment discovery to proceed. A TODO comment marks this as transitional;
backend-authoritative data should later be supplied through
DS_SOCKETD_OP_INFO.

Verification

With the Droidspaces backend bridge enabled and droidspaces-socketd
listening on TCP port 2375, Portainer CE successfully registers the endpoint
as:

  • Connected
  • Standalone 6.1.5

Portainer then proceeds to query:

GET /v1.40/containers/json?all=1

yoshi3jp added 3 commits May 18, 2026 17:04
Extend droidspaces-socketd from a backend bridge probe into the
first public Socket API daemon usable by Portainer.

The daemon now:
- performs backend PING and CAPABILITIES handshake at startup
- listens on unencrypted TCP via --listen-tcp
- defaults to 0.0.0.0:2375 for early integration testing
- serves Docker-compatible discovery endpoints:
  - GET/HEAD /_ping
  - GET /version
  - GET /info
  - versioned /vX.Y/... forms
- emits compatibility headers such as Server, Api-Version, and Ostype
- logs received HTTP request headers for bring-up debugging

/version reports truthful Droidspaces version/platform metadata without
fabricating Docker-specific Go build fields.

/info is intentionally synthesized in socketd for now so Portainer can
complete environment discovery. A clear TODO marks the path to replace
or enrich it through DS_SOCKETD_OP_INFO once backend-side information
marshalling is added.

This is sufficient for Portainer to register Droidspaces as a connected
standalone environment over localhost:2375.
Expose Docker-compatible container list routes through the socket
extension:

- GET /containers/json
- GET /vX.Y/containers/json

The extension parses the currently observed `all` query parameter and
routes the request through a socketd-owned container-list seam.

For now, the seam deliberately returns an empty JSON list. This keeps the
core engine untouched while validating Portainer behavior at the public API
boundary.

Portainer accepts the endpoint and advances to subsequent snapshot probes
for images, volumes, and networks, confirming that the next development
step can replace this dummy seam with a core-backed
DS_SOCKETD_OP_LIST_CONTAINERS implementation.
Extend the Socket API compatibility layer with additional extension-local
endpoints observed during Portainer integration.

Add dummy discovery responses for:
- GET /images/json
- GET /volumes
- GET /networks

These return structurally valid empty payloads so Portainer can complete
its periodic snapshot pass without emitting image, volume, or network
snapshot warnings. With these responses in place, the Portainer dashboard
settles correctly.

Add an initial /events implementation:
- accepts since/until query parameters
- returns Docker-compatible JSON object streams
- maintains a small socketd-local event journal
- records extension lifecycle events such as:
  - backend bridge connection
  - public TCP listener startup

This keeps the implementation within src/socketd/ only. No core-engine
changes are introduced; real core-backed inventory and lifecycle events
remain deferred until the socket extension itself requires them.

Portainer now:
- loads the dashboard without the previous UI glitch
- shows an empty event list before events exist
- renders socketd lifecycle events once recorded
@ravindu644 ravindu644 merged commit cf823ca into ravindu644:dev May 18, 2026
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.

3 participants