# Sysadmins

**URL:** https://meta.discourse.org/c/wiki/sysadmins/180.md?page=2

[最新版本](https://meta.discourse.org/latest.md) · [分類](https://meta.discourse.org/categories.md) · [標簽](https://meta.discourse.org/tags.md)

**Page:** 3

---

## [🇨🇳 500 error when upgrading Discourse | Discourse 升级时候 500 错误](https://meta.discourse.org/t/500-error-when-upgrading-discourse-discourse-500/308473)

<div class="topic-metadata">

**Author:** [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**回覆:** 2\
**Last updated:** [2024年五月19日 16:35 UTC](https://meta.discourse.org/t/500-error-when-upgrading-discourse-discourse-500/308473 "2024-05-19T16:35:35Z")

</div>

在对 Discourse 升级的时候，得到系统的错误： 这个错误比较诡异，直接就 500 错误了，没有办法查看其他的提示信息。 后来通过服务器上的日志，我们看到： 看这个情况应该是没有安装成功。 错误原因 针对上面的错误原因，官方的解释是可以到服务器上去运行 rebuild 命令。 cd /var/discourse ./launcher rebuild app 随后我们看到 Discourse 在从服务器上获取…

---

## [恢复（取消删除）用户的所有帖子](https://meta.discourse.org/t/restore-undelete-all-posts-by-a-user/304643)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 0\
**Last updated:** [2024年四月19日 16:50 UTC](https://meta.discourse.org/t/restore-undelete-all-posts-by-a-user/304643 "2024-04-19T16:50:12Z")

</div>

如果您想恢复/取消删除用户删除的所有帖子，您可以这样做： u=User.find\_by\_username('=username='); moderator=User.find\_by\_username('=moderator='); deleted\_posts = Post.with\_deleted.where(user\_id: u.id).where("deleted\_at is not null"); deleted\_pos…

---

## [🇨🇳 The IP address in Discourse’s user information shows CloudFlare’s IP address | Discourse 的用户信息中的 IP 地址显示的是 CloudFlare 的 IP 地址](https://meta.discourse.org/t/the-ip-address-in-discourse-s-user-information-shows-cloudflare-s-ip-address-discourse-ip-cloudflare-ip/265556)

<div class="topic-metadata">

**Author:** [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**回覆:** 22\
**Last updated:** [2024年四月14日 15:56 UTC](https://meta.discourse.org/t/the-ip-address-in-discourse-s-user-information-shows-cloudflare-s-ip-address-discourse-ip-cloudflare-ip/265556 "2024-04-14T15:56:11Z")

</div>

因为使用了 CloudFlare 的反向地址。 所有 Discourse 获得的用户的 IP 地址其实是 CloudFlare 的服务器地址。 修改 好在 Discourse 已经提供了相关的解决方案。 需要在 Discourse 的配置文件中，添加下面的内容： “templates/cloudflare.template.yml” 然后重新 Build 你的 Discourse 的安装实例。 ./launch…

---

## [配置对传入邮件的身份验证检查](https://meta.discourse.org/t/configure-authentication-checks-on-incoming-email/134358)

<div class="topic-metadata">

**Author:** [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**回覆:** 3\
**Last updated:** [2024年四月2日 07:14 UTC](https://meta.discourse.org/t/configure-authentication-checks-on-incoming-email/134358 "2024-04-02T07:14:55Z")

</div>

As of this commit, Discourse now supports parsing the Authentication-Results header of incoming emails. This header contains information about whether we can trust that an email is actually coming from the person who cla…

---

## [将Kunena 3论坛迁移到Discourse](https://meta.discourse.org/t/migrate-a-kunena-3-forum-to-discourse/43776)

<div class="topic-metadata">

**Author:** [@tarek](https://meta.discourse.org/u/tarek)\
**回覆:** 34\
**Last updated:** [2023年十二月14日 09:33 UTC](https://meta.discourse.org/t/migrate-a-kunena-3-forum-to-discourse/43776 "2023-12-14T09:33:11Z")

</div>

Want to migrate from Kunena3 to Discourse? Great! Let’s get started. Note: @tarek’s fine work on this topic was replaced wholesale after @pfaffman made considerable changes to the importer. Do not blame @tarek for mista…

---

## [使用需要MySQL的导入脚本](https://meta.discourse.org/t/use-an-import-script-that-requires-mysql/63349)

<div class="topic-metadata">

**Author:** [@lead4good](https://meta.discourse.org/u/lead4good)\
**回覆:** 51\
**Last updated:** [2023年十二月12日 14:41 UTC](https://meta.discourse.org/t/use-an-import-script-that-requires-mysql/63349 "2023-12-12T14:41:11Z")

</div>

:information\_source: For a more general guide for setting up an docker environment for running import scripts to migrate your forum see: Set up an environment to migrate another forum to Discourse So, you’ve been weep…

---

## [将使用 Redis 的 NodeBB 论坛迁移到 Discourse](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-redis-to-discourse/124897)

<div class="topic-metadata">

**Author:** [@enigmaty](https://meta.discourse.org/u/enigmaty)\
**回覆:** 2\
**Last updated:** [2023年十一月17日 19:28 UTC](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-redis-to-discourse/124897 "2023-11-17T19:28:34Z")

</div>

This tutorial will show you how to use the NodeBB Importer to migrate NodeBB forum to Discourse platform. If your NodeBB forum uses MongoDB as backend then follow this tutorial. Do not worry, It is an easy process. Let’s…

---

## [将 Google Workspace 配置为 SMTP 中继](https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662)

<div class="topic-metadata">

**Author:** [@poyrazdursuncan](https://meta.discourse.org/u/poyrazdursuncan)\
**回覆:** 4\
**Last updated:** [2023年七月13日 19:56 UTC](https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662 "2023-07-13T19:56:38Z")

</div>

:e\_mail: 1. 购买 Google Workspace 服务 我推荐 Business Standard 套餐。您创建的电子邮件帐户的密码将发送到您在 Google Workspace 购买套餐时使用的帐户。 2. 配置 Google Workspace MX 名称/主机/别名 生存时间 (TTL\*) 记录类型 优先级 值/答案/目标 @ 或留空 3600 MX 1 ASPMX.L.GOOGLE.COM …

---

## [🇨🇳 Configure MAXMIND for reverse IP lookups | Discourse 如何配置 MAXMIND 来对 IP 地址反向查询](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups-discourse-maxmind-ip/265932)

<div class="topic-metadata">

**Author:** [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**回覆:** 0\
**Last updated:** [2023年五月23日 14:59 UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups-discourse-maxmind-ip/265932 "2023-05-23T14:59:20Z")

</div>

:warning: 【配置 MAXMIND，Discourse 需要重新构建，这将会导致服务中断。 】 什么是 MAXMIND 和为什么我们需要使用这个服务 Discourse 使用 MAXMIND 来通过 IP 地址反向查询具体的物理地址。 如果 Discourse 没有配置 Maxmind’s 数据库，我们看到的配置信息如下： 或者在对 Discourse 容器重新编译的时候，看到下面的信息： MaxM…

---

## [将 MyBB 论坛迁移到 Discourse](https://meta.discourse.org/t/migrate-a-mybb-forum-to-discourse/130789)

<div class="topic-metadata">

**Author:** [@enigmaty](https://meta.discourse.org/u/enigmaty)\
**回覆:** 21\
**Last updated:** [2023年三月21日 14:45 UTC](https://meta.discourse.org/t/migrate-a-mybb-forum-to-discourse/130789 "2023-03-21T14:45:24Z")

</div>

In this tutorial, we will learn how to migrate MyBB forum to :discourse: platform using the official MyBB Importer script. What can be migrated Categories Root category =\> root category Child category =\> sub category R…

---

## [在 Discourse 中使用 Protonmail Bridge](https://meta.discourse.org/t/use-protonmail-bridge-with-discourse/229503)

<div class="topic-metadata">

**Author:** [@meglio](https://meta.discourse.org/u/meglio)\
**回覆:** 4\
**Last updated:** [2023年二月25日 19:41 UTC](https://meta.discourse.org/t/use-protonmail-bridge-with-discourse/229503 "2023-02-25T19:41:34Z")

</div>

问题：a) Protonmail Bridge 无法监听除 127.0.0.1 以外的 IP，b) Docker 容器中的 Discourse 无法向主机机器的 127.0.0.1 发送 SMTP 请求。 解决方案：我们将其配置为发送到 172.17.0.1（主机上的 Docker 的桥接 IP），然后重定向到 Protonmail Bridge 正在监听的 127.0.0.1。 我们使用 Socat 来实现这一点。 操作方法 首…

---

## [将 Vanilla 论坛迁移到 Discourse](https://meta.discourse.org/t/migrate-a-vanilla-forum-to-discourse/27273)

<div class="topic-metadata">

**Author:** [@Abdul\_Munim\_Zahid](https://meta.discourse.org/u/Abdul_Munim_Zahid)\
**回覆:** 44\
**Last updated:** [2023年一月30日 18:36 UTC](https://meta.discourse.org/t/migrate-a-vanilla-forum-to-discourse/27273 "2023-01-30T18:36:56Z")

</div>

I know there are a lot of posts about importing contents from a vanilla forum, but theres a lack of comprehensive guide! Not everyone can afford to hire a developer to migrate their forums and this is my way of giving b…

---

## [关于 Google Cloud S3 的提示](https://meta.discourse.org/t/tips-on-google-cloud-s3/247555)

<div class="topic-metadata">

**Author:** [@Jerome\_Hordies](https://meta.discourse.org/u/Jerome_Hordies)\
**回覆:** 4\
**Last updated:** [2022年八月25日 14:08 UTC](https://meta.discourse.org/t/tips-on-google-cloud-s3/247555 "2022-08-25T14:08:01Z")

</div>

@Pfaffman 将此 Google Cloud 信息分拆出来，该信息不一定适合放在 OP 中，但应为遇到 Google Cloud 问题的用户保存。 您好， 感谢您的提示，但直到我将角色从“存储旧版对象所有者”更改为“存储旧版存储桶所有者”后，它才对我起作用。 在选择角色时，工具提示中明确写着： 存储旧版对象所有者 对现有对象的读/写访问权限不包括列出。 存储旧版存储桶所有者 对现有存储桶的读写访问权限，包括列出、创…

---

## [快速迁移到将 Web 和数据容器分开的方案](https://meta.discourse.org/t/migrate-quickly-to-separate-web-and-data-containers/153355)

<div class="topic-metadata">

**Author:** [@mcdanlj](https://meta.discourse.org/u/mcdanlj)\
**回覆:** 7\
**Last updated:** [2022年十一月6日 02:07 UTC](https://meta.discourse.org/t/migrate-quickly-to-separate-web-and-data-containers/153355 "2022-11-06T02:07:58Z")

</div>

:warning: Warning: If you are not comfortable working as a Linux systems administrator, and do not have experience with docker containers, moving to a multi-container deployment will cause you difficulty, and both staf…

---

## [重新排列话题和类别的软件架构](https://meta.discourse.org/t/script-framework-to-rearrange-topics-and-categories/241964)

<div class="topic-metadata">

**Author:** [@mcdanlj](https://meta.discourse.org/u/mcdanlj)\
**回覆:** 6\
**Last updated:** [2022年十月28日 00:42 UTC](https://meta.discourse.org/t/script-framework-to-rearrange-topics-and-categories/241964 "2022-10-28T00:42:07Z")

</div>

为了脚本化地重新排列一个大型 Discourse 站点，并与我的网站领导层合作，我编写了一个简单的框架，用于打包一系列 ruby 脚本，并通过 YAML 配置文件进行驱动。这样，我就可以在暂存站点上恢复备份，运行我的脚本，获得反馈，更改几行 YAML，恢复备份，用新配置运行脚本，然后重复，直到满意为止。 我的网站有近 600 行配置，通过 UI 手动操作是行不通的。更不用说多次操作来获得正确的结果了。我知道这一点，因为上次我提出进行大…

---

## [提供静态文件](https://meta.discourse.org/t/serve-static-file/80585)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 13\
**Last updated:** [2022年十月4日 21:47 UTC](https://meta.discourse.org/t/serve-static-file/80585 "2022-10-04T21:47:19Z")

</div>

Want to serve a static file at the root of your Discourse server? Here’s what to do. In the bottom of your app.yml file, down in the custom commands section, do something like this: ## Remember, this is YAML syntax - y…

---

## [通过 rails 控制台设置或更新推荐主题链接](https://meta.discourse.org/t/set-or-update-a-featured-topic-link-via-the-rails-console/166923)

<div class="topic-metadata">

**Author:** [@Canapin](https://meta.discourse.org/u/Canapin)\
**回覆:** 0\
**Last updated:** [2020年十月11日 22:22 UTC](https://meta.discourse.org/t/set-or-update-a-featured-topic-link-via-the-rails-console/166923 "2020-10-11T22:22:54Z")

</div>

You can set or update a featured link on a topic by using the rails console. From your server, enter the rails console from your Discourse folder: ./launcher enter app rails c You can then use the @nathank’s form to g…

---

## [在隔离的 CentOS 7 服务器上安装 Discourse](https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538)

<div class="topic-metadata">

**Author:** [@nil4](https://meta.discourse.org/u/nil4)\
**回覆:** 23\
**Last updated:** [2022年七月5日 11:15 UTC](https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538 "2022-07-05T11:15:17Z")

</div>

Here is what worked for me to install Discourse on an isolated CentOS 7 server. In a nutshell, on a machine with internet access I prepared: the Git repos that Discourse setup needs: SamSaffron/pups, discourse/discours…

---

## [手动创建和还原 Discourse 备份](https://meta.discourse.org/t/manually-create-and-restore-discourse-backups/18273)

<div class="topic-metadata">

**Author:** [@elberet](https://meta.discourse.org/u/elberet)\
**回覆:** 13\
**Last updated:** [2022年六月16日 16:10 UTC](https://meta.discourse.org/t/manually-create-and-restore-discourse-backups/18273 "2022-06-16T16:10:07Z")

</div>

As discussed below, a warning for newbies: this is an advanced method! there is an automated, web UI way to restore from backups at /admin/backups which is so much easier. with the method below, no automatic backup is …

---

## [使用 rclone 将备份同步到 Dropbox 或 Google Drive](https://meta.discourse.org/t/use-rclone-to-sync-backups-to-dropbox-or-google-drive/97294)

<div class="topic-metadata">

**Author:** [@tophee](https://meta.discourse.org/u/tophee)\
**回覆:** 1\
**Last updated:** [2022年五月4日 22:44 UTC](https://meta.discourse.org/t/use-rclone-to-sync-backups-to-dropbox-or-google-drive/97294 "2022-05-04T22:44:54Z")

</div>

There is a plugin that allows you to sync your discourse backups to various cloud storage providers. Unfortunately, it currently doesn’t work with Dropbox and Google Drive. If you nevertheless want to store your backup o…

---

## [在上线之前建立一个沙盒来测试更改](https://meta.discourse.org/t/build-a-sandbox-to-test-changes-before-making-them-live/58298)

<div class="topic-metadata">

**Author:** [@JagWaugh](https://meta.discourse.org/u/JagWaugh)\
**回覆:** 20\
**Last updated:** [2022年二月16日 23:18 UTC](https://meta.discourse.org/t/build-a-sandbox-to-test-changes-before-making-them-live/58298 "2022-02-16T23:18:54Z")

</div>

Regardless of if you’re a moderator or an admin, you will no doubt at some time think about making some change to your live site and wonder if this will bring shame on you, and/or cause yourself an enormous amount of wor…

---

## [在Oracle Cloud免费层上安装Discourse](https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749)

<div class="topic-metadata">

**Author:** [@Canapin](https://meta.discourse.org/u/Canapin)\
**回覆:** 0\
**Last updated:** [2022年一月23日 23:15 UTC](https://meta.discourse.org/t/install-discourse-on-oracle-cloud-free-tier/215749 "2022-01-23T23:15:36Z")

</div>

\<div data-theme-toc="true"\>\</div\> Oracle 提供了一个免费套餐，其中包括两台低配置虚拟机，能够运行 Discourse。 此试用版没有时间限制。 :warning: 这些虚拟机速度非常慢，我建议不要用它们来托管社区。 话虽如此，对于不介意速度慢的非常小的社区，或者用于个人项目/测试，它可能就足够了。 要求 一张信用卡号 - 您不会被收费，但注册免费账户需要它 一个域名 一个电子邮件提…

---

## [🇨🇳 How to change the domain name | 如何修改 Discourse 的域名](https://meta.discourse.org/t/how-to-change-the-domain-name-discourse/202567)

<div class="topic-metadata">

**Author:** [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**回覆:** 0\
**Last updated:** [2021年九月3日 20:06 UTC](https://meta.discourse.org/t/how-to-change-the-domain-name-discourse/202567 "2021-09-03T20:06:31Z")

</div>

本篇文章翻译自英文的原文： Change the domain name or rename your Discourse :warning: 如果你参考了 GitHub 上的安装指南 页面中的内容安装了一个 Discourse 实例后希望对自己安装的实例修改域名的使用手册。 如果你使用的是 Discourse 官方主机服务 的话，请参考 针对 Discourse 的云服务配置你的域名 页面中的详细内容。 假设，你现在…

---

## [恢复已被删除的长主题](https://meta.discourse.org/t/restore-a-long-topic-that-has-been-deleted/180986)

<div class="topic-metadata">

**Author:** [@neounix](https://meta.discourse.org/u/neounix)\
**回覆:** 0\
**Last updated:** [2021年二月24日 08:58 UTC](https://meta.discourse.org/t/restore-a-long-topic-that-has-been-deleted/180986 "2021-02-24T08:58:16Z")

</div>

On our forums, we had a long topic with over 300 posts with a commercial webdev client and for some reason, that entire topic vanished a few day ago after moving a few posts to a different topic. I checked the user acti…

---

## [将 vBulletin 3 论坛迁移到 Discourse，通过 XenForo](https://meta.discourse.org/t/migrate-a-vbulletin-3-forum-to-discourse-via-xenforo/177573)

<div class="topic-metadata">

**Author:** [@AstonJ](https://meta.discourse.org/u/AstonJ)\
**回覆:** 0\
**Last updated:** [2021年一月28日 17:24 UTC](https://meta.discourse.org/t/migrate-a-vbulletin-3-forum-to-discourse-via-xenforo/177573 "2021-01-28T17:24:50Z")

</div>

Writing this up while it’s fresh in my mind - it’s currently a work in progress so make sure you test it and ensure that it meets your needs. There isn’t a vB3 to Discourse importer as far as I know, and I don’t have an…

---

## [使用 crontab 和 dropboxd 将备份上传到 Dropbox](https://meta.discourse.org/t/upload-backups-to-dropbox-with-crontab-and-dropboxd/176982)

<div class="topic-metadata">

**Author:** [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)\
**回覆:** 0\
**Last updated:** [2021年一月22日 20:59 UTC](https://meta.discourse.org/t/upload-backups-to-dropbox-with-crontab-and-dropboxd/176982 "2021-01-22T20:59:47Z")

</div>

Dropbox has an advantage - it syncs a new backup as soon as it appears in the system. The deal is to put new backup to your local Dropbox folder (with a cron script provided). Before you proceed you have to know: You …

---

## [用淘宝镜像替换 rubygems.org 以解决在中国的网络错误](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988)

<div class="topic-metadata">

**Author:** [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**回覆:** 3\
**Last updated:** [2021年一月21日 07:15 UTC](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988 "2021-01-21T07:15:25Z")

</div>

rubygems.org hosts its resource in Amazon S3 which is disturbed by GFW. So gem and bundle complain from time to time. This guide assumes you used docker installation. This guide also has a version in Chinese. 中文指南 Add …

---

## [使用HTTP基本认证限制对您的Discourse站点的访问](https://meta.discourse.org/t/restrict-access-to-your-discourse-site-with-http-basic-authentication/168192)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 0\
**Last updated:** [2020年十月23日 16:28 UTC](https://meta.discourse.org/t/restrict-access-to-your-discourse-site-with-http-basic-authentication/168192 "2020-10-23T16:28:18Z")

</div>

Sometimes you don’t want the general public to be able to access your Discourse instance quite yet, like when you’re staging a site for a migration. NOTE: I have had some trouble with basic-auth recently in which some s…

---

## [在使用 Digital Ocean 进行 DNS 时，配置 Mailgun 以发送电子邮件](https://meta.discourse.org/t/configure-mailgun-for-email-when-using-digital-ocean-for-dns/40590)

<div class="topic-metadata">

**Author:** [@Steven](https://meta.discourse.org/u/Steven)\
**回覆:** 28\
**Last updated:** [2020年十月14日 15:38 UTC](https://meta.discourse.org/t/configure-mailgun-for-email-when-using-digital-ocean-for-dns/40590 "2020-10-14T15:38:22Z")

</div>

I had a little bit of trouble to connect Mailgun and Digital Ocean (espacially the DNS configuration in Digital Ocean), so I’ve decided to create a little guide to help others : Connecting Mailgun with Digital Ocean Ini…

---

## [迁移到新主机时保持用户会话](https://meta.discourse.org/t/preserve-user-sessions-when-migrating-to-a-new-host/166630)

<div class="topic-metadata">

**Author:** [@TallTrees](https://meta.discourse.org/u/TallTrees)\
**回覆:** 0\
**Last updated:** [2020年十月7日 21:18 UTC](https://meta.discourse.org/t/preserve-user-sessions-when-migrating-to-a-new-host/166630 "2020-10-07T21:18:58Z")

</div>

Continuing the discussion from Move your Discourse Instance to a Different Server: One issue in migrating a Discourse instance to a new server, or even restoring a backup to a newly built instance, is that all logged in…

[上一頁](https://meta.discourse.org/c/wiki/sysadmins/180.md?page=1)

[下一頁](https://meta.discourse.org/c/wiki/sysadmins/180.md?page=3)
