@@ -149,6 +149,7 @@ API_PASS="changeme"
149149 -c CACHING_ENABLED Enable caching (true/false, default: false)
150150 -b BLOCK_EXPLOITS Block exploits (true/false, default: true)
151151 -w ALLOW_WEBSOCKET_UPGRADE Allow WebSocket upgrade (true/false, default: true)
152+ -h HTTP2_SUPPORT Enable HTTP/2 support (true/false, default: true)
152153 -l CUSTOM_LOCATIONS Custom locations (JSON array of location objects)
153154 -a ADVANCED_CONFIG Advanced configuration (block of configuration settings)
154155 -y Automatic yes prompts, yes sir!
@@ -174,11 +175,14 @@ API_PASS="changeme"
174175 --host-ssl-enable id Enable SSL, HTTP/2, and HSTS for a proxy host
175176 --host-ssl-disable id Disable SSL, HTTP/2, and HSTS for a proxy host
176177 --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
179180 --list-access List all available access lists (ID and name)
180181 --host-acl-enable id,access_list_id Enable ACL for a proxy host by ID with an access list ID
181182 --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)
182186 --update-host id field=value Modify any field on existing entry host
183187 --help Display this help
184188
@@ -192,17 +196,21 @@ API_PASS="changeme"
192196
193197 🌐 Host Creation:
194198 # 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]
196200
197201 # 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
199206
200207 # Create host with custom options
201208 ./npm-api.sh --host-create example.com -i 192.168.1.10 -p 8080 \
202209 -f https \ # Forward scheme
203210 -b true \ # Block exploits
204211 -c true \ # Enable caching
205212 -w true \ # Enable websocket
213+ -h true \ # Enable HTTP/2
206214 -y # Auto confirm
207215
208216 🤖 Automatic operations (no prompts):
@@ -222,10 +230,8 @@ API_PASS="changeme"
222230 🔒 SSL Management:
223231 # List all certificates
224232 ./npm-api.sh --list-ssl-cert
225-
226233 # 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]
229235 # Generate wildcard certificate with Cloudflare
230236 ./npm-api.sh --cert-generate " *.example.com" \
231237 --cert-email admin@example.com \
@@ -234,12 +240,10 @@ API_PASS="changeme"
234240
235241 # Delete certificate
236242 ./npm-api.sh --delete-cert domain.com
237-
238243 # 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
243247
244248 🌟 Complete Examples with Wildcard Certificates:
245249 # Create host with wildcard certificate using Cloudflare DNS
@@ -267,9 +271,36 @@ API_PASS="changeme"
267271 --host-ssl-enable -y
268272
269273 🛡️ 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
273304
274305 👥 User Management:
275306 ./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
560591## Credits & Thanks
561592
562593Special thanks to:
594+
563595- [ @ichbinder ] ( https://github.com/ichbinder ) for implementing the ` -y ` parameter for automatic confirmations
564596
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+
565599## License
566600
567601MIT License - see the [ LICENSE.md] [ license ] file for details
0 commit comments