Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60690 articles
Browse latest View live

Fullscreen composer for mobile

$
0
0

@sam wrote:

We plan to add a fullscreen composer for mobile akin to:

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)

Posts: 12

Participants: 6

Read full topic


Mermaid - A Flowchart Plugin

$
0
0

@pnewelljr wrote:

I am working on my first plugin but it is not working for me. Any help would be greatly appreciated. Here is a link to my git:

https://github.com/pnewell/discourse-mermaid

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.

Posts: 6

Participants: 2

Read full topic

Migrating from Heroku to a Hosted/Cloud instance

$
0
0

@kimpellikaan wrote:

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

Export the DB

To export the DB from heroku to your development system follow the instructions here:
https://devcenter.heroku.com/articles/heroku-postgres-import-export

You can also login to the dashboard and create and download a PG dump.

Get the images

In our case we saved the images to AWS S3. To download all the images at once we used the AWS CLI.

  1. First make sure you have the AWS CLI installed.
    http://docs.aws.amazon.com/cli/latest/userguide/installing.html
  2. Use the S3 argument to download your images.
    http://docs.aws.amazon.com/cli/latest/reference/s3/index.html

For example:

aws s3 cp /tmp/foo/ s3://bucket/ --recursive

Build a new discourse instance

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.

Posts: 3

Participants: 3

Read full topic

Allow users to choose any interface language, supported or not

$
0
0

@tobiaseigen wrote:

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?

Posts: 5

Participants: 4

Read full topic

Simulating SSO login via php curl

$
0
0

@Michael_Katrantzis wrote:

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:

https://github.com/cviebrock/discourse-php

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?

Posts: 4

Participants: 4

Read full topic

Discourse and the REAL open process for new features/proposals

$
0
0

@alefattorini wrote:

@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?

Posts: 4

Participants: 3

Read full topic

Use Discourse login for second Rails app

$
0
0

@jamesmarkcook wrote:

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.

Thanks thumbsup

Posts: 4

Participants: 3

Read full topic

Custom Code Breaking Site

$
0
0

@pnewelljr wrote:

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?

Posts: 2

Participants: 2

Read full topic


Embedding a category

$
0
0

@roarkely wrote:

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?

Posts: 2

Participants: 2

Read full topic

In a category where only admins can create topics, users editing wiki posts are forced to change category

$
0
0

@JP_ wrote:

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.

Posts: 2

Participants: 2

Read full topic

SSO with custom software (PHP)

$
0
0

@huulbaek wrote:

We are looking for an SSO plugin that integrates with our custom logon procedure in PHP.

Some properties:

  • Normal logon procedures should still be available in Discourse instance.
  • If user is authenticated via PHP on other site, Discourse should create new user if user email does not exist or log user on if email does exist.
  • It should be possible to click on link on PHP site to log directly in on Discourse instance.
  • If authenticated on Discourse site, a new link in burger menu should be made available to go to profile on PHP site

We can do the necessary PHP ourselves.

Price idea: $500.

Posts: 3

Participants: 2

Read full topic

Blog on subfolder in discourse

$
0
0

@michael_solomon wrote:

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?

Posts: 13

Participants: 4

Read full topic

What order are pending messages displayed in?

$
0
0

@watchmanmonitor wrote:

I have a number of messages pending in our forum. The number went up, so I scrolled to the bottom & didn't see it.

I see it's interspersed.. what order should they be in?

Posts: 1

Participants: 1

Read full topic

Deep Appreciation and Gratitude

$
0
0

@Capacitron wrote:

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.

Posts: 1

Participants: 1

Read full topic

Verification Email will not send

$
0
0

@jd2066 wrote:

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

Posts: 22

Participants: 5

Read full topic


Create another website along with Discourse on same server

$
0
0

@michael_solomon wrote:

Continuing the discussion from Blog on subfolder in discourse:

I have discourse at example.com and want to host a blog at blog.example.com.
How can I do that?
Thanks,
Michael

Posts: 1

Participants: 1

Read full topic

Discourse Works!

$
0
0

@Falco wrote:

Guys,

After a long wait, some plugin creation, a few patches and a SSO implementation in LUA we lauched our company internal community!

It's a huge sucess, and we just started today!

Thanks for the software and support, and we hope to contribute with some enterprise-y features to core!

success

Posts: 1

Participants: 1

Read full topic

Agree with flag from within flag discussion

$
0
0

@ralphm wrote:

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.

Posts: 1

Participants: 1

Read full topic

Triggering Actions from Connector from Plugin

$
0
0

@stylesuxx wrote:

Hello guys,
I am writing a small plugin.
The server functionality is in place, I can access it via API without problems.

Now I also have a connector in place using an outlet - this is rendering fine.

The problem I have now is, that I want to trigger an actin from a button in the template file. Where would I need to place the corresponding action?

Tried different things, like extending the Routes like so:

export default Discourse.Route.extend({
  actions: {
    myAction: function() {
      console.log("Do something");
    }
  }
});

Maybe someone could point me in the right direction.

Greetz,
Chris

Posts: 2

Participants: 2

Read full topic

How can I create a user with no posting privileges

$
0
0

@OnceWas wrote:

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.

Posts: 9

Participants: 3

Read full topic

Viewing all 60690 articles
Browse latest View live




Latest Images