How to break 99k char limit?

(Dylan Hunt) #1

I tried to make char limit 150k, but I’m limited to 99k:

Our use for this is that we have in-game bad behavior reports posting chat logs from the game. Some games are longer than others. I have no problem eating the space if it starts to get big.

For example:

We have a spoiler for our logs. We click it and ctrl+f the info we want, all color-coded (the color coding takes up a lot of the +characters with [color][/color] each line.

Anyway, the more choices we have the better – I’d love to know how to break this limit in the admin dashboard beyond 99k. Or if that’s not possible, something hacky would work too if there’s a file I can edit.

(Jeff Atwood) #2

I suggest you get users to post enormous logs at a third party service like pastebin. Or clip the logs to just the relevant parts.

(Dylan Hunt) #3

How come, though, if it seems like simply a number? 80% of most logs are under the amount specified, but 20% are not, causing issues. It’d be way easier to change 1 number than change our entire streamline of post delivery.

If we’re happy to take the storage hit, what difference does it make? I’m really enjoying our solution – it fits perfectly with our daily use this way. DigitalOcean now offers those hard drive extensions, making storage extremely affordable. Since Discourse is most advertised to use with DO, this would only make sense if people wouldn’t mind bumping up things like this.

Plus, the option to go up without it effecting anyone unless they want it to go up (much like any other option with file size limit) always seems like a positive change. Choices = better

(Gerhard Schlager) #4

Here’s the magic number.

Not sure why it’s exactly 99k, but you could write a simple plugin that overrides the max value.

(Régis Hanol) #5

There might also be a search hit (either slower search or poor results).

(Dylan Hunt) #6

In our case, only staff can see it, so it wouldn’t effect anyone else. In that case, could simply offer a warning that higher than 100k may cause instability. However, the difference between 100k and 150k (our new max we’d like) I can’t imagine being an incredible amount of difference, esp on the high-end VPS.

As long as people are warned (just like most other areas that warn), shouldn’t it be up to the admin? The difference between 100k and 1 mil I can see, but in our example, we just want to raise it to 150k.

So is there a file I can edit to achieve this?

(Dylan Hunt) #7

OH! My bad, I missed this post. Thanks~ can I just change this value directly at discourse/discourse/blob/master/config/site_settings.yml#L456-L459 ? Will it break if I update? I probably won’t have enough time to look into plugins until early next year, so just trying to hop on ezstreet for the time being while our reports are broken. There’s a lot of nasty people that we need to banhammer where the reports aren’t going through for long games.

(Joshua Rosenfeld) #8

I very strongly recommend not modifying the files directly. It will either break updates, or more likely revert to the default every time you update.

A plugin to override a site setting should be a single file, nearly as easy as modifying the file.

(Dylan Hunt) #9

I think I’m just going to change the file and not update for a few versions. This is pretty much the opposite of “nearly as easy as modifying the file” O_O

(Joshua Rosenfeld) #10

If you choose to do that (and I still don’t recommend it) - please keep an eye on the Commit log for security related commits. They’ll start with SECURITY: - you don’t want to skip installing those.

(Joshua Rosenfeld) #11

I just threw together a super quick and dirty plugin for you @dylanh724: This will override the max post length maximum value to be 150,000.

Install it like a normal plugin: Install a Plugin

Why is Max image size limited to 100MB?
(Dylan Hunt) #12

Oh, wow! I didn’t expect that. Thank you so much!!

(Joshua Rosenfeld) #13

You’re quite welcome. It’s a good example plugin to have - I will do a write up in #plugin eventually.

500 internal server error /whatever.json
(Ted Strauss) #14

I updated this setting, and a couple other occurences of max_post_length in the code, and then restarted the container, but I am still getting the error message:

Body is limited to 32000 characters; you entered 148069.

Am I doing something wrong?
Do I need to restart docker or something? Nope, that didn’t work.

(Gerhard Schlager) #15

You should use the plugin instead of manually editing source files.

(Ted Strauss) #16

That’s what I did and it worked.

The only thing I would add is that there are two variables in the plugin: default and maximum char limit. But the one that Discourse seems to use is default, so it’s not clear why there are two variables.

(Joshua Rosenfeld) #17

Default is the value used in the setting by…default. As a site setting that value can be changed. In Discourse core the maximum value for the site setting is 99000. This plugin increases the maximum value selectable to 150000.

(Ted Strauss) #18

I had not seen that setting in the dashboard, maybe an earlier version didn’t display it or I missed it. Now I found it and the purpose of the 2 variables makes sense.