https://github.com/raincal/disqus-proxy-docker
Deploy disqus-php-api to now.sh
https://github.com/raincal/disqus-proxy-docker
disqus-api now-cli
Last synced: 2 months ago
JSON representation
Deploy disqus-php-api to now.sh
- Host: GitHub
- URL: https://github.com/raincal/disqus-proxy-docker
- Owner: Raincal
- License: apache-2.0
- Created: 2017-10-19T14:35:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T10:32:21.000Z (over 6 years ago)
- Last Synced: 2025-02-14T17:55:17.694Z (4 months ago)
- Topics: disqus-api, now-cli
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/raincal/disqus-proxy-docker/
- Size: 132 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# disqus-proxy-docker
> [disqus-php-api](https://github.com/fooleap/disqus-php-api) Docker 镜像
## 环境变量
| 变量名 | 默认值 | 描述 |
| ---------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| PUBLIC_KEY | | Disqus APP 公钥,在 https://disqus.com/api/applications/ 申请注册后获得 |
| SECRET_KEY | | Disqus APP 私钥,在 https://disqus.com/api/applications/ 申请注册后获得 |
| DISQUS_USERNAME | | Disqus 用户名 |
| DISQUS_EMAIL | | Disqus 注册邮箱,重要 |
| DISQUS_PASSWORD | | Disqus 密码,重要 |
| DISQUS_WEBSITE | | 网站域名,如:'https://raincal.com' |
| DISQUS_SHORTNAME | | 网站在 Disqus 对应的 shortname |
| DISQUS_APPROVED | true | 评论是否免审核,true 即跳过评论预审核,false 则按后台设置 |
| DISQUS_BLACKLIST | false | 评论发表应用官方的 IP 黑名单,true 即启用,false 则跳过 |
| GRAVATAR_CDN | //cn.gravatar.com/avatar/ | Gravatar 头像 CDN |
| GRAVATAR_DEFAULT | retro | Gravatar 默认头像,即 d 参数,可参考 https://www.gravatar.com/site/implement/images/ |
| EMOJI_PATH | https://assets-cdn.github.com/images/icons/emoji/unicode/ | Emoji 表情 PNG 资源路径 |
| SMTP_SECURE | ssl | 安全协议 |
| SMTP_HOST | | 邮箱服务器 |
| SMTP_PORT | 465 | 端口号 |
| SMTP_USERNAME | | SMTP 登录的账号,即邮箱号 |
| SMTP_PASSWORD | | SMTP 登录的账号,即邮箱密码 |
| SMTP_FROM | | 发件人的邮箱地址,可以留空 |
| SMTP_FROMNAME | | 发件人的名称,可以留空 |## 部署到 [Now](https://zeit.co/now)
### 优势
- 自带 https
- 可在国内正常访问
- 免费套餐可以同时运行 3 个实例
- 支持 Docker / Node.js / Static Websites 部署[使用文档](https://zeit.co/docs)
### Demo
浏览器访问:[DEMO PAGE](https://raincal.com/post/vscode-icon-share/)
### 教程
#### 创建 disqus-api 文件夹并进入
#### 创建 Dockerfile
```Dockerfile
FROM raincal/disqus-proxy-docker:latest
```#### 创建 now.json
填入相关变量,@开头为私密信息,需要通过 **now secrets add** 添加
```json
{
"public": true,
"type": "docker",
"alias": "raincal-blog-disqus",
"features": {
"cloud": "v1"
},
"env": {
"PUBLIC_KEY": "@public-key",
"SECRET_KEY": "@secret-key",
"DISQUS_EMAIL": "@disqus-email",
"DISQUS_PASSWORD": "@disqus-password",
"DISQUS_USERNAME": "Raincal",
"DISQUS_WEBSITE": "https://raincal.com",
"DISQUS_SHORTNAME": "raincal",
"GRAVATAR_CDN": "https://gravatar.loli.net/avatar/",
"SMTP_HOST": "smtp.office365.com",
"SMTP_PORT": "587",
"SMTP_SECURE": "STARTTLS",
"SMTP_USERNAME": "[email protected]",
"SMTP_PASSWORD": "@smtp-password",
"SMTP_FROM": "[email protected]",
"SMTP_FROMNAME": "Raincal's Blog"
}
}
```#### 部署
```bash
now
```至此 后端 api 服务就部署好了 🎉
之后请看 [disqus-php-api](https://github.com/fooleap/disqus-php-api) 使用说明