Replace hook in container is ignored when updating using docker_manager

Hello,

I have the following hook in my discourse yml container config:

hooks:
  after_code:
    - replace:
        global: true
        filename: /var/www/discourse/app/controllers/users_controller.rb
        from: /^.*StaffActionLogger\.new\(current_user\)\.log_check_email.*$/
        to: ""

That’s a work-around for the issue explained here:

https://meta.discourse.org/t/intense-api-use-floods-staff-log/48214/5

If I do an update with docker_manager and the configuartion is a different one afterwords, that means a configuration without the replace hook, that I would consider this to be a bug. :see_no_evil:

This is not a bug, this is not a supported mechnism of patching our code, if you need to do something like this you would

either:

  • Maintain a fork (which is a pain)
  • Make this a feature in core (hidden behind a site setting)
  • Reorganise core so a plugin can take care of this

The web updated does not run pups at all, it is simply not designed that way.

3 Likes