@theotherwillembotha/node-red-nginxproxymanager 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +156 -0
- package/build/GenerateNodes.js +14 -0
- package/build/Nodes.html +1386 -0
- package/build/Nodes.js +22 -0
- package/build/Plugins.js +70 -0
- package/build/icons/nginx.png +0 -0
- package/build/index.js +22 -0
- package/build/nginx/node/NginxGetHostsNode.js +63 -0
- package/build/nginx/node/NginxProxyManagerConfigNode.js +39 -0
- package/build/nginx/node/UpdateHostNode.js +61 -0
- package/build/nginx/service/NginxProxyManagerClient.js +50 -0
- package/build/nginx/service/NginxProxyManagerService.js +90 -0
- package/build/nginx/service/client/NginxClient.js +185 -0
- package/build/nginx/service/client/NginxHttpClient.js +95 -0
- package/build/nginx/service/client/types.js +3 -0
- package/icons/nginx.png +0 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Willem Botha
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# @theotherwillembotha/node-red-nginxproxymanager
|
|
2
|
+
|
|
3
|
+
Node-RED nodes for managing [Nginx Proxy Manager](https://nginxproxymanager.com/) hosts directly from your flows. Built on [@theotherwillembotha/node-red-plugincore](https://github.com/theotherwillembotha/nodered_plugincore).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Either use the **Manage Palette** option in the Node-RED editor, or run the following in your Node-RED user directory (typically `~/.node-red`):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @theotherwillembotha/node-red-nginxproxymanager
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Nodes
|
|
18
|
+
|
|
19
|
+
### Nginx Proxy Manager Config
|
|
20
|
+
|
|
21
|
+
A config node that holds the connection details for an Nginx Proxy Manager instance. Referenced by all other nodes in this plugin.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
| Field | Description |
|
|
26
|
+
|----------|-------------|
|
|
27
|
+
| Name | A descriptive label for this connection. |
|
|
28
|
+
| URL | The base URL of the Nginx Proxy Manager admin API, including port (e.g. `http://192.168.1.10:81`). |
|
|
29
|
+
| Email | The email address used to authenticate with Nginx Proxy Manager. |
|
|
30
|
+
| Password | The password for the above account. |
|
|
31
|
+
|
|
32
|
+
> This config node registers itself as a `ReverseProxyType` in the plugincore tag system. This means it will automatically appear in the reverse proxy selector of any webhook node that uses the `WebhookTemplate` from `node-red-plugincore`.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Nginx Update Host
|
|
37
|
+
|
|
38
|
+
Creates or updates a proxy host entry in Nginx Proxy Manager. The operation is determined by the presence of an `id` field in `msg.payload`:
|
|
39
|
+
|
|
40
|
+
- **No `id`** — creates a new proxy host.
|
|
41
|
+
- **With `id`** — updates the existing proxy host with that ID.
|
|
42
|
+
|
|
43
|
+
#### Inputs
|
|
44
|
+
|
|
45
|
+
: *msg.payload* (object) : The host configuration to create or update. See the payload schema below.
|
|
46
|
+
|
|
47
|
+
#### Outputs
|
|
48
|
+
|
|
49
|
+
: *msg* (object) : The original message, passed through unchanged after the operation completes.
|
|
50
|
+
|
|
51
|
+
#### Payload schema
|
|
52
|
+
|
|
53
|
+
**Create a new host** — all required fields must be present:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
{
|
|
57
|
+
domainNames: string[], // The domain names to forward (each must be unique and not yet registered).
|
|
58
|
+
scheme: "http" | "https", // The forwarding scheme.
|
|
59
|
+
forwardHost: string, // The target host to forward requests to.
|
|
60
|
+
forwardPort: number, // The target port to forward requests to.
|
|
61
|
+
accessList: string, // The access list to bind to this host.
|
|
62
|
+
cacheAssets: boolean, // Optional: whether to cache assets.
|
|
63
|
+
blockCommonExploits: boolean, // Optional: whether to block common exploits.
|
|
64
|
+
websocketSupport: boolean, // Optional: whether to enable WebSocket support.
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Update an existing host** — only include fields that should change:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
{
|
|
72
|
+
id: number, // Required: the ID of the proxy host to update.
|
|
73
|
+
domainNames: string[], // Optional.
|
|
74
|
+
scheme: "http" | "https", // Optional.
|
|
75
|
+
forwardHost: string, // Optional.
|
|
76
|
+
forwardPort: number, // Optional.
|
|
77
|
+
accessList: string, // Optional.
|
|
78
|
+
cacheAssets: boolean, // Optional.
|
|
79
|
+
blockCommonExploits: boolean, // Optional.
|
|
80
|
+
websocketSupport: boolean, // Optional.
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Example
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"domainNames": ["myservice.example.com"],
|
|
89
|
+
"scheme": "http",
|
|
90
|
+
"forwardHost": "192.168.1.35",
|
|
91
|
+
"forwardPort": 8080,
|
|
92
|
+
"blockCommonExploits": true,
|
|
93
|
+
"websocketSupport": true
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Nginx Get Hosts
|
|
100
|
+
|
|
101
|
+
Retrieves the full list of proxy hosts from Nginx Proxy Manager and writes them to a configurable property on the message.
|
|
102
|
+
|
|
103
|
+

|
|
104
|
+
|
|
105
|
+
#### Properties
|
|
106
|
+
|
|
107
|
+
| Field | Description |
|
|
108
|
+
|---------------|-------------|
|
|
109
|
+
| Name | A descriptive label for the node. |
|
|
110
|
+
| Proxy Manager | The Nginx Proxy Manager config node to use. |
|
|
111
|
+
| Output | The message property to write the hosts array to. Defaults to `msg.payload`. |
|
|
112
|
+
|
|
113
|
+
#### Inputs
|
|
114
|
+
|
|
115
|
+
: *msg* (object) : Any message. The payload is not used; the output property is set on the incoming message and forwarded.
|
|
116
|
+
|
|
117
|
+
#### Outputs
|
|
118
|
+
|
|
119
|
+
: *msg* (object) : The original message with the specified output property set to an array of proxy host objects.
|
|
120
|
+
|
|
121
|
+
#### Output schema
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
[
|
|
125
|
+
{
|
|
126
|
+
id: number, // proxy host ID
|
|
127
|
+
domainNames: string[], // domain names served by this host
|
|
128
|
+
scheme: string, // forwarding scheme: "http" or "https"
|
|
129
|
+
forwardHost: string, // target host
|
|
130
|
+
forwardPort: number, // target port
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Integration with node-red-plugincore
|
|
138
|
+
|
|
139
|
+
This plugin is built on [@theotherwillembotha/node-red-plugincore](https://github.com/theotherwillembotha/nodered_plugincore) and integrates with its subsystems:
|
|
140
|
+
|
|
141
|
+
- **Logging** — all action nodes (Nginx Update Host, Nginx Get Hosts) accept a logger config node via the `LoggerTemplate` section in their editors, enabling structured log output to Console, REST, or Loki backends.
|
|
142
|
+
- **Metrics** — all action nodes track request counts via the `MetricsTemplate` section, publishing Prometheus counters that can be scraped from the metrics endpoint.
|
|
143
|
+
- **Reverse Proxy** — the Nginx Proxy Manager Config node registers itself as a `ReverseProxyType`. Any webhook node using `WebhookTemplate` will automatically list this config node in its reverse proxy selector, allowing Node-RED webhooks to be registered directly in Nginx Proxy Manager via a flow.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## References
|
|
148
|
+
|
|
149
|
+
- [Nginx Proxy Manager — Project](https://nginxproxymanager.com/)
|
|
150
|
+
- [Nginx Proxy Manager — GitHub](https://github.com/NginxProxyManager/nginx-proxy-manager)
|
|
151
|
+
- [node-red-plugincore](https://github.com/theotherwillembotha/nodered_plugincore)
|
|
152
|
+
- [node-red-telemetry](https://github.com/theotherwillembotha/nodered_telemetry)
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
[ISC](LICENSE)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_red_plugincore_1 = require("@theotherwillembotha/node-red-plugincore");
|
|
4
|
+
const index_js_1 = require("./index.js");
|
|
5
|
+
new node_red_plugincore_1.NodeGenerator("./src/")
|
|
6
|
+
// services.
|
|
7
|
+
.registerService(index_js_1.NginxProxyManagerService)
|
|
8
|
+
// nodes
|
|
9
|
+
.registerNode(index_js_1.NginxProxyManagerConfigNode)
|
|
10
|
+
.registerNode(index_js_1.UpdateNginxHostNode)
|
|
11
|
+
.registerNode(index_js_1.NginxGetHostsNode)
|
|
12
|
+
// done.
|
|
13
|
+
.generate("./build/Nodes", "./build/Plugins");
|
|
14
|
+
process.exit(0);
|