# Why is adding ENV not amending client side site settings

**URL:** https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271
**Category:** Development
**Created:** [May 12, 2020, 2:43pm UTC](https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271 "2020-05-12T14:43:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [May 12, 2020, 2:43pm UTC](https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271/1 "2020-05-12T14:43:04Z")

</div>

> [@Bootstrapping a discourse docker image with SSO URL as environment variable](https://meta.discourse.org/t/bootstrapping-a-discourse-docker-image-with-sso-url-as-environment-variable/85107/5):
>
> ```plaintext
> env:
> DISCOURSE_NOTIFICATION_EMAIL: 'bla@bla.com'
> 
> ```
> 
> Will set `SiteSetting.notification_email` to `bla@bla.com`

Hi @sam,

Maybe I am reading this wrong or doing this wrong?

In `app.yml` , I added a custom env var:

```plaintext
env:
   DISCOURSE_MY_ENV_TEST: app

```

and rebuilt the container with a little custom plugin where I dumped all the site settings like this:

```plaintext
console.log(Discourse.SiteSettings);

```

and it nicely dumps all the site settings to the console as expected; but the custom env: var I set in `app.yml` do not seem to make it to site settings, as I expected.

Am I doing this wrong?

The reason I ask was I found this topic, searching and looking for a simple way to get env vars into the application so I can use in my plugin; and thought you may be saying that we can do this as described by adding them to the `app.yml` file; but it’s not working as expected.

PS: Sorry for resurrecting this old topic, but it seemed the closest match based on searching the site and I thought maybe replying here might be better than starting a new topic.

---

<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: [May 13, 2020, 1:16am UTC](https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271/2 "2020-05-13T01:16:06Z")

</div>

> [@neounix](#):
>
> and it nicely dumps all the site settings to the console as expected; but the custom env: var I set in `app.yml` do not seem to make it to site settings, as I expected.

You need to define a plugin with the site setting for this to work. We don’t just pass stuff blindly from ENV to the client.

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [May 13, 2020, 2:53am UTC](https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271/3 "2020-05-13T02:53:14Z")

</div>

Hi Sam,

Got it, I think:

So basically we cannot define a new env: variable in the` yml` file and have that `env:` var consumed by the site settings in the app unless we create a plugin for this purpose (to add an additional environmental variable for the site, configurable from the `yml` file).

Is that the correct understanding on my side?

Thanks!

---

<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: [May 13, 2020, 3:53am UTC](https://meta.discourse.org/t/why-is-adding-env-not-amending-client-side-site-settings/151271/4 "2020-05-13T03:53:25Z")

</div>

Yeah if you want a new site setting defined it must be added to a plugin.
