简单
免费搭建,简单部署
diff --git a/404.html b/404.html new file mode 100644 index 000000000..0bc0fff73 --- /dev/null +++ b/404.html @@ -0,0 +1,23 @@ + + +
+ + +前往go-cqhttp release下载对应系统版本。
解压
Windows下请使用自己熟悉的解压软件自行解压
Linux下在命令行中输入tar -xzvf [文件名] 使用
Windows 标准方法
双击,根据提示生成运行脚本go-cqhttp_*.exe
[WARNING]: 尝试加载配置文件 config.yml 失败: 文件不存在 [INFO]: 默认配置文件已生成,请编辑 config.yml 后重启程序.
配置文件请参考下方config.yml
config.yml配置好后 再次双击运行脚本
[INFO]: 登录成功 欢迎使用: balabala
如出现需要认证的信息, 请自行认证设备。
此时, 基础配置完成
Linux 标准方法
通过 SSH 连接到服务器
cd到解压目录
输入 , 运行 ./go-cqhttp
[WARNING]: 尝试加载配置文件 config.yml 失败: 文件不存在 [INFO]: 默认配置文件已生成,请编辑 config.yml 后重启程序.
配置config.yml
+# go-cqhttp 默认配置文件
+
+account: # 账号相关
+ uin: # QQ账号
+ password: '' # 密码为空时使用扫码登录
+ encrypt: false # 是否开启密码加密
+ status: 0 # 在线状态 请参考 https://docs.go-cqhttp.org/guide/config.html#在线状态
+ relogin: # 重连设置
+ delay: 3 # 首次重连延迟, 单位秒
+ interval: 3 # 重连间隔
+ max-times: 0 # 最大重连次数, 0为无限制
+
+ # 是否使用服务器下发的新地址进行重连
+ # 注意, 此设置可能导致在海外服务器上连接情况更差
+ use-sso-address: true
+
+heartbeat:
+ # 心跳频率, 单位秒
+ # -1 为关闭心跳
+ interval: 5
+
+message:
+ # 上报数据类型
+ # 可选: string,array
+ post-format: string
+ # 是否忽略无效的CQ码, 如果为假将原样发送
+ ignore-invalid-cqcode: false
+ # 是否强制分片发送消息
+ # 分片发送将会带来更快的速度
+ # 但是兼容性会有些问题
+ force-fragment: false
+ # 是否将url分片发送
+ fix-url: false
+ # 下载图片等请求网络代理
+ proxy-rewrite: ''
+ # 是否上报自身消息
+ report-self-message: false
+ # 移除服务端的Reply附带的At
+ remove-reply-at: false
+ # 为Reply附加更多信息
+ extra-reply-data: false
+
+output:
+ # 日志等级 trace,debug,info,warn,error
+ log-level: warn
+ # 是否启用 DEBUG
+ debug: false # 开启调试模式
+
+# 默认中间件锚点
+default-middlewares: &default
+ # 访问密钥, 强烈推荐在公网的服务器设置
+ access-token: ''
+ # 事件过滤器文件目录
+ filter: ''
+ # API限速设置
+ # 该设置为全局生效
+ # 原 cqhttp 虽然启用了 rate_limit 后缀, 但是基本没插件适配
+ # 目前该限速设置为令牌桶算法, 请参考:
+ # https://baike.baidu.com/item/%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95/6597000?fr=aladdin
+ rate-limit:
+ enabled: true # 是否启用限速
+ frequency: 1 # 令牌回复频率, 单位秒
+ bucket: 1 # 令牌桶大小
+
+database: # 数据库相关设置
+ leveldb:
+ # 是否启用内置leveldb数据库
+ # 启用将会增加10-20MB的内存占用和一定的磁盘空间
+ # 关闭将无法使用 撤回 回复 get_msg 等上下文相关功能
+ enable: true
+
+# 连接服务列表
+servers:
+ # 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
+ #- http: # http 通信
+ #- ws: # 正向 Websocket
+ #- ws-reverse: # 反向 Websocket
+ #- pprof: #性能分析服务器
+ # HTTP 通信设置
+ - http:
+ # 服务端监听地址
+ host: 127.0.0.1
+ # 服务端监听端口
+ port: 5700
+ # 反向HTTP超时时间, 单位秒
+ # 最小值为5,小于5将会忽略本项设置
+ timeout: 5
+ middlewares:
+ <<: *default # 引用默认中间件
+ # 反向HTTP POST地址列表
+ post:
+ #- url: '' # 地址
+ # secret: '' # 密钥
+ #- url: 127.0.0.1:5701 # 地址
+ # secret: '' # 密钥
再次运行./go-cqhttp
[INFO]: 登录成功 欢迎使用: balabala
如出现需要认证的信息, 请自行认证设备。
此时, 基础配置完成
在twikoo中QQ私有化API配置项填写如下内容
QQ号 http://你的IP地址:端口号(或者域名)/send_private_msg?user_id=QQ号?token=你配置的token
QQ群 http://你的IP地址:端口号(或者域名)/send_group_msg?token=你配置的token?group_id=群号
配置完成
`,33),h=[p];function k(t,e,r,d,E,g){return a(),i("div",null,h)}const A=s(l,[["render",k]]);export{c as __pageData,A as default}; diff --git a/assets/QQ_API.md.CjBeVHHO.lean.js b/assets/QQ_API.md.CjBeVHHO.lean.js new file mode 100644 index 000000000..7297b4952 --- /dev/null +++ b/assets/QQ_API.md.CjBeVHHO.lean.js @@ -0,0 +1 @@ +import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.aNBt3w9_.js";const c=JSON.parse('{"title":"QQ私有化部署文档","description":"","frontmatter":{},"headers":[],"relativePath":"QQ_API.md","filePath":"QQ_API.md","lastUpdated":null}'),l={name:"QQ_API.md"},p=n("",33),h=[p];function k(t,e,r,d,E,g){return a(),i("div",null,h)}const A=s(l,[["render",k]]);export{c as __pageData,A as default}; diff --git a/assets/api.md.BDdCdCq-.js b/assets/api.md.BDdCdCq-.js new file mode 100644 index 000000000..5915dba76 --- /dev/null +++ b/assets/api.md.BDdCdCq-.js @@ -0,0 +1,60 @@ +import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.aNBt3w9_.js";const g=JSON.parse('{"title":"API 文档","description":"","frontmatter":{},"headers":[],"relativePath":"api.md","filePath":"api.md","lastUpdated":null}'),l={name:"api.md"},h=n(`通过 Twikoo API,主题开发者可以实现一些特殊的功能,例如:在文章列表显示文章评论数,在首页显示最新评论,等。
调用 Twikoo API 前,不需要 执行 twikoo.init()
。
批量获取文章评论数。
>= 0.2.7
twikoo.getCommentsCount({
+ envId: '您的环境id', // 环境 ID
+ // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,如果您的环境地域不是上海,需传此参数
+ urls: [ // 不包含协议、域名、参数的文章路径列表,必传参数
+ '/2020/10/post-1.html',
+ '/2020/11/post-2.html',
+ '/2020/12/post-3.html'
+ ],
+ includeReply: false // 评论数是否包括回复,默认:false
+}).then(function (res) {
+ console.log(res);
+ // 返回示例: [
+ // { url: '/2020/10/post-1.html', count: 10 },
+ // { url: '/2020/11/post-2.html', count: 0 },
+ // { url: '/2020/12/post-3.html', count: 20 }
+ // ]
+}).catch(function (err) {
+ // 发生错误
+ console.error(err);
+});
获取最新评论。
>= 0.2.7
twikoo.getRecentComments({
+ envId: '您的环境id', // 环境 ID
+ // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,如果您的环境地域不是上海,需传此参数
+ urls: [ // 要求云函数版本 >= 1.6.27。不包含协议、域名、参数的文章路径列表,不传默认获取所有最新评论
+ '/2020/10/post-1.html',
+ '/2020/11/post-2.html',
+ '/2020/12/post-3.html'
+ ],
+ pageSize: 10, // 获取多少条,默认:10,最大:100
+ includeReply: false // 是否包括最新回复,默认:false
+}).then(function (res) {
+ console.log(res);
+ // 返回 Array,包含最新评论的
+ // * id: 评论 ID
+ // * url: 评论地址
+ // * nick: 昵称
+ // * mailMd5: 邮箱的 MD5 值,可用于展示头像
+ // * link: 网址
+ // * comment: HTML 格式的评论内容
+ // * commentText: 纯文本格式的评论内容
+ // * created: 评论时间,格式为毫秒级时间戳
+ // * avatar: 头像地址(0.2.9 新增)
+ // * relativeTime: 相对评论时间,如 “1 小时前”(0.2.9 新增)
+ // 返回示例: [ // 从新到旧顺序
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 },
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 },
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 }
+ // ]
+}).catch(function (err) {
+ // 发生错误
+ console.error(err);
+});
Twikoo 成功挂载后的回调函数。
环境 ID 错误、网络异常、挂载失败等情况时不会触发。
>= 0.5.2
twikoo.init({
+ ......
+}).then(function () {
+ console.log('Twikoo 加载完成');
+});
评论加载成功后的回调函数。
发表评论后自动刷新评论时、加载下一页评论时,也会触发。
评论加载失败时不会触发。
>= 0.5.2
twikoo.init({
+ ......,
+ onCommentLoaded: function () {
+ console.log('评论加载完成');
+ }
+});
部署方式 | 推荐度 | 描述 |
---|---|---|
腾讯云一键部署 | ★☆☆☆☆ | 虽然方便,但是仅支持按量计费环境——也就是说,一键部署的环境,当免费资源用尽后,将会产生费用。且按量计费环境无法切换为包年包月环境。免费额度数据库读操作数只有 500 次 / 天,无法支撑 Twikoo 的运行需求。 |
腾讯云手动部署 | ★★☆☆☆ | 手动部署到腾讯云云开发环境,在中国大陆访问速度较快。需要付费购买环境才能部署。 |
腾讯云命令行部署 | ★☆☆☆☆ | 仅针对有 Node.js 经验的开发者。 |
Vercel 部署 | ★★★☆☆ | 适用于想要免费部署的用户,在中国大陆访问速度较慢甚至无法访问,绑定自己的域名可以提高访问速度。 |
Railway 部署 | ★★☆☆☆ | 有免费额度但不足以支持一个月连续运行,部署简单,适合全球访问。 |
Zeabur 部署 | ★☆☆☆☆ | 需要绑定支付宝或信用卡,部署简单,适合中国大陆访问,免费计划环境随时可能会被删除。 |
Netlify 部署 | ★★★★☆ | 有充足的免费额度,中国大陆访问速度不错。 |
Hugging Face 部署 | ★★★★☆ | 免费,中国大陆访问速度不错。允许通过 Cloudflare Tunnels 自定义域名。 |
AWS Lambda 部署 | ★★★☆☆ | 全球最大的云平台,适合已经使用 AWS 全家桶的用户。 |
Cloudflare workers 部署 | ★★☆☆☆ | 部署需使用命令行,冷启动时间较短,功能有部分限制。 |
私有部署 | ★★☆☆☆ | 适用于有服务器的用户,需要自行申请 HTTPS 证书。 |
私有部署 (Docker) | ★★★☆☆ | 适用于有服务器的用户,需要自行申请 HTTPS 证书。 |
如果您打算部署到一个现有的云开发环境,请直接从第 3 步开始。
提示
twikoo.init()
时额外指定环境 region: "ap-guangzhou"
包年包月
,套餐版本基础版 1
,超出免费额度不会收费twikoo
,创建方式请选择:空白函数
,运行环境请选择:Nodejs 16.13
,函数内存请选择:128MB
,点击“下一步”exports.main = require('twikoo-func').main
package.json
,回车{ "dependencies": { "twikoo-func": "1.6.38" } }
注意
[FUNCTIONS_EXECUTE_FAIL] Error: EACCES: permission denied, open '/var/user/index.js'
如果您打算部署到一个现有的云开发环境,请直接从第 3 步开始。
git clone https://github.com/twikoojs/twikoo.git # 或 git clone https://e.coding.net/imaegoo/twikoo/twikoo.git
+cd twikoo
如果您没有安装 Git,也可以从 Release 页面下载最新的 Source code
如果您所在的地区访问 Github 速度慢,也可以尝试另一个仓库地址:https://imaegoo.coding.net/public/twikoo/twikoo/git
npm install -g yarn # 已安装 yarn 可以跳过此步
+yarn install
yarn run login
yarn deploy -e 您的环境id
注意
Vercel 部署的环境需配合 1.4.0 以上版本的 twikoo.js 使用
默认域名 *.vercel.app
在中国大陆访问速度较慢甚至无法访问,绑定自己的域名可以提高访问速度
MONGODB_URI
,值为前面记录的数据库连接字符串https://
前缀,例如 https://xxx.vercel.app
)即为您的环境 id注意
Railway 部署的环境需配合 1.4.0 以上版本的 twikoo.js 使用
请一定要创建 MongoDB,不创建 MongoDB 也能正常使用,但重新部署后数据会丢失!
PORT
右边输入 8080
然后点 AddMONGOHOST
、MONGOPASSWORD
、MONGOPORT
、MONGOUSER
和 MONGO_URL
环境变量。mytwikoo.up.railway.app
)https://
加域名(例如 https://mytwikoo.up.railway.app
)注意
Zeabur 部署的环境需配合 1.4.0 以上版本的 twikoo.js 使用
请一定要创建 MongoDB,不创建 MongoDB 也能正常使用,但重新部署后数据会丢失!
无需配置数据库连接字符串! Zeabur 已自动配置
mytwikoo.zeabur.app
)https://
加域名(例如 https://mytwikoo.zeabur.app
)注意
Netlify 部署的环境需配合 1.4.0 以上版本的 twikoo.js 使用
Netlify 免费等级(Functions Level 0)支持每月 125,000 请求次数和 100 小时函数计算时长
MONGODB_URI
,Value 输入前面记录的数据库连接字符串,点击 Deploy twikoo-netlifyhttps://xxx.netlify.app
)https://
前缀和 /.netlify/functions/twikoo
后缀,例如 https://xxx.netlify.app/.netlify/functions/twikoo
)即为您的环境 idMONGODB_URI
,Value 输入前面记录的数据库连接字符串,点击 SaveDockerfile
,在 Edit 区域输入以下内容FROM imaegoo/twikoo
+ENV TWIKOO_PORT 7860
+EXPOSE 7860
https://xxx-xxx.hf.space
)即为您的环境 id自定义域名教程由 Hoshino-Yumetsuki 提供
ps:除了
CF_ZERO_TRUST_TOKEN
这个环境变量以外,其他环境变量的配置方式与上一步相同
src\\server\\hf-space
CF_ZERO_TRUST_TOKEN
,值是 Tunnels 给的令牌(删掉 cloudflared.exe service install
,只保留令牌部分)src/server/aws-lambda/terraform
目录中 Terraform 代码创建 AWS 资源。lambda_function_url
打印在屏幕上,您也可以使用 terraform output
获取这一 URL,如:$ terraform output
+lambda_function_url = "https://axtoiiithbcexamplegq7ozalu0cnkii.lambda-url.us-west-2.on.aws/"
该 URL 即为您的环境 ID,请记下这一 URL 用于前端配置。
请参考 github.com/twikoojs/twikoo-cloudflare
注意
私有部署的环境需配合 1.6.0 或以上版本的 twikoo.js 使用
私有部署对服务器系统没有要求,Windows、Ubuntu、CentOS、macOS 等常用系统均支持。
私有部署涉及终端操作、申请证书、配置反向代理或负载均衡等高级操作,如果对这些不太了解,建议优先选择其他方式部署。
npm i -g tkserver
名称 | 描述 | 默认值 |
---|---|---|
MONGODB_URI | MongoDB 数据库连接字符串,不传则使用 lokijs | null |
MONGO_URL | MongoDB 数据库连接字符串,不传则使用 lokijs | null |
TWIKOO_DATA | lokijs 数据库存储路径 | ./data |
TWIKOO_PORT | 端口号 | 8080 |
TWIKOO_THROTTLE | IP 请求限流,当同一 IP 短时间内请求次数超过阈值将对该 IP 返回错误 | 250 |
TWIKOO_LOCALHOST_ONLY | 为true 时只监听本地请求,使得 nginx 等服务器反代之后不暴露原始端口 | null |
TWIKOO_LOG_LEVEL | 日志级别,支持 verbose / info / warn / error | info |
TWIKOO_IP_HEADERS | 在一些特殊情况下使用,如使用了CloudFlare CDN 它会将请求 IP 写到请求头的 cf-connecting-ip 字段上,为了能够正确的获取请求 IP 你可以写成 ['headers.cf-connecting-ip'] | [] |
tkserver
http://服务端IP:8080
测试服务是否启动成功https://
加域名(例如 https://twikoo.yourdomain.com
)提示
nohup tkserver >> tkserver.log 2>&1 &
命令后台启动TWIKOO_PORT=1234 tkserver
启动。TWIKOO_PORT=1234 tkserver
设置开机启动注意
私有部署的环境需配合 1.6.0 或以上版本的 twikoo.js 使用
私有部署涉及终端操作、申请证书、配置反向代理或负载均衡等高级操作,如果对这些不太了解,建议优先选择其他方式部署。
docker run --name twikoo -e TWIKOO_THROTTLE=1000 -p 8080:8080 -v \${PWD}/data:/app/data -d imaegoo/twikoo
version: '3'
+services:
+ twikoo:
+ image: imaegoo/twikoo
+ container_name: twikoo
+ restart: unless-stopped
+ ports:
+ - 8080:8080
+ environment:
+ TWIKOO_THROTTLE: 1000
+ volumes:
+ - ./data:/app/data
注意
因图形化配置界面已上线,此文档已废弃且不再维护,其中的内容可能已经过时
类型: String
默认值: null
必要性: false
示例: 虹墨空间站
博客、站点名称。
类型: String
默认值: null
必要性: false
示例: https://www.imaegoo.com
博客、站点地址。
类型: String
默认值: null
必要性: false
示例: 12345@qq.com
博主的邮箱地址,用于邮件通知、博主标识。
类型: String
默认值: null
必要性: false
示例: 8651783ed123
反垃圾评论 API key。
类型: String
默认值: null
必要性: false
示例: SCT1364TKdsiGjGvyAZNYDVnuHW12345
Server酱微信推送的 SCKEY
类型: String
默认值: null
必要性: false
示例: blog@imaegoo.com
邮件通知邮箱地址。对于大多数邮箱服务商,SENDER_EMAIL
必须和 SMTP_USER
保持一致,否则无法发送邮件。
类型: String
默认值: null
必要性: false
示例: 虹墨空间站评论提醒
邮件通知标题。
类型: String
默认值: null
必要性: false
示例: qiye.aliyun
邮件通知邮箱服务商。
完整列表请参考:Supported services
类型: String
默认值: null
必要性: false
示例: blog@imaegoo.com
邮件通知邮箱用户名。
类型: String
默认值: null
必要性: false
示例: password
邮件通知邮箱密码,QQ邮箱请填写授权码。
',36),c=[l];function d(i,n,s,h,b,p){return o(),a("div",null,c)}const _=e(t,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/configuration.md.Cutop-pC.lean.js b/assets/configuration.md.Cutop-pC.lean.js new file mode 100644 index 000000000..a11ced52e --- /dev/null +++ b/assets/configuration.md.Cutop-pC.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o,a5 as r}from"./chunks/framework.aNBt3w9_.js";const u=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"configuration.md","filePath":"configuration.md","lastUpdated":null}'),t={name:"configuration.md"},l=r("",36),c=[l];function d(i,n,s,h,b,p){return o(),a("div",null,c)}const _=e(t,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/en_api.md.ZSRIbW5p.js b/assets/en_api.md.ZSRIbW5p.js new file mode 100644 index 000000000..5e6fe800c --- /dev/null +++ b/assets/en_api.md.ZSRIbW5p.js @@ -0,0 +1,55 @@ +import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.aNBt3w9_.js";const g=JSON.parse('{"title":"API reference","description":"","frontmatter":{},"headers":[],"relativePath":"en/api.md","filePath":"en/api.md","lastUpdated":null}'),e={name:"en/api.md"},t=n(`Through Twikoo API, theme developers can implement some special features, such as displaying the number of article comments in the article list, displaying the latest comments on the home page, etc.
It is not necessary to execute twikoo.init()
before calling the Twikoo API.
Get the number of article comments in batch.
>= 0.2.7
twikoo.getCommentsCount({
+ envId: 'Environment ID', // Tencent CloudBase Environment ID
+ // region: 'ap-guangzhou', // Environment locale, default is ap-shanghai, if your environment locale is not Shanghai, you need to pass this parameter
+ urls: [ // List of article paths without protocols, domains and parameters. It is a mandatory parameter
+ '/2020/10/post-1.html',
+ '/2020/11/post-2.html',
+ '/2020/12/post-3.html'
+ ],
+ includeReply: false // Whether the number of comments includes replies, the default parameter is false
+}).then(function (res) {
+ console.log(res);
+ // example: [
+ // { url: '/2020/10/post-1.html', count: 10 },
+ // { url: '/2020/11/post-2.html', count: 0 },
+ // { url: '/2020/12/post-3.html', count: 20 }
+ // ]
+}).catch(function (err) {
+ // If an error occurs
+ console.error(err);
+});
Get the latest comments.
>= 0.2.7
twikoo.getRecentComments({
+ envId: '您的环境id', // Tencent CloudBase Environment ID
+ // region: 'ap-guangzhou', // Environment locale, default is ap-shanghai, if your environment locale is not Shanghai, you need to pass this parameter
+ pageSize: 10, // Get how many bars, the default parameter is 10, the maximum parameter is 100
+ includeReply: false // Whether to include the latest reply, the default parameter is false
+}).then(function (res) {
+ console.log(res);
+ // Returns Array with the latest comments
+ // * id: comment ID
+ // * url: address of the comment
+ // * nick: nickname
+ // * mailMd5: The MD5 value of the mailbox, which can be used to display the avatar
+ // * link: URL
+ // * comment: the content of the comment in HTML format
+ // * commentText: comment content in plain text format
+ // * created: comment time, in millisecond timestamp format
+ // * avatar: the address of the avatar (new in 0.2.9)
+ // * relativeTime: relative comment time, e.g. "1 hour ago" (new in 0.2.9)
+ // Return example: [ // order from new to old
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 }
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 },
+ // { id: '', url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 }
+ // ]
+}).catch(function (err) {
+ // If an error occurs
+ console.error(err);
+});
Callback function after Twikoo is successfully mounted.
It will not be triggered in case of environment ID error, network exception, mount failure, etc.
>= 0.5.2
twikoo.init({
+ ......
+}).then(function () {
+ console.log('Twikoo is ready to go!');
+});
Callback function after comments are loaded successfully.
It will also be triggered when the comment is automatically refreshed after posting and when the next page of comments is loaded.
It will not be triggered when the comment fails to load.
>= 0.5.2
twikoo.init({
+ ......,
+ onCommentLoaded: function () {
+ console.log('Comment loading complete');
+ }
+});
https://gravatar.com Register and set your avatar by email and leave the same email when commenting.
Visitors can also comment by entering their digital QQ email address and using their QQ avatar.
云开发控制台Edit the configuration, delete the config.ADMIN_PASS
configuration item, and then go to the Twikoo administration panel to reset the password.
You can add where you need to show the number of article visits:
<span id="twikoo_visitors">0</span>
to display the number of visits. We do not support site-wide visit statistics at the moment.
Please fill in viagra-test-123
as a nickname, or akismet-guaranteed-spam@example.com
as an email address to post a comment, which will definitely be considered as a spam comment.
Note that due to the slow response time of the Akismet service (about 6 seconds), which affects the user experience, Twikoo adopts a "release first, detect later" policy, and spam comments will be visible for a short time after they are posted.
环境总览See resource usage. twikoo consumes database and cloud functions, both with a free usage of -
The memory consumption of Twikoo cloud functions is constant at 0.1GB, which means that Twikoo cloud functions have a running time of up to 400,000 seconds per month, and the bottleneck of free resources is mainly in the daily read limit of the database. It is recommended that webmasters pay attention to the usage of free resources.
Twikoo supports Katex formulas, but to limit the package size of Twikoo, Twikoo does not have the full Katex built-in, you need to load katex.js additionally in the page.
example
<head>
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></script>
+</head>
After loading, you can send $$c = \\pm\\sqrt{a^2 + b^2}$$
to test the effect.
You can also pass in a custom katex configuration during twikoo.init
, see Katex Auto-render Extension for details.
twikoo.init({
+ envId: 'Environment id',
+ el: '#tcomment',
+ katex: {
+ delimiters: [
+ { left: '$$', right: '$$', display: true },
+ { left: '$', right: '$', display: false },
+ { left: '\\\\(', right: '\\\\)', display: false },
+ { left: '\\\\[', right: '\\\\]', display: true }
+ ],
+ throwOnError: false
+ }
+});
Twikoo supports access to Tencent Cloud Text Content Detection, which uses deep learning technology to identify harmful content involving pornography, politics, terrorism, etc. It also supports user-configurable thesaurus to combat customized offending text.
Tencent Cloud text content detection is a paid service, offering a 1-month free trial, after which the price is 25 RMB per 10,000 entries. If you don't have high requirements for anti-spam comments, you can also use the free Akismet.
How to apply for Tencent Cloud Text Content Inspection?
After success, webmasters can configure custom text content filtering in Tencent Cloud Console - Custom Library Management.
Akismet (Automattic Kismet) is a widely used spam filtering system by Matt Mullenweg, the founder of WordPress, Akismet is also the default plugin installed in WordPress and is very widely used. The goal of the design is to help blog sites to filter spam messages.
Generally, after configuring the login private key, the login private key is downloaded again, which causes the previously configured login private key to be invalid.
Solution: Go to Cloud Development Console, database, delete the config, and then reconfigure the private key.
If it is a cloud function deployed by Vercel, please configure foreign mail service providers to avoid being judged as spam behavior by mail service providers. If it is other reasons, please go to Twikoo management panel, find mail test function, enter your personal mailbox and troubleshoot the reasons according to the test results.
In order to avoid performance problems caused by frequent mailbox checking, the mail configuration has a cache of about 10 minutes, if you are sure the configuration is fine but the test fails, you can wait for 10 minutes and then test again.
The Tencent Cloud environment comes with cloud storage, so you can upload images directly in the Tencent Cloud environment, and the images are saved in the cloud storage. However, Vercel environment does not, the upload image function relies on third party image bed, please configure the image bed in the admin panel, Twikoo supports the following image bed:
Bed | Address | Features |
---|---|---|
qcloud | None | Tencent Cloud environment comes with it, can be viewed in Cloud Development - Cloud Storage |
7bu | https://7bu.top | Go to No Bed, powered by 杜老师, no free packages |
smms | https://sm.ms | SMMS image bed, there is a free package, please register your account, IMAGE_CDN_TOKEN can be obtained in Dashboard |
lsky-pro | Private Deployment | LankenGraphics 2.0 version, IMAGE_CDN please configure the URL address of the home page of the graph bed (such as https://7bu.top ), IMAGE_CDN_TOKEN get way please refer to the tutorial 杜老师 said the graph bed: new version Go not to the bed Token acquisition and emptying, the format of the obtained token should be 1|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5 ) |
Yes.
`,47),r=[o];function l(h,p,d,k,c,u){return s(),t("div",null,r)}const y=i(n,[["render",l]]);export{m as __pageData,y as default}; diff --git a/assets/en_faq.md.CuEu6Jq3.lean.js b/assets/en_faq.md.CuEu6Jq3.lean.js new file mode 100644 index 000000000..a985f01b4 --- /dev/null +++ b/assets/en_faq.md.CuEu6Jq3.lean.js @@ -0,0 +1 @@ +import{_ as e}from"./chunks/katex.B5umXGHV.js";import{_ as i,c as t,o as s,a5 as a}from"./chunks/framework.aNBt3w9_.js";const m=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq.md","filePath":"en/faq.md","lastUpdated":null}'),n={name:"en/faq.md"},o=a("",47),r=[o];function l(h,p,d,k,c,u){return s(),t("div",null,r)}const y=i(n,[["render",l]]);export{m as __pageData,y as default}; diff --git a/assets/en_frontend.md.CWcIC4bn.js b/assets/en_frontend.md.CWcIC4bn.js new file mode 100644 index 000000000..2235055ee --- /dev/null +++ b/assets/en_frontend.md.CWcIC4bn.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as n}from"./chunks/framework.aNBt3w9_.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en/frontend.md","filePath":"en/frontend.md","lastUpdated":null}'),a={name:"en/frontend.md"};function r(o,s,d,c,f,p){return n(),t("div")}const l=e(a,[["render",r]]);export{i as __pageData,l as default}; diff --git a/assets/en_frontend.md.CWcIC4bn.lean.js b/assets/en_frontend.md.CWcIC4bn.lean.js new file mode 100644 index 000000000..2235055ee --- /dev/null +++ b/assets/en_frontend.md.CWcIC4bn.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as n}from"./chunks/framework.aNBt3w9_.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en/frontend.md","filePath":"en/frontend.md","lastUpdated":null}'),a={name:"en/frontend.md"};function r(o,s,d,c,f,p){return n(),t("div")}const l=e(a,[["render",r]]);export{i as __pageData,l as default}; diff --git a/assets/en_index.md.DAkyKDbd.js b/assets/en_index.md.DAkyKDbd.js new file mode 100644 index 000000000..b1a2cb712 --- /dev/null +++ b/assets/en_index.md.DAkyKDbd.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as i}from"./chunks/framework.aNBt3w9_.js";const p=JSON.parse('{"title":"Twikoo","titleTemplate":"A simple, safe, free comment system","description":"","frontmatter":{"layout":"home","title":"Twikoo","titleTemplate":"A simple, safe, free comment system","hero":{"name":"Twikoo","text":"Comment system","tagline":"Simple, safe, free","actions":[{"theme":"brand","text":"Quick start","link":"/en/quick-start"},{"theme":"alt","text":"Introduction","link":"/en/intro"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/twikoojs/twikoo"}],"image":{"src":"/twikoo-logo-home.png","alt":"Twikoo"}},"features":[{"icon":"🚀","title":"简单","details":"免费搭建,简单部署"},{"icon":"😃","title":"易用","details":"功能丰富,兼容性强"},{"icon":"🛡️","title":"安全","details":"隐私安全,内容安全"},{"icon":"⏰","title":"即时","details":"邮件提醒,即时消息推送"},{"icon":"🌈","title":"个性","details":"自定义背景图,博主标识"},{"icon":"⚙️","title":"便捷管理","details":"内嵌式管理面板,通过密码登录"}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md","lastUpdated":null}'),o={name:"en/index.md"};function n(a,s,l,m,c,r){return i(),t("div")}const f=e(o,[["render",n]]);export{p as __pageData,f as default}; diff --git a/assets/en_index.md.DAkyKDbd.lean.js b/assets/en_index.md.DAkyKDbd.lean.js new file mode 100644 index 000000000..b1a2cb712 --- /dev/null +++ b/assets/en_index.md.DAkyKDbd.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as i}from"./chunks/framework.aNBt3w9_.js";const p=JSON.parse('{"title":"Twikoo","titleTemplate":"A simple, safe, free comment system","description":"","frontmatter":{"layout":"home","title":"Twikoo","titleTemplate":"A simple, safe, free comment system","hero":{"name":"Twikoo","text":"Comment system","tagline":"Simple, safe, free","actions":[{"theme":"brand","text":"Quick start","link":"/en/quick-start"},{"theme":"alt","text":"Introduction","link":"/en/intro"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/twikoojs/twikoo"}],"image":{"src":"/twikoo-logo-home.png","alt":"Twikoo"}},"features":[{"icon":"🚀","title":"简单","details":"免费搭建,简单部署"},{"icon":"😃","title":"易用","details":"功能丰富,兼容性强"},{"icon":"🛡️","title":"安全","details":"隐私安全,内容安全"},{"icon":"⏰","title":"即时","details":"邮件提醒,即时消息推送"},{"icon":"🌈","title":"个性","details":"自定义背景图,博主标识"},{"icon":"⚙️","title":"便捷管理","details":"内嵌式管理面板,通过密码登录"}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md","lastUpdated":null}'),o={name:"en/index.md"};function n(a,s,l,m,c,r){return i(),t("div")}const f=e(o,[["render",n]]);export{p as __pageData,f as default}; diff --git a/assets/en_intro.md.B5kTfFqc.js b/assets/en_intro.md.B5kTfFqc.js new file mode 100644 index 000000000..684e8ae2b --- /dev/null +++ b/assets/en_intro.md.B5kTfFqc.js @@ -0,0 +1,3 @@ +import{_ as e,a,b as t,c as i}from"./chunks/readme-3.hEA_5CR-.js";import{_ as o,c as l,o as s,a5 as r}from"./chunks/framework.aNBt3w9_.js";const q=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en/intro.md","filePath":"en/intro.md","lastUpdated":null}'),n={name:"en/intro.md"},h=r('A simple, safe, free comment system.
简体中文 | English
This document is for American English. This document has many bugs.
If you want to get updates, make suggestions and participate in the test, welcome to join the discussion group:1080829142 (QQ)
Icon design:Maemo Lee
Update logs & Development Plan
If you want to develop locally for a second time, you can refer to the following commands:
yarn dev # (http://localhost:9820/demo.html)
+yarn lint
+yarn build # (dist/twikoo.all.min.js)
If your changes can help more people, feel free to submit a Pull Request!
Support Simplified Chinese, Traditional Chinese, English. translate Pull Request.
Tip
The English document is being built. Please refer to the Chinese document.
请前往 https://weavatar.com 通过邮箱注册并设定头像,评论时,请留下相同的邮箱。
访客还可以通过输入数字 QQ 邮箱地址,使用 QQ 头像发表评论。
腾讯云请前往云开发控制台,Vercel 请前往 MongoDB,私有部署请直接编辑 data/db.json.1
,编辑配置,删除 config.ADMIN_PASS 配置项,然后前往 Twikoo 管理面板重新设置密码。
您可以在需要展示文章访问量的地方添加:
<span id="twikoo_visitors">0</span>
来展示访问量。暂不支持全站访问量统计。
Twikoo 支持 Katex 公式,但为了限制 Twikoo 的包大小,Twikoo 没有内置完整的 Katex,您需要在页面中额外加载 katex.js。
<head>
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></script>
+</head>
载入后,您可以发送 $$c = \\pm\\sqrt{a^2 + b^2}$$
测试效果。
您还可以在 twikoo.init
时传入自定义 katex 配置,详细配置请查看 Katex Auto-render Extension。
twikoo.init({
+ envId: '您的环境id',
+ el: '#tcomment',
+ katex: {
+ delimiters: [
+ { left: '$$', right: '$$', display: true },
+ { left: '$', right: '$', display: false },
+ { left: '\\\\(', right: '\\\\)', display: false },
+ { left: '\\\\[', right: '\\\\]', display: true }
+ ],
+ throwOnError: false
+ }
+});
Twikoo 支持接入腾讯云文本内容检测,使用深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
腾讯云文本内容检测是付费服务,提供 1 个月的免费试用,之后价格为 25 元/万条。如果您对反垃圾评论要求不高,也可以使用免费的 Akismet。
如何申请腾讯云文本内容检测
成功后,站长可以在腾讯云控制台-自定义库管理配置自定义文本内容过滤。
Akismet (Automattic Kismet) 是应用广泛的一个垃圾留言过滤系统,其作者是大名鼎鼎的 WordPress 创始人 Matt Mullenweg,Akismet 也是 WordPress 默认安装的插件,其使用非常广泛,设计目标便是帮助博客网站来过滤垃圾留言。
请填写 viagra-test-123
作为昵称,或填写 akismet-guaranteed-spam@example.com
作为邮箱,发表评论,这条评论将一定会被视为垃圾评论。
需要注意的是,由于 Akismet 服务响应速度较慢(大约 6 秒),影响用户体验,Twikoo 采取 “先放行,后检测” 的策略,垃圾评论会在发表后短暂可见。
一般是配置好登录私钥之后,又重新下载了登录私钥,导致之前配置的登录私钥失效了。
解决方法:到云开发控制台,数据库,删掉 config,然后重新配置私钥。
如果是 Vercel 部署的云函数,请配置国外邮件服务商,避免被邮件服务商判定为垃圾邮件行为。如果是其他原因,请前往 Twikoo 管理面板,找到邮件测试功能,输入个人邮箱,根据测试结果排查原因。
为了避免频繁检查邮箱带来的性能问题,邮件配置有 10 分钟左右的缓存,如果确定配置没有问题,但测试失败,可以等待 10 分钟后再测试。
由于博主发表评论时,不会通知博主,如果您想实际测试通知功能,请注销管理面板后用非博主邮箱发表或回复评论。
腾讯云环境自带云存储,所以腾讯云环境下可以直接上传图片,图片保存在云存储中。然而 Vercel 环境没有,上传图片功能依赖第三方图床,请在管理面板中配置图床,Twikoo 支持以下图床:
图床 | 地址 | 特点 |
---|---|---|
qcloud | 无 | 腾讯云环境自带,可在云开发 - 云存储中查看 |
7bu | https://7bu.top | 去不图床,由杜老师提供支持,无免费套餐 |
smms | https://sm.ms | SMMS 图床,有免费套餐,请自行注册账号,IMAGE_CDN_TOKEN 可在 Dashboard 中获取 |
lsky-pro | 私有部署 | 兰空图床 2.0 版本,IMAGE_CDN 请配置图床首页 URL 地址(如 https://7bu.top ),IMAGE_CDN_TOKEN 获取方式请参考教程 杜老师说图床:新版本去不图床 Token 的获取与清空,获取到的 token 格式应为 1|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5 ) |
Twikoo 私有部署版默认使用内置数据库:LokiJS 数据库,支持的数据库容量大约为 1 GB,不需要连接外部数据库,数据存储在启动 twikoo 时所在目录下的 data 目录,您可以直接复制该目录以完成数据备份。
如果您有 MongoDB 实例,可以连接 MongoDB 作为外部数据库,只需配置环境变量 MONGODB_URI 为数据库连接地址即可,如:mongodb://<username>:<password>@<host>/
。
在包含评论框的页面,打开浏览器开发者工具(Windows 下快捷键为 F12),点击 Console 标签,查找包含 twikoo 关键字的报错。
如果看到 ERR_BLOCKED_BY_CLIENT,请禁用浏览器去广告插件或将当前网站加入白名单,然后刷新重试。
如果看到 ERR_CONNECTION_CLOSED,请检查自己所处的地区网络环境是否正常,能够连通云函数,部分地区无法访问 Vercel 等服务,请更换部署方式再试。
如果看到 Access to XMLHttpRequest at 'https://tcb-api.tencentcloudapi.com/web?env=...' from origin '...' has been blocked by CORS policy...
:请检查前端 js 文件版本是否最新,并确保 envId 以 https://
开头。
如果看到 Access to XMLHttpRequest at ... No 'Access-Control-Allow-Origin' header is present on the requested resource.
:请先访问一下 envId 查看云函数是否运行正常,如果没有运行正常的提示,请重新部署云函数,确保不要漏下任何步骤;如果提示运行正常,请本地启动网站(localhost)并访问管理面板-配置管理-通用,清空 CORS_ALLOW_ORIGIN
字段并保存,然后刷新重试。
如果看到其他错误,请 提交 issue 并附上错误信息。
`,51),l=[h];function k(r,p,o,d,E,c){return t(),a("div",null,l)}const u=i(n,[["render",k]]);export{F as __pageData,u as default}; diff --git a/assets/faq.md.B4Pnc9sL.lean.js b/assets/faq.md.B4Pnc9sL.lean.js new file mode 100644 index 000000000..c151c2e49 --- /dev/null +++ b/assets/faq.md.B4Pnc9sL.lean.js @@ -0,0 +1 @@ +import{_ as s}from"./chunks/katex.B5umXGHV.js";import{_ as i,c as a,o as t,a5 as e}from"./chunks/framework.aNBt3w9_.js";const F=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"faq.md","filePath":"faq.md","lastUpdated":null}'),n={name:"faq.md"},h=e("",51),l=[h];function k(r,p,o,d,E,c){return t(),a("div",null,l)}const u=i(n,[["render",k]]);export{F as __pageData,u as default}; diff --git a/assets/frontend.md.BEcQ_kWD.js b/assets/frontend.md.BEcQ_kWD.js new file mode 100644 index 000000000..724959d79 --- /dev/null +++ b/assets/frontend.md.BEcQ_kWD.js @@ -0,0 +1,18 @@ +import{_ as e,c as a,o as t,a5 as i}from"./chunks/framework.aNBt3w9_.js";const m=JSON.parse('{"title":"前端部署","description":"","frontmatter":{},"headers":[],"relativePath":"frontend.md","filePath":"frontend.md","lastUpdated":null}'),s={name:"frontend.md"},h=i(`请参考 Butterfly 安裝文檔(四) 主題配置-2 进行配置
请参考 hexo-theme-keep/_config.yml 进行配置
请参考 hexo-theme-volantis/_config.yml 进行配置
请参考 hexo-theme-ayer/_config.yml 进行配置
暂不支持 NexT 8 以下的版本,请先升级到 NexT 8。然后在 Hexo 项目根目录执行
# For NexT version >= 8.0.0 && < 8.4.0
+npm install hexo-next-twikoo@1.0.0
+# For NexT version >= 8.4.0
+npm install hexo-next-twikoo@1.0.3
然后在配置中添加
twikoo:
+ enable: true
+ visitor: true
+ envId: xxxxxxxxxxxxxxx # 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
+ # region: ap-guangzhou # 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
请参考 hexo-theme-matery/_config.yml 进行配置
请参考 基于腾讯云,给你的 Icarus 博客配上 Twikoo 评论系统 by 异次元de机智君💯
请参考 hexo-theme-MengD/_config.yml 进行配置
请参考 配置指南-评论 进行配置
请参考 hexo-theme-cards/_config.yml 进行配置
请参考 maupassant-hexo/_config.yml 进行配置
请参考 Redefine 官方文档 #comment 进行配置
请参考 Solitude 文档 进行配置
请参考 Comments | Stack 和 hugo-theme-stack/config.yaml#L83 进行配置
请参考 入门篇 - FixIt #主题配置 和 hugo-fixit/FixIt/config.toml#L613-L624 进行配置
请参考 VitePress 集成 twikoo 参考解决方案 进行配置。
提示
如果您使用的博客主题不支持 Twikoo,并且您不知道如何引入 Twikoo,您可以在 Github 提交适配请求
<div id="tcomment"></div>
+<script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.38/dist/twikoo.all.min.js" integrity="sha384-4KfOjEinLSkv1i1J8TzlkC/RTnuiLoR1OLerVgjEKoH5djYtbf7mzEFsz9p3nfuA" crossorigin="anonymous"></script>
+<script>
+twikoo.init({
+ envId: '您的环境id', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
+ el: '#tcomment', // 容器元素
+ // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
+ // path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
+ // lang: 'zh-CN', // 用于手动设定评论区语言,支持的语言列表 https://github.com/twikoojs/twikoo/blob/main/src/client/utils/i18n/index.js
+})
+</script>
建议使用 CDN 引入 Twikoo 的用户在链接地址上锁定版本,以免将来 Twikoo 升级时受到非兼容性更新的影响。
如果遇到默认 CDN 加载速度缓慢,可更换其他 CDN 镜像。以下为可供选择的公共 CDN,其中一些 CDN 可能需要数天时间同步最新版本:
https://s4.zstatic.net/ajax/libs/twikoo/1.6.38/twikoo.all.min.js
https://lib.baomitu.com/twikoo/1.6.38/twikoo.all.min.js
https://cdn.jsdelivr.net/npm/twikoo@1.6.38/dist/twikoo.all.min.js
建议使用 CDN 引入 Twikoo 的用户参考上一段的示例在代码中加入 SRI 属性以确保完整性。
配置好登录私钥之后无需留存私钥文件,请勿再次下载登录私钥,否则会导致之前配置的登录私钥失效。
点击评论窗口的“小齿轮”图标,设置管理员密码
`,51),r=[h];function n(o,l,p,k,c,d){return t(),a("div",null,r)}const u=e(s,[["render",n]]);export{m as __pageData,u as default}; diff --git a/assets/frontend.md.BEcQ_kWD.lean.js b/assets/frontend.md.BEcQ_kWD.lean.js new file mode 100644 index 000000000..659eb893b --- /dev/null +++ b/assets/frontend.md.BEcQ_kWD.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a5 as i}from"./chunks/framework.aNBt3w9_.js";const m=JSON.parse('{"title":"前端部署","description":"","frontmatter":{},"headers":[],"relativePath":"frontend.md","filePath":"frontend.md","lastUpdated":null}'),s={name:"frontend.md"},h=i("",51),r=[h];function n(o,l,p,k,c,d){return t(),a("div",null,r)}const u=e(s,[["render",n]]);export{m as __pageData,u as default}; diff --git a/assets/hugging-1.qykHscdz.png b/assets/hugging-1.qykHscdz.png new file mode 100644 index 000000000..f008477a3 Binary files /dev/null and b/assets/hugging-1.qykHscdz.png differ diff --git a/assets/hugging-2.BZLt3AFG.png b/assets/hugging-2.BZLt3AFG.png new file mode 100644 index 000000000..fe927ea2f Binary files /dev/null and b/assets/hugging-2.BZLt3AFG.png differ diff --git a/assets/hugging-3.BE7bV_x9.png b/assets/hugging-3.BE7bV_x9.png new file mode 100644 index 000000000..1372a36ac Binary files /dev/null and b/assets/hugging-3.BE7bV_x9.png differ diff --git a/assets/hugging-4.IZDT8YRp.png b/assets/hugging-4.IZDT8YRp.png new file mode 100644 index 000000000..7dea50b7c Binary files /dev/null and b/assets/hugging-4.IZDT8YRp.png differ diff --git a/assets/hugging-5.Cw4bsoD7.png b/assets/hugging-5.Cw4bsoD7.png new file mode 100644 index 000000000..f078f1dbf Binary files /dev/null and b/assets/hugging-5.Cw4bsoD7.png differ diff --git a/assets/hugging-6.CxsVPwFh.png b/assets/hugging-6.CxsVPwFh.png new file mode 100644 index 000000000..2f6fac05b Binary files /dev/null and b/assets/hugging-6.CxsVPwFh.png differ diff --git a/assets/hugging-7.ey7RVDUh.png b/assets/hugging-7.ey7RVDUh.png new file mode 100644 index 000000000..038200128 Binary files /dev/null and b/assets/hugging-7.ey7RVDUh.png differ diff --git a/assets/hugging-8.bn1zLPri.png b/assets/hugging-8.bn1zLPri.png new file mode 100644 index 000000000..4007d2bec Binary files /dev/null and b/assets/hugging-8.bn1zLPri.png differ diff --git a/assets/hugging-9.BfxLMyMQ.png b/assets/hugging-9.BfxLMyMQ.png new file mode 100644 index 000000000..50d410009 Binary files /dev/null and b/assets/hugging-9.BfxLMyMQ.png differ diff --git a/assets/index.md.Ck2pUnPA.js b/assets/index.md.Ck2pUnPA.js new file mode 100644 index 000000000..613b473be --- /dev/null +++ b/assets/index.md.Ck2pUnPA.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as i}from"./chunks/framework.aNBt3w9_.js";const p=JSON.parse('{"title":"Twikoo","titleTemplate":"一个简洁、安全、免费的静态网站评论系统","description":"","frontmatter":{"layout":"home","title":"Twikoo","titleTemplate":"一个简洁、安全、免费的静态网站评论系统","hero":{"name":"Twikoo","text":"网站评论系统","tagline":"简洁、安全、免费","actions":[{"theme":"brand","text":"快速上手","link":"/quick-start"},{"theme":"alt","text":"简介","link":"/intro"},{"theme":"alt","text":"QQ 群","link":"https://jq.qq.com/?_wv=1027&k=2l9ZGIoL"},{"theme":"alt","text":"GitHub","link":"https://github.com/twikoojs/twikoo"}],"image":{"src":"/twikoo-logo-home.png","alt":"Twikoo"}},"features":[{"icon":"🚀","title":"简单","details":"免费搭建,简单部署"},{"icon":"😃","title":"易用","details":"功能丰富,兼容性强"},{"icon":"🛡️","title":"安全","details":"隐私安全,内容安全"},{"icon":"⏰","title":"即时","details":"邮件提醒,即时消息推送"},{"icon":"🌈","title":"个性","details":"自定义背景图,博主标识"},{"icon":"⚙️","title":"便捷管理","details":"内嵌式管理面板,通过密码登录"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":null}'),o={name:"index.md"};function a(l,n,s,c,r,d){return i(),e("div")}const k=t(o,[["render",a]]);export{p as __pageData,k as default}; diff --git a/assets/index.md.Ck2pUnPA.lean.js b/assets/index.md.Ck2pUnPA.lean.js new file mode 100644 index 000000000..613b473be --- /dev/null +++ b/assets/index.md.Ck2pUnPA.lean.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as i}from"./chunks/framework.aNBt3w9_.js";const p=JSON.parse('{"title":"Twikoo","titleTemplate":"一个简洁、安全、免费的静态网站评论系统","description":"","frontmatter":{"layout":"home","title":"Twikoo","titleTemplate":"一个简洁、安全、免费的静态网站评论系统","hero":{"name":"Twikoo","text":"网站评论系统","tagline":"简洁、安全、免费","actions":[{"theme":"brand","text":"快速上手","link":"/quick-start"},{"theme":"alt","text":"简介","link":"/intro"},{"theme":"alt","text":"QQ 群","link":"https://jq.qq.com/?_wv=1027&k=2l9ZGIoL"},{"theme":"alt","text":"GitHub","link":"https://github.com/twikoojs/twikoo"}],"image":{"src":"/twikoo-logo-home.png","alt":"Twikoo"}},"features":[{"icon":"🚀","title":"简单","details":"免费搭建,简单部署"},{"icon":"😃","title":"易用","details":"功能丰富,兼容性强"},{"icon":"🛡️","title":"安全","details":"隐私安全,内容安全"},{"icon":"⏰","title":"即时","details":"邮件提醒,即时消息推送"},{"icon":"🌈","title":"个性","details":"自定义背景图,博主标识"},{"icon":"⚙️","title":"便捷管理","details":"内嵌式管理面板,通过密码登录"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":null}'),o={name:"index.md"};function a(l,n,s,c,r,d){return i(),e("div")}const k=t(o,[["render",a]]);export{p as __pageData,k as default}; diff --git a/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 b/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 new file mode 100644 index 000000000..b6b603d59 Binary files /dev/null and b/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 differ diff --git a/assets/inter-italic-cyrillic.By2_1cv3.woff2 b/assets/inter-italic-cyrillic.By2_1cv3.woff2 new file mode 100644 index 000000000..def40a4f6 Binary files /dev/null and b/assets/inter-italic-cyrillic.By2_1cv3.woff2 differ diff --git a/assets/inter-italic-greek-ext.1u6EdAuj.woff2 b/assets/inter-italic-greek-ext.1u6EdAuj.woff2 new file mode 100644 index 000000000..e070c3d30 Binary files /dev/null and b/assets/inter-italic-greek-ext.1u6EdAuj.woff2 differ diff --git a/assets/inter-italic-greek.DJ8dCoTZ.woff2 b/assets/inter-italic-greek.DJ8dCoTZ.woff2 new file mode 100644 index 000000000..a3c16ca40 Binary files /dev/null and b/assets/inter-italic-greek.DJ8dCoTZ.woff2 differ diff --git a/assets/inter-italic-latin-ext.CN1xVJS-.woff2 b/assets/inter-italic-latin-ext.CN1xVJS-.woff2 new file mode 100644 index 000000000..2210a899e Binary files /dev/null and b/assets/inter-italic-latin-ext.CN1xVJS-.woff2 differ diff --git a/assets/inter-italic-latin.C2AdPX0b.woff2 b/assets/inter-italic-latin.C2AdPX0b.woff2 new file mode 100644 index 000000000..790d62dc7 Binary files /dev/null and b/assets/inter-italic-latin.C2AdPX0b.woff2 differ diff --git a/assets/inter-italic-vietnamese.BSbpV94h.woff2 b/assets/inter-italic-vietnamese.BSbpV94h.woff2 new file mode 100644 index 000000000..1eec0775a Binary files /dev/null and b/assets/inter-italic-vietnamese.BSbpV94h.woff2 differ diff --git a/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 b/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 new file mode 100644 index 000000000..2cfe61536 Binary files /dev/null and b/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 differ diff --git a/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 b/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 new file mode 100644 index 000000000..e3886dd14 Binary files /dev/null and b/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 differ diff --git a/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 b/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 new file mode 100644 index 000000000..36d67487d Binary files /dev/null and b/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 differ diff --git a/assets/inter-roman-greek.BBVDIX6e.woff2 b/assets/inter-roman-greek.BBVDIX6e.woff2 new file mode 100644 index 000000000..2bed1e85e Binary files /dev/null and b/assets/inter-roman-greek.BBVDIX6e.woff2 differ diff --git a/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 b/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 new file mode 100644 index 000000000..9a8d1e2b5 Binary files /dev/null and b/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 differ diff --git a/assets/inter-roman-latin.Di8DUHzh.woff2 b/assets/inter-roman-latin.Di8DUHzh.woff2 new file mode 100644 index 000000000..07d3c53ae Binary files /dev/null and b/assets/inter-roman-latin.Di8DUHzh.woff2 differ diff --git a/assets/inter-roman-vietnamese.BjW4sHH5.woff2 b/assets/inter-roman-vietnamese.BjW4sHH5.woff2 new file mode 100644 index 000000000..57bdc22ae Binary files /dev/null and b/assets/inter-roman-vietnamese.BjW4sHH5.woff2 differ diff --git a/assets/intro.md.DXsPIJUB.js b/assets/intro.md.DXsPIJUB.js new file mode 100644 index 000000000..3ce801eab --- /dev/null +++ b/assets/intro.md.DXsPIJUB.js @@ -0,0 +1,3 @@ +import{_ as a,a as t,b as e,c as i}from"./chunks/readme-3.hEA_5CR-.js";import{_ as r,c as l,o as s,a5 as o}from"./chunks/framework.aNBt3w9_.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"intro.md","filePath":"intro.md","lastUpdated":null}'),h={name:"intro.md"},n=o('一个简洁、安全、免费的静态网站评论系统。
A simple, safe, free comment system.
简体中文 | English
如果你想获取更新动态、建言献策、参与测试,欢迎加入讨论群:
提示
技术原因,不兼容 IE
IE / Edge | Firefox | Chrome | Safari | iOS Safari |
---|---|---|---|---|
Edge | last version | last version | last version | last version |
Generated by browsers-support-badges
图标设计:Maemo Lee
如果您想在本地二次开发,可以参考以下命令:
yarn dev # 开发 (http://localhost:9820/demo.html)
+yarn lint # 代码检查
+yarn build # 编译 (dist/twikoo.all.min.js)
如果您的改动能够帮助到更多人,欢迎提交 Pull Request!
支持简体中文、繁体中文、English。欢迎提交翻译 PR。
MongoDB Atlas 是 MongoDB Inc 提供的 MongoDB 数据库托管服务。免费账户可以永久使用 500 MiB 的数据库,足够存储 Twikoo 评论使用。
AWS / Oregon (us-west-2)
,该数据中心基建成熟,故障率低,且使用 Oregon 州的清洁能源,较为环保0.0.0.0/0
(允许所有 IP 地址的连接)即可。如果 Twikoo 部署在自己的服务器上,这里可以填入固定 IP 地址。点击 Confirm 保存<username>:<password>
修改为刚刚创建的数据库 用户名:密码
test
的数据库。如果需要在同一个 MongoDB 里运行其他业务或供多个 Twikoo 实例使用,建立加入数据库名称并配置对应的 ACL。连接字符串包含了连接到 MongoDB 数据库的所有信息,一旦泄露会导致评论被任何人添加、修改、删除,并有可能获取你的 SMTP、图床 token 等信息。请妥善记录这一字符串,之后需要填入到 Twikoo 的部署平台里。
',10),i=[d];function c(_,g,m,p,A,b){return e(),t("div",null,i)}const h=o(r,[["render",c]]);export{D as __pageData,h as default}; diff --git a/assets/mongodb-atlas.md.CLmTi-jV.lean.js b/assets/mongodb-atlas.md.CLmTi-jV.lean.js new file mode 100644 index 000000000..2b5722085 --- /dev/null +++ b/assets/mongodb-atlas.md.CLmTi-jV.lean.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as e,a5 as a}from"./chunks/framework.aNBt3w9_.js";const s="/assets/mongodb-1.kzmwAvw2.png",l="/assets/mongodb-2.wGC2d7_O.png",n="/assets/mongodb-3.BlCbBw8p.png",D=JSON.parse('{"title":"MongoDB Atlas","description":"","frontmatter":{},"headers":[],"relativePath":"mongodb-atlas.md","filePath":"mongodb-atlas.md","lastUpdated":null}'),r={name:"mongodb-atlas.md"},d=a("",10),i=[d];function c(_,g,m,p,A,b){return e(),t("div",null,i)}const h=o(r,[["render",c]]);export{D as __pageData,h as default}; diff --git a/assets/netlify-1.CBH5jdAK.png b/assets/netlify-1.CBH5jdAK.png new file mode 100644 index 000000000..6b5adf242 Binary files /dev/null and b/assets/netlify-1.CBH5jdAK.png differ diff --git a/assets/netlify-2.CoU6-6Qj.png b/assets/netlify-2.CoU6-6Qj.png new file mode 100644 index 000000000..e30ce5824 Binary files /dev/null and b/assets/netlify-2.CoU6-6Qj.png differ diff --git a/assets/netlify-3.BRAuDkNv.png b/assets/netlify-3.BRAuDkNv.png new file mode 100644 index 000000000..d086765d0 Binary files /dev/null and b/assets/netlify-3.BRAuDkNv.png differ diff --git a/assets/netlify-4.BPwUhUpI.png b/assets/netlify-4.BPwUhUpI.png new file mode 100644 index 000000000..118292159 Binary files /dev/null and b/assets/netlify-4.BPwUhUpI.png differ diff --git a/assets/netlify-5.BSv5GDZV.png b/assets/netlify-5.BSv5GDZV.png new file mode 100644 index 000000000..dcdd0e733 Binary files /dev/null and b/assets/netlify-5.BSv5GDZV.png differ diff --git a/assets/quick-start.md.Bd8cDso5.js b/assets/quick-start.md.Bd8cDso5.js new file mode 100644 index 000000000..4026217fb --- /dev/null +++ b/assets/quick-start.md.Bd8cDso5.js @@ -0,0 +1 @@ +import{_ as t,c as a,o as e,a5 as o}from"./chunks/framework.aNBt3w9_.js";const u=JSON.parse('{"title":"快速上手","description":"","frontmatter":{},"headers":[],"relativePath":"quick-start.md","filePath":"quick-start.md","lastUpdated":null}'),i={name:"quick-start.md"},r=o('Twikoo 分为云函数和前端两部分,若要在您的网站上集成 Twikoo,您需要同时部署云函数和前端,部署时请注意保持二者版本一致。
不同部署方式的更新方式也不同,请对号入座。更新部署成功后,请不要忘记同时更新前端的 Twikoo CDN 地址中的 x.x.x
数字版本号,使之与云函数版本号相同,然后部署网站。
登录环境-我的应用,输入
https://github.com/twikoojs/twikoo/tree/main
main
应用目录无需填写,点击“确定”,部署完成。
登录环境-云函数,点击 twikoo,点击函数代码,打开 package.json
文件,将 "twikoo-func": "x.x.x"
其中的版本号修改为最新版本号,点击“保存并安装依赖”即可。
提示
如果您的云函数是 1.0.0 之前的版本,因为 1.0.0 版本修改了部署步骤,请先参考手动部署,从第 5 步开始,重新创建云函数,再按照此步骤更新。
如果升级后出现无法读取评论列表,云函数报错,请在函数编辑页面,删除 node_modules
目录(删除需要半分钟左右,请耐心等待删除完成),再点击保存并安装依赖。如果仍然不能解决,请删除并重新创建 Twikoo 云函数。
进入 Twikoo 源码目录,执行以下命令更新现有的云函数
yarn deploy -e 您的环境id
"twikoo-vercel": "latest"
其中的 latest
修改为最新版本号。点击 Commit changes"tkserver": "latest"
其中的 latest
修改为最新版本号。点击 Commit changes"twikoo-vercel": "latest"
其中的 latest
修改为最新版本号。点击 Commit changeskill $(ps -ef | grep tkserver | grep -v 'grep' | awk '{print $2}')
npm i -g tkserver@latest
nohup tkserver >> tkserver.log 2>&1 &
docker pull imaegoo/twikoo
docker stop twikoo
docker rm twikoo
考虑到可用性和安全性问题,Twikoo 没有实现自动更新,也没有计划实现自动更新。如果您希望实现自动更新,可以参考 MHuiG 基于 Github 工作流的 twikoo-update 的实现方式。
',26),r=[l];function c(s,d,n,h,u,p){return o(),a("div",null,r)}const b=e(i,[["render",c]]);export{g as __pageData,b as default}; diff --git a/assets/update.md.47Vc-wKh.lean.js b/assets/update.md.47Vc-wKh.lean.js new file mode 100644 index 000000000..69639e12b --- /dev/null +++ b/assets/update.md.47Vc-wKh.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o,a5 as t}from"./chunks/framework.aNBt3w9_.js";const g=JSON.parse('{"title":"版本更新","description":"","frontmatter":{},"headers":[],"relativePath":"update.md","filePath":"update.md","lastUpdated":null}'),i={name:"update.md"},l=t("",26),r=[l];function c(s,d,n,h,u,p){return o(),a("div",null,r)}const b=e(i,[["render",c]]);export{g as __pageData,b as default}; diff --git a/assets/vercel-1.Czytea8u.png b/assets/vercel-1.Czytea8u.png new file mode 100644 index 000000000..7d952918f Binary files /dev/null and b/assets/vercel-1.Czytea8u.png differ diff --git a/backend.html b/backend.html new file mode 100644 index 000000000..41f2ec15d --- /dev/null +++ b/backend.html @@ -0,0 +1,42 @@ + + + + + +