# 如果本地登录已禁用

**URL:** <https://meta.discourse.org/t/if-local-logins-are-disabled/403735>\
**Category:** Support\
**Created:** [2026年五月25日 04:27 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735 "2026-05-25T04:27:11Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![abeen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abeen/32/556478_2.png) [@abeen](https://meta.discourse.org/u/abeen)\
**Post date:** [2026年五月27日 05:03 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/21 "2026-05-27T05:03:22Z")

</div>

今天真是漫长的一天，从昨晚开始就一直卡在这个问题上……不得不销毁了那个 Droplet，重新创建了一个不带 SMTP 配置的新实例。当我尝试添加 SMTP 配置时，重建过程很快，结果又回到了原点……我暂时不再添加任何 SMTP 配置了。

---

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年五月28日 00:57 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/22 "2026-05-28T00:57:35Z")

</div>

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326):
>
> You just installed Discourse via [the install guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md), but email doesn’t seem to work. Unfortunately this means you can’t log in as an admin to finalize the install. cry Let’s troubleshootize! Try the doctor woman_health_workerIf you run ./discourse-doctor it will check several ways that your mail configuration might be broken, and offer advice. Try that first. Did you enter email settings correctly? The simplest way is to run ./discourse-setup again. Did you enter everything correctly? B…

---

<div class="post-metadata">

**Author:** ![abeen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abeen/32/556478_2.png) [@abeen](https://meta.discourse.org/u/abeen)\
**Post date:** [2026年五月28日 01:24 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/23 "2026-05-28T01:24:08Z")

</div>

在 DO 市场places 中搜索了相关文档，并通过 Web 控制台完成安装。其余部分是从 ChatGPT 复制粘贴的代码。创建了管理员账户，执行了 rake create:admin 命令，过程中得到了 ChatGPT 的帮助。由于构建过程仅耗时几秒（通常需 4-5 分钟），我不得不销毁旧的 Droplet。我并非开发者，ChatGPT 提到了容器损坏和 Nginx 运行缓慢等问题，但我至今仍未完全弄清楚具体原因。无论如何，我现在已搭建好一个新的环境，暂时未配置 SMTP，对 yml 文件仍心存顾虑。

---

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年五月28日 01:32 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/24 "2026-05-28T01:32:49Z")

</div>

你使用 DiscourseID 了吗？我本想建议你暂时跳过 SMTP 配置：

> <https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#step-3-run-the-installer>

 ![Screenshot 2026-05-27 at 6.32.34 PM](https://global.discourse-cdn.com/meta/original/4X/c/a/1/ca1bcddc637d05de86e22df4a9ab5b8f653c9d48.png)

---

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年五月28日 01:36 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/25 "2026-05-28T01:36:31Z")

</div>

> [@abeen](#):
>
> 害怕那个 yml 文件。

哈哈，好的，我想你并不孤单。哪怕只是多一个空格、逗号，或者少了一个引号，都可能搞砸一个 `.yml` 文件。

好吧，如果你的论坛现在已经正常运行了，那就说明构建成功了。以你目前的硬件配置，重新构建可能需要一些时间，但绝对足以支撑论坛运行。我以前用过这种规模的配置。只需确保让重新构建过程继续运行即可。它有时会暂停，看起来好像停了一段时间，但最终会完成。你会在最后看到 yml 配置块，然后回到 `/var/discourse` 提示符。那时网站就会启动。

---

<div class="post-metadata">

**Author:** ![abeen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abeen/32/556478_2.png) [@abeen](https://meta.discourse.org/u/abeen)\
**Post date:** [2026年五月28日 02:29 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/26 "2026-05-28T02:29:47Z")

</div>

YML 不易于人类阅读，看起来像记事本但又不是，适合用于复制粘贴、保存的 diff 命令。

我原本考虑使用 Discourse ID，但考虑到大多数成员将使用 Gmail 或 Outlook，我不想强迫他们创建 Discourse ID。好在 Discourse 提供了 OAuth 登录功能。我会逐步优化注册和登录流程。

---

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年五月28日 13:57 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/27 "2026-05-28T13:57:07Z")

</div>

好的，既然你已经切换到 Vultr，那我们就实际尝试解决这个问题，而不是每次遇到问题就换不同的主机。

请将你在终端中看到的任何错误贴到这里——复制你看到的全部输出，并用反引号包裹后粘贴在这里，就像这样：

 ![Screenshot 2026-05-28 at 6.49.42 AM](https://global.discourse-cdn.com/meta/original/4X/3/f/4/3f47b1f753ee63c11ad82f594c98029f8b8c0601.png)

我们需要查看你的完整 `app.yml` 文件。

`cd /var/discourse`  
`cat containers/app.yml`

将完整的输出用三重反引号包裹后粘贴在上面，但请移除密码字符串（保留你用来包裹密码的引号，以便我们确认它们是否正确以及其他语法问题）。

---

<div class="post-metadata">

**Author:** ![abeen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abeen/32/556478_2.png) [@abeen](https://meta.discourse.org/u/abeen)\
**Post date:** [2026年六月5日 11:42 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/28 "2026-06-05T11:42:19Z")

</div>

感谢大家提供的宝贵意见。@Lilly 感谢您的有益建议。昨晚尝试重新发送，但没有成功；今天再次尝试，Brevo 果然出色！一次就完美运行了。本来对配置 YML 文件感到有些担心，但 Brevo 创造了奇迹。

---

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [2026年六月6日 02:31 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/29 "2026-06-06T02:31:06Z")

</div>

是的，Brevo 相当不错（而且每天 300 封免费邮件！），我之前用过，设置起来非常简单。

---

<div class="post-metadata">

**Author:** ![rogerreed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rogerreed/32/545818_2.png) [@rogerreed](https://meta.discourse.org/u/rogerreed)\
**Post date:** [2026年七月17日 09:39 UTC](https://meta.discourse.org/t/if-local-logins-are-disabled/403735/30 "2026-07-17T09:39:22Z")

</div>

> [@abeen](#):
>
> 你好，
> 
> 我刚开始搭建一个论坛，对 Discourse 完全陌生，托管在 DO（DigitalOcean）上，不知为何遇到了 SMTP 或端口问题。现在想了解一下，你们是否采用了 Google 登录或其他社交登录方式，如果论坛中没有本地注册/登录功能，是否就没有问题？

当 SMTP 出现故障时，请先快速检查你的 SMTP 主机、端口、TLS/SSL 以及防火墙设置。即使仅使用 Google 或其他社交登录，你的论坛通常也能正常运行，但如果正确配置了电子邮件，本地发起的注册功能也应该能正常工作。

[上一頁](https://meta.discourse.org/t/if-local-logins-are-disabled/403735.md?page=1)
