Marzneshin

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

Basic

VariableDescription
UVICORN_HOSTBind application to this host (default: 0.0.0.0)
UVICORN_PORTBind application to this port (default: 8000)
UVICORN_UDSBind application to a UNIX domain socket
UVICORN_SSL_CERTFILESSL certificate file to have application on https
UVICORN_SSL_KEYFILESSL key file to have application on https
SQLALCHEMY_DATABASE_URLDatabase URL (SQLAlchemy’s docs)
JWT_ACCESS_TOKEN_EXPIRE_MINUTESExpire time for the Access Tokens in minutes, 0 considered as infinite (default: 1440)
AUTH_GENERATION_ALGORITHMAuthentication password encryption algorithm (default: “xxh128”, options: “xxh128”, “plain”)
REVERSIBLE_KEYReversible key support (default: False, options: “False”, “True”)

Subscription and VPN customization

VariableDescription
CUSTOM_TEMPLATES_DIRECTORYCustomized templates directory (default: app/templates)
CLASH_SUBSCRIPTION_TEMPLATEThe template that will be used for generating clash configs (default: clash/default.yml)
SUBSCRIPTION_PAGE_TEMPLATEThe template used for generating subscription info page (default: subscription/index.html)
SUBSCRIPTION_URL_PREFIXPrefix of subscription URLs
HOME_PAGE_TEMPLATEDecoy page template (default: home/index.html)

Telegram

VariableDescription
TELEGRAM_API_TOKENTelegram bot API token (get token from @botfather)
TELEGRAM_ADMIN_IDNumeric Telegram ID of admin (use @userinfobot to found your ID)
TELEGRAM_PROXY_URLRun Telegram Bot over proxy

Notification & Webhook

VariableDescription
WEBHOOK_ADDRESSWebhook address to send notifications to. Webhook notifications will be sent if this value was set.
WEBHOOK_SECRETWebhook secret will be sent with each request as x-webhook-secret in the header (default: None)
NUMBER_OF_RECURRENT_NOTIFICATIONSHow many times to retry if an error detected in sending a notification (default: 3)
RECURRENT_NOTIFICATIONS_TIMEOUTTimeout between each retry if an error detected in sending a notification in seconds (default: 180)
NOTIFY_REACHED_USAGE_PERCENTAt which percentage of usage to send the warning notification (default: 80)
NOTIFY_DAYS_LEFTWhen to send warning notification about expiration (default: 3)

Development and Documentation

VariableDescription
DOCSWhether API documents should be available on /docs and /redoc or not (default: False)
DEBUGDebug mode for development (default: False)

.env File Example

SQLALCHEMY_DATABASE_URL=
UVICORN_HOST=
UVICORN_PORT=
UVICORN_UDS=
UVICORN_SSL_CERTFILE=
UVICORN_SSL_KEYFILE=
SUBSCRIPTION_URL_PREFIX=
CUSTOM_TEMPLATES_DIRECTORY=
CLASH_SUBSCRIPTION_TEMPLATE=
SUBSCRIPTION_PAGE_TEMPLATE=
HOME_PAGE_TEMPLATE=
TELEGRAM_API_TOKEN=
TELEGRAM_ADMIN_ID=
TELEGRAM_PROXY_URL=
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=
AUTH_GENERATION_ALGORITHM="xxh128"
REVERSIBLE_KEY="False"
DOCS=true
DEBUG=true
WEBHOOK_ADDRESS="http://localhost:9000"
WEBHOOK_SECRET="dont-tell-anybody"
NUMBER_OF_RECURRENT_NOTIFICATIONS=
RECURRENT_NOTIFICATIONS_TIMEOUT=
NOTIFY_REACHED_USAGE_PERCENT=
NOTIFY_DAYS_LEFT=