Basic

搭建过程很简单,参见 https://tomatoro.space/

坑1::Mismatch between origin and baseUrl (dev).

将上文中的流程走一遍,基本可以访问blog了。

但是会报 Mismatch between origin and baseUrl (dev).错误

将worker的script更换为 https://fruition-git-master-stephenou.vercel.app 中生成的script即可解决

坑2::无法评论

虽然可以清爽的访问自己的博客了,但是会发现,即使share options 设置了comment,blog也无法评论。

该issue 位于 worker script 的 Line99

Untitled

本该返回UserInfo的/api/v3/getPublicPageData 接口,因为没有POST Body而无法获取访客身份。

我理解这里fruition限制header转发的意义在于,反代后的域名因为不同源而无法获取Cookie。

例如我是将 域名 liriu.life 反代到 www.notion.so , 后者域下虽然有可以用于评论的cookie,但是前者没有。

我尝试在 liriu.life 上再次登录 notion以获取cookie,失败。看上去是各种 OAuth 与 liriu.life 不同源。

这里等一波 https://github.com/stephenou/fruitionsite 更新。

Solution

受到 mayneyao 的 script 启发( 该 script 会报 Mismatch between origin and baseUrl (dev).

Untitled

在Page调用disqus以实现评论功能。

component 链接: https://apption.co/apps/14