npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

disqus-proxy-server

v1.0.1

Published

[![npm package](https://img.shields.io/npm/v/disqus-proxy-server.svg?style=flat)](https://www.npmjs.org/package/disqus-proxy-server) ![](https://img.shields.io/badge/node-%3E7.6-brightgreen.svg)

Downloads

6

Readme

配合disqus-proxy-core 使用的后端。

npm package

NPM

配置之前

首先,需要获取disqus提供的api-secret

在 Disqus 申请开启 api 权限。访问register new application 就可以注册一个 application.然后在applications可以看到你的 application 列表。其中 Secret Key 就是我们需要的api-secret,并且需要在后台的Settings => Community里开启访客评论

配置

配置提供node启动和docker或者docker-compose的方式启动,推荐docker或者docker-compose

使用nodejs

需要Node.js版本7.6以上。

在服务器上clone代码:
https://github.com/ciqulover/disqus-proxy-server
安装依赖
npm install
配置server目录下的config.json
{
  // 服务端端口,需要与disqus-proxy前端设置一致
    "port": 5509,
  
    // 你的diqus secret key
    "api_secret": "your secret key",
  
    // 你的website的 shortname 名称 比如在你的disqus安装代码中 有这样一句脚本:
    // s.src = 'https://test-eo9kkdlcze.disqus.com/embed.js';
    // 那么你的disqus 的shortname 就是 test-eo9kkdlcze
    "shortname": "shortname",
  
    // 日志路径,可以填写绝对路径,默认当前目录下自动创建log目录
    log_path: null
    
    只有使用nginx反向代理node时,为true,只监听否则本地端口127.0.0.1,默认false,监听0.0.0.0
    proxy: false
}
启动

测试启动:

node server.js

正式使用时需要用pm2启动,来守护服务端进程

npm install pm2 -g
pm2 start server.js

-- 到此结束,检测评论是否正常显示 --

其他

如果需要https访问,我们可以用nginx来反向代理disqus proxy.

其中disqus-proxy.domain.com是你的反向代理的域名,配置好证书位置。其中5509端口是在config.json里配置的端口

server {
    listen 443 ssl;
    server_name disqus-proxy.domain.com;
    ssl_certificate /etc/ssl/disqus-proxy.domain.com.crt;
    ssl_certificate_key /etc/ssl/disqus-proxy.domain.com.key;
    
    location / {
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_pass http://127.0.0.1:5509$request_uri;
    }
}