Find/edit hidden settings?

Can anyone help me to find and edit ENV variables?

A number of posts indicate hidden settings can be edited like

max_category_nesting

but when I search for that specific item in the app I come up with “not found”

So guess I’m going about it wrong, any help is appreciated

Thank you!

Hidden site settings can be set from your site’s Rails console. If you enter the Rails console and enter SiteSetting.max_category_nesting, the setting’s current value should be returned. Assuming that you want to update its value to 3, you can do that with the following command:

SiteSetting.max_category_nesting=3

4 Likes

That’s fantastic news thank you

but… :flushed:

Can you point me to where I locate or install a Rails console please?

You can access the Rails console from your site’s server. First ssh into the server, then:

cd /var/discourse
./launcher enter app

From the prompt that appears, run rails c to enter the console.

3 Likes

Many thanks :smiling_face_with_three_hearts:

I did enter 3 and after a reboot tried to add a 3rd sub category layer, got a 403 error,

image

Then I assigned a position in the settings and it worked!

image

Though it changed the look in a manner I wasn’t prepared for, but its nice to have made it this far, feels like Christmas morning, thank you again!

BTW, are there any good sources you can point me to to learn all the rails options?

For instance I don’t even know what pry (main) is referring too :flushed:

The “console” was a bit lackluster :nerd_face:

image

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.