Code Monkey home page Code Monkey logo

rin's Introduction

Rin

English | 简体中文

Cover

GitHub commit activity GitHub branch check runs GitHub top language GitHub License GitHub Actions Workflow Status

Introduction

Rin is a blog based on Cloudflare Pages + Workers + D1 + R2. It does not require a server to deploy. It can be deployed just with a domain name that resolves to Cloudflare.

Demo address

xeu.life

Features

  1. Support GitHub OAuth login. By default, the first logged-in user has management privileges, and other users are ordinary users
  2. Support article writing and editing
  3. Support local real-time saving of modifications/edits to any article without interfering between multiple articles
  4. Support setting it as visible only to yourself, which can serve as a draft box for cloud synchronization or record more private content
  5. Support dragging/pasting uploaded images to a bucket that supports the S3 protocol and generating links
  6. Support setting article aliases, and access articles through links such as https://xeu.life/about
  7. Support articles not being listed in the homepage list
  8. Support adding links of friends' blog, and the backend regularly checks and updates the accessible status of links every 20 minutes
  9. Support replying to comment articles/deleting comments
  10. Support sending comment notifications through Webhook
  11. Support automatic identification of the first picture in the article and display it as the header image in the article list
  12. Support inputting tag texts such as "#Blog #Cloudflare" and automatically parsing them into tags
  13. For more features, please refer to https://xeu.life

Documentation

  1. Deployment Documentation

  2. Environment Variables List

  3. SEO Optimization Configuration

  4. Contribution Guide

  5. Code of Conduct

Star History

Star History Chart

License

MIT License

Copyright (c) 2024 Xeu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

rin's People

Contributors

1percentsync avatar oxeu avatar pbk-b avatar sliverkeigo avatar wngtk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rin's Issues

[Help] WORKER_NAME 是指在pages创建的rin,还是要另外在workers中创建项目?

根据部署文档,提到
“配置 GitHub Action
在自己 fork 的仓库中 > Settings > Secrets and Variables > Actions > Repository secrets 点击 New repository secret 创建以下两个密钥:

CLOUDFLARE_ACCOUNT_ID=<你的用户ID>
CLOUDFLARE_API_TOKEN=<你的令牌>
同时你可以在Actions secrets and variables的 Variables 中创建以下变量:

DB_NAME=<数据库名称,默认rin>
WORKER_NAME=<Cloudflare Worker 名称,默认rin-server>”

这里的“rin-server”是指文档前面提到的在Pages中创建的rin?还是指需要在Workers新创建rin-server的项目?

[Help] Referer not found

描述你遇到的问题
前后端正常部署
已在pages设置自定义域
通过自定义域点击"github登录"后转到后端domain/user/github
显示 Referer not found
在使用pages自动分配的域名登录一切正常

[Feature Request] Full support for hashtags

Is your feature request related to the problem? Please describe

Currently, tag support is very rudimentary and only supports display, not querying by tag or viewing tag lists

Describe the solution you want

  • Add a tag list page
  • Add support for clicking on a tag to query related articles
  • Automatically remove duplicate tags
  • Regularly remove unreferenced tags

[Feature Request] 友链编辑与删除

您的功能请求是否与问题相关?请描述

目前友链添加后无法二次编辑于删除

描述您想要的解决方案
添加编辑与删除功能

描述你考虑过的替代方案

其他信息

[Help] 部署前端失败问题描述

描述你遇到的问题
部署前端失败

日志
2024-06-20T05:46:46.31048Z Cloning repository...
2024-06-20T05:46:46.922399Z From https://github.com/zkx9527/word
2024-06-20T05:46:46.922842Z * branch 1478353da849914af47637926fcf02dfbec5d223 -> FETCH_HEAD
2024-06-20T05:46:46.922952Z
2024-06-20T05:46:46.951006Z HEAD is now at 1478353 first commit
2024-06-20T05:46:46.951363Z
2024-06-20T05:46:47.034691Z
2024-06-20T05:46:47.035457Z Using v2 root directory strategy
2024-06-20T05:46:47.058587Z Success: Finished cloning repository files
2024-06-20T05:46:48.923653Z Checking for configuration in a wrangler.toml configuration file (BETA)
2024-06-20T05:46:48.92452Z
2024-06-20T05:46:49.021831Z No wrangler.toml file found. Continuing.
2024-06-20T05:46:49.175603Z Running user-defined pre-build script: asdf install bun latest && asdf global bun latest && bun i
2024-06-20T05:46:51.340452Z Downloading Bun v1.1.15...
2024-06-20T05:46:52.423941Z Archive: /tmp/asdf-bun.H5Ad/bun.zip
2024-06-20T05:46:53.16838Z inflating: /opt/buildhome/.asdf/downloads/bun/1.1.15/bun
2024-06-20T05:46:53.226025Z Installing Bun v1.1.15...
2024-06-20T05:46:53.321585Z Bun v1.1.15 is installed successfully!
2024-06-20T05:46:54.187874Z error: Bun could not find a package.json file to install from
2024-06-20T05:46:54.188228Z note: Run "bun init" to initialize a project
2024-06-20T05:46:54.193512Z Error: Exit with error code: 1
2024-06-20T05:46:54.193744Z at ChildProcess. (/snapshot/dist/run-build.js)
2024-06-20T05:46:54.193871Z at Object.onceWrapper (node:events:652:26)
2024-06-20T05:46:54.193975Z at ChildProcess.emit (node:events:537:28)
2024-06-20T05:46:54.19414Z at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2024-06-20T05:46:54.202897Z Failed: build command exited with code: 1
2024-06-20T05:46:54.998819Z Failed: error occurred while running build command

[Help] 访问/sub/rss.xml提示404

描述你遇到的问题

复现步骤

  1. 代码已升到最新并正常部署,前后端,访问正常;

  2. R2里已生成了rss.xml等文件

  3. 已按文档 设置路由/sub/*指向Rin Worker。

  4. 访问 域名/sub/rss.xml时,提示404
    Error 404
    This object could not be viewed
    You are not authorized to view this object
    This object does not exist or is not publicly accessible at this URL. Check the URL of the object that you're looking for or contact the owner to enable Public access.

  5. 但使用 S3_ACCESS_HOST 能访问到rss.xml文件
    S3_ACCESS_HOST/桶名/cache/rss.xml

期望行为

截图

额外信息

[Feature Request] TOC Support

您的功能请求是否与问题相关?请描述

描述您想要的解决方案

正文侧边目录支持

描述你考虑过的替代方案

其他信息

[Feature Request] 支持分类功能

您的功能请求是否与问题相关?请描述

标签不能很好的起到大类划分的作用,更多用于小板块划分

描述您想要的解决方案

支持分类功能

描述你考虑过的替代方案

其他信息

后端部署完访问无响应

完全按视频操作的,在github加了5个配置:RIN_GITHUB_CLIENT_ID,RIN_GITHUB_CLIENT_SECRET,JWT_SECRET,CLOUDFLARE_ACCOUNT_ID,CLOUDFLARE_API_TOKEN,手动触发Workflow部署完成,访问后端地址,直接无响应(视频中是返回了一个hi 显示在页面)。

五个配置不成功
无响应

请问这个和缺少配置无关吧?视频中作者您也没加S3_BUCKET和S3_REGION这几个配置项,另外如果要加,那么 “然后在公开访问处绑定一个域名用于访问资源,绑定的域名对应于S3_ACCESS_HOST环境变量,S3_ACCESS_HOST=https://image.xeu.life” ,这个S3_ACCESS_HOST绑定的域名是需要自己购买的域名?

[Help] Failed to create D1 database

描述你遇到的问题
Github Actions里run workflow的Deploy时会提示Failed to create D1 "rin"
复现步骤

  1. run workflow的Deploy时

期望行为
成功创建D1 rin

截图
image

额外信息
我在cloudflare里创不创建rin都会报错

[Feature Request] 账号密码登录

您的功能请求是否与问题相关?请描述

接入 Github OAuth 虽然比较简单,但是如果原生支持账号密码登录将会更加方便部署,同时能够解决部分地区访问 GitHub 缓慢导致难以登录的问题

描述您想要的解决方案

支持账号密码登录

描述你考虑过的替代方案

其他信息

同时需要考虑是否增加免登录评论的支持(需要输入一些必须信息)

[Feature Request] 动态配置支持

您的功能请求是否与问题相关?请描述

目前针对 Rin 的所有配置均通过环境变量实现,足以应对一些简单的配置内容,但是对于一些更加复杂的配置则显得繁琐且不便,因此希望增加动态配置的支持,能够在网页动态修改调整配置

描述您想要的解决方案

考虑到可能会存储诸多键值对,每次 Worker 启动都需要至少读取一次配置,其中可能包含数十个键值对读取请求,而 Cloudflare KV 数据库只提供了与 Workers 请求次数数量相同的每日 100k 次读取限制,不太足够使用(如果我的理解存在偏差欢迎指正)。
而 R2 虽然也有读取次数限制,但是得益于 Cloudflare 强大的 CDN 及其缓存机制,几乎能够实现多次请求只花费少量 R2 读取次数的效果,因此最终考虑将配置文件保存在 R2 而不是 KV 中(但是可能存在用户不使用 R2 而使用别家 S3 存储的情况,这个策略对他们其实不够友好,但是目前还没有更好的解决方案)

描述你考虑过的替代方案

其他信息

[Help] FRONTEND_URL 我填写了https://xeu.life或者其他都不行

Fetching FRONTEND_URL
11 | export class PuppeteerError extends Error {
12 | /**
13 | * @internal
14 | */
15 | constructor(message, options) {
16 | super(message, options);
^
ProtocolError: Protocol error (Page.navigate): Cannot navigate to invalid URL
code: "undefined"
at new PuppeteerError (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.js:16:9)
at new ProtocolError (:1:33)
at new Callback (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:93:17)
at create (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:19:26)
at /home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:161:44
at navigate (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:159:37)
at /home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:139:17
at goto (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:134:20)
at /home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:558:26
at goto (/home/runner/work/Rin/Rin/Rin/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:557:20)
Bun v1.1.12 (Linux x64 baseline)
Error: Process completed with exit code 1.

[Bug]D1_ERROR: NOT NULL constraint failed: users.username

Bug 描述
部署后,前端已正常显示。点击“github登陆”,转入后端api地址时,网页出现
D1_ERROR: NOT NULL constraint failed: users.username

cf端日志流 都显示“ok”

期望行为
正常登陆

截图

环境变量

[Feature Request] 支持保存修订记录

您的功能请求是否与问题相关?请描述

  • 修改后无法查看过去的修订记录
  • 同时能更好的支持导入 WordPress 导出的 xml 文件

描述您想要的解决方案

自动保存修订记录,同时可设置是否仅自己可见修订记录

描述你考虑过的替代方案

其他信息

[Bug] 🐛 部分 RSS 客户端要求需要 `content-type` 请求头

Bug 描述
部分 RSS 客户端需要正确的 content-type: application/rss+xml 响应头,如 https://github.com/FreshRSS/FreshRSS

复现步骤

$ curl -I https://bin.zmide.com/?feed=rss2
HTTP/2 200 
server: nginx
date: Thu, 13 Jun 2024 03:57:02 GMT
content-type: application/rss+xml; charset=UTF-8
last-modified: Fri, 07 Jun 2024 13:42:31 GMT
etag: "a1e9a6ed990a9be2dfee53c813b18255"
strict-transport-security: max-age=31536000

$ curl -I https://direct.xeu.life/sub/rss.xml
HTTP/2 404 
date: Thu, 13 Jun 2024 03:57:45 GMT
content-type: text/plain;charset=UTF-8
access-control-allow-origin: *
vary: *
access-control-allow-headers: Authorization, content-type
access-control-allow-methods: *
access-control-expose-headers: *
cf-placement: local-LHR
server: cloudflare
cf-ray: 89xxxxxx1417f-LHR
alt-svc: h3=":443"; ma=86400

期望行为
部分 RSS 客户端需要正确的 content-type: application/rss+xml; charset=UTF-8 响应头

截图
nil

环境变量
nil

[Feature Request] 顶部导航栏收折功能

您的功能请求是否与问题相关?请描述

随着顶部导航栏内容增多,在移动设备上逐渐会出现导航栏文字挤压的问题

描述您想要的解决方案

针对移动端导航栏修改为收折菜单样式,点击菜单按钮再展开完整的导航列表

描述你考虑过的替代方案

其他信息

图片

[Feature Request] 搜索引擎收录优化

您的功能请求是否与问题相关?请描述

由于目前采用前后端分离的架构,不利于 SEO,希望能够通过一些方法优化收录效果

描述您想要的解决方案

通过 Cloudflare 的规则重写功能将爬虫流量全部导向 Workers 处理,返回一些具有基础结构的内容供爬虫收录

描述你考虑过的替代方案

通过优化前端渲染格式寄希望于 Google 强大的渲染后爬取功能,但似乎并没有爬取到站内的链接

其他信息

欢迎提出更好的解决方案

[Feature Request] 对话框优化

您的功能请求是否与问题相关?请描述

当前对话框与提示框均使用浏览器默认提供的 alert 和 confirm,不够美观且体验割裂

描述您想要的解决方案

统一弹窗风格和 api

描述你考虑过的替代方案

其他信息

[Help] SEO Workflow部署失败

描述你遇到的问题
SEO Workflow部署失败
复现步骤

  1. Actions里部署SEO Workflow部署失败

期望行为
成功部署SEO Workflow,或取消部署SEO Workflow,停止给我发部署失败的Email。

截图
image
额外信息

[Bug] 评论显示溢出

Bug 描述

图片

复现步骤

  1. 窄屏
  2. 能够出现自动换行的较长评论

期望行为

不溢出白色背景

截图

环境变量

[Help] 启动开发服务器出现D1_ERROR: no such table

描述你遇到的问题

根据contributing文档配置了相关变量,也设置了[[d1_databases]],并且cf里也创好了相关的表,但启动开发服务器访问端点都出现D1_ERROR: no such table

复现步骤

期望行为

截图

image

额外信息

[Feature Request] 将头像作为网站图标

您的功能请求是否与问题相关?请描述

当前网站图标是通过 client/public/favicon.png 确定的。

描述您想要的解决方案

希望通过 https://wsrv.nl/AVATAR 处理为圆形,并且将圆形外的部分设为透明背景,作为网站图标。

描述你考虑过的替代方案

其他信息

添加GITHUB_CLIENT_ID 出现问题

描述你遇到的问题
在按照添加 CLOUDFLARE_ACCOUNT_ID 与 CLOUDFLARE_API_TOKEN步骤添加GITHUB_CLIENT_ID时被提示secrets不能以 GITHUB_ 开头
复现步骤

  1. 在fork 的仓库中 > Settings > Secrets and Variables > Actions > Repository secrets 点击 New repository secret 创建添加GITHUB_CLIENT_ID
  2. 提示secrets不能以 GITHUB_ 开头

期望行为
获得正确指引

截图

Snipaste_2024-06-07_17-38-37

[Bug] Failed: an internal error occurred

Bug 描述
pages 部署失败

复现步骤

按步骤操作

日志

2024-06-07T02:24:04.217763Z	Cloning repository...
2024-06-07T02:24:04.854586Z	From https://github.com/username/Rin
2024-06-07T02:24:04.855091Z	 * branch            a1e223b285e19b74419af7de57ac7db045cad1fb -> FETCH_HEAD
2024-06-07T02:24:04.855227Z	
2024-06-07T02:24:04.893352Z	HEAD is now at a1e223b fix: invalid page for spider
2024-06-07T02:24:04.89381Z	
2024-06-07T02:24:04.978416Z	
2024-06-07T02:24:04.979145Z	Using v2 root directory strategy
2024-06-07T02:24:05.003931Z	Success: Finished cloning repository files
2024-06-07T02:24:06.568608Z	Checking for configuration in a wrangler.toml configuration file (BETA)
2024-06-07T02:24:06.56923Z	
2024-06-07T02:24:06.667468Z	No wrangler.toml file found. Continuing.
2024-06-07T02:24:07.542274Z	Failed: an internal error occurred. If this continues, contact support: https://cfl.re/3WgEyrH

[Feature Request] 输出xml

您的功能请求是否与问题相关?请描述

RSS方式,方便聚合

描述您想要的解决方案

  • RSS
  • Atom
  • JSON Feed

描述你考虑过的替代方案

其他信息

[Help] 404: No such page!

描述你遇到的问题

复现步骤
依教程部署完毕,

  1. 前端已部署
  2. 后端也已部署(cf上已生成worker和d1数据库)
  3. 已创建github的oauth app
  4. 访问网址,点 GIthub登陆,会 跳转到domian/user/github 显示 404: No such page!

期望行为

截图

额外信息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.