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

Nested quotes will never parse correctly

$
0
0

Kane York wrote:

Reply to the something
[/quote]

[quote="codinghorror, post:13, topic:13923"]
[quote="Naatan, post:12, topic:13923"]
Something something
[/quote]
Reply to the something
[/quote]

Nested quotes are sometimes necessary, and it would be nice to have them supported: http://discourse.codinghorror.com/t/please-read-the-comments/1393/81?u=riking

( that post currently uses <blockquote> to make it look at least passable: http://discourse.codinghorror.com/raw/1393/81 )

Posts: 2

Participants: 2

Read full topic


Facebook auth callback crashing

$
0
0

Michael wrote:

On one particular forum, Facebook auth is not working for some (!) users upon signing up.

After clicking Ok on the Facebook popup , a black screen appears, and in the error log file we see the following.

Started GET "/auth/facebook" for 214.26.xx.xx at 2014-01-19 09:23:54 +0000
Started GET "/auth/facebook/callback?code=AQ....Oo&state=71...5e" for 214.26.xx.xx at 2014-01-19 09:23:55 +0000
Processing by Users::OmniauthCallbacksController#complete as HTML
  Parameters: {"code"=>"AQ..Oo", "state"=>"71..5e", "provider"=>"facebook"}
Completed 500 Internal Server Error in 49ms

NoMethodError (undefined method `length' for nil:NilClass):
  lib/email.rb:12:in `is_valid?'
  lib/email.rb:20:in `downcase'
  lib/auth/facebook_authenticator.rb:23:in `after_authenticate'
  app/controllers/users/omniauth_callbacks_controller.rb:39:in `complete'
  lib/middleware/anonymous_cache.rb:102:in `call'
  config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
  config/initializers/silence_logger.rb:19:in `call'

(some parts replaced by .. or xx for brievity and security)

Seems like a bug (it should not be crashing) but maybe caused by a configuration issue somewhere.

Running v0.9.8.2, problem also appeared before on v0.9.8.1.

Posts: 10

Participants: 5

Read full topic

`Edit Category` makes category disappear from list if cancelled

$
0
0

Michael Brown wrote:

Steps to reproduce:

  • hard refresh
  • select Category
  • click Edit Category
  • cancel (I hit ESC)

The category has now disappeared from the client. I noticed it via:

  • click HamburgerCategories
  • click Create Category
  • try and create a subcategory under Category

but it also disappears from places like the 'Create a new Topic' dropdown.

Posts: 3

Participants: 2

Read full topic

Un-clearable private message notifications

$
0
0

Jacob wrote:

A user on my forum pointed out a possible bug with group pms.

So, the private message that Person A started about the *****. I have 2 new notifications for it One from Person B. the next from @illspirit but I cant clear them. It says I don't have access to the topic. And because of that I can't clear it.

I removed this user from a group private message and he could not clear his notifications.

Posts: 4

Participants: 2

Read full topic

Expanding quote that doesn't exist silently fails

$
0
0

Michael Brown wrote:

Continuing the discussion from Libelous quote-to-reply:

Trying to expand a quote referencing a post that doesn't exist (or referencing NO posts) results in:

and this XHR failure:

We could handle this a little better - perhaps replace "Loading…" with a large blinking x and scrolling text that says "REFERENCED POST NOT FOUND".

I also happened to notice - going to https://meta.discourse.org/posts/by_number/724/undefined just results in a totally blank page (with Discourse loaded):

Posts: 1

Participants: 1

Read full topic

Installing Discourse on Debian

$
0
0

Alessandro Vermeulen wrote:

Work in Progress

This guide consists of the following steps:

  • Installing the necessary packages
  • Setting up the database
  • Installing RVM (Ruby environment)
  • Cloning and installing Discourse

I recommend installing discourse as different user than root. The servers set up here are not configured to be secure. Do NOT use this as a production environment.

Packages to install

The following packages have to be installed:

Edit /etc/apt/sources.list to contain the following line:

deb http://backports.debian.org/debian-backports squeeze-backports main

Now update your sources: apt-get update

Install the following packages:

  • apt-get install build-essential git libpq-dev
  • apt-get -t squeeze-backports install postgresql-9.1 postgresql-contrib-9.1 redis-server

Setting up the database (postgres)

Add the following line to /etc/postgresql/9.1/main/pg_hba.conf and then restart postgres /etc/init.d/postgresql restart.

host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust

Create a user that has database create and superuser permissions.

Installing RVM

First install the recommended dependencies:

apt-get --no-install-recommends install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev

Then installing RVM is as easy as executing \curl -L https://get.rvm.io | bash -s stable --ruby

Installing discourse

git clone git://github.com/discourse/discourse.git
cd discourse
bundle install

Edit the file config/database.yml to include the user credentials for the user you just made.

rake db:create db:migrate db:seed_fu
redis-cli flushall
thin start

Setting up discourse

Go to your website and create an account. Then go back to the console and do the following:

bundle exec rails c
u = User.first
u.admin = true
u.save

Posts: 102

Participants: 28

Read full topic

Automated Signatures?

$
0
0

chronodekar wrote:

@codinghorror has already PM'd me that THIS implementation of Discourse discourages manual signatures. But what about automated signatures, like we see on other forums? (the forum software draws a horizontal line below the post and prints the custom signature) Some folks don't like them and in the userCP, they can be turned off.

Here?

I can't find the option anywhere at all. Is it on the cards or only through plugins?

Posts: 91

Participants: 33

Read full topic

Override HOME/END keys to perform same action as topic counter

$
0
0

Kane York wrote:

Let's jump into one of the large topics on the front page right now:

Hm, that's a lot of posts. I don't have time to read all of them. I see the "Best Of Mode" header, but I just want to see why it was on the front page. So I hit my END key!

Waaaaaaat? 23 of 64? But I wanted the end!

Pretty sure this would be a small piece of javascript that listens for the keypress and activates the same function as the count navigator.

(By the way, PageUp and PageDown are fine as they currently are right now. I just don't want End to be a "bigger Page Down key".)
(And yes, I'm aware that I can click the time on the right side, but I'd typically be making the decision to go to the bottom after processing the context and content of the first post.)

Posts: 6

Participants: 4

Read full topic


Download images to local in posts:rebake

$
0
0

nXqd wrote:

I do not if it's a good idea to download all the images to local when we run the task posts:rebake . It should be optional in my opinion.

Posts: 2

Participants: 2

Read full topic

How to pass currentUser to #groupedEach helper?

$
0
0

Alexandre Angelim wrote:

I'd like to change the way the top list of posts is displayed depending on the user's current state. Although I can expose currentUser to basic-topic-list template, I can't access it inside the #groupedEach block.

Can someone help me with that?

Posts: 1

Participants: 1

Read full topic

Regression: alternating row colours switch around

$
0
0

probus wrote:

I noticed the alternating row colors switch around when I choose a category in topic list. On first load odd rows are white and after changing the category (or clicking the site logo), even rows are white. Reload page to get white odd rows again. I don't think it used to be like this.

Posts: 8

Participants: 7

Read full topic

Is "Activity" too ambiguous?

Rack-mini-profiler showing up in production for admins?

What about an easier styling/theming system?

$
0
0

Jeff Atwood wrote:

This would really just be a "CSS generator".

How about a page that has nice color selectors and then nicely named coloring categories, like:

  • Primary background color
  • Secondary background color
  • Tertiary background color
  • Primary text color
  • Secondary text color
  • Primary link color
  • Secondary link color
  • Button background
  • Button background hover
  • Button text
  • Button text hover
  • Last poster highlight color

It doesn't need to be super detailed or advanced or able to do everything. Let people choose the colors on that page, and then click "Generate Style" which outputs a CSS page on the pre-existing Style page which they can then apply.

Most of the hours of work in theming Discourse are "replace #fff with #333, replace link colors with orange, replace #333/other dark with #ccc/other light". Having a simple styling CSS generator would get us 80% of the way there, and then we would be able to just fine-tune the colors of things.

(this text belongs to @DanYouhon but I really wanted it here for discussion and could not wait, sorry Dan!)

Posts: 26

Participants: 13

Read full topic

Beginners Guide to Deploy Discourse on Digital Ocean using Docker

$
0
0

Arpit Jalan wrote:

The Discourse Docker Image makes it easy to set up Discourse on a cloud server. We will use Digital Ocean, although these steps may work on other cloud providers.

This guide assumes that you have no knowledge of Ruby/Rails or Linux shell.

Create New Digital Ocean Droplet

Sign up for Digital Ocean, update billing info, then begin creating your new cloud server (Droplet).

Discourse requires a minimum of 1 GB RAM for small communities; we recommend 2 GB RAM for medium communities. We'll use "discourse" as the Hostname.

Install Discourse on Ubuntu 12.04.3 LTS x64. We always recommend using the current LTS distribution.

You will receive a mail from Digital Ocean with the root password to your Droplet. (However, if you know how to use SSH keys, you may not need a password to log in.)

Access Your Droplet

Connect to your Droplet via SSH:

ssh root@192.168.1.1

(Alternately, use Putty on Windows)

Replace 192.168.1.1 with the IP address of your Droplet.

You will be asked for permission to connect, type yes, then the root password, which is in the email Digital Ocean sent you when the Droplet was set up. Enter it.

Update the kernel

apt-get update
apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

Reboot the server:

reboot

This will log you out from your SSH session, so reconnect:

ssh root@192.168.1.1

Set up Swap (if needed)

  • If you're using the minimum 1 GB install, you must set up a swap file of 1 GB minimum.

  • If you're using 2 GB+ memory, you can probably get by without a swap file.

Install Git

apt-get install git

Install Docker

wget -qO- https://get.docker.io/ | sh

Install Discourse

Create a /var/docker folder where all the Docker related stuff will reside:

mkdir /var/docker

Clone the Official Discourse Docker Image into this /var/docker folder:

git clone https://github.com/discourse/discourse_docker.git /var/docker

Switch to your Docker folder:

cd /var/docker

Copy the samples/standalone.yml file into the containers folder as app.yml, so the path becomes containers/app.yml:

cp samples/standalone.yml containers/app.yml

Edit app.yml:

nano containers/app.yml

(We recommend Nano because it works like a typical GUI text editor, just use your arrow keys. Hit CtrlO then Enter to save and CtrlX to exit. However, feel free to choose whatever text editor you like.)

  • Edit as desired, but at minimum you must set DISCOURSE_DEVELOPER_EMAILS and DISCOURSE_HOSTNAME.

  • If you are using a 1 GB instance, set UNICORN_WORKERS to 2 so you have more memory room.

If you set DISCOURSE_HOSTNAME to discourse.example.com, this means you want to host our instance of Discourse on http://discourse.example.com/. You'll need to update the DNS A record for this domain with the IP address of your server.

Mail Setup

Email is critical to notifications in Discourse. If you do not configure email before bootstrapping you will have a broken site.

  • If you already have a mail server, put your existing mail server credentials in the app.yml file.

  • Otherwise, create a free account on Mandrill (or Mailgun, or Mailjet), and put your mail credentials (available via the Mandrill dashboard) in the app.yml file. The settings you want to change are DISCOURSE_SMTP_ADDRESS, DISCOURSE_SMTP_PORT, DISCOURSE_SMTP_USER_NAME, DISCOURSE_SMTP_PASSWORD.

  • Be sure you remove the comment character and space # from the beginning of these mail configuration lines!

  • Don't forget to set the SPF and DKIM records up for your domain name. In Mandrill, that's under Sending Domains, View DKIM/SPF setup instructions.

  • The name of your droplet is your reverse PTR record; rename your droplet to discourse.example.com so the PTR record correctly reflects your domain name.

Bootstrap Discourse

Be sure to save the app.yml file, and begin bootstrapping Discourse:

./launcher bootstrap app

This command can take up to 8 minutes. It is automagically configuring your Discourse environment.

After that completes, start Discourse:

./launcher start app

Congratulations! You now have your own instance of Discourse, accessible via the domain name you entered in app.yml earlier.

You can also access it by visiting the server IP address directly, e.g. http://192.168.1.1.

Log In and Become Admin

Sign into your Discourse instance. There should be a reminder visible on the site about which email was used for the DISCOURSE_DEVELOPER_EMAILS address. Be sure you log in with that email, and your account will be made Admin by default.

Post-Install Maintenance

To upgrade Discourse to the latest version, visit /admin/docker, refresh the page a few times (yes, seriously) and then press the Upgrade button at the top. View the live output at the bottom of your browser to see when things are complete. You should see:

Killed sidekiq
Restarting unicorn pid: 37

Then you know it's complete. (Yes, we will be improving this process soon!)

The launcher command in the /var/docker folder can be used for various kinds of maintenance:

Usage: launcher COMMAND CONFIG
Commands:
    start:      Start/initialize a container
    stop:       Stop a running container
    restart:    Restart a container
    destroy:    Stop and remove a container
    ssh:        Start a bash shell in a running container
    logs:       Docker logs for container
    bootstrap:  Bootstrap a container for the config based on a template
    rebuild:    Rebuild a container (destroy old, bootstrap, start new)

Other Optional Stuff

Do you want...

If anything needs to be improved in this guide, feel free to ask on meta.discourse.org, or even better, submit a pull request.

Posts: 172

Participants: 40

Read full topic


Discourse as Your First Rails App

$
0
0

Jeff Atwood wrote:

If you’re a developer, but have never touched Ruby on Rails, we understand how you feel. We were there once! Sometimes diving into a new language and codebase can make you feel like this: The good news is that Discourse has a wonderfully supportive community and we’re here to help. Here’s our first guide on…


This topic is for comments on the original blog entry, at http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/

Posts: 70

Participants: 31

Read full topic

Usernames on top, lifting username length restrictions

$
0
0

Sam Saffron wrote:

I just deployed this change set:

It allows you to lift the max username length restriction.

For the time being I made this setting hidden, this means you need the following to raise it:

./launcher ssh app
rails c
SiteSetting.max_username_length = 40

Combined with this site customisation (thanks to @radq ) you can have usable site with long usernames:

@import "common/foundation/variables";

.topic-post {
  article > .row {
    & > .topic-meta-data {
      width: 79%;
      .contents {
        text-align: left;
        padding-left: 3%;
        position: relative;
      }
      .names {
        z-index: 1;
        position: absolute;
        top: -2px;
        left: 10%;
        width: 100%;
      }
      h3, .user-title {
        display: inline;
        padding-left: 5px;
        font-size: $base-font-size * 0.9;
        a {
            color: #6f6f6f;
            font-weight: bold;
        }
      }
    }
    & > .topic-body {
      width: 70.5%;
      margin-left: 7.5%;
      margin-top: -85px;
      border-top: none;
      padding-left: 10px;
      & > .contents {
        &.avoid-tab { padding-top: 0; }
        .topic-meta-data-inside, .avoid-tab .topic-meta-data-inside {
          margin-top: -52px;
        }
        .cooked, .avoid-tab .cooked {
          margin-top: 48px;
          z-index: 2;
        }
      }
    }
    & > .reply-to-tab {
      left: 9%;
      padding: 2px 12px;
      .avatar {
        height: 15px;
        width: 15px;
      }
    }
  }
  .embedded-posts {
    &.top {
      margin-left: 7.5%;
    }
    position: relative;
    .contents h5 {
      position: absolute;
      top: 12px;
      left: 95px;
      font-size: $base-font-size;
    }
    .topic-body {
      margin-top: 15px;
      .topic-meta-data-inside {
        margin-top: -15px;
      }
    }
  }
}

For example see: http://talk.folksy.com/t/welcome-to-the-discourse-forum-usability-test/62/93?u=sam

Posts: 2

Participants: 2

Read full topic

Admin on trust level 3 can see categories only for trust level 4

$
0
0

parasquid wrote:

I'm probably doing this wrong or misunderstanding the whole reason behind trust levels frowning

We're deploying discourse as the company's "watering hole" of sorts, replacing Facebook Groups. My CEO would like to create a category only meant for Executives (trust level 4). I'm not (fortunately or unfortunately) an Executive (trust level 3), and I'm able to see the category that was setup.

I've verified through impersonation that other people on trust level 3 or lower are unable to see this category, so my guess is that I'm able to see the category by the fact that I'm an admin.

Unfortunately I'm also the tech guy in the company, so I need to be an admin to tweak the settings (and monitor performance).

Do you guys have any pointers? Is there a sub-admin account that respects trust levels but still allows me access to the settings? I understand that I can later on set my self to trust level 4, but that would show up on the logs and the other people would know that I promoted myself and now have access to previously hidden information.

Posts: 2

Participants: 2

Read full topic

How to use the poll plugin?

Project: Better frontend error handling

$
0
0

Kane York wrote:

With my laptop and the spotty campus WiFi, I've noticed that Discourse doesn't handle sudden connectivity loss very well. For example, try this test:

  • Disconnect network
  • Click notifications bubble

Expect: Some visual indication that I clicked on the bubble. Anything!
Actual: Uncaught promise is logged to the console and no header popup is shown.

  • Disconnect network
  • Click logo

Expect: Some sort of graceful degradation
Actual: Infinite loading spinner


Additionally, it would be nice if the backend had cleaner paths to error returning. If I look at application_controller.rb, I see at least 4 utility functions for returning an error:

  • handle_unverified_request returns a 403 with the text ['BAD CSRF']. This is handled by Discourse.ajax().
  • rescuing from RateLimiter::LimitExceeded returns 429 with a JSON object with an errors array and a time_left parameter.
  • rescuing from Discourse::NotLoggedIn either redirects to / or returns a 403 with failed_json.merge, adding a message string.
  • Similarly, but a little differently, rescuing from Discourse::ReadOnly returns a 405 with failed_json merged with a message.
  • Discourse::NotFound and Discourse::InvalidAccess call rescue_discourse_actions, which has such weird behavior, I'm going to need subbullets to explain it:
    • If the request is from the URL bar or an external link, the 'Not Found' page with a login button is returned. (example)
    • If the request is from JS, but the status is 404, the Not Found page is returned anyways.
    • If the request is from JS and the status isn't 404, it renders plaintext: either [error: 'not found'] or [error: 'invalid access']. Both of these, and the Not Found page, are guaranteed to break the JSON parser.

Other controllers use the failed_json.merge method, but there's even another error path: render_json_error which is called with an ActiveRecord object and serializes its .errors.full_messages. admin/screened_ip_addresses_controller provides a nice example of this here.

Just as an extra punch in the face, if you're running in development mode, none of the rescue_froms are run and instead you get the beautiful Rails error page: https://meta.discourse.org/uploads/default/4104/6a7ea727bef9e3bb.png (Oh, this also happens for the ActiveRecord errors too, so it's also impossible to do manual tests of render_json_error in a development environment.)


I've started trying to add all the catches here.

What it does is repurpose the render_json_error method from something specific to ActiveRecord objects to taking any array of messages (that's the return type of full_messages). It gives the client a JSON array like this:

{
  success: false, /* compat with success_json */
  failed: 'FAILED', /* compat with failed_json */
  messages: ["The site is in read only mode. Interactions are disabled."]
}

An intermediate goal would be to make sure that every Discourse.ajax() call either provides an error handler or passes the promise to a function that adds one. The status-complete state would be that every call has an appropriate response to the request failing.

Posts: 5

Participants: 3

Read full topic

Viewing all 60707 articles
Browse latest View live




Latest Images