@@ -149,6 +149,7 @@ API_PASS="changeme"
149
149
-c CACHING_ENABLED Enable caching (true/false, default: false)
150
150
-b BLOCK_EXPLOITS Block exploits (true/false, default: true)
151
151
-w ALLOW_WEBSOCKET_UPGRADE Allow WebSocket upgrade (true/false, default: true)
152
+ -h HTTP2_SUPPORT Enable HTTP/2 support (true/false, default: true)
152
153
-l CUSTOM_LOCATIONS Custom locations (JSON array of location objects)
153
154
-a ADVANCED_CONFIG Advanced configuration (block of configuration settings)
154
155
-y Automatic yes prompts, yes sir!
@@ -174,11 +175,14 @@ API_PASS="changeme"
174
175
--host-ssl-enable id Enable SSL, HTTP/2, and HSTS for a proxy host
175
176
--host-ssl-disable id Disable SSL, HTTP/2, and HSTS for a proxy host
176
177
--list-ssl-cert List All SSL certificates availables (JSON)
177
- --cert-generate domain email Generate certificate for the given domain and email
178
- --delete-cert domain Delete certificate for the given domain
178
+ --cert-generate domain [ email] [dns_provider] [dns_credentials] [-y] Generate certificate for the given domain and email
179
+ --delete-cert domain Delete certificate for the given domain
179
180
--list-access List all available access lists (ID and name)
180
181
--host-acl-enable id,access_list_id Enable ACL for a proxy host by ID with an access list ID
181
182
--host-acl-disable id Disable ACL for a proxy host by ID
183
+ --access-list-create Create a new access list with name and rules
184
+ --access-list-update id Update an existing access list by ID
185
+ --access-list-delete id Delete an access list by ID (requires confirmation unless -y is used)
182
186
--update-host id field=value Modify any field on existing entry host
183
187
--help Display this help
184
188
@@ -192,17 +196,21 @@ API_PASS="changeme"
192
196
193
197
🌐 Host Creation:
194
198
# Basic host creation
195
- ./npm-api.sh --host-create example .com -i 192.168.1.10 -p 8080
199
+ ./npm-api.sh --host-create domain .com -i IP -p PORT [-b true/false] [-c true/false] [-w true/false] [-h true/false]
196
200
197
201
# Create host with SSL certificate and enable SSL (all-in-one)
198
- ./npm-api.sh --host-create sub.domain.com -i 192.168.0.1 -p 80 --cert-generate --host-ssl-enable -y
202
+ ./npm-api.sh --host-create domain.com -i IP -p PORT [options] --cert-generate --host-ssl-enable -y
203
+
204
+ # Create host with SSL certificate and enable SSL (with specific domain)
205
+ ./npm-api.sh --host-create domain.com -i IP -p PORT [options] --cert-generate domain.com --host-ssl-enable -y
199
206
200
207
# Create host with custom options
201
208
./npm-api.sh --host-create example.com -i 192.168.1.10 -p 8080 \
202
209
-f https \ # Forward scheme
203
210
-b true \ # Block exploits
204
211
-c true \ # Enable caching
205
212
-w true \ # Enable websocket
213
+ -h true \ # Enable HTTP/2
206
214
-y # Auto confirm
207
215
208
216
🤖 Automatic operations (no prompts):
@@ -222,10 +230,8 @@ API_PASS="changeme"
222
230
🔒 SSL Management:
223
231
# List all certificates
224
232
./npm-api.sh --list-ssl-cert
225
-
226
233
# Generate standard Let's Encrypt certificate
227
- ./npm-api.sh --cert-generate example.com --cert-email admin@example.com
228
-
234
+ ./npm-api.sh --cert-generate domain.com [email] [dns_provider] [dns_credentials] [-y]
229
235
# Generate wildcard certificate with Cloudflare
230
236
./npm-api.sh --cert-generate " *.example.com" \
231
237
--cert-email admin@example.com \
@@ -234,12 +240,10 @@ API_PASS="changeme"
234
240
235
241
# Delete certificate
236
242
./npm-api.sh --delete-cert domain.com
237
-
238
243
# Enable SSL for host
239
- ./npm-api.sh --host-ssl-enable 42
240
-
241
- # Enable SSL with specific cert ID
242
- ./npm-api.sh --host-ssl-enable 42 33
244
+ ./npm-api.sh --host-ssl-enable HOST_ID
245
+ # Generate certificate and enable SSL for existing host
246
+ ./npm-api.sh --cert-generate domain.com --host-ssl-enable -y
243
247
244
248
🌟 Complete Examples with Wildcard Certificates:
245
249
# Create host with wildcard certificate using Cloudflare DNS
@@ -267,9 +271,36 @@ API_PASS="changeme"
267
271
--host-ssl-enable -y
268
272
269
273
🛡️ Access Control Lists:
270
- ./npm-api.sh --list-access # List all access lists
271
- ./npm-api.sh --host-acl-enable 42,5 # Enable ACL ID 5 for host 42
272
- ./npm-api.sh --host-acl-disable 42 # Disable ACL for host 42
274
+ # List all access lists
275
+ ./npm-api.sh --list-access
276
+ # Show detailed information for specific access list
277
+ ./npm-api.sh --access-list-show 123
278
+ # Create a basic access list
279
+ ./npm-api.sh --access-list-create " office" --satisfy any
280
+ # Create access list with authentication
281
+ ./npm-api.sh --access-list-create " secure_area" --satisfy all --pass-auth true
282
+ # Create access list with users
283
+ ./npm-api.sh --access-list-create " dev_team" --users " john,jane,bob" --pass-auth true
284
+ # Create access list with IP rules
285
+ ./npm-api.sh --access-list-create " internal" --allow " 192.168.1.0/24" --deny " 192.168.1.100"
286
+ # Create comprehensive access list
287
+ ./npm-api.sh --access-list-create " full_config" \
288
+ --satisfy all \
289
+ --pass-auth true \
290
+ --users " admin1,admin2" \
291
+ --allow " 10.0.0.0/8,172.16.0.0/12" \
292
+ --deny " 10.0.0.50,172.16.1.100"
293
+
294
+ # Update an existing access list
295
+ ./npm-api.sh --access-list-update 42
296
+ # Delete an access list (with confirmation)
297
+ ./npm-api.sh --access-list-delete 42
298
+ # Delete an access list (skip confirmation)
299
+ ./npm-api.sh --access-list-delete 42 -y
300
+ # Enable ACL for a host
301
+ ./npm-api.sh --host-acl-enable 42,5 # Enable ACL ID 5 for host 42
302
+ # Disable ACL for a host
303
+ ./npm-api.sh --host-acl-disable 42 # Disable ACL for host 42
273
304
274
305
👥 User Management:
275
306
./npm-api.sh --create-user newuser password123 user@example.com
@@ -560,8 +591,11 @@ If you have local changes that you **don't want to lose**, consider making a bac
560
591
## Credits & Thanks
561
592
562
593
Special thanks to:
594
+
563
595
- [ @ichbinder ] ( https://github.com/ichbinder ) for implementing the ` -y ` parameter for automatic confirmations
564
596
597
+ - 🙏 ** Special thanks to [ zafar-2020] ( https://github.com/zafar-2020 ) ** for his valuable help with testing and reporting issues during the development of version 3.0.0!
598
+
565
599
## License
566
600
567
601
MIT License - see the [ LICENSE.md] [ license ] file for details
0 commit comments