Skip to content

Commit 426ac0c

Browse files
committed
hotfix: wpcli permissions issue;
1 parent 8019e11 commit 426ac0c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/handlers/wpcli/handler.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import (
2424
)
2525

2626
// wpcliContainerPath is where wp-cli is installed inside the PHP container.
27-
const wpcliContainerPath = "/usr/local/bin/wp"
27+
// the rootfs is read-only, so it lives on the /tmp tmpfs and reinstalls on demand
28+
const wpcliContainerPath = "/tmp/wp"
2829

2930
// WPCLIClient is the subset of podman.Client consumed by this handler.
3031
type WPCLIClient interface {
@@ -180,7 +181,7 @@ func (h *Handler) ensureWPCLI(ctx context.Context, siteName string, conn *websoc
180181
containerName := podman.ContainerName(siteName, "php")
181182

182183
checkSpec := map[string]any{
183-
"AttachStdout": false,
184+
"AttachStdout": true,
184185
"AttachStderr": false,
185186
"Detach": false,
186187
"Cmd": []string{"test", "-f", wpcliContainerPath},
@@ -217,7 +218,7 @@ func (h *Handler) ensureWPCLI(ctx context.Context, siteName string, conn *websoc
217218
"Detach": false,
218219
"Cmd": []string{
219220
"sh", "-c",
220-
"wget -q https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /tmp/wp-cli.phar && chmod +x /tmp/wp-cli.phar && mv /tmp/wp-cli.phar /usr/local/bin/wp",
221+
fmt.Sprintf("wget -q https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /tmp/wp-cli.phar && chmod +x /tmp/wp-cli.phar && mv /tmp/wp-cli.phar %s", wpcliContainerPath),
221222
},
222223
}
223224
var installResp struct {

0 commit comments

Comments
 (0)