-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff4396c
commit bdb105f
Showing
1 changed file
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,99 @@ | ||
# marzban-backup | ||
a simple bot for get full backup of marzban pannel | ||
# Marzban-backup | ||
a simple bot for get full backup of Marzban pannel | ||
|
||
this bot use ssh to download all files from the server so it can be use on iran serveers | ||
|
||
## How to run | ||
|
||
first clone the project | ||
|
||
```bash | ||
git clone https://github.com/ImMohammad20000/marzban-backup.git && cd marzban-backup | ||
``` | ||
|
||
now create `.env` file and configure it. | ||
|
||
```bash | ||
mv .env.example .env | ||
``` | ||
|
||
```bash | ||
nano .env | ||
``` | ||
|
||
1. set `BOT_TOKEN` to your bot's API Token | ||
2. set `CHAT_ID` to your Telegram account's numeric ID, you can get your ID from [@userinfobot](https://t.me/userinfobot) | ||
3. if you want to use proxy for connect to telegram uncomment `PROXY_URL` and set a socks5 or http proxy | ||
4. set `TZ` to your time zone, by default set to `Asia/Tehran` | ||
5. `CRON_JOB` use to schedule send backups, by default send backups every hour [moore info](https://crontab.guru/examples.html) | ||
|
||
then save the changes | ||
|
||
It's time to create `server_list.json` file and configure oure ssh login info | ||
|
||
```bash | ||
mv server_list.json.example server_list.json | ||
``` | ||
|
||
```bash | ||
nano server_list.json | ||
``` | ||
|
||
```json | ||
{ | ||
"servers":[ | ||
{ | ||
"host": "host", | ||
"port": 22, | ||
"user": "user", | ||
"pass": "pass", | ||
"var_files": "/var/lib/marzban/", | ||
"opt_files": "/opt/marzban/" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
bot support multiple panel if you have another panel you can use this json | ||
|
||
```json | ||
{ | ||
"servers":[ | ||
{ | ||
"host": "host", | ||
"port": 22, | ||
"user": "user", | ||
"pass": "pass", | ||
"var_files": "/var/lib/marzban/", | ||
"opt_files": "/opt/marzban/" | ||
}, | ||
{ | ||
"host": "host2", | ||
"port": 22, | ||
"user": "user2", | ||
"pass": "pass2", | ||
"var_files": "/var/lib/marzban/", | ||
"opt_files": "/opt/marzban/" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
then save the changes | ||
|
||
now run this command for start bor | ||
|
||
|
||
```bash | ||
docker compose up -d | ||
``` | ||
|
||
to test the bot is working use `/db` command | ||
|
||
## Modify .env or json files | ||
|
||
if you want to edit `.env` or `server_list.json` after you save changes **you havw to** use `docker compose down` and `docker compose up --build -d` for re-build docker contaner | ||
|
||
## Update | ||
|
||
to update the project just clone the repositories again. |