+ {footerHtml &&
}
- © 2024 Powered by Rin
+ © 2024 Powered by Rin
{config.get('rss') && <>
diff --git a/client/src/components/header.tsx b/client/src/components/header.tsx
index 2f6aa2e9..91289fbf 100644
--- a/client/src/components/header.tsx
+++ b/client/src/components/header.tsx
@@ -229,7 +229,7 @@ function SearchButton({ className, onClose }: { className?: string, onClose?: ()
setIsOpened(false)
onClose?.()
}, 100)
- if (value.length != 0)
+ if (value.length !== 0)
setLocation(`/search/${key}`)
}
return (
diff --git a/client/src/components/markdown.tsx b/client/src/components/markdown.tsx
index e97cc0e2..39ae569e 100644
--- a/client/src/components/markdown.tsx
+++ b/client/src/components/markdown.tsx
@@ -365,7 +365,7 @@ export function Markdown({ content }: { content: string }) {
},
};
})
- .filter((slide) => slide.src != "");
+ .filter((slide) => slide.src !== "");
slides.current = (slidesLocal);
}
const index = slidesLocal?.findIndex((slide) => slide.src === src) ?? -1;
diff --git a/client/src/hooks/useTableOfContents.tsx b/client/src/hooks/useTableOfContents.tsx
index ddafe85c..de411f40 100644
--- a/client/src/hooks/useTableOfContents.tsx
+++ b/client/src/hooks/useTableOfContents.tsx
@@ -58,7 +58,7 @@ const useTableOfContents = (selector: string) => {
)
intersectingList.length = 0 // reset array
headers.forEach((header, i) => {
- if (header.getAttribute('data-id') != null) return
+ if (header.getAttribute('data-id') !== null) return
header.setAttribute('data-id', i.toString()) // set data-id
intersectingList.push(false) // increase array length
io.current!.observe(header) // register to observe
diff --git a/client/src/page/feed.tsx b/client/src/page/feed.tsx
index f4118164..de6f6969 100644
--- a/client/src/page/feed.tsx
+++ b/client/src/page/feed.tsx
@@ -72,7 +72,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen
}
function topFeed() {
const isUnTop = !(top > 0)
- const topNew = top === 0 ? 1 : 0;
+ const topNew = isUnTop ? 1 : 0;
// Confirm
showConfirm(
isUnTop ? t("article.top.title") : t("article.untop.title"),
@@ -204,12 +204,12 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen
)}
{counterEnabled &&
- {t("count.pv")}
+ {t("count.pv")}
{feed.pv}
|
- {t("count.uv")}
+ {t("count.uv")}
{feed.uv}
diff --git a/client/src/page/feeds.tsx b/client/src/page/feeds.tsx
index 13fbacc7..fb8c4a31 100644
--- a/client/src/page/feeds.tsx
+++ b/client/src/page/feeds.tsx
@@ -45,7 +45,7 @@ export function FeedsPage() {
},
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
setFeeds({
...feeds,
[type]: data
diff --git a/client/src/page/friends.tsx b/client/src/page/friends.tsx
index d9964a18..5cdb26ad 100644
--- a/client/src/page/friends.tsx
+++ b/client/src/page/friends.tsx
@@ -98,13 +98,13 @@ export function FriendsPage() {
-
+
0} friends={friendsAvailable} />
0} friends={friendsUnavailable} />
0} friends={waitList} />
0} friends={refusedList} />
-
+
{profile && (profile.permission || config.get("friend_apply_enable")) &&
@@ -210,7 +210,7 @@ function Friend({ friend }: { friend: FriendItem }) {
{friend.name}
{friend.health.length == 0 &&
{friend.desc}
}
- {friend.accepted != 1 &&
{statusOption[friend.accepted + 1].label}
}
+ {friend.accepted !== 1 &&
{statusOption[friend.accepted + 1].label}
}
{friend.health.length > 0 &&
{errorHumanize(friend.health)}
}
{(profile?.permission || profile?.id === friend.uid) && <>
- {hashtags.filter(({ feeds }) => feeds > 0).map((hashtag, index) => {
+ {hashtags?.filter(({ feeds }) => feeds > 0).map((hashtag, index) => {
return (
diff --git a/client/src/page/search.tsx b/client/src/page/search.tsx
index 11965b9a..b94d2436 100644
--- a/client/src/page/search.tsx
+++ b/client/src/page/search.tsx
@@ -32,7 +32,7 @@ export function SearchPage({ keyword }: { keyword: string }) {
},
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
setFeeds(data)
setStatus('idle')
}
diff --git a/client/src/page/settings.tsx b/client/src/page/settings.tsx
index b957e7c9..825a3e51 100644
--- a/client/src/page/settings.tsx
+++ b/client/src/page/settings.tsx
@@ -31,7 +31,7 @@ export function Settings() {
}).get({
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
sessionStorage.setItem('config', JSON.stringify(data));
const config = new ConfigWrapper(data, defaultClientConfig)
setClientConfig(config)
@@ -46,7 +46,7 @@ export function Settings() {
}).get({
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
const config = new ConfigWrapper(data, defaultServerConfig)
setServerConfig(config)
}
@@ -66,7 +66,7 @@ export function Settings() {
}, {
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
setMsg(t('settings.import_success$success$skipped', { success: data.success, skipped: data.skipped }))
setMsgList(data.skippedList)
setIsOpen(true);
@@ -97,6 +97,7 @@ export function Settings() {
+
{
await client.config.cache.delete(undefined, {
headers: headersWithAuth()
diff --git a/client/src/page/timeline.tsx b/client/src/page/timeline.tsx
index 83fe7dad..2820c906 100644
--- a/client/src/page/timeline.tsx
+++ b/client/src/page/timeline.tsx
@@ -17,7 +17,7 @@ export function TimelinePage() {
client.feed.timeline.get({
headers: headersWithAuth()
}).then(({ data }) => {
- if (data && typeof data != 'string') {
+ if (data && typeof data !== 'string') {
setLength(data.length)
const groups = Object.groupBy(data, ({ createdAt }) => new Date(createdAt).getFullYear())
setFeeds(groups)
diff --git a/client/src/page/writing.tsx b/client/src/page/writing.tsx
index 99504e68..5bb8839e 100644
--- a/client/src/page/writing.tsx
+++ b/client/src/page/writing.tsx
@@ -62,7 +62,7 @@ async function publish({
if (error) {
showAlert(error.value as string);
}
- if (data && typeof data != "string") {
+ if (data && typeof data !== "string") {
showAlert(t("publish.success"));
Cache.with().clear();
window.location.href = "/feed/" + data.insertedId;
@@ -176,7 +176,7 @@ export function WritingPage({ id }: { id?: number }) {
.split("#")
.filter((tag) => tag !== "")
.map((tag) => tag.trim()) || [];
- if (id != undefined) {
+ if (id !== undefined) {
setPublishing(true)
update({
id,
@@ -451,7 +451,7 @@ export function WritingPage({ id }: { id?: number }) {
No content now. Write on the left side."} />
diff --git a/client/src/state/config.tsx b/client/src/state/config.tsx
index fb522d29..0032b511 100644
--- a/client/src/state/config.tsx
+++ b/client/src/state/config.tsx
@@ -10,7 +10,7 @@ export const defaultClientConfig = new Map(Object.entries({
export const defaultServerConfig = new Map(Object.entries({
"friend_apply_auto_accept": false,
"friend_crontab": true,
- "friend_ua":"Rin-Check/0.1.0"
+ "friend_ua": "Rin-Check/0.1.0"
}))
export class ConfigWrapper {
@@ -22,7 +22,7 @@ export class ConfigWrapper {
}
get
(key: string) {
const value = this.config[key];
- if (value != undefined && value != "") {
+ if (value !== undefined && value !== "") {
return value as T;
}
if (this.defaultConfig.has(key)) {
diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md
index 754563f9..560cbec1 100644
--- a/docs/DEPLOY.md
+++ b/docs/DEPLOY.md
@@ -1,6 +1,6 @@
# 部署
-项目目前处于开发阶段,文档可能未及时更新或存在描述不清,如遇部署失败请提 [Issue](https://github.com/OXeu/Rin/issues/new?assignees=&labels=help+wanted&projects=&template=need-help.md&title=%5BHelp%5D+%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0)
+项目目前处于开发阶段,文档可能未及时更新或存在描述不清,如遇部署失败请提 [Issue](https://github.com/openRin/Rin/issues/new?assignees=&labels=help+wanted&projects=&template=need-help.md&title=%5BHelp%5D+%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0)
> [!TIP]
> 我们在文档末尾追加了完整的部署流程演示视频,以便解决您在部署期间遇到的部分困难
@@ -63,12 +63,12 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey>
>
> 这就是最终的命令
-打开仓库页面:https://github.com/OXeu/Rin
+打开仓库页面:https://github.com/openRin/Rin
## Fork
点击 Fork 按钮 fork 出一个新仓库
-![1000000657](https://github.com/OXeu/Rin/assets/36541432/df3607ca-a8a9-49b8-92ce-6b348afeb13f)
+![1000000657](https://github.com/openRin/Rin/assets/36541432/df3607ca-a8a9-49b8-92ce-6b348afeb13f)
## 前端
@@ -79,20 +79,20 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey>
>
> 下文提到的前端与后端你可以分别等价代换为 Cloudflare Pages 与 Cloudflare Workers,当提到说需要前端地址或者后端地址时,即为 Cloudflare Pages 地址或 Cloudflare Workers 地址,你可以在 Cloudflare 控制面板中通过少量的操作找到这两个地址,如下面的截图所示:
> 前端(Pages)的地址在 `Workers 和 Pages` > 你的 Pages 项目 > `部署` 中可以找到:
-> ![图片](https://github.com/OXeu/Rin/assets/36541432/d9dcc5f2-6930-4487-af4b-0ab52e948114)
+> ![图片](https://github.com/openRin/Rin/assets/36541432/d9dcc5f2-6930-4487-af4b-0ab52e948114)
> 图中的`rin-6qe.pages.dev`,`direct.xeu.life` 都是前端地址,如果有更多的地址,你还可以点击形如 `+2 个域` 的链接查看更多的地址,这些地址都是可以访问的,你可以使用其中任意一个地址,但是需要保持不同地方都填写的是同一个前端地址(如果有多个环境变量要求填写前端地址的话),通常来说前端地址是 `https://rin-6qe.pages.dev` 或 `https://direct.xeu.life` 这样的形式
>
> 后端(Workers)的地址在 `Workers 和 Pages` > 你的 Workers 项目 > `设置` > `触发器` 中可以找到:
-> ![图片](https://github.com/OXeu/Rin/assets/36541432/0a2385b7-94db-4469-bef9-399cc334f1b6)
+> ![图片](https://github.com/openRin/Rin/assets/36541432/0a2385b7-94db-4469-bef9-399cc334f1b6)
> 图中的 `rin.xeu.life` 和 `rin-server.xeu.workers.dev` 都是后端地址,前者是自定义域名,后者是默认分配的域名,你可以使用默认分配的域名,也可以自定义域名,自定义域名需要在 Cloudflare 控制面板中进行配置,在本文档中当要求填写后端地址时,你可以填写形如 `https://rin.xeu.life` 或 `https://rin-server.xeu.workers.dev`的地址,但需保持不同地方都填写的是同一个后端地址(如果有多个环境变量要求填写后端地址的话)
登录 [Cloudflare](https://dash.cloudflare.com) 控制台,进入 `Workers 和 Pages` 页面,点击`创建应用程序`,选择 Pages
-![1000000658](https://github.com/OXeu/Rin/assets/36541432/35d4f9e3-3af3-4ec8-8060-2a352f4d51ae)
+![1000000658](https://github.com/openRin/Rin/assets/36541432/35d4f9e3-3af3-4ec8-8060-2a352f4d51ae)
点击连接到 Git 连接自己的 GitHub 账号并选择 Fork 的存储库
-![1000000666](https://github.com/OXeu/Rin/assets/36541432/e3b6da75-1a5f-46ec-9820-636cc5238023)
+![1000000666](https://github.com/openRin/Rin/assets/36541432/e3b6da75-1a5f-46ec-9820-636cc5238023)
点击 `开始设置` 进入配置页面:
@@ -105,7 +105,7 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey>
路径:<留空>
```
-![1000000659](https://github.com/OXeu/Rin/assets/36541432/98fb3021-932b-4bfa-8118-3378f98ff628)
+![1000000659](https://github.com/openRin/Rin/assets/36541432/98fb3021-932b-4bfa-8118-3378f98ff628)
环境变量复制以下内容,根据自身情况修改变量值:
@@ -122,15 +122,15 @@ SKIP_DEPENDENCY_INSTALL=true
UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i
```
-![1000000660](https://github.com/OXeu/Rin/assets/36541432/0fe9276f-e16f-4b8a-87c5-14de582c9a3a)
+![1000000660](https://github.com/openRin/Rin/assets/36541432/0fe9276f-e16f-4b8a-87c5-14de582c9a3a)
点击`保存并部署`,等待构建部署,不出意外的话约 30s 后即可部署完成:
-![1000000661](https://github.com/OXeu/Rin/assets/36541432/979810b7-3f6f-415b-a8e8-5b08b0da905d)
+![1000000661](https://github.com/openRin/Rin/assets/36541432/979810b7-3f6f-415b-a8e8-5b08b0da905d)
点击打开即可看见前端页面
-![1000000662](https://github.com/OXeu/Rin/assets/36541432/57c61ad6-c324-48e4-a28f-a1708fd7d41a)
+![1000000662](https://github.com/openRin/Rin/assets/36541432/57c61ad6-c324-48e4-a28f-a1708fd7d41a)
前端就全部部署完成啦 🎉
@@ -169,7 +169,7 @@ UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i
ID 随意点击一个自己绑定的域名,进入后在右侧(需要向下滑动一段距离)可以找到`账户ID`
创建 API 令牌:点击右上角`头像` > `我的个人资料` > `API 令牌` > `创建令牌`,模板选择`编辑 Cloudflare Workers`:
-![1000000663](https://github.com/OXeu/Rin/assets/36541432/3a34a2ad-b993-47fe-965d-31cca4a8e92a)
+![1000000663](https://github.com/openRin/Rin/assets/36541432/3a34a2ad-b993-47fe-965d-31cca4a8e92a)
创建完成后保存令牌
@@ -232,7 +232,7 @@ https://<你的后端地址>/user/github/callback
```
这里附上我的参数
-![GitHub OAuth 配置](https://github.com/OXeu/Rin/assets/36541432/74ab8d16-93ca-4919-beec-4beb7a2003a6)
+![GitHub OAuth 配置](https://github.com/openRin/Rin/assets/36541432/74ab8d16-93ca-4919-beec-4beb7a2003a6)
随后配置环境变量中 OAuth 部分
@@ -243,7 +243,7 @@ https://<你的后端地址>/user/github/callback
理论上支持任意遵循 S3 协议的对象存储服务,这里只介绍接入 Cloudflare R2 的操作
Cloudflare 面板中点击 `R2` > `创建存储桶`,填写名称,选择距离自己近的位置:
-![1000000665](https://github.com/OXeu/Rin/assets/36541432/17c5ad7b-8a3a-49b2-845a-8d043484aa63)
+![1000000665](https://github.com/openRin/Rin/assets/36541432/17c5ad7b-8a3a-49b2-845a-8d043484aa63)
创建存储桶之后进入存储桶详情页 > `设置`,复制 S3 API 地址,去除末尾的存储桶名称后填入 `S3_ENDPOINT`,如:
@@ -276,6 +276,6 @@ S3_ACCESS_HOST=https://image.xeu.life
由于时间原因未对以下视频做剪辑与后期说明处理,如果对于部署流程不了解或疑惑可参考视频步骤
-https://github.com/OXeu/Rin/assets/36541432/3ed98e93-2cc3-4e5f-a885-4d16a48500c3
+https://github.com/openRin/Rin/assets/36541432/3ed98e93-2cc3-4e5f-a885-4d16a48500c3
diff --git a/docs/SEO.md b/docs/SEO.md
index 7ecdf94c..fcdb460e 100644
--- a/docs/SEO.md
+++ b/docs/SEO.md
@@ -41,7 +41,7 @@ S3_SECRET_ACCESS_KEY=<你的S3SecretAccessKey>
```
xeu.life/seo/*
```
-![图片](https://github.com/OXeu/Rin/assets/36541432/ed0ecc72-f61f-4460-8ede-4475ca54ffcb)
+![图片](https://github.com/openRin/Rin/assets/36541432/ed0ecc72-f61f-4460-8ede-4475ca54ffcb)
Worker 选择为部署的 Worker,点击保存。
@@ -58,6 +58,6 @@ concat("/seo",http.request.uri.path)
选择`保留查询`
参考配置截图:
-![转换规则](https://github.com/OXeu/Rin/assets/36541432/657e9546-1dc0-4390-9bfc-5d3eb725e792)
+![转换规则](https://github.com/openRin/Rin/assets/36541432/657e9546-1dc0-4390-9bfc-5d3eb725e792)
点击部署,即可完成 SEO 配置。
diff --git a/scripts/render.ts b/scripts/render.ts
index 6244ce38..9fc84484 100644
--- a/scripts/render.ts
+++ b/scripts/render.ts
@@ -82,7 +82,7 @@ async function fetchPage(url: string) {
const anchors = Array.from(document.querySelectorAll('a'));
return anchors.map(anchor => anchor.href);
});
- for (const link of links.filter(link => (link.startsWith(baseUrl) || (containsKey != '' && link.includes(containsKey))))) {
+ for (const link of links.filter(link => (link.startsWith(baseUrl) || (containsKey !== '' && link.includes(containsKey))))) {
const linkWithoutHash = link.split('#')[0];
if (fetchedLinks.has(linkWithoutHash)) {
continue;
diff --git a/server/package.json b/server/package.json
index fe607cee..fc8caa49 100644
--- a/server/package.json
+++ b/server/package.json
@@ -24,7 +24,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.583.0",
"@aws-sdk/s3-request-presigner": "^3.583.0",
- "@elysiajs/cors": "^1.0.2",
+ "@elysiajs/cors": "1.0.2",
"@elysiajs/cron": "^1.0.3",
"@elysiajs/eden": "^1.0.13",
"@elysiajs/server-timing": "^1.0.2",
diff --git a/server/src/server.ts b/server/src/server.ts
index 0c9bd274..c16e2d1d 100644
--- a/server/src/server.ts
+++ b/server/src/server.ts
@@ -17,7 +17,7 @@ export const app = () => new Elysia({ aot: false })
origin: '*',
methods: '*',
allowedHeaders: [
- 'Authorization',
+ 'authorization',
'content-type'
],
maxAge: 600,
diff --git a/server/src/services/feed.ts b/server/src/services/feed.ts
index df0bf2ea..9cb535d8 100644
--- a/server/src/services/feed.ts
+++ b/server/src/services/feed.ts
@@ -398,7 +398,7 @@ export function FeedService() {
const feedItems: FeedItem[] = items?.map((item: any) => {
const createdAt = new Date(item?.['wp:post_date']);
const updatedAt = new Date(item?.['wp:post_modified']);
- const draft = item?.['wp:status'] != 'publish';
+ const draft = item?.['wp:status'] !== 'publish';
const contentHtml = item?.['content:encoded'];
const content = html2md(contentHtml);
const summary = content.length > 100 ? content.slice(0, 100) : content;