Everything is visibility none except for 5 or so elements, no borders etc
This resolves the issues around having an INPUT in a position fixed panel. As it stands our mobile composer is cramped and once keyboard is open positioning is bonkers. (try typing a reply and scrolling around)
For this plugin to work you also need to add the following code before the closing head tag in the Customize section of Admin settings in Discourse:
<!-- Styles for the Mermaid (Flowchart) Plugin -->
<link rel="stylesheet" type="text/css" href="https://a1b162c9ba316380004223e5ebcd9fd144cbffea.googledrive.com/host/0B94LsQPLeilLfkxHY3djaE53TkEwcUZfbVY1MkxTa3Bpb25aclNhLWUzV2dLeEt4VlVFcWM/mermaid.min.css">
<!-- Custom Code to Remove <br> Tags from Mermaid (Flowchart) Posts -->
<script src="https://a1b162c9ba316380004223e5ebcd9fd144cbffea.googledrive.com/host/0B94LsQPLeilLfkxHY3djaE53TkEwcUZfbVY1MkxTa3Bpb25aclNhLWUzV2dLeEt4VlVFcWM/remove.mermaid.div.js"></script>
<!-- Code for the Mermaid (Flowchart) Plugin -->
<script src="https://a1b162c9ba316380004223e5ebcd9fd144cbffea.googledrive.com/host/0B94LsQPLeilLfkxHY3djaE53TkEwcUZfbVY1MkxTa3Bpb25aclNhLWUzV2dLeEt4VlVFcWM/mermaid.min.js"></script>
<!-- Code to Initialize the Mermaid (Flowchart) Plugin -->
<script>mermaid.initialize({startOnLoad:true});</script>
When the plugin is installed it raises an error and assets can't be compiled. I am not sure why though.
The plugin is just supposed to wrap anything in the [flowchart][/flowchart] tags in:
<div class="mermaid">" + contents + "</div>
Also, the "contents" should not be modified in any way (no html br or div tags added) as the text needs to be exactly as typed for the javascript to run correctly.
If you ever need to migrate away from Heroku to a currently supported infrastructure by discourse it can be quite troublesome.
We did the following to be able to create a backup which cloud thereafter be imported by discourses hosted solution. These steps can also be used if you just want to migrate to your own cloud hosted instance.
Get the data out of Heroku
There are 2 parts you need to backup:
Database
Images
Note: Before you continue make sure the heroku version is updated to the last version
Create a new discourse instance by following the instructions:
Start the restore
Assuming that you have a working discourse instance and that the versions of both heroku and the new cloud instance are the same (discourse versions) lets start the import.
Get your backups from your local system in the docker container.
To get your images and db from your local to the vps I prefer scp. You can also do this with an sftp client if that is your preference.
An example of the SCP command assuming that your public key is set:
scp /tmp/latest.dump root@xxx.xxx.xxx.xxx:/tmp
Get the backups in the container
The Container has one volume mounted; /var/discourse/shared/standalone/
Copy the backups to this location and you can access them when your inside your container.
Importing your backups
Before we can start importing we need to convert the compressed pg dump that heroku gave us to an sql file.
Else you get these kinds of issues:
Convert Compressed pg dump
You need to enter the Docker container inside your vps. Thereafter we can convert the dump to an sql file.
Commands:
cd /var/discourse
sudo ./launcher enter app
sudo -u postgres pg_restore -O -f /tmp/latest.sql /shared/latest.dump
exit
exit
Now you should have a file called latest.sql in you tmp folder.
Do the restore
Go to the following link and follow the instructions under the Restore header.
Rebuild container
Discourse relays heavily on caching. This means we need to rebuild the container after the DB is restored. Outside your cotainer in the root of your vps do:
cd /var/discourse
sudo ./launcher rebuild app
Optional: Resetting your force_hostname value
There is a good chance that you set the force_hostname value to make sure all links are working correct. In the new environment this is no longer needed so you need to unset the value
cd /var/docker
sudo ./launcher enter app
su - discourse
bundle exec rails c
SiteSetting.force_hostname = “"
exit
exit
exit
Now you should be good to go! Create backups to be imported later or just let it run like this.
Now that we have Discourse-Translator++ I'd like to see more languages (all languages supported by the Microsoft translation service, really) available to choose from in the user setting for interface language. If the language they choose isn't supported yet, default interface language for the user to the site default. Is this possible?
If via SSO we populate the locale to one that is not in discourse already, would that be possible for the purposes of the inline translation and default interface to english, or would it break something?
I'm in the process of integrating Discourse into our platform (using an iframe) and I am trying to understand what I am doing wrong and can't get SSO to authenticate my users.
I am working on symfony 1.4 and I have an action that accommodates both the logic of displaying the page (that contains the iframe) and that of logging the users in.
public function executeViewDiscussionForum(sfWebRequest $request){
$requestIsInternal = $request->getParameter('isInternal');
if($requestIsInternal==='1'){
//====Discourse will redirect here again with the payload parameters
$response = DiscourseAuthDriver::makeCurlRequest('http://****.****.com:8080');
}
$url = parse_url($response['Location']);
$cookie = $response['Set-Cookie'];
parse_str($url['query'], $params);
$sso = $params['sso'];
$signature = $params['sig'];
// load the payload passed in by Discourse
$payload = $sso;
$ssoHelper = new SSOHelper();
// this should be the same in your code and in your Discourse settings:
$secret = '****';
$ssoHelper->setSecret( $secret );
// validate the payload
if (!($ssoHelper->validatePayload($payload,$signature))) {
// invaild, deny
$this->redirect404();
}
$nonce = $ssoHelper->getNonce($payload);
// Insert your user authentication code here ...
// Required and must be unique to your application
$userId = $this->currentUser->id;
// Required and must be consistent with your application
$userEmail = $this->currentUser->getEmailAddress();
// Optional - if you don't set these, Discourse will generate suggestions
// based on the email address
$extraParameters = array(
'username' => $this->currentUser->getUsername(),
'name' => $this->currentUser->getFullname()
);
// build query string and redirect back to the Discourse site
$query = $ssoHelper->getSignInString($nonce, $userId, $userEmail, $extraParameters);
DiscourseAuthDriver::makeCurlRequest('http://*****.***.com:8080/session/sso_login?' . $query, $cookie);
}
The SSOHelper class that im using is the one found here:
And the DiscourseAuthDriver::makeCurlRequest is as below:
public static function makeCurlRequest($url, $cookie=null){
$ch = curl_init($url);
if($cookie){
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Set-Cookie: ".$cookie));
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"); // Necessary. The server checks for a valid User-Agent.
$response = curl_exec($ch);
$header = $response;
$header = self::get_headers_from_curl_response($header);
curl_close($ch);
return $header[1];
}
If I dont have SSO enabled I can see the main discourse page loading just fine in my iframe.
The logic behind the above was that by using curl I can essentially simulate the sign in process and then serve the logged in page in the iframe but that doesnt seem to cut it as even if I manually navigate to the sign in url with the hashed parameters and everything I get the following error:
"Account login timed out, please try logging in again"
I have checked other possible answers as well as my settings and I dont have the approval option set so I thought it might be due to session information not being passed in upon requesting the login but even after adding that it doesnt seem to work.
Can anyone see what is wrong with this or identify any flaws in the logic?
@codinghorror I love your process for new features and proposals, it's really engaging for users because you open the debate on alpha stage with some initial ideas but you're open to discussing everything, defending strongly your opinion otherwise It seems to me very onerous to sustain.. isn't it? What's the best practices to have something like this?
I was wondering if any other members have experience of extending Discourse's user management system to work with other apps i.e. let users who register on the forum, log in to another Rails app.
I've been thinking about building a website using Rails (that requires a log in) that also has a Discourse forum associated with it. It would make sense to keep them as separate apps to keep Discourse easily upgradable but was hoping I could get some opinions on how difficult this may be or if there might be a better solution.
I added some html and javscript under the Custom section of the Admin area and it has broken some stuff and actually removed my ability to edit that very same section. Is there an ssh command I could run to clear out all the Custom stuff?
I know that we can embed a topic, and I know that we can assign a category for new topics based on the embedding host. But is it possible to embed a category?
Here is the use-case we are exploring: A private Wordpress site with separate groups (e.g. Cat People, Dog People, Chicken People). Each group has a matching category in Discourse for their forums. On Wordpress we would like to embed the category for each group, listing the last 5-10 active topics. A user can click on a topic in Wordpress and join the conversation through Discourse.
I've seen that Twig Anything is one way to solve this problem, but is there a more "native" solution that I havn't run into yet?
So, I have a wiki category and I'd like to restrict creating threads to admins but allow regular users to edit the OP -- I set it up like that and thought it was fine.
Then I noticed one of the wiki threads was moved to a different category. First, I think regular users editing wiki posts created by others shouldn't be able to edit the category/title. And second, that user didn't even intend to move the thread -- because he didn't have access to create threads in that category, the category dropdown defaulted to the general category and didn't let him reselect the wiki category.
I guess a workaround would be to make the second post in the thread the wiki post, but that seems icky.
Hi, I have discourse at example.com and want to host a blog at example.com/blog. How can I do that? Thanks, Michael p.s: what you suggest from SEO point of view? subdomain or subfolder?
I have to say, this has been some of the best web software I have ever encountered. So well considered and thought out, simple and elegant. Excellent job, please keep up the great work. I'm now an official, loyal supporter.
I have a Linode with Gentoo Linux that I decided to install Discourse on. I installed Docker and then using the 30-min install options installed discourse. This part worked as I can go to the site and register my admin user but after registering, I never get a Verification Email. I configured Discourse via nano -w containers/app.yml with ./launcher bootstrap app after editing it. I signed up with Mailjet to do email and got an API Key and Secret key to use. To show examples without revealing those, I'll use these: API Key: hotdog Secret Key: ketchup Dev Email: justin@mydomain.tld Hostname: forum.mydomain.tld
Here is my app.yml configuration: DISCOURSE_DEVELOPER_EMAILS: 'justin@mydomain.tld' DISCOURSE_HOSTNAME: 'forum.mydomain.tld' DISCOURSE_SMTP_ADDRESS: in-v3.mailjet.com DISCOURSE_SMTP_DOMAIN: mydomain.tld DISCOURSE_SMTP_USER_NAME: hotdog DISCOURSE_SMTP_PASSWORD: ketchup
I have tried using using these options (separately and together) also without any effect: DISCOURSE_SMTP_PORT: 587 DISCOURSE_SMTP_ENABLE_START_TLS: false
After looking at this topic, I copied an example python script and edited it's configuration to be: SMTPserver = 'in-v3.mailjet.com' sender = 'forum@mydomain.tld' destination = ['justin@mydomain.tld'] USERNAME = "hotdog" PASSWORD = "ketchup"
The python script worked just fine so I know the Mailjet account works. No idea why Discourse can't send email.
Are there any logs I can look at to figure out why Discourse won't send email? I've looked in shared/standalone/log/rails/production.log but all I find about email is various entries of this (with different ms values): Sent mail to justin@mydomain.tld (30058.0ms) Job exception: execution expired
Just a small suggestion that may have been made before, but I couldn't find a discussion about it.
When you see a list of flagged posts, you often need to enter the flag discussion to work out whether or not you agree or disagree. Often I also want to comment in the flag discussion before agreeing or disagreeing. It would be nice then to be able to Agree or Disagree with the flag to close it from within that discussion, rather than having to return to the Flags list to clear the flag.
I know this seems like an odd request - but bear with me. I would like to create a user that can't create posts. I want to be able to create a Discourse profile for an organization, separate from the person responsible for that organization.
An example would be YoyoDyne Inc., as a separate entity from the YoyoDyne CEO. I would like the CEO to be able to create topics and posts, but I would not want YoyoDyne Inc. to be able to post. The CEO would want to link to their company profile when they wanted to highlight the company, instead of linking to their own profile and posting history.