在从 🇨🇳 The IP address in Discourse’s user information shows CloudFlare’s IP address | Discourse 的用户信息中的 IP 地址显示的是 CloudFlare 的 IP 地址 添加模板并重新构建应用后,
我发现无法操作我的网站 https://forum.beginner.center/
我尝试了重启浏览器、电脑和服务器,也更换了其他浏览器,但问题依旧。
我的 app.yml 文件如下:
## 这是 Discourse Docker 容器的全功能独立模板
##
## 修改此文件后,您必须重新构建
## /var/discourse/launcher rebuild app
##
## 编辑时请*格外小心*!
## YAML 文件对空格或对齐的错误极其敏感!
## 如有需要,请访问 http://www.yamllint.com/ 验证此文件
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
# - "templates/web.china.template.yml"
- "templates/web.template.yml"
## 取消注释下一行以启用 IPv6 监听器
#- "templates/web.ipv6.template.yml"
- "templates/web.ratelimited.template.yml"
## 如果您想添加 Lets Encrypt (https),请取消注释以下两行
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
# - "templates/cloudflare.template.yml"
## 此容器应暴露哪些 TCP/IP 端口?
## 如果您希望 Discourse 与 Apache 或 nginx 等其他 Web 服务器共享端口,
## 请参阅 https://meta.discourse.org/t/17247 了解详情
expose:
- "80:80" # http
- "443:443" # https
- "587:587"
params:
db_default_text_search_config: "pg_catalog.english"
## 将 db_shared_buffers 设置为总内存的最大 25%。
## 将基于检测到的 RAM 由 bootstrap 自动设置,您也可以覆盖此值
db_shared_buffers: "128MB"
## 可改善排序性能,但会增加每个连接的内存使用量
#db_work_mem: "40MB"
## 此容器应使用哪个 Git 版本?(默认:tests-passed)
#version: tests-passed
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
## 支持的并发 Web 请求数量?取决于内存和 CPU 核心数。
## 将基于检测到的 CPU 由 bootstrap 自动设置,您也可以覆盖此值
UNICORN_WORKERS: 2
## TODO: 此 Discourse 实例将响应的域名
## 必填项。Discourse 无法在纯 IP 地址上运行。
DISCOURSE_HOSTNAME: forum.beginner.center
## 如果您希望容器以与上述相同的主机名(-h 选项)启动,请取消注释
## (默认值为 "$hostname-$config")
#DOCKER_USE_HOSTNAME: true
## TODO: 初始注册时将被设为管理员和开发人员的电子邮件列表
## 示例:'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'whitewatercn@outlook.com'
## TODO: 用于验证新账户和发送通知的 SMTP 邮件服务器
# 需要 SMTP 地址、用户名和密码
# 警告:SMTP 密码中的字符 '#' 可能导致问题!
DISCOURSE_SMTP_ADDRESS: smtpdm.aliyun.com
DISCOURSE_SMTP_PORT: 80
DISCOURSE_SMTP_USER_NAME: noreply@noreply.beginner.center
DISCOURSE_SMTP_PASSWORD: REDACTED
DISCOURSE_SMTP_ENABLE_START_TLS: false # (可选,默认为 true)
DISCOURSE_SMTP_DOMAIN: noreply.beginner.center
DISCOURSE_NOTIFICATION_EMAIL: noreply@noreply.beginner.center
## 如果您添加了 Lets Encrypt 模板,请取消注释以下行以获取免费 SSL 证书
LETSENCRYPT_ACCOUNT_EMAIL: noreply@noreply.beginner.center
## 此 Discourse 实例的 http 或 https CDN 地址(配置为拉取)
## 请参阅 https://meta.discourse.org/t/14857 了解详情
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
## Maxmind 地理位置 IP 地址查询的密钥
## 请参阅 https://meta.discourse.org/t/-/137387/23 了解详情
#DISCOURSE_MAXMIND_LICENSE_KEY: 1234567890123456
## Docker 容器是无状态的;所有数据都存储在 /shared 中
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## 插件请放在此处
## 请参阅 https://meta.discourse.org/t/19157 了解详情
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-adplugin.git
- git clone https://github.com/paviliondev/discourse-ratings.git
- git clone https://github.com/discourse/discourse-topic-voting
- git clone https://github.com/discourse/discourse-whos-online
- git clone https://github.com/discourse/discourse-solved
- git clone https://github.com/paviliondev/discourse-news
- git clone https://github.com/discourse/discourse-steam-login
- git clone https://github.com/discourse/discourse-table-builder
- git clone https://github.com/merefield/discourse-ai-topic-summary
- git clone https://github.com/discourse/discourse-post-voting
- git clone https://github.com/discourse/discourse-ai
- git clone https://github.com/discourse/discourse-follow
- git clone https://github.com/discourse/discourse-reactions
- git clone https://github.com/discourse/discourse-gamification
- git clone https://github.com/discourse/discourse-yearly-review
- git clone https://github.com/whitewatercn/discourse-embed-bilibili
- git clone https://github.com/discourse/discourse-automation
- git clone https://github.com/discourse/discourse-cakeday
- git clone https://github.com/communiteq/discourse-restrict-pms-to-group
- git clone https://github.com/discourse/discourse-math
## 构建后运行的任何自定义命令
run:
- exec: echo "开始自定义命令"
## 如果您想为首次注册设置「发件人」电子邮件地址,请取消注释并修改:
## 在收到首次注册邮件后,请重新注释该行。该行只需运行一次。
- exec: rails r "SiteSetting.notification_email='noreply@noreply.beginner.center'"
- exec: echo "结束自定义命令"
./launcher logs app 的输出如下:
x86_64 arch detected.
run-parts: executing /etc/runit/1.d/00-ensure-links
run-parts: executing /etc/runit/1.d/00-fix-var-logs
run-parts: executing /etc/runit/1.d/01-cleanup-web-pids
run-parts: executing /etc/runit/1.d/anacron
run-parts: executing /etc/runit/1.d/cleanup-pids
Cleaning stale PID files
run-parts: executing /etc/runit/1.d/copy-env
run-parts: executing /etc/runit/1.d/letsencrypt
[Wed 06 Mar 2024 01:28:00 PM UTC] Domains not changed.
[Wed 06 Mar 2024 01:28:00 PM UTC] Skip, Next renewal time is: 2024-04-11T00:09:12Z
[Wed 06 Mar 2024 01:28:00 PM UTC] Add '--force' to force to renew.
[Wed 06 Mar 2024 01:28:00 PM UTC] Installing key to: /shared/ssl/forum.beginner.center.key
[Wed 06 Mar 2024 01:28:00 PM UTC] Installing full chain to: /shared/ssl/forum.beginner.center.cer
[Wed 06 Mar 2024 01:28:00 PM UTC] Run reload cmd: sv reload nginx
warning: nginx: unable to open supervise/ok: file does not exist
[Wed 06 Mar 2024 01:28:00 PM UTC] Reload error for :
[Wed 06 Mar 2024 01:28:01 PM UTC] Domains not changed.
[Wed 06 Mar 2024 01:28:01 PM UTC] Skip, Next renewal time is: 2024-04-11T00:09:17Z
[Wed 06 Mar 2024 01:28:01 PM UTC] Add '--force' to force to renew.
[Wed 06 Mar 2024 01:28:01 PM UTC] Installing key to: /shared/ssl/forum.beginner.center_ecc.key
[Wed 06 Mar 2024 01:28:01 PM UTC] Installing full chain to: /shared/ssl/forum.beginner.center_ecc.cer
[Wed 06 Mar 2024 01:28:01 PM UTC] Run reload cmd: sv reload nginx
warning: nginx: unable to open supervise/ok: file does not exist
[Wed 06 Mar 2024 01:28:01 PM UTC] Reload error for :
Started runsvdir, PID is 538
ok: run: redis: (pid 547) 0s
ok: run: postgres: (pid 553) 0s
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/discourse.conf:60
supervisor pid: 551 unicorn pid: 578
Shutting Down
run-parts: executing /etc/runit/3.d/01-nginx
ok: down: nginx: 0s, normally up
run-parts: executing /etc/runit/3.d/02-unicorn
(551) exiting
ok: down: unicorn: 1s, normally up
run-parts: executing /etc/runit/3.d/10-redis
ok: down: redis: 0s, normally up
run-parts: executing /etc/runit/3.d/99-postgres
ok: down: postgres: 0s, normally up
ok: down: nginx: 3s, normally up
ok: down: postgres: 1s, normally up
ok: down: redis: 2s, normally up
ok: down: cron: 0s, normally up
ok: down: unicorn: 3s, normally up
ok: down: rsyslog: 0s, normally up
run-parts: executing /etc/runit/1.d/00-ensure-links
run-parts: executing /etc/runit/1.d/00-fix-var-logs
run-parts: executing /etc/runit/1.d/01-cleanup-web-pids
run-parts: executing /etc/runit/1.d/anacron
run-parts: executing /etc/runit/1.d/cleanup-pids
Cleaning stale PID files
run-parts: executing /etc/runit/1.d/copy-env
run-parts: executing /etc/runit/1.d/letsencrypt
[Wed 06 Mar 2024 01:51:54 PM UTC] Domains not changed.
[Wed 06 Mar 2024 01:51:54 PM UTC] Skip, Next renewal time is: 2024-04-11T00:09:12Z
[Wed 06 Mar 2024 01:51:54 PM UTC] Add '--force' to force to renew.
[Wed 06 Mar 2024 01:51:54 PM UTC] Installing key to: /shared/ssl/forum.beginner.center.key
[Wed 06 Mar 2024 01:51:54 PM UTC] Installing full chain to: /shared/ssl/forum.beginner.center.cer
[Wed 06 Mar 2024 01:51:54 PM UTC] Run reload cmd: sv reload nginx
fail: nginx: runsv not running
[Wed 06 Mar 2024 01:51:54 PM UTC] Reload error for :
[Wed 06 Mar 2024 01:51:54 PM UTC] Domains not changed.
[Wed 06 Mar 2024 01:51:54 PM UTC] Skip, Next renewal time is: 2024-04-11T00:09:17Z
[Wed 06 Mar 2024 01:51:54 PM UTC] Add '--force' to force to renew.
[Wed 06 Mar 2024 01:51:55 PM UTC] Installing key to: /shared/ssl/forum.beginner.center_ecc.key
[Wed 06 Mar 2024 01:51:55 PM UTC] Installing full chain to: /shared/ssl/forum.beginner.center_ecc.cer
[Wed 06 Mar 2024 01:51:55 PM UTC] Run reload cmd: sv reload nginx
fail: nginx: runsv not running
[Wed 06 Mar 2024 01:51:55 PM UTC] Reload error for :
Started runsvdir, PID is 531
ok: run: redis: (pid 543) 0s
ok: run: postgres: (pid 548) 0s
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/discourse.conf:60
supervisor pid: 541 unicorn pid: 571