wechaty / summer

Summer of Wechaty (SoW) is a program for connecting students with the Wechaty community for coding & tech writing.
https://wechaty.github.io/summer-of-wechaty
Apache License 2.0
31 stars 12 forks source link

基于 Matrix AppService Wechaty 项目的用户、群与消息等基础功能的完善 #59

Open yswtrue opened 3 years ago

yswtrue commented 3 years ago

Update by @huan

开源软件供应链点亮计划

“开源软件供应链点亮计划-暑期2021”(以下简称 暑期2021)是由中科院软件所与 openEuler 社区共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进国内优秀开源软件社区的蓬勃发展。

根据项目的难易程度和完成情况,参与者还可获取“开源软件供应链点亮计划-暑期2021”活动奖金和奖杯。

官网:https://summer.iscas.ac.cn

Wechaty

Wechaty 是一个开源聊天机器人框架SDK,具有高度封装、高可用的特性,支持NodeJs, Python, Go 和Java 等多语言版本。在过去的5年中,服务了数万名开发者,收获了 Github 的 9600 Star。同时配置了完整的DevOps体系并持续按照Apache 的方式管理技术社区。

Wechaty 官网暑期2021项目入口:https://wechaty.js.org/docs/ospp/2021/

项目名称

基于 Matrix AppService Wechaty 项目的用户、群与消息等基础功能的完善

背景介绍

Wechaty 社区目前已经支持微信、Whatsapp、企业微信、飞书等常见流行即时通讯工具,并且能够通过多语言 SDK (比如 Python Wechaty) 进行调用。

Matrix 是一个 open network for secure, decentralized communication, like Pidgin on your Phone.

matrix-appservice-wechaty 是一个 WeChat (微信) Matrix AppService for bridging the Matrix user with WeChat user.

It has been officially listed at [Matrix] Bridge Page for Wechaty.

我们在本次 Summer 2021 的项目中,社区希望可以将我们的 matrix-appservice-wechaty 项目进行继续完善,将它对用户、群、消息收发(包括文本、图片、视频等)的基础功能进行完善和支持。

需求介绍

  1. 架设一套自己的 Matrix 系统
  2. 架设 matrix-appservice-wechaty 并整合到 Matrix 系统中
  3. 对 Matrix AppService Wechaty 的功能进行试用,分析其当前的功能,然后列出需要完善的功能列表,以及欠缺的功能列表,并作出开发计划。

在初期开发中,能够实现图片消息的接收和发送,即可完成原型验证 POC 。

项目难度

中(奖金:9,000元)

导师联系方式

项目产出目标

  1. 每日代码 commit
  2. 每周提交一份 report (回复本 issue)
  3. 每两周一次在线会议
  4. 完成各种消息类型的收发功能
  5. 对项目进行完整的分析,整理出所有需要支持的 Wechaty 功能列表,以及那些需要完善,那些需要继续开发
  6. 完成计划列表中的计划
  7. 配置 GitHub Actions 实现自动化测试* (可选)

项目技术栈

  1. TypeScript programming language
  2. Git
  3. Matrix

参考链接

  1. 用Matrix和wechaty来聊微信, @yswtrue, Feb 04, 2021

Hi, dear students.

My project requirements:

  1. Appservice doesn't show the user name and user avatar in group chat. Now we need to show the correct user name and avatar in group chat. And show the user avatar in the direct message.
  2. Appservice can not display wechat bbob message directly. We need to convert bbob message to HTML and return it to the matrix server.
  3. Appservice can not send files to wechat users. Now we make appservice send files and pictures to wechat users.

Required skills for all projects

Thank you.

matrix-appservice-wechaty [M] Matrix

Wechat (微信) Matrix Application Services Bridge

Matrix + Wechaty

Image credit: Gnosis

Powered by Wechaty NPM Version NPM Docker TypeScript

What is [Matrix]

Matrix is an open network for secure, decentralized communication, like Pidgin on your Phone.

Pidgin try to IM all your friends in one place in Linux, and with Matrix you can have your Phone clinet with your private server which is highly customized. Matrix did not use XMPP protocol, it's server uses REST so that it could be more easy to extend.

The [Matrix] client Riot is a universal secure chat app entirely under your control. It supports all types of the platforms, including Web/Browser, Android, and iPhone.

What is matrix-appservice-wechaty

matrix-appservice-wechaty is a WeChat (微信) Matrix AppService for bridging the Matrix user with WeChat user.

It has been officially listed at [Matrix] Bridge Page for Wechaty.

According to Types of Bridging, Wechaty Bot in Matrix will create an Simple Puppeted Bridge with Portal Rooms because we want to bring all conversations from Wechat to Matrix, and let the Matrix user control his account on Wechat.

Features

  1. Support connect to Wechat via Web/iPad/Hostie/Windows/Mac Protocol, with the power of Wechaty
  2. Map all Wechat users/room/official accounts to Matrix virtual users

Links

lprintf commented 3 years ago

很遗憾没能在OSPP成功申报该项目。但如果该项目最终没被认领,我依然很乐意在此贡献代码。

huan commented 3 years ago

@545641826 It's great to know that you'd like to contribute to this project with strong aspiration, I thank you for trying to participant in OSPP 2021, and welcome to join the Wechaty community!

lprintf commented 3 years ago

@545641826 It's great to know that you'd like to contribute to this project with strong aspiration, I thank you for trying to participant in OSPP 2021, and welcome to join the Wechaty community!

Thanks! It's my pleasure.

huan commented 3 years ago

明天(19日,周六)晚上20点社区召开暑期 2021 kick off 的在线会议,会议地点见 meeting notes。

meeting notes 地址 https://bit.ly/2zpi2XG ,请暑期 2021 的同学们注意参加:注册、添加介绍自己的 agenda 和准备 slides。

huan commented 3 years ago

image

lprintf commented 3 years ago

OK,I got it. I will finish the experiment at hand, try to move the Matrix server(It's too memory-intensive) to the physical machine.

lprintf commented 3 years ago

matrix-appservice-wechaty 进度报告

日期: 2021-07-04

本周完成的成果

  1. 熟悉Matrix
  2. 大概了解matrix-appservice-wechaty
  3. 了解wechaty机制
  4. 熟悉开源项目贡献流程

本周遇到的困难和需要配合的地方

  1. 关于wechaty具体运行原理,可能需要咨询其他项目的开发人员验证一些猜想

下周的开发计划和预计成果

  1. 在局域网内部署开发环境,调试代码
  2. 拟定开发计划

其他需要说明和同步的事项

  1. 目前局域网内部署的matrix全家桶访问方式灵活,如果matrix-appservice-wechaty没增加其他特别的依赖的话,可以尝试p2p穿透的方式暴露给其他开发者。
zrn-fight commented 3 years ago

[matrix-appservice-wechaty] 进度报告

日期:2021-07-04

本周完成的成果

  1. 大致了解了Matrix
  2. 试着去配置了matrix-appservice-wechaty但没有配置成功

    本周遇到的困难和需要配合的地方

  3. 对项目的开发流程还不是很清晰,不知道从哪里着手

    下周的开发计划和预计成果

  4. 完成起初博客,拟定开发计划
  5. 熟悉开发流程,做好分工

    其他需要说明和同步的事项

    暂无

huan commented 2 years ago

Thank you very much for the report! They help me a lot to understand the progress of your works.

@545641826 It seems that you are on track and please keep moving ahead.

@zrn-fight Your progress seems a little behind so please try harder in the next week.

Please be prepared to publish the 期初报告 to our blog and make sure you are following the guidelines. I'd like to schedule a 30 minutes meeting for our project after that, and looking forward to hearing good news from you.

Cheers!

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

日期: 2021-07-18

本周完成的成果

  1. 部署一套可以在境内高速访问的matrix-element服务。
  2. 熟悉开源项目贡献流程和注意事项。
  3. 实现接收图片的展示。

本周遇到的困难和需要配合的地方

  1. 对开源项目贡献流程不熟悉,PR请求磕磕碰碰。
  2. 该项目似乎为某个对齐插件做了配置,但不清楚该插件的名字,以后代码量大了可能会遇到困难。

下周的开发计划和预计成果

  1. 熟悉虚拟桥接用户的命名和创建方式
  2. 设计实现群会话下用户名展示策略

其他需要说明和同步的事项

zrn-fight commented 2 years ago

[matrix-appservice-wechaty] 进度报告

日期:2021-07-18

本周完成的成果

  1. 提交了期初博客
  2. 运行了下wechaty 的入门项目,大致了解了该如何使用wechaty

本周遇到的困难和需要配合的地方

​ 1. 对pull request的流程不是很熟悉

下周的开发计划和预计成果

  1. 使用element 应用,利用545641826暴露的接口进行开发和测试,多向545641826请教

其他需要说明和同步的事项

​ 暂无

huan commented 2 years ago

@545641826 @zrn-fight Thanks for the update.

Could you please write a weekly plan for the following 3 months, with milestones/roadmap so that we can have a big picture for our project?

Thank you very much.

该项目似乎为某个对齐插件做了配置,但不清楚该插件的名字,以后代码量大了可能会遇到困难。

The plugin name is "Better Align":

lprintf commented 2 years ago

matrix-appservice-wechaty Weekly Plan

日期: 2021-07-11

huan commented 2 years ago

Thanks for the plan, it's great!

Please make sure you have included the "在 Matrix 用户列表中(联系人、群成员),正确的显示 Wechaty 联系人的昵称与头像" requirement.

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

日期: 2021-07-25

本周完成的成果

  1. 进一步探索了开源项目贡献流程
  2. 完善实现群和用户图片的收发
  3. 实现群内用户头像昵称的展示
  4. 添加一些简单feature,如:机器人自动进群;不为用户自己的微信额外创建机器人;(详见相关PR的commit)

本周遇到的困难和需要配合的地方

  1. 发现了其他待改进的功能点,如:发送文件时,出现少量冗余消息重复建群问题
  2. 尝试同步其他设备中自己发送的消息时遇到了大量冗余消息(有点像心跳包)。

下周的开发计划和预计成果

  1. 拟定社区Matrix服务器配置
  2. 部署社区Matrix服务器
  3. 完善优化配套文档
  4. 宣传推广

其他需要说明和同步的事项

lprintf commented 2 years ago

相关链接:

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

日期: 2021-08-01

本周完成的成果

  1. 设计了一套更加易于部署的部署方案
  2. 对该方案进行了多次测试,完善
  3. 用户测试,并解答问题。

本周遇到的困难和需要配合的地方

  1. 缺少测试用户

下周的开发计划和预计成果

  1. 讨论项目计划
  2. 部署社区Matrix服务器
  3. 完善优化配套文档
  4. 宣传推广

其他需要说明和同步的事项

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

日期:2021-08-08

本周完成的成果

  1. 获得Eric(the founder of Beeper.com)的赞助
  2. 部署社区matrix服务器
  3. 测试了matrix服务器的部分功能

本周遇到的困难和需要配合的地方

  1. 需要推广服务器供他人使用,并获得反馈结果。

下周的开发计划和预计成果

  1. 协助 @zrn-fight 总结项目中期进度
  2. 完善和推广服务器
  3. 继续项目开发

其他需要说明和同步的事项

huan commented 2 years ago

It would be great if you can help @ericmigi to run his matrix-appservice-wechaty smoothly by getting feedbacks and keep improving our code base.

lprintf commented 2 years ago

Okay, I like coding then writing documentation more. So I writed easy-matrix-deploy istead of writing a complicated document. But the works ... @zrn-fight

lprintf commented 2 years ago

【基于 Matrix AppService Wechaty 项目的用户、群与消息等基础功能的完善】中期报告

项目信息

项目进度

lprintf commented 2 years ago

@zrn-fight You can edit the above document directly here. It seem to be the better choice than <石墨文档>.

huan commented 2 years ago

项目中期审核意见

项目完成度:二位同学能够按照既定计划进行开源项目开发,目前进度与计划相符; 学生参与度:能够积极参与项目开发,主动调研新技术和解决现有问题。 代码贡献量:完成了代码新功能的开发,经过测试可以正常运行,贡献量适中 综合评价及建议:项目进展顺利,希望接下来能够完善用户安装文档,并对任务中相关功能进行继续完善和优化。

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

2021-08-22

本周完成的成果

  1. 完善优化社区matrix服务器
  2. 在导师帮助下发现了matrix服务主机无法访问主流邮件服务供应商25端口的stmp服务。
  3. 自己小米平板3些简单的服务器。
  4. 在一台破笔记本上装了套nextclound服务器等,可直接通过公网访问,上下行带宽都是100mbit每秒,今后可作团队协作工具。

本周遇到的困难和需要配合的地方

  1. 企图在平板上装一些复杂服务器,获取了root权限,弄坏好几次系统,fastboot,学会了短接电路板,但因内核缺陷,且该设备不好升级内核,不好刷bios(1、2比较好折腾)和各种服务器自带bug最终放弃。
  2. 在一台古董笔记本上装了Ubuntu20并部署各种服务,期间也遇到过不少驱动问题,比折腾平板舒服,但估计断电超过一天服务就挂了。

下周的开发计划和预计成果

  1. 完善matrix-appservice-wechaty功能。
  2. 开始文档撰写。

其他需要说明和同步的事项

huan commented 2 years ago

Please follow https://github.com/wechaty/summer/issues/79#issuecomment-899086777 and make sure you have:

  1. RSVP by registering yourself to https://docs.google.com/document/d/1fVCk8qRYc4RKGMf2UY5HOe07hEhPUOpGC34v88GEFJg/edit#heading=h.5ztnno5qivcb (by adding your name below the "Attendees")
  2. Submit your mid-term demo day presentation blog & video & slide in the meeting notes.

Pleaset let me know when you have get it done, thank you very much.

lprintf commented 2 years ago

Youtu:

Bilibili:

huan commented 2 years ago

ping for the weekly update

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

2021-09-10

本周完成的成果

  1. 中期视频配音与博客完善

本周遇到的困难和需要配合的地方

  1. 原开发环境依赖使用matrix-docker-ansible-deploy部署的matrix服务器,部署环境要求较为苛刻,新的网络环境下不容易重新配置开发环境。这种开发环境对刚接触该项目的开发者也不友好。

下周的开发计划和预计成果

  1. 拟基于docker设计一个新的开发环境,在项目中添加相关说明,方便新开发者快速上手。
  2. 完成至少一个issue提到的功能点、问题点。

其他需要说明和同步的事项

huan commented 2 years ago

Thanks for the update!

I have seen there are some user experience issues from @ericmigi, could you please have a look at them and put them in your working plan?

lprintf commented 2 years ago

matrix-appservice-wechaty 进度报告

2021-09-21

本周完成的成果

  1. 升级tsconfig,matrix-appservice-bridge,wecahty等依赖,解决依赖冲突

本周遇到的困难和需要配合的地方

  1. 部分冲突解决方式需要进一步讨论

下周的开发计划和预计成果

  1. 继续升级其他依赖
  2. 添加npm-run-all依赖,添加并行测试功能
  3. 实现其他功能点

其他需要说明和同步的事项

lprintf commented 2 years ago

live coding视频

{% include iframe.html src="https://youtu.be/qtbExkN0uoI" %}

国内链接:https://www.bilibili.com/video/BV1Eq4y1Z7Ya/

PPT展示视频

{% include iframe.html src="https://youtu.be/3j3BGRnoVtE" %}

国内链接:https://www.bilibili.com/video/BV1QR4y1p7Hd/

huan commented 2 years ago

结项审核

希望同学未来可以不但继续自己参与维护社区代码,还可以多带动身边的同学参加,在开源项目中发挥更加积极的作用。