mmasoudih / Marzban

Unified GUI Censorship Resistant Solution Powered by Xray

Home Page:https://t.me/gozargah_marzban

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marzban

Unified GUI Censorship Resistant Solution Powered by Xray


English / فارسی

Marzban screenshots

Overview

Marzban (the Persian word for "border guard" - pronounced /mærz'ban/) is a proxy management tool that provides a simple and easy-to-use user interface for managing hundreds of proxy accounts powered by Xray-core and built using Python and Reactjs.

Why using Marzban?

Marzban is user-friendly, feature-rich and reliable. It lets you to create different proxies for your users without any complicated configuration. Using its built-in web UI, you are able to monitor, modify and limit users.

Features

  • Built-in Web UI

  • Fully REST API backend

  • Supports protocols Vmess, VLESS, Trojan and Shadowsocks

  • Multi-protocol for a single user

  • Multi-user on a single inbound

  • Multi-inbound on a single port (using fallbacks)

  • Traffic and expiry date limitations

  • Subscription link compatible with V2ray (such as V2RayNG, OneClick, Nekoray, etc.) and Clash

  • Automated Share link and QRcode generator

  • System monitoring and traffic statistics

  • Customizable xray configuration

  • TLS support

  • Multi-admin support (WIP)

Installation guide

We stronly recommend use our Docker images to run on production. It's easier to maintain and upgrade.

Install with docker

We've made some prebuilt docker configurations based on different needs. To run this app using docker, please read our instruction here.

Manual install

Install xray on your machine

You can install it using Xray-install

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

Clone the project and install the dependencies.

You need Python>=3.8

git clone https://github.com/Gozargah/Marzban.git
cd Marzban
wget -qO- https://bootstrap.pypa.io/get-pip.py | python3 -
python3 -m pip install -r requirements.txt

Alternatively, to have an isolated environment you can use Python Virtualenv

Then run the following command to run the database migration scripts

alembic upgrade head

Now it's time to configuration

Make a copy of .env.example file, take a look and edit it using a text editor like nano.

You probably like to modify the admin credentials.

cp .env.example .env
nano .env

Check configurations section for more information

Eventually, launch the application using command below

python3 main.py

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.

Configuration

You can set settings below using environment variables or placing them in .env file.

Variable Description
SUDO_USERNAME Superuser's username (default: admin)
SUDO_PASSWORD Superuser's password (default: admin)
SQLALCHEMY_DATABASE_URL Database URL (SQLAlchemy's docs)
UVICORN_HOST Bind application to this host (default: 0.0.0.0)
UVICORN_PORT Bind application to this port (default: 8000)
UVICORN_UDS Bind application to a UNIX domain socket
UVICORN_SSL_CERTFILE SSL certificate file to have application on https
UVICORN_SSL_KEYFILE SSL key file to have application on https
XRAY_HOSTS Xray hosts in different lines with remark@hostname format (default: 🚀 Marz@SERVER_IP)
XRAY_JSON Path of Xray's json config file (default: xray.json)
XRAY_EXECUTABLE_PATH Path of Xray binary (default: /usr/local/bin/xray)
XRAY_ASSETS_PATH Path of Xray assets (default: /usr/local/share/xray)
XRAY_SUBSCRIPTION_URL_PREFIX Prefix of subscription URLs
XRAY_FALLBACK_INBOUND_TAG Tag of the inbound that includes fallbacks, needed in the case you're using fallbacks
XRAY_EXCLUDE_INBOUND_TAGS Tags of the inbounds that shouldn't be managed and included in links by application
JWT_ACCESS_TOKEN_EXPIRE_MINUTES Expire time for the Access Tokens in minutes, 0 considered as infinite (default: 1440)
DOCS Whether API documents should be available on /docs and /redoc or not (default: False)
DEBUG Debug mode for development (default: False)

Marzban is young and under development

Check open issues to help the progress of this project.

Also please share your ideas!

If this project has helped you in any way, we will be happy if you help us to continue the maintenance of this project by donation.

License

Made in [Unknown!] and Published under AGPL-3.0.

About

Unified GUI Censorship Resistant Solution Powered by Xray

https://t.me/gozargah_marzban

License:GNU Affero General Public License v3.0


Languages

Language:Python 63.1%Language:TypeScript 33.6%Language:HTML 2.0%Language:Dockerfile 0.4%Language:SCSS 0.4%Language:Mako 0.3%Language:Shell 0.2%