I'd like to propose exposing like and favorite buttons to everyone as an incentive to signups.
I've just came upon the project and I have no data to support that this is beneficial, other than that a lot of famous sites do it, like Youtube and Stackoverflow.
I believe that If someone is willing to show appreciation for finding helpful content, he would be more inclined to sign up to let the author knows he helped someone.
This is a really important feature... Users should be able to upload pictures when they are using their smartphones, no matter they post new threads or reply to other threads, or between PMs.
We have a user on the HTG forum who decided that they hated all of their old posts... and has gone on a deleting spree, which leaves weird holes in topics, and then keeps pushing old topics to the first page for no reason.
The problem is that by default all posts can be edited or deleted for up to 1 year... and while sure, I can change that default (and already did), it also means that other useful forum members can't do any editing after the much shorter window that I imposed.
My idea is that the delete window should be tied to the trust level. So level 1 users would only have a shorter window for editing and deleting, and as the trust level increases, they would have more ability to edit older posts.
It's not a critical feature, but it does seem like something logical that might be included at some point.
Discourse now ships with official hooks to perform auth offsite.
The Problem
Many sites wish to integrate with a Discourse site, however want to keep all user registration in a separate site. In such a setup all Login operations should be outsourced to a different site.
What if I would like SSO in conjunction with existing auth?
enable_sso : must be enabled, global switch sso_url: the offsite URL users will be sent to when attempting to log on sso_secret: a secret string used to hash SSO payloads. Ensures payloads are authentic.
Once enable_sso is set to true:
Clicking on login or avatar will, redirect you to /session/sso which in turn will redirect users to sso_url with a signed payload.
Users will not be allowed to "change password". That field is removed from the user profile.
Users will no longer be able to use Discourse auth (username/password, google, etc)
What if you check it by mistake?
If you check enable_sso by mistake and need to revert to the original state and no longer have access to the admin panel
run:
RAILS_ENV=production bin/rails c
irb > SiteSetting.enable_sso = false
Implementing SSO on your site
Discourse will redirect clients to sso_url with a signed payload: (say sso_url is https://somesite.com/sso)
You will receive incoming traffic with the following
https://somesite.com/sso?sso=PAYLOAD&sig=SIG
The payload is a Base64 encoded string comprising of a nonce. The payload is always a valid querystring.
For example, if the nonce is ABCD. raw_payload will be:
Validate the signature, ensure that HMAC 256 of sso_secret,PAYLOAD is equal to the sig
Perform whatever authentication it has to
Create a new payload with nonce, email, external_id and optionally (username, name, return_url)
Base64 encode the payload
Calculate a HMAC 256 hash of the using sso_secret as the key and Base64 encoded payload as text
Redirect back to http://discourse_site/session/sso_login?sso=payload&sig=sig
Discourse will validate that the nonce is valid (if valid it will expire it right away so it can no longer be used) it will attempt to:
Log the user on by looking up an already associated external_id in the SingleSignOnRecord model
Log the user on by using the email provided (updating external_id)
Create a new account for the user providing (email, username, name) updating external_id
Security concerns
The nonce (one time token) will expire automatically after 10 minutes. This means that as soon as the user is redirected to your site they have 10 minutes to log in / create a new account.
The protocol is safe against replay attacks as nonce may only be used once.
Reference implementation
Discourse contains a reference implementation of the SSO class:
A trivial implementation would be:
class DiscourseSsoController < ApplicationController
def sso
secret = "MY_SECRET_STRING"
sso = SingleSignOn.parse(request.query_string, secret)
sso.email = "user@email.com"
sso.name = "Bill Hicks"
sso.username = "bill@hicks.com"
sso.external_id = "123" # unique to your application
sso.sso_secret = secret
redirect_to sso.to_url("http://l.discourse/session/sso_login")
end
end
Transitioning to and from single sign on.
The system always trusts emails provided by the single sign on endpoint. This means that if you had an existing account in the past on Discourse with SSO disabled, SSO will simply re-use it and avoid creating a new account.
If you ever turn off SSO, users will be able to reset passwords and gain access back to their accounts.
Future work
We would like to gather more reference implementations for SSO on other platforms. If you have one please post to the Extensibility / SSO category.
Add session expiry and/or revalidation logic, so users are not logged in forever.
Create an API endpoint to log off users, in case somebody logs off the main site.
Consider adding a discourse_sso gem to make it easier to implement in Ruby.
Updates:
2-Feb-2014
use HMAC 256 instead of SHA256. This is more secure and cleanly separates key from payload.
removed return_url, the system will automatically redirect users back to the page they were on after login
Someone asked recently about a list of features in Discourse. Well, I was having a discussion with someone else about Discourse and the forum FAQ came up.
I've noticed that Discourse has some flexibility to customize stylesheets and headers, but I'd like to know how developer oriented admins are doing when they feel the need to hook up HTML snippets in a certain point/container.
I'm a SpreeCommerce (http://guides.spreecommerce.com/developer/view.html) user and they came with a simple enough solution to use Deface (https://github.com/spree/deface) in order to allow template customization. The idea is to insert hooks in html elements making it easier for the developer to reach them and attach whatever he wants before, after, inside or around it.
I know the bulk of templates is being done using handlebars for ember, but I don't think it would invalidate the method with minor tweaks. If we find a way to override those views before handlebars is compiled, we'd be ok.
The overrides are done in separate files in a non obtrusive manner, so core updates wouldn't cause conflict(at least not a lot).
I understand this project doesn't preach forking, as SpreeCommerce does, but I think it would be a good first step to allow discourse forums to differentiate themselves. It would also create incentives for third-party companies to work in project customizations.
I've tried long and hard to figure this out on my own before posting on here so I apologize in advance if this is easy. I'm still new to Rails but know my way around it.
I already have an existing Rails application running. I'm adding Discourse as a second Rails application and followed the guide for Docker. I'm up to the point where I need to run ./launcher start app. However in doing so I get the following error.
Error: Cannot start container d9541419a93f: listen tcp 0.0.0.0:80: bind: address already in use
2014/03/20 22:18:08 Error: failed to start one or more containers
I'm assuming that I need to configure my nginx for this to work properly, correct? So I copied over /etc/nginx/sites-available/arsiamons.io to /etc/nginx/sites-available/forums.arsiamons.io. Here's what I got in there
The install guide doesn't currently tell you how to start the Discourse docker image at boot. (My VPS provider had a momentary hiccup and had to reboot my node. It came up, but Discourse didn't.)
I'm looking for an overview of privacy, privilege, & trust features in Discourse. This would be an overall description of how an admin can control and restrict what users are allowed to see. I looked on the main Discourse site and was surprised to find very little about this. It would be especially helpful if this information was organized into (1) how these features work out of the box, (2) what is the range of configuration options, and (3) bleeding edge features, if any. There are a lot of posts looking into specific features. Maybe as a first step i'll compile some of those below.
There's been some recent confusion as to who did what on our Discourse install. I wasn't able to determine if there was or not, but having a way to see what actions a moderator has taken against a user (similar to edits on a post, etc) would be helpful to build an audit log to verify facts and settle disputes.
What I mean by this is that it would be nice to be able to distinguish whether an admin or mod is participating in a conversation as a regular user or in their official capacity. It looks like this sort of functionality is half-way there; I imagine this looking graphically something like the way "Topic Lock" messages or "This topic is now pinned" messages are displayed with a colored background when the mod or admin to denote that this is "Word From On High" as opposed to the opinion of a site user who happens to be a mod.
I imagine the UI for this might be some kind of megaphone button that would also tint the background of the post editor. (Or, using font-awesome, fa-bullhorn. Maybe fa-bell or fa-gavel.)
I know that most discourse forums so far are probably engineer / technically focused (at least as far as the admins and I suspect many of the users - if the early beta sites are any indication). The downside of this is that I think Discourse is more complex in some areas than it needs to be for widespread adoption.
Here is the screen shot of my forum dashboard after 3 months of use. My users are virtually all non-technical, at a health-related web site - the type of site that I think is much more representative of the broader user base than the main Discourse beta sites so far.
I recommend Discourse deprecate / remove the features of "Starred" and "Bookmark" because I don't think many regular users are going to use them and they make the interface more complex than it needs to be (which hurts adoption, and use of the forum software).
I know in startups that there is a strong tendency for feature creep - and that you are continually bombarded by new feature requests, and that the most feature requests frequently come from the more technical users. My recommendation to the discourse team is to try to get in better touch with the non-technical users because success with that user base is what will really drive successful adoption for the platform.
I've upgraded a couple times already in the past. I believe I ended up upgrading twice today though. The first time seemed successful then later I saw the upgrade button was still there, so clicked it again and am now getting a 502 bad gateway nginx error.
I did try doing a launcher destroy, bootstrap, and start app, but am still getting the error.
Any tips on where I can look to see what the problem is?
But making it the blog's comment engine is not (have a discourse thread at the bottom of the page) Especially for sites which have both comments AND forums.
It would allow for users to use the same account for article comments and forum posts.
It would allow users to have a single profile page to go to and see responses to posts both in forums and in article comments.
I have seen bulk invitation feature in many places such as LinkedIn where you can invite multiple friends to LinkedIn using your gmail (or other email, facebook etc.) address book.
This feature doesn't seem to exist here. Any plans on this feature? I think this can help a lot for generating critical mass for any forum in a short time.