webhook
webhook copied to clipboard
permission denied error
I did chmod a+x checkchan2tgbot.sh, there is also permission denied in logs.
could post your docker compose yaml file and webhook config?
docker compose file
version: '3'
services:
webhook:
container_name: webhook
image: soulteary/webhook:extend-3.4.5
environment:
HOST: "0.0.0.0"
PORT: 9000
VERBOSE: true
HOOKS: "/app/hooks.yml"
volumes:
- ./app:/app
ports:
- 127.0.0.1:19000:9000
restart: always
webhook config
- id: checkchan2tgbot
execute-command: "/app/checkchan2tgbot.sh"
command-working-directory: "/app"
include-command-output-in-response: true
include-command-out-in-response-on-error: true
response-message: I got the payload!
response-headers:
- name: Access-Control-Allow-Origin
value: "*"
pass-arguments-to-command:
- source: payload
name: payload.id
- source: payload
name: payload.url
- source: payload
name: payload.value
- source: payload
name: payload.html
- source: payload
name: payload.link
parse-parameters-as-json:
- source: payload
name: payload.id
- source: payload
name: payload.url
- source: payload
name: payload.value
- source: payload
name: payload.html
- source: payload
name: payload.link
@leic4u
I tried it out, and no exception occurred. I personally guess it's the behavioral difference of Docker under different operating systems.
To solve this issue and avoid similar problems in the future, I made some program improvements. You can replace the program version with 3.5.0 or later versions to resolve such issues.
(No need to manually set the script executable anymore.)
https://github.com/soulteary/webhook/releases
After redeploying v3.5.0, permission denied still appears
Even I also did the chmod a+x /app/checkchan2tgbot.sh.
https://github.com/soulteary/webhook/tree/main/example/muti-webhook
You can try this configuration example, and before starting, execute chmod +x trigger.sh, I tested in macOS and Ubuntu environments, no problem. Either before the container starts, set up or go into the container settings.
But in the Ubuntu environment, if permissions are not set before starting, the permissions may not be recognized by SH. I have thought of a solution and will improve it later. @leic4u
@leic4u try 3.6.0
I haven't encountered this issue because I used the volumes feature in k8s to set the permissions to 0755 when mounting. I hope this helps you @leic4u
volumeMounts:
- mountPath: /etc/webhook/
name: hooks
...
volumes:
- name: hooks
configMap:
name: hooks
defaultMode: 0755