嘿,我使用这份指南在 Linux 机器上设置了默认的 Discourse。过程非常顺利,网站也完美启动。
我决定允许用户通过 Facebook 登录,因此我按照上述链接中引用的 Facebook 说明进行了操作(我本想再次提供链接,但新用户似乎只能发布两个链接)。结果未能成功,但网站仍然正常运行(我不记得尝试通过 Facebook 登录时遇到的具体错误)。
在浏览 Facebook 文档时,我看到需要启用 HTTPS,于是开始按照这些文档进行操作。一切顺利,直到执行 ./launcher rebuild app 时出现了 PostgreSQL 错误。这让我感到意外,因为据我所知,我并未对 PostgreSQL 配置做任何修改。第一个错误如下:
INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
我没有停止 PostgreSQL 服务,但尝试运行 service start postgres 时,系统提示该服务未安装。因此我推测它是以我习惯之外的其他方式自动安装的。请问我可能哪里做错了?谢谢。
我的 container/app.yml 内容如下:
templates:
- "templates/web.template.yml"
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
expose:
- "80:80" # http
- "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
db_shared_buffers: "128MB"
env:
LANG: en_US.UTF-8
LETSENCRYPT_ACCOUNT_EMAIL: 'myotheremail@gmail.com'
UNICORN_WORKERS: 2
DISCOURSE_HOSTNAME: mysite.com
DISCOURSE_DEVELOPER_EMAILS: 'myemail@gmail.com'
DISCOURSE_SMTP_ADDRESS: smtp.gmail.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: myemail@gmail.com
DISCOURSE_SMTP_PASSWORD: "myPa$$word"
## 此 Discourse 实例的 HTTP 或 HTTPS CDN 地址(配置为拉取)
## 详见 https://meta.discourse.org/t/14857
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
run:
- exec: echo "Beginning of custom commands"
- exec: echo "End of custom commands"
