# Create a pop up alert when deploying node in a no local configuration

**URL:** https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401
**Category:** Feature Requests
**Created:** [13 March 2024 13:08 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401 "2024-03-13T13:08:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Maluquinho59](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maluquinho59/32/89252_2.png) [@Maluquinho59](https://discourse.nodered.org/u/Maluquinho59)
#### Post date: [13 March 2024 13:08 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/1 "2024-03-13T13:08:48Z")

</div>

Hello.  
Nodered 3.1.6

When we are on a server (in a not local configuration) trying to deploy a code, there is no alert sent to notify a potential risk.

I think it can be benefical to add such a feature (to avoid creating important mistakes).

For exemple, i tried on /package/node\_modules/@node-red/editor-client/src/js/ui/deploy.js to modify arround line 440 with the following code :  
And it result in a pop up when deploying in a no local disposition

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a86164dc7423bb0ab2c023e59815f65e03f988f.png)

```auto
....
            let notificationButtons = [];
            let notification;
            if (!window.location.href.includes("localhost") && !window.location.href.includes("127.0.0.1")) {
                showWarning = true;
                notificationMessage = "<p>" + RED._("You are not in localhost. Do not deploy unvalidated flow") + "</p>" +
                    "<p>" +
                    RED._('deploy.confirm.confirm') +
                    "</p>";

                notificationButtons = [
                    {
                        id: "red-ui-deploy-dialog-confirm-deploy-deploy",
                        text: RED._("deploy.confirm.button.confirm"),
                        class: "primary",
                        click: function () {
                            save(true);
                            notification.close();
                        }
                    }
                ];
            } else if (hasUnknown && !ignoreDeployWarnings.unknown) {
                showWarning = true;
                notificationMessage = "<p>" + RED._('deploy.confirm.unknown') + "</p>" +
                    '<ul class="red-ui-deploy-dialog-confirm-list"><li>' + cropList(unknownNodes).map(function (n) { return sanitize(n) }).join("</li><li>") + "</li></ul><p>" +
                    RED._('deploy.confirm.confirm') +
                    "</p>";

                notificationButtons = [
                    {
                        text: RED._("deploy.unknownNodesButton"),
                        class: "pull-left",
                        click: function() {
                            notification.close();
                            RED.actions.invoke("core:search","type:unknown ");
                        }
                    },
                    {
                        id: "red-ui-deploy-dialog-confirm-deploy-deploy",
                        text: RED._("deploy.confirm.button.confirm"),
                        class: "primary",
                        click: function () {
                            save(true);
                            notification.close();
                        }
                    }
                ];
            }
.......

```

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [13 March 2024 13:13 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/2 "2024-03-13T13:13:36Z")

</div>

Don't like this.

I **never** access my Node-red servers using a browser on the server itself so I'm always in a "no local configuration".

This popup, like popups in general, would be very annoying.

---

<div class="post-metadata">

### Author: ![Maluquinho59](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maluquinho59/32/89252_2.png) [@Maluquinho59](https://discourse.nodered.org/u/Maluquinho59)
#### Post date: [13 March 2024 13:16 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/3 "2024-03-13T13:16:06Z")

</div>

So maybe with a setting to enable or disable this kind of popup ?

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [13 March 2024 13:25 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/4 "2024-03-13T13:25:59Z")

</div>

There is a difference in culture between WIndows and Linux hemispheres.

In WIndows it's very common to see an "Are you sure?" popup. In my experience, this results in clicking Yes without any real consideration of the question.

Contrariwise, Linux tries to do whatever you ask it to, assuming you know what you are doing.  
A user generally learns to consider the consequences before clicking Go.

Neither approach actually prevents mistakes.  
Fortunately Node-red respects CTRL-Z to undo.

I think it's better to only allow thoughtful and competent users to access important live servers.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [17 March 2024 13:33 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/5 "2024-03-17T13:33:12Z")

</div>

I think this may have some merit as an option in settings.js - perhaps a PR?

It certainly couldn't be a fixed feature as it wouldn't allow for the many different ways of using Node-RED.

---

<div class="post-metadata">

### Author: ![Maluquinho59](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maluquinho59/32/89252_2.png) [@Maluquinho59](https://discourse.nodered.org/u/Maluquinho59)
#### Post date: [18 March 2024 14:01 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/6 "2024-03-18T14:01:12Z")

</div>

Thanks for your consideration.  
Yes a setting that can be on / off to nofity if the adress is not "localhost" or something custom can be good 😉  
But for sure nodered is used with a lot of different way so I don't know the best solution to implement it

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [25 March 2024 14:54 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/7 "2024-03-25T14:54:45Z")

</div>

I don't really understand the risk, is it linked to multi-user editing (two users editing at the same time)?

---

<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 May 2024 14:55 UTC](https://discourse.nodered.org/t/create-a-pop-up-alert-when-deploying-node-in-a-no-local-configuration/86401/8 "2024-05-24T14:55:31Z")

</div>

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