开发任务列表
-
recommender system 推荐系统(全局 / 针对不同用户,定制 主页 / 相关话题)。弄清现在的 Discourse 自带的推荐/排序方法,再利用开源的 SOTA 方法进行改进。See more: https://xjtu.app/t/topic/7278 . 有人分析了 Discourse 是怎么统计用户阅读时间的:https://linux.do/t/topic/26966
难度: ⭐️ ⭐️ ⭐️
进展:无进展。现在使用 Discourse-AI 插件通过 Open AItext-embedding-ada-002接口自动生成帖子的 embeddings,然后根据相似性推荐 5 条相关话题。 -
Noto animated emojis,寻找和 Discourse emoji 的对应关系,转换成 AVIF/WebP, 压缩到现有 emoji 像素尺寸以减小文件大小,在文件系统层替换现有 emoji png 文件。
Status: done. See 1. https://xjtu.app/t/topic/15054 2. 使用 webp_server 减少全站图片大小 https://xjtu.app/t/topic/14939
-
Deprecated:
修 Mastodon m.xjtu.app 无法使用的问题。(发现竟然是因为 caddy 没有读 mastodon 静态文件的权限造成的错误,忘了除了反代到 puma 的 3000 端口还要 serve static files) -
共享.men, .live 等不同域名的登陆凭据,否则xjtu.app的用户会经常会跳转到 canonical namexjtu.app。自动识别插入的站内 URL 并自动替换到当前访问使用的域名(类似目前的 Watched words,可参考 https://github.com/openSUSE-zh/discourse-cjk-text-spacing)。解决 CSP 和 CORS 问题。难度:⭐️ 💫
进展:放弃。在尝试用 non-Rails-native 方法在本地调试到接近成功的状态下无法进展,可在 https://github.com/xjtumen/discourse_share_sessions 参观胚胎代码。Multi domain access may hurt SEO. Few people need to access via multiple domains. -
加快网站首次打开速度。不知道这是否可行,有些网站是渐进式加载。Discourse 最好也能首先显示基本文本内容,在浏览的过程中逐渐加载各种功能。现在是几个点在那跳,让人等的很不爽。Discourse team 估计很难遇到低网速情况,应该是不会做这个功能的。
进展:放弃,这个是 SPA 娘胎里带来的毛病,很难优化。https://www.webpagetest.org/result/250831_YiDcYR_1N2/
-
用 https://github.com/oracle/truffleruby 替代默认的 CRuby。根据 benchmark(https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-truffleruby.html),性能提高了 N 多倍。
进展:与 AI, github, steam-login 插件依赖的 gem, core hook 不兼容 -
Discourse as blog fediverse
进展:放弃。Discourse can be seen as a blog aggregator. /my/activity/topics 可认为是个人主页。测试了将 discourse 嵌入到其他页面作为评论系统以及自动触发在 Discourse 建立新话题。 -
自动在中英文之间加空格,之前看 SUSE 中文社区好像做过相关工作:https://github.com/openSUSE-zh/rubygem-cjk_auto_space,不知道能否直接拿来用。
难度: 💫
进展:使用:https://github.com/fokx/discourse-cjk-formatter -
做本地 APP,利用 Hysteria 做网络优化,达到忽略线路丢包/延迟的极速访问的用户体验,最重要的是把很多静态资源缓存到本地。
进展:1. 基于 Kotlin 的 Web 加壳 https://xjtu.app/t/topic/1440 2. 基于 Electron 的 Web 加壳:https://xjtu.app/t/app-v0-0-1-windows-dns/11924 由于为了应对 DDoS,暂时失效。3. 正在 Tauri 2 基础上开发跨平台 App:https://xjtu.app/t/tauri/11882 https://xjtu.app/t/topic/14216 https://xjtu.app/t/topic/14538/
-
类似 Reddit/百度贴吧的 折叠式 UI。已经有类似 Stack Overflow 的开源插件:https://meta.discourse.org/t/discourse-post-voting/227808 和 https://coop.pavilion.tech/docs?topic=2972。threaded view 和 flat view 相比各有千秋,例如前者可以方便查看两个人交替的讨论(目前 Discourse 只能通过嵌套的引用来实现)。
难度:⭐️ ⭐️
进展:通过 Journal Plugin 可以实现。当前 https://xjtu.app/c/course/64 https://xjtu.app/c/general/journal/60 类别正是启用了此种 一层缩进式 UI。 -
参考 https://github.com/discourse/discourse-graphviz,给 Discourse 加上 tikz 支持。
理论上有 https://github.com/kisonecat/tikzjax 这个开源项目,通过 js 和 wasm 将源码转成 svg,但问题在于正常情况下不允许用户插入<script>块以防止 mischief,所以得通过插件来实现,上面那个项目就是通过viz.js来支持 graphviz,所以理论上要支持 tikz 可以如法炮制。
难度:⭐️ ⭐️
进展:Mermaid/Graphviz 都冇人用,做这个有乜意义 -
把 discourse 的 nginx 配置转成 caddy 的从而给反代加上缓存功能
难度: 💫
进展:无需,不管是使用 cloudflared 还是 caddy 还是只用 nginx 反代,性能上都差不了太多。 -
完善不登录回复功能- 目前是外挂到一个 python 程序,调用 discourse api。用户体验上不如用插件的方式将回复功能嵌入到页面内,这方面 pkuanvil 做的快速回复 UI 就很好。
外挂的实现方式有以下问题: - 假如因为 rate limit 而失败,直接返回草稿编辑页面(当前为需要人工 Alt + 返回)
- 防止话题页面内滚动 post_id URL 变化引起的 iframe 刷新。
- 没有亮暗色自动切换,可以通过 python 程序里读 header 来自适应。
不如直接调用 Discourse原生 Composer进行匿名回帖/发帖。参考:https://github.com/alangibson/discourse-loners
难度: ⭐️
进展:禁用,https://meta.discourse.org/t/discourse-staff-alias/156202
bug:匿名回复和问答模式插件冲突,最新的 Discourse API 升级使得插件失效。 - 目前是外挂到一个 python 程序,调用 discourse api。用户体验上不如用插件的方式将回复功能嵌入到页面内,这方面 pkuanvil 做的快速回复 UI 就很好。
-
完善评课社区,详见 https://xjtu.app/t/topic/4919/
解决割裂的使用体验(不同的 UI,无法接入 AI),并且避免再次从 上游 人工合并,写一个插件,类似 https://meta.discourse.org/t/topic-ratings-plugin/39578,将 MySQL 里的数据批量导入 PG,增加该类别 topic 的 field,主要的关系是课程的老师的不同教学班,选修课该板块的其他课程,注意和导师信息的联系,学期信息、推荐星级无所谓,数据初始化的时候很多数据是无意义的平均值,成绩信息可视化不重要(数据来源无法说服用户可信、不同学期之间的差距、没有新人贡献数据)。可借助现有的 模板 功能应用到新的回复。
难度: ⭐️
进展:弃用 USTC 评课社区软件,改用 Discourse 的具有模板的类别:https://xjtu.app/c/course/64 -
定制主页和用户界面、配色、完善中文翻译,使用 Stable Diffusion 自动生成头像图片,Auto dark mode for instant reply + course review
支持动态头像、动态徽标、动态格言(参考 www/craiglist theme 顶部的滚动栏])。对于不喜欢浏览时页面有像素改变的用户,提供设置允许静止一切。进展:已有动态头像的插件:https://meta.discourse.org/t/animated-avatar-plugin/220445,修改了部分 UI,可在 https://github.com/xjtumen/discourse-xjtumen-custom-tc 参观代码
-
利用有关语料 finetune 并部署开源 LLM,用于自动回帖以及应答。(注:GPU 不是问题)
开发 bot(@forward_bot)自动理解并回复现有的相关链接,不过这跟当前的 related topic 功能重叠。(进阶:Finetune LLM)进展:(效果不好,已被禁用)试验:训练一个解答下交学生疑问的 Chatbot
为了让门友和水友们更不孤独,我设置了一个自动回复的 bot -
管理 tag(聚类),利用 LLM 自动打 tag,可视化:https://meta.discourse.org/t/discourse-tag-cloud/218014
进展:discourse-ai 插件已有此类功能 https://meta.discourse.org/t/discourse-ai-post-classifier-automation-rule/281227,但尚未配置 -
基于地理位置的社区功能,现有 discourse 插件
discourse-locations可以给帖子和用户增加位置属性,可以在此之上增加发现附近的人等功能。支持调用系统的 GPS 定位/手动输入位置。
难度:⭐️
进展:还不如基于 IP 显示位置:https://github.com/xjtumen/discourse-ip-location -
基于 SMS 的注册登录,大多数中国人没有 email 邮箱,但上网的人大多用行動裝置,因而虽然 SMS 不安全,SIM swap scam,实现 SMS 注册/登录依然很有意义。事实上,一些基于 Discourse 的网站如 https://swapd.co 已经实现了这个功能。
进展:太烧钱了,还不如实现和 T 的深度结合 -
没有任何意义,厌网站上正常阅读的区域添加动来动去的东西会让人非常烦躁
-
Upvote / downvote + karma → automatically promote a user to specific group + Category ACL 量化用户的活跃度/贡献度(已有 discourse-gamification),并自动授予相应的权限和功能(已有 trust level 系统)。没有任何意义。
-
实现 zulip → discourse 的消息传递,即正确处理 Zulip’s outgoing webhooks,监听在某个地址,识别出是对xjtu-to-nk这个 bot 的回复,并从文本中提取出 discourse 上的 topic id,然后调用 discourse 的 api 进行发帖。更进一步,实现 两个/多个 Discourse 之间的互联。
ℹ️ 学好了 Ruby on Rails, Ember.js, Discourse,有可能去 Discourse 背后的 CDCK 公司上班,或者 去 Discourse Marketplace 接活,或者开一家 Discourse Hosting 公司成为 CDCK 的伙伴。
支持
md,放寒假了,有没有同学想学学 ruby on rails 搞点开发练练手啊?
Anonymous Coward Old self-assign 一下 SMS 用户登录
uika_winwing 关于这个我之前调研了一下,huawei aali 云公司只对企业服务,价格大概批量购买折合 0.几元一条。国外云公司发到国内短信几乎找不到。若果要做,需要再给注册界面加个 CAPTCHA,否则光靠 IP 做 rate limit,恶意攻击者一下子就把钱搞光了。
你可以再调研看看,如果难就知难而退。
Anonymous Coward Old 草那先换一个
uika_winwing 我感觉难度适中并且有通用意义的两个,
- 不同 Discourse 站之间的互通,包括:
https://meta.discourse.org/t/synchronising-crossposting-topics-across-different-discourse-sites/263269/
这个功能做得好的话,大则我们实现可以类似 sub-Reddit,允许不同社区创建 sub-Discourse(目前是不同实例在不同域名下,可以把它做成在子目录下,类似reddit.com/r/<sub-reddit-name>,同时共享身份系统/数据库);小则可以实现 npuer.life 和 xjtu.app 的互联。
再类似于 Matrix,Discourse 上的不同类别/话题对应 Matrix 不同服务器(域名)上的 Room,不同服务器(域名)上的用户不用另外注册,就能参与评论,到时候显示的用户名是 @admin:xjtu.app。
- 参考目前话题底部的
related智能推荐,在主页新增一个“For you”,通过历史浏览记录(浏览 1s 以上)。这个在将来也许会被 sam 开发出来:
https://meta.discourse.org/t/could-a-list-of-recommended-topics-be-added-to-the-top-menu/289323/
我之前也考虑过:
https://xjtu.app/t/topic/7278
Anonymous Coward Old 在主页新增一个“For you”,通过历史浏览记录(浏览 1s 以上)。这个在将来也许会被 sam 开发出来:
很困难的亚子
自黄药师黄仁勋来,世人皆爱猫。余独爱老鼠之,可爱之态,活泼之动,实为人所难以抗拒。喵~
🐁 🐁 🖱️ 🪤
![]()
John 我感觉不困难,看看当前 discourse-ai 源码里怎么生成 related 部分的内容,无非之前调用过 openai 的 text-embedding-ada-002 接口把每篇 topic 的 embedding 存在数据库里,然后查询距离最近的几个 topic 显示出来(这方面功能由 pgvector 支持)。现在无非就是用户在选择 For You 而非当前默认的 Latest 的时候查询目前用户阅览过的 topic 的 embeddings 的平均值,找最近的几个 topic(当然这只是一种方案)显示出来
Anonymous Coward Old 第一个就是瓜大桥啊,做做看吧
uika_winwing 不全是,有很多种实现的方式,哪天我们用 matrix chat 连个语音交流一下
Anonymous Coward Old 我想到的方案是贴子和回复同步,然后用户可以在两个站点都创建用户并绑定。如果有没有绑定本站账号的用户出现,就自动创建一个新账号,名称显示为 @username:example.com 这样。用户可以选择自己的贴子是否会被同步到其他站。
未来此用户加入本社区时可以直接继承该自动创建的账号的信息。
但是如果采用这种方法,会出现用户已经在本站注册,但因没有绑定而被自动创建了账号。这就得将两账号合并。
还是这样的问题啊,我在 stack overflow 上开一贴提问好了
*redacted*@*redacted*:~/discourse$ d/rake db:migrate RAILS_ENV=development
fatal: detected dubious ownership in repository at '/src'
To add an exception for this directory, call:
git config --global --add safe.directory /src
*redacted*@*redacted*:~/discourse$ git config --global --add safe.directory ~/discourse
*redacted*@*redacted*:~/discourse$ d/rake db:migrate RAILS_ENV=development
fatal: detected dubious ownership in repository at '/src'
To add an exception for this directory, call:
git config --global --add safe.directory /src
*redacted*@*redacted*:~/discourse$ git config --global -l
user.name=*redacted*
user.email=*redacted*
user.signingkey=*redacted*
commit.gpgsign=true
safe.directory=*
safe.derectory=/src
safe.directory=/src
safe.directory=/home/*redacted*/discourse
uika_winwing 应该不关 safe dir 什么事
whoami
ls -l ~/discourse
ls -ld ~/discourse
看看输出
Anonymous Coward Old 之前还遇到了 mkdir permission denied 的问题,于是我给了所有人全部权限(递归):
*1*@*2*:~/discourse$ whoami
*1*
*1*@*2*:~/discourse$ ls -ld ~/discourse
drwxrwxrwx 25 *1* *1* 4096 Jan 29 15:15 /home/*1*/discourse
uika_winwing 我感觉d/rake db:migrate RAILS_ENV=development这个错是在容器里运行时报的
Anonymous Coward Old *1*@*2*:~/discourse$ ls -l ~/discourse
total 416
drwxrwxrwx 11 *1* *1* 4096 Jan 29 14:56 app
drwxrwxrwx 3 *1* *1* 4096 Jan 29 14:56 bin
-rw-rw-rw- 1 *1* *1* 316 Jan 29 14:56 Brewfile
-rw-rw-rw- 1 *1* *1* 148 Jan 29 14:56 CODEOWNERS
drwxrwxrwx 6 *1* *1* 4096 Jan 29 14:56 config
-rw-rw-rw- 1 *1* *1* 304 Jan 29 14:56 config.ru
-rw-rw-rw- 1 *1* *1* 1303 Jan 29 14:56 CONTRIBUTING.md
-rw-rw-rw- 1 *1* *1* 2347 Jan 29 14:56 COPYRIGHT.md
lrwxrwxrwx 1 *1* *1* 10 Jan 29 14:56 d -> bin/docker
drwxrwxrwx 3 *1* *1* 4096 Jan 29 14:57 data
drwxrwxrwx 5 *1* *1* 4096 Jan 29 15:40 db
-rw-rw-rw- 1 *1* *1* 1315 Jan 29 14:56 discourse.sublime-project
drwxrwxrwx 2 *1* *1* 4096 Jan 29 14:56 docs
drwxrwxrwx 5 *1* *1* 4096 Jan 29 14:56 documentation
-rw-rw-rw- 1 *1* *1* 6675 Jan 29 14:56 Gemfile
-rw-rw-rw- 1 *1* *1* 15384 Jan 29 15:12 Gemfile.lock
drwxrwxrwx 2 *1* *1* 4096 Jan 29 14:56 images
-rw-rw-rw- 1 *1* *1* 3885 Jan 29 14:56 jsconfig.json
-rw-rw-rw- 1 *1* *1* 1937 Jan 29 14:56 lefthook.yml
drwxrwxrwx 47 *1* *1* 12288 Jan 29 14:56 lib
-rw-rw-rw- 1 *1* *1* 18092 Jan 29 14:56 LICENSE.txt
drwxrwxrwx 2 *1* *1* 4096 Jan 29 15:15 log
drwxrwxrwx 8 *1* *1* 4096 Jan 29 14:56 migrations
drwxrwxrwx 486 *1* *1* 20480 Jan 29 15:10 node_modules
-rw-rw-rw- 1 *1* *1* 3035 Jan 29 14:56 package.json
drwxrwxrwx 13 *1* *1* 4096 Jan 29 14:56 plugins
drwxrwxrwx 5 *1* *1* 4096 Jan 29 15:15 public
-rwxrwxrwx 1 *1* *1* 305 Jan 29 14:56 Rakefile
-rw-rw-rw- 1 *1* *1* 7819 Jan 29 14:56 README.md
drwxrwxrwx 6 *1* *1* 4096 Jan 29 14:56 script
drwxrwxrwx 24 *1* *1* 4096 Jan 29 14:56 spec
drwxrwxrwx 2 *1* *1* 4096 Jan 29 14:56 test
drwxr-xr-x 4 100999 100999 4096 Jan 29 15:15 tmp
-rw-rw-rw- 1 *1* *1* 3279 Jan 29 14:56 translator.yml
drwxrwxrwx 4 *1* *1* 4096 Jan 29 14:56 vendor
-rw-rw-rw- 1 *1* *1* 224288 Jan 29 14:56 yarn.lock
uika_winwing 我们私聊,省得影响其他人
我发现对我而言一个经常的情况是列的东西(心中想的东西)越多实际做的往往越少。行动力不足,不能深入,经常一有点小的收获就浅尝辄止分心做其他事情了。涉猎的东西哪怕精通一门现在也就有正事可做了,不至于落得今天这么悲惨的局面。
Anonymous Coward Old 不是有实习吗