openclaw-feishu-webhook

为阿里云轻量服务器上的OpenClaw配置飞书Webhook通信方式。用于将OpenClaw从企业微信改为飞书webhook模式连接。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "openclaw-feishu-webhook" with this command: npx skills add jindon1020/osi-skills/jindon1020-osi-skills-openclaw-feishu-webhook

OpenClaw 飞书 Webhook 配置指南

概述

本指南帮助你在阿里云轻量服务器上配置OpenClaw使用飞书Webhook方式进行通信。主要步骤包括:

  1. 连接服务器并检查当前配置
  2. 更新OpenClaw配置文件
  3. 安装并配置Nginx反向代理
  4. 在飞书开放平台配置Webhook地址

前置条件

  • 阿里云轻量服务器(已安装OpenClaw)
  • 飞书企业账号(管理员权限)
  • 飞书开放平台应用凭证(App ID、App Secret、Verification Token)

步骤一:连接服务器

使用SSH连接到阿里云服务器:

# 需要安装sshpass
brew install sshpass

# 连接服务器
sshpass -p '服务器密码' ssh -o StrictHostKeyChecking=no root@服务器IP

步骤二:检查当前OpenClaw配置

# 查看当前配置文件
cat ~/.openclaw/openclaw.json

关键配置项:

  • channels.feishu.connectionMode: 应为 "webhook"
  • channels.feishu.appId: 飞书应用ID
  • channels.feishu.appSecret: 飞书应用密钥
  • channels.feishu.verificationToken: 飞书验证Token

步骤三:更新OpenClaw配置文件

编辑 ~/.openclaw/openclaw.json,确保飞书配置包含以下字段:

{
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "cli_xxxxx",
      "appSecret": "xxxxx",
      "connectionMode": "webhook",
      "verificationToken": "your-verification-token",
      "webhookPort": 3000,
      "webhookPath": "/feishu/events",
      "webhookHost": "127.0.0.1",
      "domain": "feishu",
      "groupPolicy": "open",
      "dmPolicy": "open",
      "allowFrom": ["*"]
    }
  }
}

注意

  • connectionMode 必须设为 "webhook"
  • webhookPortwebhookPathwebhookHost 是关键配置,用于内部Webhook服务

步骤四:安装并配置Nginx反向代理

OpenClaw的Webhook服务监听在内网127.0.0.1:3000,需要通过Nginx反向代理暴露给外部。

4.1 安装Nginx

# Alibaba Cloud Linux / CentOS / RHEL
yum install nginx --disablerepo=docker-ce-stable

# Ubuntu / Debian
apt-get install nginx

4.2 配置Nginx反向代理

创建配置文件 /etc/nginx/conf.d/feishu.conf

server {
    listen 18790;
    server_name _;

    location /feishu/events {
        proxy_pass http://127.0.0.1:3000/feishu/events;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

4.3 启动Nginx

nginx -t
systemctl enable nginx
systemctl start nginx

# 验证端口
netstat -tlnp | grep 18790

步骤五:重启OpenClaw服务

systemctl --user restart openclaw-gateway

# 查看日志
tail -50 /tmp/openclaw.log

确认日志显示:

[feishu] starting feishu[default] (mode: webhook)
[feishu] feishu[default]: Webhook server listening on 127.0.0.1:3000

步骤六:在飞书开放平台配置

  1. 访问 飞书开放平台
  2. 进入你的应用 → 「机器人」
  3. 在「Webhook事件」中添加:
http://你的服务器IP:18790/feishu/events

注意:端口是 18790(Nginx监听端口),不是18789

  1. 订阅事件:

    • im.message.message_created - 接收消息
  2. 发布应用版本


步骤七:测试连接

  1. 在飞书群聊中添加机器人
  2. @机器人发送消息测试

常见问题

Q: 飞书配置显示"返回数据不是合法的JSON格式"

A: 检查Webhook地址是否正确,应为:

http://服务器IP:18790/feishu/events

端口是18790,不是18789

Q: 无法收到消息

A: 检查以下几点:

  1. 确认Nginx已启动:systemctl status nginx
  2. 确认端口开放:netstat -tlnp | grep 18790
  3. 测试本地:curl http://localhost:18790/feishu/events
  4. 检查OpenClaw日志:tail -50 /tmp/openclaw.log

Q: 如何更新配置

A: 编辑 ~/.openclaw/openclaw.json 后,OpenClaw会自动热加载,或者执行:

systemctl --user restart openclaw-gateway

配置汇总

配置项说明示例值
服务器IP阿里云公网IP8.137.19.64
Gateway端口OpenClaw网关端口18789
Nginx端口Webhook暴露端口18790
Webhook路径飞书回调路径/feishu/events
完整URL飞书配置地址http://8.137.19.64:18790/feishu/events

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

publish-to-skills-sh

No summary provided by upstream source.

Repository SourceNeeds Review
General

ll-feishu-audio

飞书语音交互技能。支持语音消息自动识别、AI 处理、语音回复全流程。需要配置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量。使用 faster-whisper 进行语音识别,Edge TTS 进行语音合成,自动转换 OPUS 格式并通过飞书发送。适用于飞书平台的语音对话场景。

Archived SourceRecently Updated
General

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated
General

51mee-resume-profile

简历画像。触发场景:用户要求生成候选人画像;用户想了解候选人的多维度标签和能力评估。

Archived SourceRecently Updated