# Set forum settings either before or after install

**URL:** <https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772>\
**Category:** Self-hosting\
**Created:** [12월 16, 2015, 8:48오전 UTC](https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772 "2015-12-16T08:48:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SnipersCode](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@SnipersCode](https://meta.discourse.org/u/SnipersCode)\
**Post date:** [12월 16, 2015, 8:48오전 UTC](https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772/1 "2015-12-16T08:48:51Z")

</div>

Background: I’m currently creating a solution that automatically deploys the nginx, uwsgi, flask, and discourse containers using docker-compose. My flask application has an oauth2 endpoint that discourse uses (using the discourse-oauth2-basic plugin) to authenticate users.

Question: Is there a way to automatically update settings pre/post install such as custom plugin settings like “oauth2 user id path”, default settings like “login required”, or creating/setting an api?

---

<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:** [12월 16, 2015, 9:00오전 UTC](https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772/2 "2015-12-16T09:00:59Z")

</div>

You can introduce a hook after you are done installing that calls rails run and sets the settings

```plaintext
rails run 'SiteSetting.SomeSetting = "value"'

```

---

<div class="post-metadata">

**Author:** ![SnipersCode](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@SnipersCode](https://meta.discourse.org/u/SnipersCode)\
**Post date:** [12월 16, 2015, 10:05오전 UTC](https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772/3 "2015-12-16T10:05:37Z")

</div>

Cool. Just for completeness sake, I assume I can use the setting names found here: [discourse/config/site\_settings.yml at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/config/site_settings.yml) (main), [discourse-oauth2-basic/config/settings.yml at main · discourse/discourse-oauth2-basic · GitHub](https://github.com/discourse/discourse-oauth2-basic/blob/master/config/settings.yml) (plugin) and put the hook in the yaml used to bootstrap discourse.

I assume it would also be valid to add  
`- exec: rails r "SiteSetting.SomeSetting='value'"`  
to the yaml under “run:” as well? Or should this run in the after\_code or after\_bundle\_exec hooks? I can’t seem to find documentation or the file that shows the valid hooks.

---

<div class="post-metadata">

**Author:** ![bbendick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bbendick/32/104987_2.png) [@bbendick](https://meta.discourse.org/u/bbendick)\
**Post date:** [8월 10, 2016, 2:52오전 UTC](https://meta.discourse.org/t/set-forum-settings-either-before-or-after-install/36772/4 "2016-08-10T02:52:36Z")

</div>

Did you have any success with this? I just restored a backup to another server and was effectively locked out due to the oauth2 hostname checking. I logged into the app and postgres directly to alter the setting, but being able to set it in the yaml would be much more appealing.
