Coverview 部署

因为 Typecho-Butterfly 主题需要文章封面,我就选择了这个快速生成文章封面的项目 Coverview

项目介绍

  • 🚀 super fast and easy to use
  • 🌈 4 different themes, multiple fonts
  • 🌠 100+ dev icons with option to upload custom icon
  • ✨ 15+ different background patterns
  • 💾 Cover size based on blogging platform (i.e hashnode and dev)

项目部署

安装 npm

Before you begin, ensure that curl is installed on your system. If curl is not installed, you can install it using the following command:

apt-get install -y curl
  1. Download the setup script:

    curl -fsSL https://deb.nodesource.com/setup_current.x -o nodesource_setup.sh
  1. Run the setup script with sudo:

    bash nodesource_setup.sh
  1. Install Node.js:

    apt-get install -y nodejs
  1. Verify the installation:

    node -v

下载 Coverview

mkdir -p /opt/npm/Coverview && cd  /opt/npm/Coverview
git clone https://github.com/rutikwankhade/CoverView.git

持久化运行 Coverview

npm install -g pm2
pm2 start npm --name "coverview" -- start
pm2 list

nginx 反代 covervie

nginx 反代配置文件

server {
    listen       30001;
    server_name  yourname.com;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        proxy_pass http://127.0.0.1:3000/; #coverview 监听 127.0.0.1:3000
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
    }

   

}
nginx -t 
nginx -s reload 

总结

  • 新部署的 coverview 需要使用nginx反代。如果直接使用 cloudflared 将 coverview 映射到 公网,会导致访问失败。