Skip to content

[BUG] Environment variable HOME points to /root #11

Description

@userid0x0

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi,
I noticed that the HOME variable points to /root when the webhooks are run. This may case problems for tools that read e.g. ~/.config a.s.o. . docker is an example here as it tries to read ~/.docker/config.json .

Expected Behavior

I would expect HOME points to /config as this is the folder of the user.

Steps To Reproduce

use the following hooks.json

[
    {
        "id": "testme",
        "execute-command": "/bin/bash",
        "pass-arguments-to-command": [
            {
                "source": "string",
                "name": "-c"
            },
            {
                "source": "string",
                "name": "export"
            }
        ],
        "include-command-output-in-response": true
    }
]

Then issue the webhook e.g. curl http://<host>:<port>/hooks/testme

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

---
services:
  webhook:
    image: ghcr.io/linuxserver-labs/webhook:latest
    container_name: webhook
    environment:
      - DOCKER_MODS=linuxserver/mods:universal-docker
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - EXTRA_PARAM=-hotreload #optional
    volumes:
       - ./config:/config
       - /opt/compose:/opt/compose
       - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 9000:9000
    restart: unless-stopped

Container logs

nothing interesting in the logs - the output of the webhook is of interest


declare -x DOCKER_MODS="linuxserver/mods:universal-docker"
declare -x EXTRA_PARAM="-hotreload"
declare -x HOME="/root"
declare -x HOSTNAME="4ded06182f70"
declare -x OLDPWD
declare -x PATH="/command:/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x PGID="1000"
declare -x PUID="1000"
declare -x PWD="/run/s6-rc:s6-rc-init:lhPpLj/servicedirs/svc-webhook"
declare -x S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0"
declare -x S6_STAGE2_HOOK="/docker-mods"
declare -x S6_VERBOSITY="1"
declare -x SHLVL="3"
declare -x TERM="xterm"
declare -x TZ="Europe/Berlin"
declare -x VIRTUAL_ENV="/lsiopy"
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions