# Notify admin when site settings are updated by system

**URL:** https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961
**Category:** Feature
**Tags:** pr-welcome, site-settings
**Created:** [November 12, 2021, 10:03am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961 "2021-11-12T10:03:47Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [November 12, 2021, 10:03am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/1 "2021-11-12T10:03:48Z")

</div>

We recently had our download\_remote\_images\_to\_local disabled by system as s ‘silent’ change. As a site owner, it would have been useful to receive a DM about this. I’m not sure if there are more changes that can be updated by system like this though.

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/4/64d00c2e4710aeb18f386be26a99e5f11d12e6e3.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 12, 2021, 11:26am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/2 "2021-11-12T11:26:46Z")

</div>

I’ve seen that happen when the disk is full. Was it that or something else?

---

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [November 12, 2021, 11:27am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/3 "2021-11-12T11:27:41Z")

</div>

It wasn’t full, just going below the threshold we set for downloading remote images.

---

<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: [November 15, 2021, 12:31am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/4 "2021-11-15T00:31:28Z")

</div>

I think the suggestion is reasonable, unfortunately I do not think we will have time to work on this for quite a while.

Placing a #pr-welcome on it in case anyone in the community wants to investigate this. (A PM to admins when we fiddle with the setting)

---

<div class="post-metadata">

### Author: ![Earnie\_Baird](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/earnie_baird/32/380079_2.png) [@Earnie\_Baird](https://meta.discourse.org/u/Earnie_Baird)
#### Post date: [August 7, 2024, 8:34pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/5 "2024-08-07T20:34:38Z")

</div>

The “system” broke our site by changing the default trust level to “0” when we had set it to be “1”.

It is very surprising that the system can make ad hoc changes to our production site without any kind of approval or notice and we need to prevent this from happening again in the future.

Is there any way to disable these automatic system changes?

---

<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: [August 16, 2024, 12:43am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/6 "2024-08-16T00:43:49Z")

</div>

> [@Earnie\_Baird](#):
>
> The “system” broke our site by changing the default trust level to “0” when we had set it to be “1”.

This should not happen, plenty of sites have default of TL1. We need more context, can you open a new topic about this.

---

<div class="post-metadata">

### Author: ![Earnie\_Baird](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/earnie_baird/32/380079_2.png) [@Earnie\_Baird](https://meta.discourse.org/u/Earnie_Baird)
#### Post date: [August 21, 2024, 3:13pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/7 "2024-08-21T15:13:29Z")

</div>

So it turns out that this happened due to bootstrap mode on a new server/app that we were setting up.

But my message was less about this specific system change and more about how any system change should ideally require approval so things don’t break. If approval isnt possible then at minimum an email notifying all admins about the change (which I think is more or less what the OP was asking after) would be great.

Thanks for all the work on Discourse!

---

<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: [August 21, 2024, 11:11pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/8 "2024-08-21T23:11:54Z")

</div>

Hi @Earnie_Baird, this is great feedback.

I guess one suggestion would be to have more clarity on bootstrap mode, maybe when you see that on the header and click on it it should very clearly spell out what happened.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 13, 2025, 8:36pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/10 "2025-08-13T20:36:23Z")

</div>

Unless there were changes I wasn’t aware of (and I don’t think there were), I strongly approve this feature request.

I’ve encountered this issue several times when temporarily lacking disk space.

Every single time, I noticed the setting was disabled only by chance. I didn’t think of looking at setting changes when I reach a disk space threshold, even after experiencing his multiple times.

I’m pretty sure there are many instances in the wild that have this setting disabled without the admin even knowing it, just because they ran out of disk space one year ago.

The setting change is logged in `/admin/logs/staff_action_logs?filters=%7B"subject"%3A"download_remote_images_to_local"%7D`, but I don’t remember ever getting any notification when it triggers.

Ideally, I’d like either at least a warning in the dashboard, a notification in the user menu, or an email.

The context of the following quote was quite specific (and old), but it also applies here.

> [@Empty topics after a successful backup restore](https://meta.discourse.org/t/empty-topics-after-a-successful-backup-restore/139142/7):
>
> if a value of a specific setting needs to be changed, I would want to expect Discourse to tell the admin what’s going on. It’s just about being transparent and making the admin life less painful.

An absence of any kind of notification when a setting is changed by @system can be detrimental.

* * *

When I notice **download\_remote\_images\_to\_local** has been disabled at some point, I run one of (or both, once) these rails scripts to trigger the download of remote files:

# Rebake all posts from a given date

```ruby
i = 0
Post.where('created_at >= ?', Date.new(2023, 5, 1)).where('user_id > 0').find_each do |post|
  post.rebake!
  puts "Post #{post.id}, Created at #{post.created_at}"
  i += 1
end

puts "Total number of posts rebaked: #{i}"

```

# Rebake all posts between two given dates

```ruby
i = 0
Post.where('created_at >= ? AND created_at < ?', Date.new(2021, 12, 1), Date.new(2022, 3, 1)).where('user_id > 0').find_each do |post|
  post.rebake!
  puts "Post #{post.id}, Created at #{post.created_at}"
  i += 1
end

puts "Total number of posts rebaked: #{i}"

```

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 14, 2025, 10:10pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/11 "2025-09-14T22:10:03Z")

</div>

> [@Canapin](#):
>
> The setting change is logged in `/admin/logs/staff_action_logs?filters=%7B"subject"%3A"download_remote_images_to_local"%7D`, but I don’t remember ever getting any notification when it triggers.
> 
> Ideally, I’d like either at least a warning in the dashboard, a notification in the user menu, or an email.

Reading [Get admin notification from logs? - #4 by JammyDodger](https://meta.discourse.org/t/get-admin-notification-from-logs/363729/4) made me think of this topic again. I think you could also use the “Schedule a PM with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) results” or “Schedule a post in a topic with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) results” automation script and a [data explorer](https://meta.discourse.org/t/32566?silent=true) query to receive notifications on changes on site settings by system.

Something like

```sql
SELECT subject, previous_value, new_value, updated_at
FROM user_histories uh
where uh.action = 3
AND uh.acting_user_id = -1
AND uh.updated_at > CURRENT_TIMESTAMP - INTERVAL '60 minutes'
order by updated_at desc

```

Then you set up the automation with a recurrence matching the interval in the query, and skip if there are no results to avoid noise.

You could also improve the query to filter for the exact subject, but I thought maybe other automatic changes are interesting as well.

---

<div class="post-metadata">

### Author: ![gassim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gassim/32/220910_2.png) [@gassim](https://meta.discourse.org/u/gassim)
#### Post date: [October 25, 2025, 11:18am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/12 "2025-10-25T11:18:13Z")

</div>

Hi @Moin

Thank your this, it sounds like a very helpful idea!

> [@Moin](#):
>
> ```plaintext
> SELECT subject, previous_value, new_value, updated_at
> FROM user_histories uh
> where uh.action = 3
> AND uh.acting_user_id = -1
> AND uh.updated_at > CURRENT_TIMESTAMP - INTERVAL '60 minutes'
> order by updated_at desc
> 
> ```

I ran this query but it doesn’t show changes such as the automatic [disabling of the Narrative](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/11)..

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [October 25, 2025, 11:28am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/13 "2025-10-25T11:28:57Z")

</div>

That’s right! There is no entry in the logs for this. The automation only notifies you about changes that are logged in the staff action logs. That’s why I suggested that an entry should always be created for such changes.

This query deliberately only queries a short period of time. When I comment out the time restriction, I see at least some changes, but there are no log entries for most changes.

```diff
- AND uh.updated_at > CURRENT_TIMESTAMP - INTERVAL '60 minutes'
+ --AND uh.updated_at > CURRENT_TIMESTAMP - INTERVAL '60 minutes'

```

However, to prevent the automation script from reporting those old changes, I have added this time restriction.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [October 25, 2025, 6:42pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/14 "2025-10-25T18:42:22Z")

</div>

This is a helpful query for any site to have for troubleshooting, when some behavior has unexpectedly changed. It might even be you or a fellow admin who changed something and it had an unexpected effect.

I created an automation here on meta to run this query weekly, to show all logged changes in the last week. We have alot of cooks in this kitchen and it can be hard sometimes to maintain an overview.

Seems to me the feature request here would be to log all staff actions, more comprehensively.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [October 25, 2025, 7:06pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/15 "2025-10-25T19:06:00Z")

</div>

> [@tobiaseigen](#):
>
> This is a helpful query for any site to have for troubleshooting, when some behavior has unexpectedly changed. It might even be you or a fellow admin who changed something and it had an unexpected effect.

The query I shared is limited to changes on site settings and limited to actions by system. So it helps noticing when settings are changed by system either because of an automation, like disabling image download because of a full disk or the setting changes when bootstrap mode ends. In combination with a post or PM by the automation plugin this can help in cases like the one described in the OP.

But the query doesn’t really help to find unexpected changes like the change that disabled the welcome message of discobot @gassim would have liked to know about. Most setting changes that happen during a Discourse update aren’t logged and that’s what makes them so hard to track down.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [October 25, 2025, 7:10pm UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/16 "2025-10-25T19:10:34Z")

</div>

I modified your query to show me all logged changes in the last week.

I agree with you that a gap needs to be filled. Not enough actions are being logged.

---

<div class="post-metadata">

### Author: ![ted](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ted/32/283882_2.png) [@ted](https://meta.discourse.org/u/ted)
#### Post date: [May 1, 2026, 8:10am UTC](https://meta.discourse.org/t/notify-admin-when-site-settings-are-updated-by-system/208961/17 "2026-05-01T08:10:34Z")

</div>

Two thoughts here:

1. This could easily be a problem check that will add an admin notice to the dashboard.
2. The code knows when you’re running out of disk space and disables the setting. But the code also knows when you have enough disk space and should in theory be able to start downloading again. This would require a different source of truth, however, since the code doesn’t know that the setting is _intended to be_ enabled.
