Replace hook in container is ignored when updating using docker_manager


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

    - 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:

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


  • 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.