# How to push Node-Red to GitHub without revealing sensitive information?

**URL:** https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505
**Category:** General
**Created:** [9 August 2021 06:01 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505 "2021-08-09T06:01:36Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![portfedh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/portfedh/32/46277_2.png) [@portfedh](https://discourse.nodered.org/u/portfedh)
#### Post date: [9 August 2021 06:01 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/1 "2021-08-09T06:01:36Z")

</div>

I would like to share my NodeRed Code in Github as part of an IOT project, however I would like to keep some of my data private (MQTT password, InfluxDB password, etc).

I could manually erase this information, but this would not be very practical, since I would have to do it every time I update the file.

In my python scripts I use os.environ.get to save my passwords and upload to GitHub securely.

¿Is there some way to set up Node-Red to easily push to GitHub without revealing sensitive information?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [9 August 2021 06:33 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/2 "2021-08-09T06:33:16Z")

</div>

You can configure them using environment variables in the node configuration. Then they do not exist in the flow. [Using environment variables : Node-RED](https://nodered.org/docs/user-guide/environment-variables)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [9 August 2021 08:56 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/3 "2021-08-09T08:56:31Z")

</div>

In case you weren't aware, all node credentials are kept in a separate file alongside your flow file. The credentials file is, by default, encrypted using the `credentialSecret` key in your settings file. As long as you keep that secret out of git, then your credentials will be protected.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [9 August 2021 08:59 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/4 "2021-08-09T08:59:43Z")

</div>

The credential secret can be picked up from an environment variable, so then you only need to set that up in the environment.

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [9 August 2021 10:01 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/5 "2021-08-09T10:01:23Z")

</div>

Also cross posted and answered on Stack Overflow

> <https://stackoverflow.com/questions/68706591/how-to-push-node-red-to-github-without-revealing-sensitive-information>

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 August 2021 10:33 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/6 "2021-08-09T10:33:53Z")

</div>

But do check that any 3rd party contrib nodes also store credentials correctly

---

<div class="post-metadata">

### Author: ![portfedh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/portfedh/32/46277_2.png) [@portfedh](https://discourse.nodered.org/u/portfedh)
#### Post date: [10 August 2021 02:51 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/7 "2021-08-10T02:51:40Z")

</div>

Thank you, this was very helpfull!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [24 August 2021 02:51 UTC](https://discourse.nodered.org/t/how-to-push-node-red-to-github-without-revealing-sensitive-information/49505/8 "2021-08-24T02:51:55Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
