mirror of
https://github.com/Erreur32/nginx-proxy-manager-Bash-API.git
synced 2024-12-22 13:32:11 +01:00
Update README.md
This commit is contained in:
parent
58e6346981
commit
549940f6e8
1 changed files with 59 additions and 36 deletions
89
README.md
89
README.md
|
@ -10,16 +10,16 @@
|
||||||
6. [Usage](#usage)
|
6. [Usage](#usage)
|
||||||
7. [Options](#options)
|
7. [Options](#options)
|
||||||
8. [Examples](#examples)
|
8. [Examples](#examples)
|
||||||
9. [SSL](#ssl) |
|
- [Info script](#info)
|
||||||
[List HOST](#check) |
|
- [List HOST](#list)
|
||||||
[Info](#info)
|
- [Enable SSL](#ssl)
|
||||||
12. [Screens](#screens)
|
12. [Screens](#screens)
|
||||||
13. [TODO](#todo)
|
13. [TODO](#todo)
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> The restore function of the --restore command may not work correctly (a fix is in progress)
|
> The --restore command may not work correctly (a fix is in progress)
|
||||||
>
|
> instead try:
|
||||||
> Single RESTORE --restore-id (necessary to add hosts one by one) should work fine.
|
> ./nginx_proxy_manager_cli.sh --restore-id id(necessary to add hosts one by one) should work fine.
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
⚙️ Provides functionalities such as creating and deleting proxy hosts, managing users, displaying configurations, creating **BACKUPS**, and more.
|
⚙️ Provides functionalities such as creating and deleting proxy hosts, managing users, displaying configurations, creating **BACKUPS**, and more.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### French description:
|
### French description:
|
||||||
Ce script permet de gérer Nginx Proxy Manager via l'API. Il fournit des fonctionnalités telles que la création de hosts proxy, la gestion des utilisateurs, et l'affichage des configurations avec creation de BACKUP !
|
Ce script permet de gérer Nginx Proxy Manager via l'API. Il fournit des fonctionnalités telles que la création de hosts proxy, la gestion des utilisateurs, et l'affichage des configurations avec creation de BACKUP !
|
||||||
La fonction RESTORE n'est pas encore terminée.
|
La fonction RESTORE n'est pas encore terminée.
|
||||||
|
@ -40,27 +42,27 @@ La fonction RESTORE n'est pas encore terminée.
|
||||||
|
|
||||||
And of course the excellent NPM (![Nginx Proxy Manager](https://github.com/NginxProxyManager/nginx-proxy-manager?utm_source=nginx-proxy-manager))
|
And of course the excellent NPM (![Nginx Proxy Manager](https://github.com/NginxProxyManager/nginx-proxy-manager?utm_source=nginx-proxy-manager))
|
||||||
|
|
||||||
required basic dependencies:
|
Required basic dependencies.
|
||||||
|
> The script will automatically check if they are installed and will download them if necessary:
|
||||||
|
|
||||||
- `curl`
|
- `curl`
|
||||||
- `jq`
|
- `jq`
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt-get install jq curl
|
|
||||||
```
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
```
|
```
|
||||||
wget https://raw.githubusercontent.com/Erreur32/nginx-proxy-manager-API/main/nginx_proxy_manager_cli.sh
|
wget https://raw.githubusercontent.com/Erreur32/nginx-proxy-manager-API/main/nginx_proxy_manager_cli.sh
|
||||||
chmod +x nginx_proxy_manager_cli.sh
|
chmod +x nginx_proxy_manager_cli.sh
|
||||||
|
# Check script
|
||||||
|
./nginx_proxy_manager_cli.sh --info
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!NOTE]
|
||||||
> With the new version 2.0.0, some command arguments have been changed to be simpler.
|
> With the new `V2.0.0`, some command arguments have been changed to be simpler, and need to set `BASE_DIR` variable to store `Tokens` and `Backups`.
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
Only edit these 4 variables:
|
Required to edit these 4 variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
## Nginx proxy IP address (your Nginx IP)
|
## Nginx proxy IP address (your Nginx IP)
|
||||||
|
@ -76,6 +78,8 @@ BASE_DIR="/path/nginx_proxy_script/data"
|
||||||
## Usage
|
## Usage
|
||||||
```bash
|
```bash
|
||||||
./nginx_proxy_manager_cli.sh [OPTIONS]
|
./nginx_proxy_manager_cli.sh [OPTIONS]
|
||||||
|
./nginx_proxy_manager_cli.sh --info
|
||||||
|
./nginx_proxy_manager_cli.sh --show-default
|
||||||
```
|
```
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
@ -100,12 +104,12 @@ BASE_DIR="/path/nginx_proxy_script/data"
|
||||||
|
|
||||||
🔧 Miscellaneous:
|
🔧 Miscellaneous:
|
||||||
--info Script and configuration information
|
--info Script and configuration information
|
||||||
|
--show-default Show default settings for creating hosts
|
||||||
--check-token Check if the current token is valid
|
--check-token Check if the current token is valid
|
||||||
--create-user user pass email Create a user with a username, password and email
|
--create-user user pass email Create a user with a username, password and email
|
||||||
--delete-user username Delete a user by username
|
--delete-user username Delete a user by username
|
||||||
--host-delete id Delete a proxy host by ID
|
--host-delete id Delete a proxy host by ID
|
||||||
--host-show id Show full details for a specific host by ID
|
--host-show id Show full details for a specific host by ID
|
||||||
--show-default Show default settings for creating hosts
|
|
||||||
--host-list List the names of all proxy hosts
|
--host-list List the names of all proxy hosts
|
||||||
--host-list-full List all proxy hosts with full details
|
--host-list-full List all proxy hosts with full details
|
||||||
--host-list-ssl-certificates List all SSL certificates
|
--host-list-ssl-certificates List all SSL certificates
|
||||||
|
@ -149,25 +153,16 @@ BASE_DIR="/path/nginx_proxy_script/data"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### SSL
|
|
||||||
Enable SSL for the Host:
|
|
||||||
|
|
||||||
Assuming the host ID is *10*, you would enable SSL for the host as follows:
|
|
||||||
|
|
||||||
./nginx_proxy_manager_cli.sh --host-ssl-enable 10
|
|
||||||
|
|
||||||
##### Verifying the Configuration
|
##### Verifying the Configuration
|
||||||
|
###### Info
|
||||||
|
|
||||||
After running the above commands, you can verify the SSL configuration by checking the details of the proxy host.
|
Some info settings from scriptwith `./nginx_proxy_manager_cli_.sh --info`
|
||||||
|
|
||||||
./nginx_proxy_manager_cli.sh --host-show 10
|
|
||||||
|
|
||||||
This command will show the full details of the proxy host with ID *10*, including whether SSL is enabled.
|
|
||||||
|
|
||||||
By following these steps, you can enable SSL for your proxy host for the first time using Let's Encrypt.
|
By following these steps, you can enable SSL for your proxy host for the first time using Let's Encrypt.
|
||||||
|
|
||||||
##### Check
|
##### List
|
||||||
Better way to check if SSL is active with command --host-list :
|
List all Host in one command and show ´id´ , ´status´ and ´SSL´ status:
|
||||||
|
|
||||||
./nginx_proxy_manager_cli.sh --host-list
|
./nginx_proxy_manager_cli.sh --host-list
|
||||||
|
|
||||||
|
@ -178,11 +173,32 @@ By following these steps, you can enable SSL for your proxy host for the first t
|
||||||
3 tutu.fun enabled ✅
|
3 tutu.fun enabled ✅
|
||||||
|
|
||||||
|
|
||||||
You should now see the parameters activated ✅
|
##### SSL
|
||||||
|
Enable SSL for the Host:
|
||||||
|
|
||||||
##### Info
|
Assuming the host ID is *10*, you would enable SSL for the host as follows:
|
||||||
|
|
||||||
Host proxy info command --host-show id:
|
./nginx_proxy_manager_cli.sh --host-ssl-enable 10
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
./nginx_proxy_manager_cli_new.sh --info
|
||||||
|
|
||||||
|
Script Info: 2.3.5
|
||||||
|
|
||||||
|
Script Variables Information:
|
||||||
|
BASE_URL http://127.0.0.1:81/api
|
||||||
|
NGINX_IP 127.0.0.1
|
||||||
|
API_USER user@monmail.com
|
||||||
|
BASE_DIR /path/to/nginx_proxy
|
||||||
|
BACKUP_DIR /path/to/nginx_proxy/backups
|
||||||
|
BACKUP HOST 40
|
||||||
|
Token NPM /path/to/nginx_proxy/token/token_127.0.0.1.txt
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Other Exemple:
|
||||||
|
Host proxy info command `--host-show id`
|
||||||
|
|
||||||
```
|
```
|
||||||
./nginx_proxy_manager_cli_.sh --host-show 10
|
./nginx_proxy_manager_cli_.sh --host-show 10
|
||||||
|
@ -230,9 +246,16 @@ Host proxy info command --host-show id:
|
||||||
```
|
```
|
||||||
# ./nginx_proxy_manager_cli.sh --backup
|
# ./nginx_proxy_manager_cli.sh --backup
|
||||||
|
|
||||||
✅ Nginx url: http://192.168.1.200:81/api
|
✅ Users backup completed 🆗: /path/to/nginx_proxy/backups/users_127_0_0_1_2024_07_29__14_01_23.json
|
||||||
✅ The token is valid. Expiry: 2025-07-12T08:14:58.521Z
|
✅ Settings backup completed 🆗: /path/to/nginx_proxy/backups/settings_127_0_0_1_2024_07_29__14_01_23.json
|
||||||
✅ Full backup completed successfully in 📂 './backups'
|
✅ Proxy host backup completed 🆗: /path/to/nginx_proxy/backups
|
||||||
|
✅ Access lists backup completed 🆗: /path/to/nginx_proxy/backups/access_lists_127_0_0_1_2024_07_29__14_01_23.json
|
||||||
|
✅ Backup 🆗
|
||||||
|
📦 Backup Summary:
|
||||||
|
- Number of users backed up: 1
|
||||||
|
- Number of proxy hosts backed up: 31
|
||||||
|
- Total number of backup files: 42
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue