notifrp

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

frp-notify

Build

一个专注于消息通知的 frp server manager plugin 实现,让你对进入 frps 的连接了如指掌,不再裸奔。

快速启动

下载地址

目录介绍

* frp-notify
└─── system
|    |          frp-notify.service                  # linux 系统服务配置文件
|
│           frp-notify                              # frp-notify 程序
|           frp-notify.json                      # 通知插件配置文件

打印帮助信息

./frp-notify --help

命令行启动

./frp-notify start -c /etc/frp-notify/frp-notify.json -b 127.0.0.1:50080

配置介绍

frps

frps.ini 增加以下配置

[plugin.frp-notify]
addr = 127.0.0.1:50080                             // frp-notify 地址
path = /handler                                    // frp-notify url, 固定配置
ops = Login,NewProxy,NewWorkConn,NewUserConn       // 通知的操作

黑白名单配置(IP 过滤)

先判断白名单,后判断黑名单。仅对 NewUserConn 有效 (黑白名单配置支持热加载)。

{
  "blacklist": [                                   // 黑名单
    "127.0.0.1"
  ],
  "whitelist": [                                   // 白名单
    "127.0.0.1"
  ],
  "notify_plugins": [
    ...
  ]
}

通知插件配置

插件列表:

  1. log
  2. dingTalk
  3. wxwork
  4. 飞书
  5. gotify

frp-notify.json 文件中按需配置通知插件,支持同时配置多个插件。

log

将消息打印到控制台,用于调试。

{
  "notify_plugins": [
    {
      "name": "log",                                                               // 固定配置
      "config": {}
    }
  ]
}
dingTalk

将消息发送到钉钉。

{
  "notify_plugins": [
    {
      "name": "dingTalk",                                                               // 固定配置
      "config": {
        "token": "df54651465c1189b76fd13f910b76bed361f8fff31bf9118b1896bc148500000",    // dingTalk 自定义机器人 token
        "secret": "SEC97d8a209f9ddda25b89d63d82a0b2ad4065504cbe4bc043719fbb1a0000000",  // dingTalk 自定义机器人 secret
        "is_at_all": true                                                               // 发送消息时是否@所有人
      }
    }
  ]
}

实例截图

wxwork

将消息发送到企业微信。

{
  "notify_plugins": [
    {
      "name": "wxwork",
      "config": {
        "corp_id": "ww123456789",
        "corp_secret": "UK__xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "agent_id": 12345678,
        "to_user": [],
        "to_party": [],
        "to_tag": [],
        "filter_regexp": ".*"
      }
    }
  ]
}

实例截图

飞书

将消息发送到飞书

{
  "notify_plugins": [
    {
      "name": "lark",
      "config": {
        "webhook_url": "",
        "secret": "",
        "at_users": []
      }
    }
  ]
}
gotify

将消息发送到 gotify-server

{
  "notify_plugins": [
    {
      "name": "gotify",                                                                // 固定配置
      "config": {
        "server_proto": "http",                                                        // gotify-server 上报协议
        "server_addr": "127.0.0.1:40080",                                              // gotify-server 服务地址
        "app_token": "token"                                                           // gotify-server 配置的 app token
      }
    }
  ]
}

实例截图

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL