Hooks from: & to: syntax in yml to disable anonymous searches

Thanks for providing with the variable, with this documentation I could make it work.

So I modified the app.yml with the following, saved, then ./launcher restart app(no rebuild needed)

env:
  DISCOURSE_RATE_LIMIT_SEARCH_ANON_GLOBAL_PER_MINUTE: 0

Now the /search page is unreachable = great
Now the front end search button instantly returns : you’ve performed this action too many times = great
You may hide the search button with :

.anon #search-button {
	display: none !important;
}

But the question is : is this thorough? Can anyone just create a simple session cookie to make it look like they are connected so that they can access the content of the site through searches?

More thorough but uncomplete solution :

The file is : /var/www/discourse/app/controllers/search_controller.rb
The modification : add “if current_user.present?” after “def show” and add an “end” at the bottom of the condition.

However I could not make it persistent after restart, so anybody is welcome to tell how to make it persistent after restart with the app.yml hooks after_code replace: feature.