私有部署twikoo评论系统

2024-02-18 08:54:19 浏览数 (1)

使用过很多自带的评论系统,太慢太慢,为了网站的访问速度,我一度关闭了评论功能,现在有了更好的方式,那就是私有部署!!!!

1.进行部署

首先确保服务器安装了docker

然后安装twikoo

代码语言:javascript复制
docker pull imaegoo/twikoo

接着部署

代码语言:javascript复制
docker run -p 8084:8080 -v ${PWD}/data:/app/data -d imaegoo/twikoo

这样访问https://你的ip:8084就能访问twikoo服务了

2.修改nginx代理

在nginx配置文件中添加

代码语言:javascript复制
location /twikoo {
    proxy_pass http://你的ip:8084;  # Twikoo 服务运行的地址和端口
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

3.最后修改butterfly配置文件

代码语言:javascript复制
comments:
  # Up to two comments system, the first will be shown as default
  # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk
  use: Twikoo
  text: true # Display the comment name next to the button
  # lazyload: The comment system will be load when comment element enters the browser's viewport.
  # If you set it to true, the comment count will be invalid
  lazyload: true
  count: true # Display comment count in post's top_img
  card_post_count: false # Display comment count in Home Page
  
twikoo:
  envId: https://你的ip/twikoo
  region:
  visitor: false
  option:

大功告成!

0 人点赞