Discourse가 실효성 있는 댓글 플랫폼이 되기 위해 노력해야 할까요?

I’m just catching up with this thread—but I certainly think the answer is yes :slight_smile:

Because of the success of our enterprise community (both with our users, and within our business) our documentation team reached out and asked if we could build a comment system for all of documentation.sailpoint.com. From the looks of it, we’ll be able to do almost everything we want to accomplish at a bare minimum:

  • Embed comments (embedding feature)
    • We also want to use different users to post as, and apply different sets of tags, based on the embedding. This feature is coming very soon:

https://github.com/discourse/discourse/pull/26868/files

From there, everything else the docs team (and my team) wanted was within Discourse for us to effectively segregate this experience from the rest of our “day to day” forum usage, while still giving people the ability comment, get notified of replies, etc.

  • Ability to designate which users can and cannot comment
  • Assign category moderators to the associated topics
  • Suppress this plethora of categories for these docs from our main site
    • category not searchable
    • theme component used to hide it from main category list
    • suppressed from digest
    • added to default muted categories
  • Comments removed after n days
  • A few other settings…

I definitely would love to see many of the features mentioned here implemented, though!

3개의 좋아요

Is the goal to allow users to create comments on https://documentation.sailpoint.com/, or are you ok with just embedding the comments on the docs site and having users visit your Discourse site to comment on articles?

3개의 좋아요

The former is a feature I’d welcome and love to have (read: please build, CDCK), but the latter meets our minimum requirements, at least.

I actually will be exploring an idea in the near future of having Discourse serve up our markdown documentation (no, not in topics, but in traditional markdown-style docs) in which case comments, and signing up to make them, would be all-inclusive. But that exploration hasn’t begun yet.

3개의 좋아요

With the approach I’m working on now, it would be technically possible to allow Discourse comments to be generated directly on MkDocs pages, but it would require using a server side framework (Remix, Rails, etc) to serve the MkDocs pages. That would make it possible to authenticate users (with DiscourseConnect) on the docs site and also allow an in-memory database to be used for caching previously returned comments.

(Edit: just to be clear, I’m talking about using Discourse as an identity provider for the website, not the website as the identity provider for Discourse. The latter approach works, but it’s too inflexible for most use cases.)

That would be a big change to ask your team to make though.

I’m sure from your perspective it would be more straightforward if this was accomplished entirely inside of Discourse, but it’s also possible to use Discourse as a content management system. In that case, the markdown documentation would be generated as regular Discourse topics. Discourse webhooks would be used to trigger the generation of a docs page on an external site. That’s actually the basis of the Discourse comments demo site I’m setting up.

5개의 좋아요

That’s just the thing I love about this platform: it has all the foundations for either (or both!) of these things to be possible.

5개의 좋아요

Since this topic was linked to today, I figured I should update it with the conclusions I came to after putting some work into the idea.

I still think Discourse would make a good comment platform for the reasons I outlined in the OP.

In terms of how to do that, I think the work needs to be done on the Discourse end - ideally by improving the Discourse comment embed script. This could be done incrementally.

It’s technically possible to use Discourse as the server for a comment platform by doing all the work on a Discourse client (for example, the WP Discourse plugin), but due to having to manage the state between the client and Discourse, and get around rate limiting issues, it turns into a complex problem. It’s definitely more complex that something I want to be responsible for maintaining.

A few posts in this topic indicated that people would be interested in just allowing users to create Discourse comments on a blog site. From my point of view that’s not a great solution, but it can be achieved now with the Discourse API. Where things get complicated is in trying to create a full comment system, where users can interact with Discourse comments on a website in a similar way to how they’d expect to interact with comments on a typical mainstream news site.

8개의 좋아요

A drupal integration module is being developed here, where you can write discourse comments on the drupal side via the API.

4개의 좋아요

Given my experience with ActivityPub and WP Discourse I think two-way commenting via embedded javascript is achievable. The embed script would contain the following:

  1. Unauthenticated “read” working in a similar fashion to current js embed (with some optimisations).
  2. Remote client (i.e. the user’s browser) registers a user api key client, specific to the user’s session and stores relevant details in the browser’s local storage.
  3. User is presented with “Login to comment”.
  4. User authenticates (with Discourse) to retrieve a session user api key which is stored in the browser’s local storage.
  5. Each activity (comment, like, etc) is directly posted to a dedicated endpoint with appropriate safeguards, handling and task management.

With the right budget I think I could get v1 production ready and integrated with discourse/discourse in 6-8 months. Following on from initial release I could do the following:

  1. Add explicit support for Wordpress, Ghost and other select platforms.
  2. Write the documentation.
  3. Support it.

cc @pmusaraj @mcwumbly

6개의 좋아요

Try to implement it in a way that makes sense for non-technical users. Existing platforms like Disqus and Facebook comments probably offer good examples.

Some more authentication options:

  • the client site becomes a DiscourseConnect client. This is straightforward to implement, but requires added server side code to the client site.
  • users authenticate on the client and their auth status is passed to the iframe with the postMessage API: Window: postMessage() method - Web APIs | MDN
  • users login directly to Discourse via the iframe

My reluctance to developing this purely on the client side came from considering the problems of the system working at any kind of scale. Essentially, I was having to queue API requests and handle responses from queued requests. It didn’t feel robust enough to deal with, say 1000 concurrent users. I’d have similar concerns, but for different reasons with the javascript embed approach. I suspect it would be much easier to deal with than trying to synchronize everything on the client though.

3개의 좋아요

Thanks for the feedback :slight_smile:

I gave this some more in-depth thought yesterday as the topic was bumped (which is why I ended up posting here). I think a client-only solution (i.e. a javascript embed) is the only one that really makes sense here. Otherwise we’re essentially talking about a number of platform-specific implementations, each with their own set of issues.

You’re right that concurrency and load are issues. There are significant load and concurrency issues with ActivityPub as a single ActivityPub post can open you up to many incoming and outgoing requests to and from the Fediverse. In that context, this may be actually slightly easier as the remote client(s) are controlled. Moreover, in this case, concurrency and load are only really issues on the server side (i.e. the Discourse side), and, while they are issues, I think they should be solvable via background jobs, caching and mutexes. But yes, important issues to consider.

3개의 좋아요

To be honest my biggest concern here is timing.

Composer v2 is just around the corner, it would be crazy to embark on this adventure and not lean on our new composer but there is a mountain of work we need upfront to make using it in a lightweight app feasible.

I think the right thing to do here is to watch this space for new composer for say 2-3 months and then revisit the question.

7개의 좋아요

I think it can be done in parallel. You need to make 2 changes to the discourse.
The “Reply” button should be visible to unregistered users.
reply

And when unregistered users click on this button, this should be displayed:
login
Next, you need to figure out how to use comment insertion. These are likely to be small code changes rather than a lot of work.

2개의 좋아요

I’m wondering if there is still interest in developing this feature, now that Composer v2 is out. Putting my vote in that it’s still something I’d love to see and use.

이 개념 증명(Proof of Concept)을 Discourse Full App Embed Test 에 구축했습니다.

14개의 좋아요

‘답장’이나 ‘좋아요’ 버튼을 클릭할 때 CSP 오류(로 보이는 오류)가 발생합니다.

1개의 좋아요

개념 증명을 위해 https://discourse-on-a-pi5.falco.dev를 방문한 후 데모를 로드하기 전에 로그인해야 합니다.

7개의 좋아요

첫 번째 게시글을 숨겨서 이렇게 보이게 할 수 있을까요?

또한, iframe에 고정된 높이가 필요한가요? 아니면 현재 임베드처럼 댓글 수에 따라 높이가 자동으로 조절되게 할 수도 있나요?

한 가지 더 질문이 있습니다: GTM/Analytics 코드가 이 임베드 내에서 로드되거나 차단되나요? 이상적으로는 로드되지 않는 것이 좋겠습니다. 그렇지 않으면 통계가 중복되니까요(블로그와 디스코스가 동시에 두 번의 페이지뷰를 트리거함).

3개의 좋아요

그렇게 해주시면 좋겠습니다.

궁극적인 목표는 제목과 첫 번째 게시글(OP)을 숨겨 두 번째 게시글이 먼저 보이게 하는 것입니다.

부모 프레임으로 메시지를 전달하는 것은 불가능한 것은 아니지만, 아직 그 부분을 탐구해 보지 않았습니다.

이것도 추가하기가 쉬운 부분입니다.

7개의 좋아요

전체 페이지 임베드를 위한 실험적 작업을 병합했습니다. 관심이 있으시다면 테스트해 보실 수 있습니다.

아래 단계를 따라야 합니다:

  1. 최신 버전으로 업데이트
  2. 숨겨진 설정인 embed_full_app을 활성화
  3. 페이지에 임베드를 구성하는 JS 스니펫에 fullApp: true 추가

이미 로그인되어 있지 않은 사용자의 경우 로그인 흐름이 아직 매끄럽지 않지만, 이미 유효한 쿠키를 가진 커뮤니티에서는 매우 적합할 수 있습니다.

사용 후기를 알려주세요. 앞으로의 방향을 설정하는 데 도움이 됩니다.

10개의 좋아요

안녕하세요 @Falco 님!

수고 많으셨습니다 :slight_smile:

호스팅된 Discourse 인스턴스(Communiteq/discoursehosting.net를 통해)에서 fullApp 임베드를 사용하려고 시도하고 있는데 문제가 발생하고 있습니다.

다음과 같은 조치를 취했습니다:

  • Communiteq에 숨겨진 설정 embed_full_app을 활성화하도록 요청했습니다.
  • JS 스니펫에 fullApp: true를 추가했습니다.
  • 제 임베딩 호스트가 허용된 호스트 목록에 포함되어 있습니다.

다음과 같은 현상이 발생하고 있습니다:

discourseEmbedUrl 없이:

DiscourseEmbed = {
  discourseUrl: 'https://my-forum-url/',
  fullApp: true
};

→ “Error Embedding” 오류가 발생합니다.

discourseEmbedUrl 사용 시:

DiscourseEmbed = {
  discourseUrl: 'https://my-forum-url/',
  discourseEmbedUrl: 'https://my-platform-url/page-where-I-want-discourse-embedded',
  fullApp: true
};

→ 전체 포럼이 로드되지 않고, embedUrl을 크롤링한 후 리다이렉트됩니다(제 플랫폼은 로그인이 필요합니다). 그 결과 리다이렉트 URL을 제목으로 하는 불필요한 토픽이 생성됩니다.

fullApp: true를 완전히 무시하고 일반 댓글 임베드처럼 작동하고 있습니다.

fullApp 모드에서도 discourseEmbedUrl이 필수적인가요?

그렇다면 토픽 생성을 방지하고 대신 전체 포럼만 렌더링하는 방법이 있을까요?

가이드라인을 주시면 감사하겠습니다.

추가 정보를 제공하거나 테스트를 수행할 수 있습니다.

감사합니다!

2개의 좋아요