[PR #9] [MERGED] [codex] Harden Portainer exec streaming #11

Closed
opened 2026-10-15 12:51:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/9
Author: @JBailes
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @JBailes

Base: docker-lxc-daemon ← Head: aimee/session/portainer-exec-fix


📝 Commits (1)

  • cf73265 Harden Portainer exec streaming

📊 Changes

2 files changed (+78 additions, -35 deletions)

View changed files

📝 internal/api/exec.go (+77 -35)
📝 internal/api/types.go (+1 -0)

📄 Description

Summary

  • harden Portainer exec streaming so /exec/{id}/start no longer hard-fails when the response path does not expose http.Hijacker
  • preserve the base process environment for exec calls instead of replacing it entirely
  • carry WorkingDir through exec invocation so terminal sessions and command runs start in the requested directory

Why

PR #8 was already merged before the exec-streaming follow-up landed. This PR isolates the remaining exec fix on top of the merged Portainer compatibility work.

Validation

  • GOCACHE=/tmp/go-build-cache go test ./...
  • validated /logs on root@192.168.1.253 against the running Portainer container through a transient daemon socket
  • validated /exec on root@192.168.1.253 against a temporary nginx:alpine container, including WorkingDir=/tmp, framed output, and ExitCode: 0

Notes

  • the earlier 127 seen against the Portainer container was due to that image not shipping /bin/sh, not a stream-plumbing failure

🔄 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/games-on-whales/LXC2Docker/pull/9 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `docker-lxc-daemon` ← **Head:** `aimee/session/portainer-exec-fix` --- ### 📝 Commits (1) - [`cf73265`](https://github.com/games-on-whales/LXC2Docker/commit/cf73265df6c0a6ef08c4f57f0d277aa3c6f85197) Harden Portainer exec streaming ### 📊 Changes **2 files changed** (+78 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `internal/api/exec.go` (+77 -35) 📝 `internal/api/types.go` (+1 -0) </details> ### 📄 Description ## Summary - harden Portainer exec streaming so `/exec/{id}/start` no longer hard-fails when the response path does not expose `http.Hijacker` - preserve the base process environment for exec calls instead of replacing it entirely - carry `WorkingDir` through exec invocation so terminal sessions and command runs start in the requested directory ## Why PR #8 was already merged before the exec-streaming follow-up landed. This PR isolates the remaining exec fix on top of the merged Portainer compatibility work. ## Validation - `GOCACHE=/tmp/go-build-cache go test ./...` - validated `/logs` on `root@192.168.1.253` against the running Portainer container through a transient daemon socket - validated `/exec` on `root@192.168.1.253` against a temporary `nginx:alpine` container, including `WorkingDir=/tmp`, framed output, and `ExitCode: 0` ## Notes - the earlier `127` seen against the Portainer container was due to that image not shipping `/bin/sh`, not a stream-plumbing failure --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:51:15 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/LXC2Docker#11
No description provided.