chainreactors / picker

将你的repo变为讨论社区
GNU General Public License v3.0
83 stars 16 forks source link

fork from https://github.com/VulnTotal-Team/yarb

picker

抓取, 推送, 讨论, 交流, 互动为一体, 将github的repo变为私人的讨论社区。

支持导入 opml 文件,也可以订阅其他任何 RSS 源。

使用

基于github action 实现的自动化推送系统

目前有四个不同的推送信息类型

信息流

每日会在issue中生成昨日信息流

img.png

精选

如果认为某篇文章质量较好, 值得其他人阅读可以点击convert to issue 自动添加到精选文章列表.

img.png

如果需要多人合作, 普通的read权限并没有convert to issue的功能, 需要triage权限

img.png

或手动new issue, 也会自动添加到issue中

img.png

每天下午13:30, 会将昨日的精选汇总进行一次推送.

标签

每日信息流会自动添加标签daily, 每日精选会自动添加标签dailypick. 精选文章会添加标签pick.

一些文章的细分领域可以通过手动添加不同的标签进行管理.

img.png

已经给主要用户都添加了写权限, 可以自行创建标签.

评论

对精选文章的评论将会自动推送到钉钉群

订阅源

推荐订阅源:

其他订阅源:

非安全订阅源:

添加自定义订阅源

  1. config.json 中添加本地或远程仓库:
rss:
  CustomRSS:
    enabled: true
    filename: CustomRSS.opml
  CyberSecurityRSS:
    enabled: true
    url: >-
      https://raw.githubusercontent.com/zer0yu/CyberSecurityRSS/master/CyberSecurityRSS.opml
    filename: CyberSecurityRSS.opml
  CyberSecurityRSS-tiny:
    enabled: false
    url: 'https://raw.githubusercontent.com/zer0yu/CyberSecurityRSS/master/tiny.opml'
    filename: CyberSecurityRSS-tiny.opml
  Chinese-Security-RSS:
    enabled: true
    url: >-
      https://raw.githubusercontent.com/zhengjim/Chinese-Security-RSS/master/Chinese-Security-RSS.opml
    filename: Chinese-Security-RSS.opml
  awesome-security-feed:
    enabled: true
    url: >-
      https://raw.githubusercontent.com/mrtouch93/awesome-security-feed/main/security_feeds.opml
    filename: awesome-security-feed.opml
  SecurityRSS:
    enabled: true
    url: 'https://github.com/Han0nly/SecurityRSS/blob/master/SecureRss.opml'
    filename: SecureRss.opml
  wechatRSS:
    enabled: true
    url: 'https://wechat2rss.xlab.app/opml/sec.opml'
    filename: wechatRSS.opml
  chinese-independent-blogs:
    enabled: false
    url: >-
      https://raw.githubusercontent.com/timqian/chinese-independent-blogs/master/feed.opml
    filename: chinese-independent-blogs.opml

2.

自定义rss源位于rss/CustomRSS.opml中, 需要添加请提交pr, 次日自动加入到推送列表

非rss源可以使用rsshub转发

部署

推荐使用github action部署

github部署

step1: fork仓库

因为fork可能自动关闭issue, 并且导致issue指向原仓库, 所以建议脱离fork关系. 操作比较简单, clone本仓库, 然后创建一个空项目, 将该仓库push即可.

step2: 手动添加label

issue需要通过标签管理, 所以需要先创建pick, dailydailypick标签. 否则会报错

step3: 创建github token

在secret中配置MY_GITHUB_TOKEN, 点击这里生成, 只需要给repo权限即可.

step4: 配置bot机器人

当前只支持飞书,钉钉推送, 需要先注册钉钉机器人, 选择加签的方式.

在github secret中配置

可以配置两个不同的钉钉机器人, 也可以只配置一个, 如果只有一个所有消息均通过同一个机器人推送.

其他的推送渠道请自行添加, 可以参考yarb与picker中的代码, 修改下markdown模板即可实现.

本地搭建

需要在本地安装 github-cli ,并登录. 不推荐使用, 仅在调试模式下测试用.

$ git clone https://github.com/chainreactors/picker
$ cd picker && ./install.sh

编辑配置文件 config.json,启用所需的订阅源和机器人(key 也可以通过环境变量传入),最好启用代理。

$ ./picker.py --help                            
usage: picker.py [-h] [--update] [--cron CRON] [--config CONFIG] [--test]
optional arguments:
  -h, --help       show this help message and exit
  --update         Update RSS config file
  --cron CRON      Execute scheduled tasks every day (eg:"11:00")
  --config CONFIG  Use specified config file
  --test           Test bot

# 单次任务
$ ./picker.py