mirror of
https://github.com/Erreur32/nginx-proxy-manager-Bash-API.git
synced 2025-01-15 16:21:55 +01:00
Compare commits
No commits in common. "a022b1393c700785424c9887a6d9fcb79d9f8209" and "58e6346981cbe2289a62600afb83ea3070bdb635" have entirely different histories.
a022b1393c
...
58e6346981
1 changed files with 33 additions and 57 deletions
88
README.md
88
README.md
|
@ -10,16 +10,16 @@
|
||||||
6. [Usage](#usage)
|
6. [Usage](#usage)
|
||||||
7. [Options](#options)
|
7. [Options](#options)
|
||||||
8. [Examples](#examples)
|
8. [Examples](#examples)
|
||||||
- [Info script](#info)
|
9. [SSL](#ssl) |
|
||||||
- [List HOST](#list)
|
[List HOST](#check) |
|
||||||
- [Enable SSL](#ssl)
|
[Info](#info)
|
||||||
12. [Screens](#screens)
|
12. [Screens](#screens)
|
||||||
13. [TODO](#todo)
|
13. [TODO](#todo)
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> The --restore command may not work correctly (a fix is in progress)
|
> The restore function of the --restore command may not work correctly (a fix is in progress)
|
||||||
> instead try:
|
>
|
||||||
> ./nginx_proxy_manager_cli.sh --restore-id id(necessary to add hosts one by one) should work fine.
|
> Single RESTORE --restore-id (necessary to add hosts one by one) should work fine.
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@
|
||||||
|
|
||||||
⚙️ 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.
|
||||||
|
@ -42,27 +40,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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!IMPORTANT]
|
||||||
> 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`.
|
> With the new version 2.0.0, some command arguments have been changed to be simpler.
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
Required to edit these 4 variables:
|
Only edit these 4 variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
## Nginx proxy IP address (your Nginx IP)
|
## Nginx proxy IP address (your Nginx IP)
|
||||||
|
@ -78,8 +76,6 @@ 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
|
||||||
|
@ -104,12 +100,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
|
||||||
|
@ -153,31 +149,25 @@ 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.
|
||||||
```
|
|
||||||
./nginx_proxy_manager_cli_new.sh --info
|
|
||||||
|
|
||||||
Script Info: 2.3.5
|
./nginx_proxy_manager_cli.sh --host-show 10
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
```
|
|
||||||
Some info settings from scriptwith `./nginx_proxy_manager_cli_.sh --info`
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
##### List
|
##### Check
|
||||||
List all Host in one command and show ´id´ , ´status´ and ´SSL´ status:
|
Better way to check if SSL is active with command --host-list :
|
||||||
|
|
||||||
./nginx_proxy_manager_cli.sh --host-list
|
./nginx_proxy_manager_cli.sh --host-list
|
||||||
|
|
||||||
|
@ -188,18 +178,11 @@ By following these steps, you can enable SSL for your proxy host for the first t
|
||||||
3 tutu.fun enabled ✅
|
3 tutu.fun enabled ✅
|
||||||
|
|
||||||
|
|
||||||
##### SSL
|
You should now see the parameters activated ✅
|
||||||
Enable SSL for the Host:
|
|
||||||
|
|
||||||
Assuming the host ID is *10*, you would enable SSL for the host as follows:
|
##### Info
|
||||||
|
|
||||||
./nginx_proxy_manager_cli.sh --host-ssl-enable 10
|
Host proxy info command --host-show id:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -247,16 +230,9 @@ Host proxy info command `--host-show id`
|
||||||
```
|
```
|
||||||
# ./nginx_proxy_manager_cli.sh --backup
|
# ./nginx_proxy_manager_cli.sh --backup
|
||||||
|
|
||||||
✅ Users backup completed 🆗: /path/to/nginx_proxy/backups/users_127_0_0_1_2024_07_29__14_01_23.json
|
✅ Nginx url: http://192.168.1.200:81/api
|
||||||
✅ Settings backup completed 🆗: /path/to/nginx_proxy/backups/settings_127_0_0_1_2024_07_29__14_01_23.json
|
✅ The token is valid. Expiry: 2025-07-12T08:14:58.521Z
|
||||||
✅ Proxy host backup completed 🆗: /path/to/nginx_proxy/backups
|
✅ Full backup completed successfully in 📂 './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