Webhook.site的安装方法

首先,Webhook.site是什么?

Webhook.site是一种工具,可以在托管的网站上确认Webhook的操作并提供调试支持。然而,它也可以在本地环境中安装和运行(尽管似乎默认只支持http)。

要在本地环境中安装Webhook.site,需要使用docker-compose。此外,为了使docker-compose运行,需要先安装docker。

    • Webhook.siteのインストール方法

 

    • convenience scriptを利用したdockerのインストール方法

 

    • docker-composeのインストール方法

 

    docker-composeのrelease notes

2. 安装方式

[root@syasuda-wehbook1 ~]# cat /etc/redhat-release
CentOS Stream release 9

[root@syasuda-wehbook1 ~]# uname -a
Linux syasuda-wehbook1 5.14.0-252.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 1 13:25:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@syasuda-wehbook1 ~]# curl -fsSL https://get.docker.com -o get-docker.sh
[root@syasuda-wehbook1 ~]# sudo sh get-docker.sh
[root@syasuda-wehbook1 ~]# docker version
Client: Docker Engine - Community
 Version:           23.0.4
 API version:       1.42
 Go version:        go1.19.8
 Git commit:        f480fb1
 Built:             Fri Apr 14 10:34:35 2023
 OS/Arch:           linux/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@syasuda-wehbook1 ~]# systemctl start docker
[root@syasuda-wehbook1 ~]# curl -SL https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
[root@syasuda-wehbook1 ~]# chmod +x /usr/local/bin/docker-compose
[root@syasuda-wehbook1 ~]# docker-compose version
Docker Compose version v2.17.3
[root@syasuda-wehbook1 ~]# yum install -y git
[root@syasuda-wehbook1 ~]# git clone https://github.com/fredsted/webhook.site
[root@syasuda-wehbook1 ~]# cd webhook.site/
[root@syasuda-wehbook1 webhook.site]# docker-compose up
(途中略)
Attaching to webhooksite-laravel-echo-server-1, webhooksite-redis-1, webhooksite-webhook-1
webhooksite-redis-1                | 1:C 24 Apr 2023 06:12:31.139 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
webhooksite-redis-1                | 1:C 24 Apr 2023 06:12:31.139 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
webhooksite-redis-1                | 1:C 24 Apr 2023 06:12:31.139 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
webhooksite-redis-1                | 1:M 24 Apr 2023 06:12:31.139 * monotonic clock: POSIX clock_gettime
webhooksite-redis-1                | 1:M 24 Apr 2023 06:12:31.141 * Running mode=standalone, port=6379.
webhooksite-redis-1                | 1:M 24 Apr 2023 06:12:31.141 # Server initialized
webhooksite-redis-1                | 1:M 24 Apr 2023 06:12:31.141 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
webhooksite-redis-1                | 1:M 24 Apr 2023 06:12:31.141 * Ready to accept connections
webhooksite-webhook-1              | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
webhooksite-webhook-1              | [s6-init] ensuring user provided files have correct perms...exited 0.
webhooksite-webhook-1              | [fix-attrs.d] applying ownership & permissions fixes...
webhooksite-webhook-1              | [fix-attrs.d] done.
webhooksite-webhook-1              | [cont-init.d] executing container initialization scripts...
webhooksite-webhook-1              | [cont-init.d] done.
webhooksite-webhook-1              | [services.d] starting services
webhooksite-webhook-1              | PHP-FPM's opcache is NOT enabled
webhooksite-webhook-1              | [24-Apr-2023 06:12:31] NOTICE: fpm is running, pid 181
webhooksite-webhook-1              | [24-Apr-2023 06:12:31] NOTICE: ready to handle connections
webhooksite-webhook-1              | [services.d] done.
webhooksite-laravel-echo-server-1  |
webhooksite-laravel-echo-server-1  | L A R A V E L  E C H O  S E R V E R
webhooksite-laravel-echo-server-1  |
webhooksite-laravel-echo-server-1  | version 1.3.7
webhooksite-laravel-echo-server-1  |
webhooksite-laravel-echo-server-1  | ⚠ Starting server in DEV mode...
webhooksite-laravel-echo-server-1  |
webhooksite-laravel-echo-server-1  | ✔  Running at 0.0.0.0 on port 6001
webhooksite-laravel-echo-server-1  | ✔  Channels are ready.
webhooksite-laravel-echo-server-1  | ✔  Listening for http events...
webhooksite-laravel-echo-server-1  | ✔  Listening for redis events...
webhooksite-laravel-echo-server-1  |
webhooksite-laravel-echo-server-1  | Server ready!
webhooksite-laravel-echo-server-1  |

3. 验证动作

[root@syasuda-wehbook1 ~]# ss -anpt
State               Recv-Q              Send-Q                             Local Address:Port                             Peer Address:Port               Process
LISTEN              0                   4096                                     0.0.0.0:111                                   0.0.0.0:*                   users:(("rpcbind",pid=671,fd=4),("systemd",pid=1,fd=89))
LISTEN              0                   128                                      0.0.0.0:22                                    0.0.0.0:*                   users:(("sshd",pid=828,fd=3))
LISTEN              0                   4096                                     0.0.0.0:8084                                  0.0.0.0:*                   users:(("docker-proxy",pid=5433,fd=4))
ESTAB               0                   0                                      10.0.0.40:22                                   10.0.0.4:36002               users:(("sshd",pid=937,fd=4),("sshd",pid=922,fd=4))
ESTAB               0                   0                                      10.0.0.40:22                                   10.0.0.4:36010               users:(("sshd",pid=5739,fd=4),("sshd",pid=5736,fd=4))
LISTEN              0                   4096                                        [::]:111                                      [::]:*                   users:(("rpcbind",pid=671,fd=6),("systemd",pid=1,fd=91))
LISTEN              0                   128                                         [::]:22                                       [::]:*                   users:(("sshd",pid=828,fd=4))
LISTEN              0                   4096                                        [::]:8084                                     [::]:*                   users:(("docker-proxy",pid=5440,fd=4))
syasuda@MacBook ~ % ssh -L 8084:localhost:8084 root@xxx.xxx.xxx.xxx
image.png
image.png
广告
将在 10 秒后关闭
bannerAds