How to setup up a private forum with Discourse


(Justin Gordon) #1

I’m setting up discourse.org for my local Harvard Club of Maui alumni club. Jeff Atwood set us up on Digital Ocean. Is there a FAQ somewhere that shows me how to setup a private forum in the way that Parley is setup?

This seems related, but I want to get confirmation on the latest: Discourse Meta


Restrict some posts to logged in users
(Sam Saffron) #2

The 3 settings you want are:

  • login required
  • must approve users
  • invite only

All 3 should be true, then to onboard users you invite them to a welcome topic.


(Jeff Atwood) #3

This is covered in the Admin Quick Start Guide topic that is a part of every default Discourse install – I don’t think you had seen it yet since the DNS wasn’t changed for such a long time:


(Kris Alcordo) #4

This is something I am looking into as well. Thank you #Coolio


(eriko) #5

I have run in to an issue with this and onebox. When saving a post that links to another post it take about 30 seconds to save and there is a 404 error in the logs from the site trying to request a page that requires a login to get to.


(Jeff Atwood) #6

Maybe you can add that to your list for self oneboxing on a private forum @eviltrout.


(Robin Ward) #7

I just tried this out by linking to a private post and it responded in less than a second as a 404. Can you reproduce the 30 second wait? Is it specific to your server set up perhaps?


(eriko) #8
Started GET "/onebox?url=http%3A%2F%2Flocalhost%3A3000%2Ft%2Ftest-you-tube-test-filters%2F6&refresh=false" for 127.0.0.1 at 2014-04-09 15:37:00 -0700
Processing by OneboxController#show as HTML
Parameters: {"url"=>"http://localhost:3000/t/test-you-tube-test-filters/6", "refresh"=>"false"}
User Load (2.2ms)  SELECT "users".* FROM "users" WHERE "users"."auth_token" = '56256c10d5c4d00eb44d705dc11ec06c' ORDER BY "users"."id" ASC LIMIT 1
Rendered text template (0.0ms)
Completed 404 Not Found in 40149ms (Views: 118.4ms | ActiveRecord: 2.2ms)

Even in dev from a current pull I get a lag where is there is a “Saving” bar at the bottom and as an extra when replying to a topic a working swirl next the the reply. Once the onebox stuff above 404’s both the Saving bar and the swirl go away.

The post does eventually save and just displays the url as a link.


(Robin Ward) #9

Do you control the private forum you’re trying to onebox? Does it take 30 seconds to reply? That seems like a long time.


(eriko) #10

to be clear this is a discourse instance linking to it’s self and not another site.


(Robin Ward) #11

Oooh I see. There’s a special code path for that that shouldn’t be making HTTP requests at all. I will look into it again.


(eriko) #12

I am wonder if this is because I have the site wrapped in https via apache that is serving it up. Discourse thinks it is http and does not match to the https based url.


(Kane York) #13

Won’t enabling the use_https site setting fix that? You said it’s already running, so…


(Sam Saffron) #14

look at the https template for docker, it adds a header.


(eriko) #15

Ah now that is interesting. I do not have that checked. For institutional reasons that I won’t get into I am running this in roll your own environment without docker. That said activating that setting has fixed this issue.

thanks @riking


(Joshua Frank) #16

This works perfectly, but with a tiny quibble; I used invite only, logged out, went to the site home page, and got this message:

But you have to be invited, so the screen text should say something to that effect and not ask you to create an account that you’re not allowed to create.


Custom login page?
(Joshua Frank) #17

Also, is it possible (without forking the code) to customize this message, for instance, to provide the name and address of an admin you can contact to request an invitation?


Custom login page?
(Jeff Atwood) #18

Admin, Content, Login Required: Welcome Message


Custom login page?
(Joshua Frank) #19

Perfect, thanks!

I noticed that this message can contain tokens like %{title}. Is there documentation somewhere about what the possible tokens are?


(Jeff Atwood) #20

Only that token can be used there.