始终匿名类别插件

I had a request from a co-worker to find a way to offer “anonymous Q&A” to our division’s employees. At first blush, Discourse seemed like the wrong tool for the job: anonymous posting seemed anathema to the whole point of fostering open, friendly, but lively discussions. Discourse does have built-in support for anonymous posting, but it’s a global setting. What we needed was a way to restrict anonymous posting to a single category (or a select subset of them). Even better, make anonymous posting automatic, so that users don’t have to think about it (and can’t get it wrong).

Thus was born discourse-anonymous-categories.

This plugin lets you choose individual categories for “always-anonymous” behavior, where all posts and replies automatically use the anonymous pseudonym for the user instead of their actual identity. The user doesn’t have to opt-in, and more importantly, doesn’t need to remember to opt-out when they are done posting.

Here’s what that looks like:

  1. After the plugin is installed, turn on the global setting to enable “always-anonymous” categories:

  2. Then, pick a category (or create a new one) for which you want “always-anonymous” behavior, and turn on the “Force posts to be anonymous in this cateory” setting:

  3. Now, when anyone posts (note that current user is “E”):

  4. They will actually get anonymized:

  5. … like this (note that post is as “anonymous”/“A”):


This plays very nicely with recent versions of discourse-feature-voting, which can be used to anonymously vote on topics. (The votes themselves aren’t anonymous, but the identities of the voters are not currently surfaced through the UI, unlike “Likes”.)

30 个赞

and whether non-registered users to post messages in this category?

Is this plugin still working (it hasn’t been updated since two years)?

2 个赞

Somehow I’m having a hard time making it work on my local environment. I’m gonna do some digging and share back here.

Yes, it still works. I had to delete my tmp folder in order to make it work but I think this is a problem with my local dev installation only (not using docker).

2 个赞

Sadly, the purpose for which this was created no longer exists, so I haven’t given the plugin any love for the last several years. If anyone wants to take over maintenance, I’d be happy to let them!

6 个赞

I have a use for this plugin. How do I get it ‘looked after again’? Non-tech person asking, I’m on Communiteq (formerly DiscourseHosting). @michaeld @RGJ

Do you have a budget for this? If so, posting in marketplace is most likely the best approach :slight_smile:

6 个赞

Are you sure that the plugin is not working correctly anymore?

When I read the posts above it just says it needs a new maintainer but Daniel says “Yes, it still works”

2 个赞

Yes, I agree the post says it needs a new maintainer. I guess that’s what I’m wondering if someone would do. Is that something that comes with my Pro hosting package?

I am runing it on v2.0.0.beta10 +111 and looks like it is working.
I do not have some issues whit my instace

2 个赞

仅供参考 - Docker 版本 2.4:向标记为匿名的分类发布时,添加插件会生成 500 服务器错误。

@JaredReisinger 已将此移至 #plugin:broken-plugin,等待您调查。我在 2.4 版本中重写了匿名账户的处理方式,因此可能是这导致了插件故障。

5 个赞

如上所述,我和 @michaeld 很乐意接手该插件的维护工作。

6 个赞

您能预估一下修复时间吗?:wink:

可能是在九月左右……

1 个赞

@sam 说得对,针对匿名用户的最新工作破坏了该插件。我正在调查这个问题,因为我的公司的一款产品需要它。

我在产品中遇到的错误是:

NoMethodError (undefined method `create_shadow' for AnonymousShadowCreator:Class) /var/www/discourse/plugins/discourse-anonymous-categories/plugin.rb:76:in `block (2 levels) in activate!'

错误来自这一行:

我会尝试修复它,并很快在这里发布更新。

4 个赞

这是我快速的修复方案:Updating plugin to work with Discourse v2.4.0.beta2 · danielvlopes/discourse-anonymous-categories@08dda70 · GitHub

我认为现在 Discourse 对匿名用户的支持更好了,我也可以移除用户自定义字段(user custom_fields)相关的部分,但目前我会先保持这个改动简单。

4 个赞

@JaredReisinger 您还在维护这个插件吗?如果不是的话,也许 @Daniel_Lopes 可以在此处将其设为 OP 以指向该分支,这样我们就可以将这个问题从 #plugin:broken-plugin 中解决掉。

4 个赞

对不起,我知道我不是专家,无法让它工作……能否请您写几句说明?谢谢。