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

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.xdnf.cn/news/12583.html

相关文章:

  • Imprompter: Tricking LLM Agents into Improper Tool Use
  • VUE解决页面请求接口大规模并发的问题(请求队列)
  • 通过跳板机连接远程主机
  • 【佳易王个体诊所电子处方软件】助力智慧诊疗! #医疗数字化 #电子处方效率提升
  • MySQL体系架构解析(三):MySQL数据存储的揭秘
  • 从0到1写一个适用于Node.js的User Agent生成库
  • 矩阵和向量范数的区别分析
  • GAN模式奔溃的探讨论文综述(一)
  • SQL进阶之旅 Day 17:大数据量查询优化策略
  • C++.OpenGL (9/64)复习(Review)
  • 【论文阅读笔记】万花筒:用于异构多智能体强化学习的可学习掩码
  • vb监测Excel两个单元格变化,达到阈值响铃
  • 【Linux跬步积累】—— 网络编程套接字(二)
  • 精益数据分析(94/126):30/10/10用户参与法则与定价策略的科学制定
  • Linux(Centos 7.6)命令详解:sed
  • react public/index.html文件使用env里面的变量
  • gitee 拉取失败
  • javascript中Cookie、BOM、DOM的使用
  • JS设计模式(4):观察者模式
  • java 局域网 rtsp 取流 WebSocket 推送到前端显示 低延迟
  • vsCode使用本地低版本node启动配置文件
  • sklearn 和 pytorch tensorflow什么关系
  • k8s部署dify
  • Python打卡第46天
  • 埃文科技智能数据引擎产品入选《中国网络安全细分领域产品名录》
  • for AC500 PLCs 3ADR025003M9903的安全说明
  • Linux配置yum 时间同步服务 关闭防火墙 关闭ESlinux
  • DIY|Mac 搭建 ESP-IDF 开发环境及编译小智 AI
  • 12.5Swing控件3Jpanel JOptionPane
  • 03 mysql 的环境搭建