当前位置: 首页 > news >正文

Webhook 配置备忘

本文地址:blog.lucien.ink/archives/552

将下列代码保存为 install.sh,然后 bash install.sh

#!/usr/bin/env bash
set -e
wget 'https://github.mirrors.lucien.ink/https://github.com/adnanh/webhook/releases/download/2.8.2/webhook-linux-amd64.tar.gz'
tar -xzvf webhook-linux-amd64.tar.gz
mv webhook-linux-amd64 /usr/local/
cat << EOF > /etc/systemd/system/webhook.service
[Unit]
Description=Webhook server
After=network.target[Service]
Type=simple
ExecStart=/usr/local/webhook-linux-amd64/webhook \-nopanic \-hooks /etc/webhook/hooks.yaml \-hotreload \-logfile /var/log/webhook/webhook.log \-port 9000
Restart=on-failure
User=root
Group=root[Install]
WantedBy=multi-user.target
EOF
systemctl enable webhook
mkdir -p /etc/webhook/scripts
cat << EOF > /etc/webhook/hooks.yaml
- id: testexecute-command: "/etc/webhook/scripts/test.sh"command-working-directory: "/root/"trigger-rule:match:type: valuevalue: Bearer change-thisparameter:source: headername: Authorization
EOF
cat << EOF > /etc/webhook/scripts/test.sh
#!/usr/bin/env sh
echo foo > bar
EOF
chmod +x /etc/webhook/scripts/test.sh
mkdir -p /var/log/webhook
systemctl start webhook
curl 'http://localhost:9000/hooks/test' -H 'Authorization: Bearer change-this'
http://www.dtcms.com/a/234323.html

相关文章:

  • Chrome 浏览器前端与客户端双向通信实战
  • 前端对WebSocket进行封装,并建立心跳监测
  • 前端项目初始化
  • Web 架构之 CDN 加速原理与落地实践
  • ESP8266(NodeMcu)+GPS模块+TFT屏幕实现GPS码表
  • 32单片机——窗口看门狗
  • 智能终端与边缘计算按章复习
  • Science Robotics:UCLA 贺曦敏团队综述自主软体机器人
  • npm install的原理
  • 【leetcode】3. 无重复字符的最长子串
  • JAVA学习 DAY2 java程序运行、注意事项、转义字符
  • logstash拉取redisStream的流数据,并存储ES
  • Kubernetes弃用Docker:技术演进与生态变革的深度解析
  • 5.2 HarmonyOS NEXT应用性能诊断与优化:工具链、启动速度与功耗管理实战
  • Tika Server:企业级文档内容解析的轻量级服务化方案
  • 发版前后的调试对照实践:用 WebDebugX 与多工具构建上线验证闭环
  • AI大模型学习三十三、HeyGem.ai 服务端(ubuntu)docker 安装 /客户端(win)分离部署
  • CentOS 7 如何安装llvm-project-10.0.0?
  • 使用Python和OpenCV实现图像识别与目标检测
  • 负载均衡LB》》HAproxy
  • 全球长序列高分辨率光合有效辐射(PAR)(1984-2018)
  • 三、元器件的选型
  • 水库大坝安全监测系统是什么?需要用到哪些设备?
  • 分布式协同自动化办公系统-工作流引擎-流程设计
  • LeetCode 2434.使用机器人打印字典序最小的字符串:贪心(栈)——清晰题解
  • VS Code使用 SSH 扩展连接主机出现失败的解决方案
  • 【手写数据库核心揭秘系列】第10节 SQL解析树的结构,语言识别与程序执行之间的桥梁
  • 超构光学与 AR 的深度融合 | 攻克 VAC 与眼动范围难题
  • Python60日基础学习打卡Day45
  • 国标GB28181设备管理软件EasyGBS远程视频监控方案助力高效安全运营