# Replace hook in container is ignored when updating using docker\_manager

**URL:** <https://meta.discourse.org/t/replace-hook-in-container-is-ignored-when-updating-using-docker-manager/56014>\
**Category:** Self-hosting\
**Created:** [2017年一月19日 10:02 UTC](https://meta.discourse.org/t/replace-hook-in-container-is-ignored-when-updating-using-docker-manager/56014 "2017-01-19T10:02:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)\
**Post date:** [2017年一月19日 10:02 UTC](https://meta.discourse.org/t/replace-hook-in-container-is-ignored-when-updating-using-docker-manager/56014/1 "2017-01-19T10:02:47Z")

</div>

Hello,

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

```yml
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](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. 🙈

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年一月19日 18:01 UTC](https://meta.discourse.org/t/replace-hook-in-container-is-ignored-when-updating-using-docker-manager/56014/2 "2017-01-19T18:01:24Z")

</div>

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.
