@pdkkid/n8n-nodes-nginx-proxy-manager 1.0.0

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/README.md ADDED
@@ -0,0 +1,225 @@
1
+ # Nginx Proxy Manager - N8N Integration
2
+
3
+ This package provides N8N nodes for interacting with the Nginx Proxy Manager API, allowing you to automate proxy host management, user administration, and system monitoring directly from N8N workflows.
4
+
5
+ ## Features
6
+
7
+ - **Proxy Host Management**: Create, read, update, and delete proxy hosts
8
+ - **User Management**: Manage users, permissions, and authentication
9
+ - **Settings Management**: Get and update system settings
10
+ - **Health Monitoring**: Check API health status
11
+ - **Reporting**: Get statistics about hosted services
12
+ - **Token Management**: Automatic token handling with refresh support
13
+
14
+ ## Installation
15
+
16
+ 1. Copy this directory to your N8N custom nodes folder:
17
+ ```bash
18
+ cp -r n8n-nodes-nginx-proxy-manager ~/.n8n/nodes/
19
+ ```
20
+
21
+ 2. Rebuild N8N:
22
+ ```bash
23
+ npm rebuild
24
+ ```
25
+
26
+ 3. Restart N8N
27
+
28
+ ## Setup
29
+
30
+ ### 1. Add Credentials
31
+
32
+ 1. In N8N, go to **Credentials**
33
+ 2. Click **New** and select **Nginx Proxy Manager API**
34
+ 3. Fill in the following:
35
+ - **API URL**: Your Nginx Proxy Manager API base URL
36
+ - **Email**: Your NPM login email
37
+ - **Password**: Your NPM login password
38
+ - **Access Token** (optional): If you already have a valid token, paste it here to skip credential-based auth
39
+
40
+ ### 2. Use in Workflows
41
+
42
+ Add the "Nginx Proxy Manager" node to any workflow and select from the available operations.
43
+
44
+ ## Available Operations
45
+
46
+ ### Health
47
+ - **Get Status**: Check if the API is healthy
48
+
49
+ ### Proxy Hosts
50
+ - **Get All**: Retrieve all proxy hosts (supports expansion of related data)
51
+ - **Get**: Retrieve a specific proxy host by ID
52
+ - **Create**: Create a new proxy host
53
+ - **Update**: Update an existing proxy host
54
+ - **Delete**: Delete a proxy host
55
+
56
+ **Proxy Host Fields:**
57
+ - Domain Names (required)
58
+ - Forward Host (required) - IP or hostname
59
+ - Forward Port (required)
60
+ - Forward Scheme - HTTP or HTTPS
61
+ - SSL Forced
62
+ - Caching Enabled
63
+ - Block Exploits
64
+ - Allow Websocket Upgrade
65
+ - HTTP/2 Support
66
+ - HSTS Enabled
67
+ - HSTS Subdomains
68
+ - Advanced Nginx Config
69
+
70
+ ### Users
71
+ - **Get All**: Retrieve all users (with optional permissions expansion)
72
+ - **Get**: Get a specific user
73
+ - **Create**: Create a new user
74
+ - **Update**: Update user details
75
+ - **Delete**: Delete a user
76
+ - **Update Auth**: Change user password
77
+ - **Update Permissions**: Set user permissions for different resources
78
+
79
+ **Permission Levels:**
80
+ - `hidden` - User cannot see the resource
81
+ - `view` - User can view but not modify
82
+ - `manage` - User has full control
83
+
84
+ **Visibility Levels:**
85
+ - `all` - User can see all items
86
+ - `user` - User can only see their own items
87
+
88
+ ### Settings
89
+ - **Get All**: Retrieve all system settings
90
+ - **Get**: Get a specific setting
91
+ - **Update**: Update a setting value
92
+
93
+ **Common Settings:**
94
+ - `default-site` - What to show for unknown hosts
95
+
96
+ ### Reports
97
+ - **Get Hosts Report**: Get statistics about proxy hosts, redirections, streams, and dead hosts
98
+
99
+ ### Tokens
100
+ - **Get New Token**: Request a new access token from credentials
101
+ - **Refresh Token**: Refresh an existing token
102
+
103
+ ## Examples
104
+
105
+ ### Create a Proxy Host
106
+
107
+ ```json
108
+ {
109
+ "resource": "proxyHost",
110
+ "operation": "create",
111
+ "domainNames": "example.com,www.example.com",
112
+ "forwardHost": "192.168.1.100",
113
+ "forwardPort": 8080,
114
+ "forwardScheme": "http",
115
+ "enabled": true,
116
+ "sslForced": false,
117
+ "blockExploits": true
118
+ }
119
+ ```
120
+
121
+ ### Get All Proxy Hosts with Details
122
+
123
+ ```json
124
+ {
125
+ "resource": "proxyHost",
126
+ "operation": "getAll",
127
+ "expand": "owner"
128
+ }
129
+ ```
130
+
131
+ ### Create a New User
132
+
133
+ ```json
134
+ {
135
+ "resource": "user",
136
+ "operation": "create",
137
+ "email": "newuser@example.com",
138
+ "name": "New User",
139
+ "nickname": "New",
140
+ "roles": ["user"]
141
+ }
142
+ ```
143
+
144
+ ### Update User Permissions
145
+
146
+ ```json
147
+ {
148
+ "resource": "user",
149
+ "operation": "updatePermissions",
150
+ "userId": 2,
151
+ "visibility": "all",
152
+ "proxyHostsPermission": "manage"
153
+ }
154
+ ```
155
+
156
+ ### Check System Health
157
+
158
+ ```json
159
+ {
160
+ "resource": "health",
161
+ "operation": "getStatus"
162
+ }
163
+ ```
164
+
165
+ ### Get Statistics
166
+
167
+ ```json
168
+ {
169
+ "resource": "report",
170
+ "operation": "getHostsReport"
171
+ }
172
+ ```
173
+
174
+ ## API Expansion Options
175
+
176
+ Some operations support expanding related data:
177
+
178
+ - `access_list` - Include access list information
179
+ - `owner` - Include owner/user information
180
+ - `certificate` - Include SSL certificate information
181
+ - `permissions` - Include user permission details
182
+
183
+ ## Error Handling
184
+
185
+ The nodes will return detailed error messages from the API. Common errors include:
186
+
187
+ - **401 Unauthorized**: Invalid credentials or expired token
188
+ - **404 Not Found**: Resource doesn't exist
189
+ - **400 Bad Request**: Invalid parameters
190
+ - **409 Conflict**: Resource conflict (e.g., duplicate domain)
191
+
192
+ ## Rate Limiting
193
+
194
+ The Nginx Proxy Manager API doesn't have explicit rate limits, but it's recommended to add delays between requests if making bulk operations.
195
+
196
+ ## Troubleshooting
197
+
198
+ ### "No credentials provided"
199
+ Make sure you've added the Nginx Proxy Manager API credentials and selected them in the node.
200
+
201
+ ### "401 Unauthorized"
202
+ Verify your email and password are correct. The token may have expired - try refreshing or re-authenticating.
203
+
204
+ ### "Domain already in use"
205
+ The domain name is already configured for another proxy host. Remove it from the existing host first.
206
+
207
+ ### "Nginx configuration error"
208
+ Check your advanced configuration syntax. Invalid Nginx directives will prevent the host from being enabled.
209
+
210
+ ## Support
211
+
212
+ For issues with the integration, check:
213
+ - The [Nginx Proxy Manager documentation](https://nginxproxymanager.com/)
214
+ - The [API Schema](https://github.com/NginxProxyManager/nginx-proxy-manager)
215
+
216
+ ## License
217
+
218
+ MIT
219
+
220
+ ## Changelog
221
+
222
+ ### v1.0.0
223
+ - Initial release
224
+ - Full support for proxy hosts, users, settings, and tokens
225
+ - Health monitoring and reporting endpoints
@@ -0,0 +1,36 @@
1
+ import { ICredentialType } from 'n8n-workflow';
2
+ export declare class NginxProxyManagerApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: ({
7
+ displayName: string;
8
+ name: string;
9
+ type: "string";
10
+ default: string;
11
+ required: boolean;
12
+ description: string;
13
+ typeOptions?: undefined;
14
+ } | {
15
+ displayName: string;
16
+ name: string;
17
+ type: "string";
18
+ typeOptions: {
19
+ password: boolean;
20
+ };
21
+ default: string;
22
+ required: boolean;
23
+ description: string;
24
+ } | {
25
+ displayName: string;
26
+ name: string;
27
+ type: "string";
28
+ typeOptions: {
29
+ password: boolean;
30
+ };
31
+ default: string;
32
+ description: string;
33
+ required?: undefined;
34
+ })[];
35
+ }
36
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,oBAAqB,YAAW,eAAe;IAC3D,IAAI,SAA0B;IAC9B,WAAW,SAA6B;IACxC,gBAAgB,SAA8D;IAC9E,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAsCR;CACF"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NginxProxyManagerApi = void 0;
4
+ class NginxProxyManagerApi {
5
+ constructor() {
6
+ this.name = 'nginxProxyManagerApi';
7
+ this.displayName = 'Nginx Proxy Manager API';
8
+ this.documentationUrl = 'https://github.com/NginxProxyManager/nginx-proxy-manager';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API URL',
12
+ name: 'apiUrl',
13
+ type: 'string',
14
+ default: 'http://proxy.example.com/api',
15
+ required: true,
16
+ description: 'The base URL of your Nginx Proxy Manager API (e.g., http://proxy.pdkkid.dev/api)',
17
+ },
18
+ {
19
+ displayName: 'Email',
20
+ name: 'email',
21
+ type: 'string',
22
+ default: '',
23
+ required: true,
24
+ description: 'Email address for authentication',
25
+ },
26
+ {
27
+ displayName: 'Password',
28
+ name: 'password',
29
+ type: 'string',
30
+ typeOptions: {
31
+ password: true,
32
+ },
33
+ default: '',
34
+ required: true,
35
+ description: 'Password for authentication',
36
+ },
37
+ {
38
+ displayName: 'Access Token',
39
+ name: 'accessToken',
40
+ type: 'string',
41
+ typeOptions: {
42
+ password: true,
43
+ },
44
+ default: '',
45
+ description: 'If you already have an access token, you can use it directly (optional)',
46
+ },
47
+ ];
48
+ }
49
+ }
50
+ exports.NginxProxyManagerApi = NginxProxyManagerApi;
51
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../credentials.ts"],"names":[],"mappings":";;;AAIA,MAAa,oBAAoB;IAAjC;QACC,SAAI,GAAG,sBAAsB,CAAC;QAC9B,gBAAW,GAAG,yBAAyB,CAAC;QACxC,qBAAgB,GAAG,0DAA0D,CAAC;QAC9E,eAAU,GAAG;YACZ;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAiB;gBACvB,OAAO,EAAE,8BAA8B;gBACvC,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,kFAAkF;aAC/F;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAiB;gBACvB,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,kCAAkC;aAC/C;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,6BAA6B;aAC1C;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,yEAAyE;aACtF;SACD,CAAC;IACH,CAAC;CAAA;AA3CD,oDA2CC"}
@@ -0,0 +1,4 @@
1
+ import { NginxProxyManager } from './nginxProxyManager';
2
+ import { NginxProxyManagerApi } from './credentials';
3
+ export { NginxProxyManager, NginxProxyManagerApi };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NginxProxyManagerApi = exports.NginxProxyManager = void 0;
4
+ const nginxProxyManager_1 = require("./nginxProxyManager");
5
+ Object.defineProperty(exports, "NginxProxyManager", { enumerable: true, get: function () { return nginxProxyManager_1.NginxProxyManager; } });
6
+ const credentials_1 = require("./credentials");
7
+ Object.defineProperty(exports, "NginxProxyManagerApi", { enumerable: true, get: function () { return credentials_1.NginxProxyManagerApi; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AAG/C,kGAHA,qCAAiB,OAGA;AAF1B,+CAAqD;AAEzB,qGAFnB,kCAAoB,OAEmB"}
@@ -0,0 +1,14 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class NginxProxyManager implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ private handleProxyHost;
6
+ private buildProxyHostPayload;
7
+ private handleToken;
8
+ private handleUser;
9
+ private buildUserPayload;
10
+ private handleSetting;
11
+ private handleReport;
12
+ private getToken;
13
+ }
14
+ //# sourceMappingURL=nginxProxyManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nginxProxyManager.d.ts","sourceRoot":"","sources":["../nginxProxyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,iBAAkB,YAAW,SAAS;IAClD,WAAW,EAAE,oBAAoB,CA8qB/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAoCzD,eAAe;IAsC7B,OAAO,CAAC,qBAAqB;YAkCf,WAAW;YA2BX,UAAU;IA2DxB,OAAO,CAAC,gBAAgB;YAgBV,aAAa;YAgCb,YAAY;YAiBZ,QAAQ;CAkBtB"}