Upadte README.md & CHANGELOG.me

This commit is contained in:
Erreur32 2025-03-14 15:37:57 +01:00
parent 2c2601fd71
commit 7f1508cc66
3 changed files with 184 additions and 107 deletions

View file

@ -4,13 +4,49 @@ All notable changes to the nginx_proxy_manager_cli.sh script will be documented
## [2.8.0] - 2025-03-15
- **Host Creation Syntax Changed**
### 🔄 Breaking Changes
- **Host Creation Command Simplified**
```diff
- OLD: ./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080
+ NEW: ./nginx_proxy_manager_cli.sh --host-create example.com -i 192.168.1.10 -p 8080
- OLD: ./npm-api.sh -d example.com -i 192.168.1.10 -p 8080
+ NEW: ./npm-api.sh --host-create example.com -i 192.168.1.10 -p 8080
```
The `-d` option has been removed in favor of a more intuitive syntax where the domain is provided directly after `--host-create`
The `-d` option has been removed in favor of a more intuitive positional argument after `--host-create`
### ✨ New Features
- **Enhanced Host Creation**
- Simplified command syntax with positional domain argument
- Improved parameter validation
- Better error messages with clear examples
- Default values for optional parameters
- **Improved Error Handling**
- Clear error messages for missing parameters
- Validation of domain name format
- Parameter type checking (e.g., port numbers, boolean values)
- Helpful usage examples in error messages
### 🛠️ Code Optimizations
- Removed redundant parameter validations
- Streamlined host creation logic
- Unified error message format
- Better code organization
### 📚 Documentation
- Updated help messages with new command syntax
- Added more detailed examples
- Improved parameter descriptions
- Better organization of command options
### 🔐 Security
- Enhanced input validation
- Better parameter sanitization
- Improved error handling for invalid inputs
### 🔄 Migration Notes
To migrate to this version:
1. Update all scripts using `-d` to use `--host-create domain`
2. Review the new help menu (`--help`) for updated syntax
3. Test existing automation with new command format
### ✨ New Features
- Added comprehensive dashboard with `display_dashboard()` showing:
@ -64,13 +100,6 @@ All notable changes to the nginx_proxy_manager_cli.sh script will be documented
- Improved authentication token handling
- Protection against command injection
### 🔄 Migration Notes
To migrate to this version:
1. Backup your current configuration
2. Update the script
3. Verify configuration with `--info`
4. Test new features
## [2.7.5] - 2025-03-08
### 🔄 Breaking Changes

172
README.md
View file

@ -66,11 +66,11 @@ git fetch --all
git reset --hard origin/main # Replace 'main' with your branch name if different
```
If you have local changes that you **dont want to lose**, consider making a backup before running these commands.
If you have local changes that you **don't want to lose**, consider making a backup before running these commands.
### ❓ Why Was This Done?
This action was necessary to **remove sensitive data** from the repositorys history and ensure better security.
This action was necessary to **remove sensitive data** from the repository's history and ensure better security.
### 💀 Need Help?
@ -93,11 +93,11 @@ Required basic dependencies.
## Installation
```bash
wget https://raw.githubusercontent.com/Erreur32/nginx-proxy-manager-Bash-API/main/nginx_proxy_manager_cli.sh
chmod +x nginx_proxy_manager_cli.sh
wget https://raw.githubusercontent.com/Erreur32/nginx-proxy-manager-Bash-API/main/npm-api.sh
chmod +x npm-api.sh
# Create a config file nginx_proxy_manager_cli.conf in same directory (to keep your config safe) check below.
echo -e "## Nginx proxy IP address (your Nginx IP)\nNGINX_IP=\"127.0.0.1\"\nAPI_USER=\"existingUser@mail.com\"\nAPI_PASS=\"password\"\nBASE_DIR=\"$(pwd)\"" > nginx_proxy_manager_cli.conf
./nginx_proxy_manager_cli.sh --info
./npm-api.sh --info
```
@ -126,9 +126,9 @@ BASE_DIR="/path/nginx_proxy_script/data"
## Usage
```bash
./nginx_proxy_manager_cli.sh [OPTIONS]
./nginx_proxy_manager_cli.sh --help
./nginx_proxy_manager_cli.sh --show-default
./npm-api.sh [OPTIONS]
./npm-api.sh --help
./npm-api.sh --show-default
```
@ -222,66 +222,66 @@ BASE_DIR="/path/nginx_proxy_script/data"
```bash
📦 Backup First !
./nginx_proxy_manager_cli.sh --backup
./npm-api.sh --backup
🌐 Host Creation:
./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080 (check default values below)
./nginx_proxy_manager_cli.sh --info
./nginx_proxy_manager_cli.sh --show-default
./nginx_proxy_manager_cli.sh --create-user newuser password123 user@example.com
./nginx_proxy_manager_cli.sh --delete-user 'username'
./nginx_proxy_manager_cli.sh --host-list
./nginx_proxy_manager_cli.sh --host-ssl-enable 10
./npm-api.sh -d example.com -i 192.168.1.10 -p 8080 (check default values below)
./npm-api.sh --info
./npm-api.sh --show-default
./npm-api.sh --create-user newuser password123 user@example.com
./npm-api.sh --delete-user 'username'
./npm-api.sh --host-list
./npm-api.sh --host-ssl-enable 10
🤖 Automatic operations (no prompts):
./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080 -y
./nginx_proxy_manager_cli.sh --host-delete 42 -y
./nginx_proxy_manager_cli.sh --host-ssl-enable 10 -y
./npm-api.sh -d example.com -i 192.168.1.10 -p 8080 -y
./npm-api.sh --host-delete 42 -y
./npm-api.sh --host-ssl-enable 10 -y
🔍 Information and Status:
./nginx_proxy_manager_cli.sh --info # Show script configuration and status
./nginx_proxy_manager_cli.sh --check-token # Verify token validity
./nginx_proxy_manager_cli.sh --host-search domain.com # Search for a specific domain
./npm-api.sh --info # Show script configuration and status
./npm-api.sh --check-token # Verify token validity
./npm-api.sh --host-search domain.com # Search for a specific domain
🔄 Host Management:
# Enable/Disable hosts
./nginx_proxy_manager_cli.sh --host-enable 42
./nginx_proxy_manager_cli.sh --host-disable 42
./npm-api.sh --host-enable 42
./npm-api.sh --host-disable 42
🛡️ Access Control Lists:
./nginx_proxy_manager_cli.sh --list-access # List all access lists
./nginx_proxy_manager_cli.sh --host-acl-enable 42,5 # Enable ACL ID 5 for host 42
./nginx_proxy_manager_cli.sh --host-acl-disable 42 # Disable ACL for host 42
./npm-api.sh --list-access # List all access lists
./npm-api.sh --host-acl-enable 42,5 # Enable ACL ID 5 for host 42
./npm-api.sh --host-acl-disable 42 # Disable ACL for host 42
🔒 SSL Management:
./nginx_proxy_manager_cli.sh --list-ssl-cert # List all SSL certificates
./nginx_proxy_manager_cli.sh --delete-cert domain.com # Delete certificate for domain
./npm-api.sh --list-ssl-cert # List all SSL certificates
./npm-api.sh --delete-cert domain.com # Delete certificate for domain
🔄 Update Specific Fields:
# Update individual fields without recreating the entire host
./nginx_proxy_manager_cli.sh --update-host 42 forward_scheme=https
./nginx_proxy_manager_cli.sh --update-host 42 forward_port=8443
./nginx_proxy_manager_cli.sh --update-host 42 block_exploits=true
./nginx_proxy_manager_cli.sh --update-host 42 allow_websocket_upgrade=true
./npm-api.sh --update-host 42 forward_scheme=https
./npm-api.sh --update-host 42 forward_port=8443
./npm-api.sh --update-host 42 block_exploits=true
./npm-api.sh --update-host 42 allow_websocket_upgrade=true
🔧 Advanced Example:
./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080 -a 'proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;'
./npm-api.sh -d example.com -i 192.168.1.10 -p 8080 -a 'proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;'
🛡️ Custom Certificate:
./nginx_proxy_manager_cli.sh --generate-cert example.com user@example.com
./npm-api.sh --generate-cert example.com user@example.com
# Note: This will generate a Let's Encrypt certificate only
🛡️ Custom locations:
./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080 -l '[{"path":"/api","forward_host":"192.168.1.11","forward_port":8081}]'
./npm-api.sh -d example.com -i 192.168.1.10 -p 8080 -l '[{"path":"/api","forward_host":"192.168.1.11","forward_port":8081}]'
🔖 Full options:
./nginx_proxy_manager_cli.sh -d example.com -i 192.168.1.10 -p 8080 -f https -c true -b true -w true -a 'proxy_set_header X-Real-IP $remote_addr;' -l '[{"path":"/api","forward_host":"192.168.1.11","forward_port":8081}]'
./npm-api.sh -d example.com -i 192.168.1.10 -p 8080 -f https -c true -b true -w true -a 'proxy_set_header X-Real-IP $remote_addr;' -l '[{"path":"/api","forward_host":"192.168.1.11","forward_port":8081}]'
```
### --backup
```bash
./nginx_proxy_manager_cli.sh --backup
./npm-api.sh --backup
```
@ -289,40 +289,92 @@ BASE_DIR="/path/nginx_proxy_script/data"
```
📁 data/ # Root directory
├── 📁 backups/ # Backup directories
│ └── 📁 [IP]_[PORT]/ # NPM Instance (IP:PORT)
│ └── 📁 [IP]_[PORT]/ # NPM Instance (IP:PORT)
│ ├── 📁 .access_lists/ # Access Lists configurations
│ ├── 📁 .Proxy_Hosts/ # Host configurations
│ │ ├── 📁 [DOMAIN]/ # Directory for each domain
│ │ │ ├── 📁 logs/ # Log directory
│ │ │ ├── 📁 ssl/ # SSL directory
│ │ │ │ ├── 📄 certificate_meta.json # Certificate metadata
│ │ │ │ ├── 📄 certificate.pem # Certificate
│ │ │ │ ├── 📄 chain.pem # Chain of certificates
│ │ │ │ └── 📄 private.key # Private key
│ │ │ ├── 📄 nginx.conf # Nginx configuration
│ │ │ └── 📄 proxy_config.json # Proxy configuration
│ │ │ ├── 📄 proxy_config.json # Proxy configuration
│ │ │ └── 📄 nginx.conf # Nginx configuration
│ │ ├── 📄 all_hosts_[DATE].json # List of all hosts
│ │ └── 📄 all_hosts_latest.json # Symlink to latest backup
│ ├── 📁 .settings/ # NPM settings
│ ├── 📁 .ssl/ # SSL certificates
│ │ ├── 📄 certificate.pem # Certificate
│ │ ├── 📄 chain.pem # Chain of certificates
│ │ ├── 📄 private.key # Private key
│ │ └── 📄 certificate_meta.json # Certificate metadata
│ ├── 📁 .user/ # User configurations
│ ├── 📄 full_config_[DATE].json # Full backup
│ └── 🔗 full_config_latest.json # Symlink to latest backup
│ └── 📄 full_config_latest.json # Symlink to latest backup
└── 📁 token/ # Token directory
├── 📄 token_[IP]_[PORT].txt # Authentication token
└── 📄 expiry_[IP]_[PORT].txt # Token expiry date
├── 📄 token_[IP].txt # Authentication token
└── 📄 expiry_[IP].txt # Token expiry date
```
#### --update-host
### 💾 Backup Operations
```bash
# Full backup of all configurations
./npm-api.sh --backup
# This will create a backup in the following structure:
data/
└── backups/
└── [IP]_[PORT]/
├── .access_lists/ # Access list configurations
├── .Proxy_Hosts/ # All proxy host configurations
├── .settings/ # NPM settings
├── .ssl/ # SSL certificates
├── .user/ # User configurations
└── full_config.json # Complete backup file
└── 📁 token/
├── 📄 token.txt # Authentication token
└── 📄 expiry.txt # Token expiry date
```
#### 🔄 Backup Contents
1. **Proxy Hosts** (`/.Proxy_Hosts/`)
- Individual host configurations
- Nginx configurations
- Complete host list with timestamps
2. **SSL Certificates** (`/.ssl/`)
- Certificates and private keys
- Certificate metadata
- Chain certificates
3. **Access Lists** (`/.access_lists/`)
- Access list configurations
- Client authorizations
- Access rules
4. **Users** (`/.user/`)
- User accounts
- Permissions
- Authentication settings
5. **Settings** (`/.settings/`)
- Global NPM settings
- System configurations
- Default parameters
#### 🔐 Token Management
The `token/` directory contains:
- Authentication tokens
- Token expiry information
- One file per NPM instance
#### --host-update
##### update specific fields of an existing proxy host
The `--update-host` command allows you to **update specific fields** of an existing proxy host in Nginx Proxy Manager **without recreating it**.
The `--host-update` command allows you to **update specific fields** of an existing proxy host in Nginx Proxy Manager **without recreating it**.
Simply specify the **proxy host ID** and the **field you want to update**, like this:
```bash
./nginx_proxy_manager_cli.sh --update-host 42 forward_host=new.backend.local
./npm-api.sh --update-host 42 forward_host=new.backend.local
```
| Field Name | Type | Description |
@ -347,11 +399,11 @@ Simply specify the **proxy host ID** and the **field you want to update**, like
#### Verifying the Configuration
Some info of settings in the script with `./nginx_proxy_manager_cli_.sh --info`
Some info of settings in the script with `./npm-api.sh --info`
#### info
```bash
./nginx_proxy_manager_cli_.sh --info
./npm-api.sh --info
Script Info: 2.3.5
@ -374,7 +426,7 @@ By following these steps, you can enable SSL for your proxy host for the first t
#### --host-list
List all Host in one command and show ´id´ , ´status´ and ´SSL´ status:
./nginx_proxy_manager_cli.sh --host-list
./npm-api.sh --host-list
👉 List of proxy hosts (simple)
ID Domain Status SSL
@ -388,11 +440,11 @@ By following these steps, you can enable SSL for your proxy host for the first t
Assuming the host ID is *1*, you would enable SSL for the host as follows:
./nginx_proxy_manager_cli.sh --host-ssl-enable 1
./npm-api.sh --host-ssl-enable 1
SSl is enable successfully, check again with --host-list
./nginx_proxy_manager_cli.sh --host-list
./npm-api.sh --host-list
👉 List of proxy hosts (simple)
ID Domain Status SSL
@ -407,7 +459,7 @@ Host proxy info command `--host-show id`
```
./nginx_proxy_manager_cli_.sh --host-show 1
./npm-api.sh --host-show 1
👉 Full details for proxy host ID: 59...

View file

@ -530,33 +530,35 @@ show_help() {
#echo -e " --restore-host id 📦 ${COLOR_GREEN}Restore${CoR} Restore single host with list with empty arguments or a Domain name"
echo ""
echo -e " Proxy Host Management:"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo -e " --host-search ${COLOR_CYAN}domain${CoR} Search ${COLOR_GREY}Proxy host by ${COLOR_YELLOW}domain name${CoR}"
echo -e " --host-list List ${COLOR_GREY}All Proxy hosts (to find ID)${CoR}"
#echo -e " --host-list-full 📜 List ${COLOR_GREY}All Proxy hosts full details (JSON)${CoR}"
echo -e " --host-show ${COLOR_CYAN}🆔${CoR} Show ${COLOR_GREY}Full details for a specific host by ${COLOR_YELLOW}ID${CoR}"
echo ""
echo -e " --host-create ${COLOR_ORANGE}domain${CoR} -i ${COLOR_ORANGE}forward_host${CoR} -p ${COLOR_ORANGE}forward_port${CoR}\n"
echo -e " Domain name (${COLOR_RED}required${CoR})"
echo -e " IP address or domain name of the target server (${COLOR_RED}required${CoR})"
echo -e " Port of the target server (${COLOR_RED}required${CoR})\n"
echo -e " --host-create ${COLOR_ORANGE}domain${CoR} -i ${COLOR_ORANGE}forward_host${CoR} -p ${COLOR_ORANGE}forward_port${CoR} [options]\n"
echo -e " ${COLOR_RED}Required:${CoR}"
echo -e " domain Domain name (${COLOR_RED}required${CoR})"
echo -e " -i, --forward-host IP address or domain name of the target server (${COLOR_RED}required${CoR})"
echo -e " -p, --forward-port Port of the target server (${COLOR_RED}required${CoR})\n"
echo -e " optional: ${COLOR_GREY}(Check default settings,no argument needed if already set!)${CoR}"
echo -e " -f ${COLOR_GREY}FORWARD_SCHEME${CoR} Scheme for forwarding (http/https, default: $(colorize_booleanh "$FORWARD_SCHEME"))"
echo -e " -c ${COLOR_GREY}CACHING_ENABLED${CoR} Enable caching (true/false, default: $(colorize_boolean "$CACHING_ENABLED"))"
echo -e " -b ${COLOR_GREY}BLOCK_EXPLOITS${CoR} Block exploits (true/false, default: $(colorize_boolean "$BLOCK_EXPLOITS"))"
echo -e " -w ${COLOR_GREY}ALLOW_WEBSOCKET_UPGRADE${CoR} Allow WebSocket upgrade (true/false, default: $(colorize_boolean "$ALLOW_WEBSOCKET_UPGRADE"))"
echo -e " -l ${COLOR_GREY}CUSTOM_LOCATIONS${CoR} Custom locations (${COLOR_YELLOW}JSON array${CoR} of location objects)"
echo -e " -a ${COLOR_GREY}ADVANCED_CONFIG${CoR} Advanced configuration (${COLOR_YELLOW}string${CoR})"
echo ""
echo -e " -f ${COLOR_GREY}FORWARD_SCHEME${CoR} Scheme for forwarding (http/https, default: $(colorize_booleanh "$FORWARD_SCHEME"))"
echo -e " -c ${COLOR_GREY}CACHING_ENABLED${CoR} Enable caching (true/false, default: $(colorize_boolean "$CACHING_ENABLED"))"
echo -e " -b ${COLOR_GREY}BLOCK_EXPLOITS${CoR} Block exploits (true/false, default: $(colorize_boolean "$BLOCK_EXPLOITS"))"
echo -e " -w ${COLOR_GREY}ALLOW_WEBSOCKET_UPGRADE${CoR} Allow WebSocket upgrade (true/false, default: $(colorize_boolean "$ALLOW_WEBSOCKET_UPGRADE"))"
echo -e " -l ${COLOR_GREY}CUSTOM_LOCATIONS${CoR} Custom locations (${COLOR_YELLOW}JSON array${CoR} of location objects)"
echo -e " -a ${COLOR_GREY}ADVANCED_CONFIG${CoR} Advanced configuration (${COLOR_YELLOW}string${CoR})"
echo ""
echo -e " --host-enable ${COLOR_CYAN}🆔${CoR} Enable Proxy ${COLOR_GREY}host by ${COLOR_YELLOW}ID${CoR}"
echo -e " --host-disable ${COLOR_CYAN}🆔${CoR} Disable Proxy ${COLOR_GREY}host by ${COLOR_YELLOW}ID${CoR}"
echo -e " --host-delete ${COLOR_CYAN}🆔${CoR} Delete ${COLOR_GREY}Proxy host by ${COLOR_YELLOW}ID${CoR}"
echo -e " --host-update ${COLOR_CYAN}🆔${CoR} ${COLOR_CYAN}[field]=value${CoR} Update ${COLOR_GREY}One specific field of an existing proxy host by ${COLOR_YELLOW}ID${CoR}"
echo -e " (eg., --host-update 42 forward_host=foobar.local)${CoR}"
echo ""
echo -e " --host-acl-enable ${COLOR_CYAN}🆔${CoR},${COLOR_CYAN}access_list_id${CoR} Enable ACL ${COLOR_GREY}for Proxy host by ${COLOR_YELLOW}ID${CoR} with ${COLOR_GREY}Access List ID ${CoR} (eg., --host-acl-enable 16,2)"
echo -e " --host-acl-enable ${COLOR_CYAN}🆔${CoR},${COLOR_CYAN}access_list_id${CoR} Enable ACL ${COLOR_GREY}for Proxy host by ${COLOR_YELLOW}ID${CoR} with ${COLOR_GREY}Access List ID ${CoR}"
echo -e " --host-acl-disable ${COLOR_CYAN}🆔${CoR} Disable ACL ${COLOR_GREY}for Proxy host by ${COLOR_YELLOW}ID${CoR}"
echo -e " --host-ssl-enable ${COLOR_CYAN}🆔${CoR} ${COLOR_CYAN}[cert_id]${CoR} Enable SSL for host ID ${COLOR_GREY}optionally using ${CoR}specific certificate ID"
echo -e " --host-ssl-disable ${COLOR_CYAN}🆔${CoR} Disable SSL${COLOR_GREY}, HTTP/2, and HSTS for a proxy host${CoR}"
@ -593,8 +595,9 @@ examples_cli() {
echo -e " • Check --help for complete command list"
echo -e " • Always backup before making major changes"
echo -e " • Use --host-list OR --host-search to find host IDs\n"
echo -e "\n${COLOR_YELLOW}🔰 Common Usage Examples:${CoR}"
# Commandes de base
# Basic commands
echo -e "\n${COLOR_GREEN}📋 Basic Commands:${CoR}"
echo -e "${COLOR_GREY} # List all hosts in table format${CoR}"
echo -e " $0 --host-list"
@ -602,21 +605,16 @@ examples_cli() {
echo -e " $0 --host-show 42"
echo -e "${COLOR_GREY} # Display default settings${CoR}"
echo -e " $0 --show-default"
# Backup & Restore
echo -e "\n${COLOR_GREEN}📦 Backup Operations:${CoR}"
echo -e "${COLOR_GREY} # Backup all configurations${CoR}"
echo -e " $0 --backup"
#echo -e "${COLOR_GREY} # Backup specific host only or all hosts and ssl certificates in single file ${CoR}"
#echo -e " $0 --backup-host 32"
#echo -e " $0 --backup-host"
# Host Management
echo -e "\n${COLOR_GREEN}🌐 Host Management:${CoR}"
echo -e "${COLOR_GREY} # Create new proxy host (basic)${CoR}"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080"
echo -e "${COLOR_GREY} # Create host with SSL and advanced config${CoR}"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080 --generate-cert example.com admin@example.com"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080 -f https -b true -c true"
echo -e "${COLOR_GREY} # Create host with custom locations${CoR}"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080 -l '[{\"path\":\"/api\",\"forward_host\":\"192.168.1.11\",\"forward_port\":8081}]'"
# SSL Management
echo -e "\n${COLOR_GREEN}🔒 SSL Certificate Management:${CoR}"
echo -e "${COLOR_GREY} # Generate new SSL certificate${CoR}"
@ -625,51 +623,49 @@ examples_cli() {
echo -e " $0 --host-ssl-enable 42"
echo -e "${COLOR_GREY} # List all SSL certificates${CoR}"
echo -e " $0 --list-cert"
# User Management
echo -e "\n${COLOR_GREEN}👤 User Management:${CoR}"
echo -e "${COLOR_GREY} # Create new user${CoR}"
echo -e " $0 --user-create john.doe secretpass john.doe@example.com"
echo -e "${COLOR_GREY} # List all users${CoR}"
echo -e " $0 --user-list"
echo -e "${COLOR_GREY} # Delete user${CoR}"
echo -e " $0 --delete-user 42"
# Access Control
echo -e "\n${COLOR_GREEN}🔑 Access Control Management:${CoR}"
echo -e "${COLOR_GREY} # List all access lists${CoR}"
echo -e " $0 --access-list"
echo -e "${COLOR_GREY} # Enable ACL for a host${CoR}"
echo -e " $0 --host-acl-enable 42,2"
# Advanced Configuration
echo -e "\n${COLOR_GREEN}⚙️ Advanced Configuration:${CoR}"
echo -e "${COLOR_GREY} # Create host with custom headers${CoR}"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080 -a 'proxy_set_header X-Real-IP \$remote_addr;'"
echo -e "${COLOR_GREY} # Update specific field of existing host${CoR}"
echo -e " $0 --host-update 42 forward_host=new.example.com"
# Maintenance
echo -e "\n${COLOR_GREEN}🔧 Maintenance Operations:${CoR}"
echo -e "${COLOR_GREY} # Check token validity${CoR}"
echo -e " $0 --check-token"
echo -e "${COLOR_GREY} # Display script information${CoR}"
echo -e " $0 --info"
# Full Option Example
echo -e "\n${COLOR_GREEN}🔰 Full Option Example:${CoR}"
echo -e "${COLOR_GREY} # Create host with all available options${CoR}"
echo -e "\n${COLOR_GREEN}⚙️ Advanced Configuration:${CoR}"
echo -e "${COLOR_GREY} # Create host with all options${CoR}"
echo -e " $0 --host-create example.com -i 192.168.1.10 -p 8080 \\"
echo -e " -f https \\"
echo -e " -c true \\"
echo -e " -b true \\"
echo -e " -w true \\"
echo -e " -h true \\"
echo -e " -s true \\"
echo -e " -a 'proxy_set_header X-Real-IP \$remote_addr;' \\"
echo -e " -l '[{\"path\":\"/api\",\"forward_host\":\"api.local\",\"forward_port\":3000}]'"
echo -e "\n${COLOR_YELLOW}📝 Command Parameters:${CoR}"
echo -e " domain : New domaine "
echo -e " domain : Domain name for the proxy host"
echo -e " -i, --forward-host : Target server (IP/hostname)"
echo -e " -p, --forward-port : Target port"
echo -e " -f, --forward-scheme : http/https"
echo -e " -c, --cache-enabled : Enable cache"
echo -e " -c, --cache : Enable cache"
echo -e " -b, --block-exploits : Protection against exploits"
echo -e " -w, --websocket : WebSocket support"
echo -e " -h, --http2 : HTTP/2 support"
echo -e " -s, --ssl-force : Force SSL"
echo -e " -a, --advanced-config : Custom Nginx configuration"
echo -e " -l, --locations : Custom location rules (JSON)\n"
exit 0