ubuntu18
设置一个域名,例如discourse.example.com
,添加NDS使其能够解析该域名
sudo apt-get install docker.io ruby git
等会需要一个邮箱服务器,这里介绍用qq邮箱普通用户每天100封,选取一个qq邮箱名,获取授权码(SMTP的密码)
邮箱测试http://tool.chacuo.net/mailserversend
准备一份网站的可信证书(.crt和.key),或者自签名证书也可以
建议全程用root权限
sudo -s
git clone https://github.com/discourse/discourse_docker.git /home/discourse
cd /home/discourse
替换成你的证书名字,vim ./templates/web.letsencrypt.ssl.template.yml:111-125
./discourse-setup
Hostname for your Discourse? [discourse.example.com]: [论坛的域名]
Email address for admin account(s)? [me@example.com,you@example.com]:[一个或者多个管理员邮箱,此邮箱不会公开]
SMTP server address? [smtp.example.com]: [SMTP邮件服务器地址,qq邮箱填写]
SMTP port? [587]: [SMTP邮件服务器端口]
SMTP user name? [user@example.com]: [论坛自动发信邮箱账号,qq邮箱名]
SMTP password? [pa$$word]: [论坛自动发信邮箱账号的密码,qq邮箱授权码]
Let‘s Encrypt account email? (ENTER to skip) [me@example.com]: [自动更新证书的通知邮箱地址]
将你的证书放到/var/discourse/shared/standalone/ssl目录下
./launcher restart app # 证书放好后重启app
现在可以访问域名
尝试注册管理员,注册时使用管理员邮箱,自动注册管理员用户
./launcher enter app
如果没有创建好管理员,则用命令创建管理员
rake admin:create
现在你的邮箱系统可能还没有设置发送邮箱地址,需要用管理员登录网站后,设置notification email
现在用户就可以正常注册了
原文:https://www.cnblogs.com/macrored/p/13173340.html