gitscope
https://dev.kronoz.win/r/marzneshin.git
README.md · v0.1.3
Source
1 df3ebf4 Mrdn 2y ago <h1 align="center"/>Marzneshin</h1>
2 a47eb4c Dawsh 2y ago
3 a47eb4c Dawsh 2y ago <p align="center">
4 bf00248 Dawsh 2y ago A Fork of Marzban aiming for scalability
5 a47eb4c Dawsh 2y ago </p>
6 a47eb4c Dawsh 2y ago
7 a47eb4c Dawsh 2y ago <br/>
8 a47eb4c Dawsh 2y ago <p align="center">
9 a47eb4c Dawsh 2y ago <a href="#">
10 b2cc54e Dawsh 2y ago <img src="https://img.shields.io/github/actions/workflow/status/khodedawsh/marzneshin/package.yml?style=flat-square" />
11 a47eb4c Dawsh 2y ago </a>
12 953c697 Dawsh 2y ago <a href="https://hub.docker.com/r/dawsh/marzneshin" target="_blank">
13 bf00248 Dawsh 2y ago <img src="https://img.shields.io/docker/pulls/dawsh/marzneshin?style=flat-square&logo=docker" />
14 a47eb4c Dawsh 2y ago </a>
15 a47eb4c Dawsh 2y ago <a href="#">
16 bf00248 Dawsh 2y ago <img src="https://img.shields.io/github/license/khodedawsh/marzneshin?style=flat-square" />
17 a47eb4c Dawsh 2y ago </a>
18 bf00248 Dawsh 2y ago <a href="https://t.me/marzneshins" target="_blank">
19 a47eb4c Dawsh 2y ago <img src="https://img.shields.io/badge/telegram-group-blue?style=flat-square&logo=telegram" />
20 a47eb4c Dawsh 2y ago </a>
21 a47eb4c Dawsh 2y ago <a href="#">
22 a47eb4c Dawsh 2y ago <img src="https://img.shields.io/badge/twitter-commiunity-blue?style=flat-square&logo=twitter" />
23 a47eb4c Dawsh 2y ago </a>
24 a47eb4c Dawsh 2y ago <a href="#">
25 bf00248 Dawsh 2y ago <img src="https://img.shields.io/github/stars/khodedawsh/marzneshin?style=social" />
26 a47eb4c Dawsh 2y ago </a>
27 a47eb4c Dawsh 2y ago </p>
28 a47eb4c Dawsh 2y ago
29 a47eb4c Dawsh 2y ago <p align="center">
30 a47eb4c Dawsh 2y ago <a href="./README.md">
31 a47eb4c Dawsh 2y ago English
32 a47eb4c Dawsh 2y ago </a>
33 a47eb4c Dawsh 2y ago /
34 a47eb4c Dawsh 2y ago <a href="./README-fa.md">
35 a47eb4c Dawsh 2y ago فارسی
36 a47eb4c Dawsh 2y ago </a>
37 a47eb4c Dawsh 2y ago /
38 a47eb4c Dawsh 2y ago <a href="./README-zh-cn.md">
39 a47eb4c Dawsh 2y ago 简体中文
40 a47eb4c Dawsh 2y ago </a>
41 a47eb4c Dawsh 2y ago /
42 a47eb4c Dawsh 2y ago <a href="./README-ru.md">
43 a47eb4c Dawsh 2y ago Русский
44 a47eb4c Dawsh 2y ago </a>
45 a47eb4c Dawsh 2y ago </p>
46 a47eb4c Dawsh 2y ago
47 a47eb4c Dawsh 2y ago <p align="center">
48 953c697 Dawsh 2y ago <a href="https://github.com/khodedawsh/marzneshin" target="_blank" rel="noopener noreferrer" >
49 a47eb4c Dawsh 2y ago <img src="https://github.com/Gozargah/Marzban-docs/raw/master/screenshots/preview.png" alt="Marzban screenshots" width="600" height="auto">
50 a47eb4c Dawsh 2y ago </a>
51 a47eb4c Dawsh 2y ago </p>
52 a47eb4c Dawsh 2y ago
53 a47eb4c Dawsh 2y ago ## Table of Contents
54 a47eb4c Dawsh 2y ago
55 a47eb4c Dawsh 2y ago - [Overview](#overview)
56 bf00248 Dawsh 2y ago - [How it works](#how-it-works)
57 bf00248 Dawsh 2y ago - [Legacy features](#marzbans-legacy-features)
58 bf00248 Dawsh 2y ago - [New features](#new-features)
59 a47eb4c Dawsh 2y ago - [Installation guide](#installation-guide)
60 a47eb4c Dawsh 2y ago - [Configuration](#configuration)
61 a47eb4c Dawsh 2y ago - [API](#api)
62 a47eb4c Dawsh 2y ago - [Backup](#backup)
63 a47eb4c Dawsh 2y ago - [Telegram Bot](#telegram-bot)
64 bf00248 Dawsh 2y ago - [Marzneshin CLI](#marzneshin-cli)
65 bf00248 Dawsh 2y ago - [Marzneshin Node](#marzneshin-node)
66 a47eb4c Dawsh 2y ago - [Webhook notifications](#webhook-notifications)
67 a47eb4c Dawsh 2y ago - [Donation](#donation)
68 a47eb4c Dawsh 2y ago - [License](#license)
69 a47eb4c Dawsh 2y ago - [Contributors](#contributors)
70 a47eb4c Dawsh 2y ago
71 a47eb4c Dawsh 2y ago # Overview
72 a47eb4c Dawsh 2y ago
73 bf00248 Dawsh 2y ago Marzneshin is simply an interface for managing marznode users and services.
74 a47eb4c Dawsh 2y ago
75 bf00248 Dawsh 2y ago ## How it works
76 a47eb4c Dawsh 2y ago
77 bf00248 Dawsh 2y ago Marzneshin controls the nodes connected to it; monitoring/disabling/enabling users on marznode instances
78 bf00248 Dawsh 2y ago while marznode manages vpn backends (such as xray)
79 a47eb4c Dawsh 2y ago
80 bf00248 Dawsh 2y ago ### Marzban's legacy Features
81 a47eb4c Dawsh 2y ago
82 a47eb4c Dawsh 2y ago - Built-in **Web UI**
83 bf00248 Dawsh 2y ago - [**Multiple Nodes**](#marznode) support (for infrastructure distribution & scalability)
84 a47eb4c Dawsh 2y ago - Supports protocols **Vmess**, **VLESS**, **Trojan** and **Shadowsocks**
85 a47eb4c Dawsh 2y ago - **Multi-protocol** for a single user
86 a47eb4c Dawsh 2y ago - **Multi-user** on a single inbound
87 bf00248 Dawsh 2y ago - Restfull api
88 bf00248 Dawsh 2y ago - limit users' data and set exire dates
89 bf00248 Dawsh 2y ago - reset traffic periodically (daily, weekly,...)
90 a47eb4c Dawsh 2y ago - **Subscription link** compatible with **V2ray** _(such as V2RayNG, OneClick, Nekoray, etc.)_, **Clash** and **ClashMeta**
91 a47eb4c Dawsh 2y ago - Automated **Share link** and **QRcode** generator
92 a47eb4c Dawsh 2y ago - System monitoring and **traffic statistics**
93 a47eb4c Dawsh 2y ago - Integrated **Telegram Bot**
94 a47eb4c Dawsh 2y ago - Integrated **Command Line Interface (CLI)**
95 a47eb4c Dawsh 2y ago - **Multi-language**
96 a47eb4c Dawsh 2y ago - **Multi-admin** support (WIP)
97 a47eb4c Dawsh 2y ago
98 bf00248 Dawsh 2y ago ### New Features
99 bf00248 Dawsh 2y ago - Manage users' access to inbounds separately
100 bf00248 Dawsh 2y ago - Better UI with navigation bar
101 bf00248 Dawsh 2y ago - Marzneshin runs independent of any vpn backend(xray/...)
102 bf00248 Dawsh 2y ago - In case Marzneshin goes down nodes continue working normally as if nothing has happened.
103 bf00248 Dawsh 2y ago - shorter subscription links LOL
104 bf00248 Dawsh 2y ago
105 a47eb4c Dawsh 2y ago # Installation guide
106 a47eb4c Dawsh 2y ago
107 a47eb4c Dawsh 2y ago Run the following command
108 a47eb4c Dawsh 2y ago
109 a47eb4c Dawsh 2y ago ```bash
110 bf00248 Dawsh 2y ago sudo bash -c "$(curl -sL https://github.com/khodedawsh/Marzneshin/raw/master/script.sh)" @ install
111 a47eb4c Dawsh 2y ago ```
112 a47eb4c Dawsh 2y ago
113 a47eb4c Dawsh 2y ago Once the installation is complete:
114 a47eb4c Dawsh 2y ago
115 bf00248 Dawsh 2y ago - You'd notice the logs, which you could stop watching by pressing `Ctrl+C`; The process will continue running normally.
116 bf00248 Dawsh 2y ago - the configuration file can be found at `/etc/opt/marzneshin/.env` (refer to [configurations](#configuration) section to see variables)
117 bf00248 Dawsh 2y ago - Data files will be placed at `/var/lib/marzneshin`; e.g. the sqlite database.
118 bf00248 Dawsh 2y ago - You can access the Marzneshin dashboard by opening a web browser and navigating to `http://<SERVER_IP>:8000/dashboard/`
119 a47eb4c Dawsh 2y ago
120 bf00248 Dawsh 2y ago Next, you need to create a sudo admin for logging into the Marzneshin dashboard by the following command
121 a47eb4c Dawsh 2y ago
122 a47eb4c Dawsh 2y ago ```bash
123 bf00248 Dawsh 2y ago marzneshin cli admin create --sudo
124 a47eb4c Dawsh 2y ago ```
125 a47eb4c Dawsh 2y ago
126 a47eb4c Dawsh 2y ago That's it! You can login to your dashboard using these credentials
127 a47eb4c Dawsh 2y ago
128 bf00248 Dawsh 2y ago To see the help message of the Marzneshin script, run the following command
129 a47eb4c Dawsh 2y ago
130 a47eb4c Dawsh 2y ago ```bash
131 bf00248 Dawsh 2y ago marzneshin --help
132 a47eb4c Dawsh 2y ago ```
133 a47eb4c Dawsh 2y ago
134 a47eb4c Dawsh 2y ago If you are eager to run the project using the source code, check the section below
135 a47eb4c Dawsh 2y ago <details markdown="1">
136 a47eb4c Dawsh 2y ago <summary><h3>Manual install (advanced)</h3></summary>
137 a47eb4c Dawsh 2y ago
138 a47eb4c Dawsh 2y ago Install xray on your machine
139 a47eb4c Dawsh 2y ago
140 a47eb4c Dawsh 2y ago You can install it using [Xray-install](https://github.com/XTLS/Xray-install)
141 a47eb4c Dawsh 2y ago
142 a47eb4c Dawsh 2y ago ```bash
143 a47eb4c Dawsh 2y ago bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
144 a47eb4c Dawsh 2y ago ```
145 a47eb4c Dawsh 2y ago
146 bf00248 Dawsh 2y ago Clone this project and install the dependencies (you'd need Python >= 3.10)
147 a47eb4c Dawsh 2y ago
148 a47eb4c Dawsh 2y ago ```bash
149 bf00248 Dawsh 2y ago git clone https://github.com/khodedawsh/Marzneshin
150 bf00248 Dawsh 2y ago cd Marzneshin/
151 a47eb4c Dawsh 2y ago wget -qO- https://bootstrap.pypa.io/get-pip.py | python3 -
152 a47eb4c Dawsh 2y ago python3 -m pip install -r requirements.txt
153 a47eb4c Dawsh 2y ago ```
154 a47eb4c Dawsh 2y ago
155 a47eb4c Dawsh 2y ago Alternatively, to have an isolated environment you can use [Python Virtualenv](https://pypi.org/project/virtualenv/)
156 a47eb4c Dawsh 2y ago
157 a47eb4c Dawsh 2y ago Then run the following command to run the database migration scripts
158 a47eb4c Dawsh 2y ago
159 a47eb4c Dawsh 2y ago ```bash
160 a47eb4c Dawsh 2y ago alembic upgrade head
161 a47eb4c Dawsh 2y ago ```
162 a47eb4c Dawsh 2y ago
163 bf00248 Dawsh 2y ago If you want to use `marzneshin-cli`, you should link it to a file in your `$PATH`, make it executable, and install the auto-completion:
164 a47eb4c Dawsh 2y ago
165 a47eb4c Dawsh 2y ago ```bash
166 bf00248 Dawsh 2y ago sudo ln -s $(pwd)/marzneshin-cli.py /usr/bin/marzneshin-cli
167 bf00248 Dawsh 2y ago sudo chmod +x /usr/bin/marzneshin-cli
168 bf00248 Dawsh 2y ago marzneshin-cli completion install
169 a47eb4c Dawsh 2y ago ```
170 a47eb4c Dawsh 2y ago
171 a47eb4c Dawsh 2y ago Now it's time to configuration
172 a47eb4c Dawsh 2y ago
173 a47eb4c Dawsh 2y ago Make a copy of `.env.example` file, take a look and edit it using a text editor like `nano`.
174 a47eb4c Dawsh 2y ago
175 a47eb4c Dawsh 2y ago You probably like to modify the admin credentials.
176 a47eb4c Dawsh 2y ago
177 a47eb4c Dawsh 2y ago ```bash
178 a47eb4c Dawsh 2y ago cp .env.example .env
179 a47eb4c Dawsh 2y ago nano .env
180 a47eb4c Dawsh 2y ago ```
181 a47eb4c Dawsh 2y ago
182 a47eb4c Dawsh 2y ago > Check [configurations](#configuration) section for more information
183 a47eb4c Dawsh 2y ago
184 a47eb4c Dawsh 2y ago Eventually, launch the application using command below
185 a47eb4c Dawsh 2y ago
186 a47eb4c Dawsh 2y ago ```bash
187 a47eb4c Dawsh 2y ago python3 main.py
188 a47eb4c Dawsh 2y ago ```
189 a47eb4c Dawsh 2y ago
190 bf00248 Dawsh 2y ago To launch with linux systemctl (copy marzneshin.service file to `/var/lib/marzneshin/marzneshin.service`)
191 a47eb4c Dawsh 2y ago
192 a47eb4c Dawsh 2y ago ```
193 bf00248 Dawsh 2y ago systemctl enable /var/lib/marzneshin/marzneshin.service
194 bf00248 Dawsh 2y ago systemctl start marzneshin
195 a47eb4c Dawsh 2y ago ```
196 a47eb4c Dawsh 2y ago
197 a47eb4c Dawsh 2y ago To use with nginx
198 a47eb4c Dawsh 2y ago
199 a47eb4c Dawsh 2y ago ```
200 a47eb4c Dawsh 2y ago server {
201 a47eb4c Dawsh 2y ago listen 443 ssl http2;
202 a47eb4c Dawsh 2y ago listen [::]:443 ssl http2;
203 a47eb4c Dawsh 2y ago server_name example.com;
204 a47eb4c Dawsh 2y ago
205 a47eb4c Dawsh 2y ago ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
206 a47eb4c Dawsh 2y ago ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
207 a47eb4c Dawsh 2y ago
208 a47eb4c Dawsh 2y ago location ~* /(dashboard|api|docs|redoc|openapi.json) {
209 a47eb4c Dawsh 2y ago proxy_pass http://0.0.0.0:8000;
210 a47eb4c Dawsh 2y ago proxy_set_header Host $host;
211 a47eb4c Dawsh 2y ago proxy_set_header X-Real-IP $remote_addr;
212 a47eb4c Dawsh 2y ago proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
213 a47eb4c Dawsh 2y ago }
214 a47eb4c Dawsh 2y ago
215 a47eb4c Dawsh 2y ago # xray-core ws-path: /
216 bf00248 Dawsh 2y ago # client ws-path: /marzneshin/me/2087
217 a47eb4c Dawsh 2y ago #
218 a47eb4c Dawsh 2y ago # All traffic is proxed through port 443, and send to the xray port(2087, 2088 etc.).
219 bf00248 Dawsh 2y ago # The '/marzneshin' in location regex path can changed any characters by yourself.
220 a47eb4c Dawsh 2y ago #
221 a47eb4c Dawsh 2y ago # /${path}/${username}/${xray-port}
222 bf00248 Dawsh 2y ago location ~* /marzneshin/.+/(.+)$ {
223 a47eb4c Dawsh 2y ago proxy_redirect off;
224 a47eb4c Dawsh 2y ago proxy_pass http://127.0.0.1:$1/;
225 a47eb4c Dawsh 2y ago proxy_http_version 1.1;
226 a47eb4c Dawsh 2y ago proxy_set_header Upgrade $http_upgrade;
227 a47eb4c Dawsh 2y ago proxy_set_header Connection "upgrade";
228 a47eb4c Dawsh 2y ago proxy_set_header Host $http_host;
229 a47eb4c Dawsh 2y ago proxy_set_header X-Real-IP $remote_addr;
230 a47eb4c Dawsh 2y ago proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
231 a47eb4c Dawsh 2y ago }
232 a47eb4c Dawsh 2y ago }
233 a47eb4c Dawsh 2y ago ```
234 a47eb4c Dawsh 2y ago
235 a47eb4c Dawsh 2y ago or
236 a47eb4c Dawsh 2y ago
237 a47eb4c Dawsh 2y ago ```
238 a47eb4c Dawsh 2y ago server {
239 a47eb4c Dawsh 2y ago listen 443 ssl http2;
240 a47eb4c Dawsh 2y ago listen [::]:443 ssl http2;
241 bf00248 Dawsh 2y ago server_name marzneshin.example.com;
242 a47eb4c Dawsh 2y ago
243 a47eb4c Dawsh 2y ago ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
244 a47eb4c Dawsh 2y ago ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
245 a47eb4c Dawsh 2y ago
246 a47eb4c Dawsh 2y ago location / {
247 a47eb4c Dawsh 2y ago proxy_pass http://0.0.0.0:8000;
248 a47eb4c Dawsh 2y ago proxy_set_header Host $host;
249 a47eb4c Dawsh 2y ago proxy_set_header X-Real-IP $remote_addr;
250 a47eb4c Dawsh 2y ago proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
251 a47eb4c Dawsh 2y ago }
252 a47eb4c Dawsh 2y ago }
253 a47eb4c Dawsh 2y ago ```
254 a47eb4c Dawsh 2y ago
255 a47eb4c Dawsh 2y ago By default the app will be run on `http://localhost:8000/dashboard`. You can configure it using changing the `UVICORN_HOST` and `UVICORN_PORT` environment variables.
256 a47eb4c Dawsh 2y ago </details>
257 a47eb4c Dawsh 2y ago
258 a47eb4c Dawsh 2y ago # Configuration
259 a47eb4c Dawsh 2y ago
260 a47eb4c Dawsh 2y ago > You can set settings below using environment variables or placing them in `.env` file.
261 a47eb4c Dawsh 2y ago
262 a47eb4c Dawsh 2y ago | Variable | Description |
263 a47eb4c Dawsh 2y ago | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
264 a47eb4c Dawsh 2y ago | SUDO_USERNAME | Superuser's username |
265 a47eb4c Dawsh 2y ago | SUDO_PASSWORD | Superuser's password |
266 a47eb4c Dawsh 2y ago | SQLALCHEMY_DATABASE_URL | Database URL ([SQLAlchemy's docs](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls)) |
267 a47eb4c Dawsh 2y ago | UVICORN_HOST | Bind application to this host (default: `0.0.0.0`) |
268 a47eb4c Dawsh 2y ago | UVICORN_PORT | Bind application to this port (default: `8000`) |
269 a47eb4c Dawsh 2y ago | UVICORN_UDS | Bind application to a UNIX domain socket |
270 a47eb4c Dawsh 2y ago | UVICORN_SSL_CERTFILE | SSL certificate file to have application on https |
271 a47eb4c Dawsh 2y ago | UVICORN_SSL_KEYFILE | SSL key file to have application on https |
272 a47eb4c Dawsh 2y ago | XRAY_SUBSCRIPTION_URL_PREFIX | Prefix of subscription URLs |
273 a47eb4c Dawsh 2y ago | CUSTOM_TEMPLATES_DIRECTORY | Customized templates directory (default: `app/templates`) |
274 a47eb4c Dawsh 2y ago | CLASH_SUBSCRIPTION_TEMPLATE | The template that will be used for generating clash configs (default: `clash/default.yml`) |
275 a47eb4c Dawsh 2y ago | SUBSCRIPTION_PAGE_TEMPLATE | The template used for generating subscription info page (default: `subscription/index.html`) |
276 a47eb4c Dawsh 2y ago | HOME_PAGE_TEMPLATE | Decoy page template (default: `home/index.html`) |
277 a47eb4c Dawsh 2y ago | TELEGRAM_API_TOKEN | Telegram bot API token (get token from [@botfather](https://t.me/botfather)) |
278 a47eb4c Dawsh 2y ago | TELEGRAM_ADMIN_ID | Numeric Telegram ID of admin (use [@userinfobot](https://t.me/userinfobot) to found your ID) |
279 a47eb4c Dawsh 2y ago | TELEGRAM_PROXY_URL | Run Telegram Bot over proxy |
280 a47eb4c Dawsh 2y ago | JWT_ACCESS_TOKEN_EXPIRE_MINUTES | Expire time for the Access Tokens in minutes, `0` considered as infinite (default: `1440`) |
281 a47eb4c Dawsh 2y ago | DOCS | Whether API documents should be available on `/docs` and `/redoc` or not (default: `False`) |
282 a47eb4c Dawsh 2y ago | DEBUG | Debug mode for development (default: `False`) |
283 a47eb4c Dawsh 2y ago | WEBHOOK_ADDRESS | Webhook address to send notifications to. Webhook notifications will be sent if this value was set. |
284 a47eb4c Dawsh 2y ago | WEBHOOK_SECRET | Webhook secret will be sent with each request as `x-webhook-secret` in the header (default: `None`) |
285 a47eb4c Dawsh 2y ago | NUMBER_OF_RECURRENT_NOTIFICATIONS | How many times to retry if an error detected in sending a notification (default: `3`) |
286 a47eb4c Dawsh 2y ago | RECURRENT_NOTIFICATIONS_TIMEOUT | Timeout between each retry if an error detected in sending a notification in seconds (default: `180`) |
287 a47eb4c Dawsh 2y ago | NOTIFY_REACHED_USAGE_PERCENT | At which percentage of usage to send the warning notification (default: `80`) |
288 a47eb4c Dawsh 2y ago | NOTIFY_DAYS_LEFT | When to send warning notifaction about expiration (default: `3`) |
289 a47eb4c Dawsh 2y ago
290 a47eb4c Dawsh 2y ago # API
291 a47eb4c Dawsh 2y ago
292 bf00248 Dawsh 2y ago Marzneshin provides a REST API that enables developers to interact with Marzneshin services programmatically. To view the API documentation in Swagger UI or ReDoc, set the configuration variable `DOCS=True` and navigate to the `/docs` and `/redoc`.
293 a47eb4c Dawsh 2y ago
294 a47eb4c Dawsh 2y ago # Backup
295 a47eb4c Dawsh 2y ago
296 bf00248 Dawsh 2y ago It's always a good idea to backup your Marzneshin files regularly to prevent data loss in case of system failures or accidental deletion. Here are the steps to backup Marzneshin:
297 a47eb4c Dawsh 2y ago
298 bf00248 Dawsh 2y ago 1. By default, all Marzneshin important files are saved in `/var/lib/marzneshin` (Docker versions). Copy the entire `/var/lib/marzneshin` directory to a backup location of your choice, such as an external hard drive or cloud storage.
299 bf00248 Dawsh 2y ago 2. Additionally, make sure to backup your env file, which contains your configuration variables. If you installed Marzneshin using the script (recommended installation approach), the env and other configurations should be inside `/etc/opt/marzneshin/` directory.
300 a47eb4c Dawsh 2y ago
301 bf00248 Dawsh 2y ago By following these steps, you can ensure that you have a backup of all your Marzneshin files and data, as well as your configuration variables and Xray configuration, in case you need to restore them in the future. Remember to update your backups regularly to keep them up-to-date.
302 a47eb4c Dawsh 2y ago
303 a47eb4c Dawsh 2y ago # Telegram Bot
304 a47eb4c Dawsh 2y ago
305 bf00248 Dawsh 2y ago Marzneshin comes with an integrated Telegram bot that can handle server management, user creation and removal, and send notifications. This bot can be easily enabled by following a few simple steps, and it provides a convenient way to interact with Marzneshin without having to log in to the server every time.
306 a47eb4c Dawsh 2y ago
307 a47eb4c Dawsh 2y ago To enable Telegram Bot:
308 a47eb4c Dawsh 2y ago
309 a47eb4c Dawsh 2y ago 1. set `TELEGRAM_API_TOKEN` to your bot's API Token
310 a47eb4c Dawsh 2y ago 2. set `TELEGRAM_ADMIN_ID` to your Telegram account's numeric ID, you can get your ID from [@userinfobot](https://t.me/userinfobot)
311 a47eb4c Dawsh 2y ago
312 bf00248 Dawsh 2y ago # Marzneshin CLI
313 a47eb4c Dawsh 2y ago
314 bf00248 Dawsh 2y ago Marzneshin comes with an integrated CLI named `marzneshin-cli` which allows administrators to have direct interaction with it.
315 a47eb4c Dawsh 2y ago
316 bf00248 Dawsh 2y ago If you've installed Marzneshin using the installation script, you can access the cli commands by running
317 a47eb4c Dawsh 2y ago
318 a47eb4c Dawsh 2y ago ```bash
319 bf00248 Dawsh 2y ago marzneshin cli [OPTIONS] COMMAND [ARGS]...
320 a47eb4c Dawsh 2y ago ```
321 a47eb4c Dawsh 2y ago
322 bf00248 Dawsh 2y ago For more information, You can read [Marzneshin CLI's documentation](./cli/README.md).
323 a47eb4c Dawsh 2y ago
324 bf00248 Dawsh 2y ago # marznode
325 a47eb4c Dawsh 2y ago
326 bf00248 Dawsh 2y ago [marznode](https://github.com/khodedawsh/marznode) is the backend needed to run proxy servers.
327 a47eb4c Dawsh 2y ago
328 a47eb4c Dawsh 2y ago # Webhook notifications
329 a47eb4c Dawsh 2y ago
330 bf00248 Dawsh 2y ago You can set a webhook address and Marzneshin will send the notifications to that address.
331 a47eb4c Dawsh 2y ago
332 a47eb4c Dawsh 2y ago the requests will be sent as a post request to the adress provided by `WEBHOOK_ADDRESS` with `WEBHOOK_SECRET` as `x-webhook-secret` in the headers.
333 a47eb4c Dawsh 2y ago
334 bf00248 Dawsh 2y ago Example request sent from Marzneshin:
335 a47eb4c Dawsh 2y ago
336 a47eb4c Dawsh 2y ago ```
337 a47eb4c Dawsh 2y ago Headers:
338 a47eb4c Dawsh 2y ago Host: 0.0.0.0:9000
339 a47eb4c Dawsh 2y ago User-Agent: python-requests/2.28.1
340 a47eb4c Dawsh 2y ago Accept-Encoding: gzip, deflate
341 a47eb4c Dawsh 2y ago Accept: */*
342 a47eb4c Dawsh 2y ago Connection: keep-alive
343 a47eb4c Dawsh 2y ago x-webhook-secret: something-very-very-secret
344 a47eb4c Dawsh 2y ago Content-Length: 107
345 a47eb4c Dawsh 2y ago Content-Type: application/json
346 a47eb4c Dawsh 2y ago
347 a47eb4c Dawsh 2y ago
348 a47eb4c Dawsh 2y ago
349 a47eb4c Dawsh 2y ago Body:
350 bf00248 Dawsh 2y ago {"username": "marzneshin_test_user", "action": "user_updated", "enqueued_at": 1680506457.636369, "tries": 0}
351 a47eb4c Dawsh 2y ago ```
352 a47eb4c Dawsh 2y ago
353 a47eb4c Dawsh 2y ago Different action typs are: `user_created`, `user_updated`, `user_deleted`, `user_limited`, `user_expired`, `user_disabled`, `user_enabled`
354 a47eb4c Dawsh 2y ago
355 a47eb4c Dawsh 2y ago # Donation
356 a47eb4c Dawsh 2y ago
357 bf00248 Dawsh 2y ago If you found Marzneshin useful and would like to support its development, you can't make a donation in one of the following crypto networks:
358 a47eb4c Dawsh 2y ago
359 bf00248 Dawsh 2y ago - TRON network (TRC20):
360 bf00248 Dawsh 2y ago - ETH, BNB, MATIC network (ERC20, BEP20):
361 bf00248 Dawsh 2y ago - Bitcoin network:
362 bf00248 Dawsh 2y ago - Dogecoin network:
363 bf00248 Dawsh 2y ago - TON network:
364 a47eb4c Dawsh 2y ago
365 a47eb4c Dawsh 2y ago Thank you for your support!
366 a47eb4c Dawsh 2y ago
367 a47eb4c Dawsh 2y ago # License
368 a47eb4c Dawsh 2y ago
369 a47eb4c Dawsh 2y ago Made in [Unknown!] and Published under [AGPL-3.0](./LICENSE).
370 a47eb4c Dawsh 2y ago
371 a47eb4c Dawsh 2y ago # Contributors
372 a47eb4c Dawsh 2y ago
373 bf00248 Dawsh 2y ago We ❤️‍🔥 contributors! If you'd like to contribute, please check out our [Contributing Guidelines](CONTRIBUTING.md) and feel free to submit a pull request or open an issue. We also welcome you to join our [Telegram](https://t.me/marzneshins) group for either support or contributing guidance.
374 a47eb4c Dawsh 2y ago
375 bf00248 Dawsh 2y ago Check [open issues](https://github.com/khodedawsh/marzneshin/issues) to help the progress of this project.
376 a47eb4c Dawsh 2y ago
377 a47eb4c Dawsh 2y ago <p align="center">
378 bf00248 Dawsh 2y ago Thanks to the all contributors who have helped improved Marzban & Marzneshin:
379 a47eb4c Dawsh 2y ago </p>
380 a47eb4c Dawsh 2y ago <p align="center">
381 a47eb4c Dawsh 2y ago <a href="https://github.com/Gozargah/Marzban/graphs/contributors">
382 a47eb4c Dawsh 2y ago <img src="https://contrib.rocks/image?repo=Gozargah/Marzban" />
383 a47eb4c Dawsh 2y ago </a>
384 a47eb4c Dawsh 2y ago </p>
385 bf00248 Dawsh 2y ago <p align="center">
386 bf00248 Dawsh 2y ago <a href="https://github.com/khodedawsh/marzneshin/graphs/contributors">
387 bf00248 Dawsh 2y ago <img src="https://contrib.rocks/image?repo=khodedawsh/marzneshin" />
388 bf00248 Dawsh 2y ago </a>
389 bf00248 Dawsh 2y ago </p>
390 a47eb4c Dawsh 2y ago <p align="center">
391 a47eb4c Dawsh 2y ago Made with <a rel="noopener noreferrer" target="_blank" href="https://contrib.rocks">contrib.rocks</a>
392 a47eb4c Dawsh 2y ago </p>