NX Addons

NX Shop

by NX · shop
Official

Sell your panel's plans: a Telegram bot, a web app and a mini-app; card-to-card receipts, a bank-SMS forwarder and your own gateways; wallets, renewals, discount and gift codes, referrals and agents; reports and an encrypted backup — in Persian, English, Russian and Chinese.

Install

By hand

On the server the addon will live on, as root:

As a service (no Docker)

curl -fsSL https://raw.githubusercontent.com/nx-panel/shop/v0.1.1/install.sh -o install.sh
sh install.sh --method script --version v0.1.1 \
  --opt port=8095 \
  --opt database=sqlite \
  --opt admin_username=admin \
  --opt admin_password=<admin_password> \
  --opt https=panel \
  --panel-url https://<your-panel>

With Docker

curl -fsSL https://raw.githubusercontent.com/nx-panel/shop/v0.1.1/install.sh -o install.sh
sh install.sh --method docker --version v0.1.1 \
  --opt port=8095 \
  --opt database=sqlite \
  --opt admin_username=admin \
  --opt admin_password=<admin_password> \
  --opt https=panel \
  --panel-url https://<your-panel>

Then open Addons → Register a signed addon in your panel and enter the addon's address and the claim code it shows.

Install options

OptionTypeDefault
Port
Shop listens here. With HTTPS on, this one port serves it and nothing plain: the public address names it (443 for acme).
NX_OPT_PORT
port8095
Admin path
Shop's admin and the panel's calls are served under this path; customers' pages stay at the root and never show it. A random one keeps scanners off the admin. Empty: the root.
NX_OPT_BASE_PATH
path—
Database
SQLite keeps everything in Shop's data directory. PostgreSQL is a server you already run.
NX_OPT_DATABASE
choice: sqlite | postgressqlite
PostgreSQL connection
host=… user=… password=… dbname=… sslmode=…
NX_OPT_DATABASE_DSN
secret—required · only when database = postgres
Shop admin username
NX_OPT_ADMIN_USERNAME
stringadmin
Shop admin password
At least 10 characters. Makes the first admin, and again on a new install over kept data; change it in Shop afterwards.
NX_OPT_ADMIN_PASSWORD
password—required
Shop's public address
Where customers reach Shop, e.g. https://shop.example.com:8095. With HTTPS on it is needed now and names Shop's port (none means 443). The mini-app in Telegram needs https.
NX_OPT_PUBLIC_URL
url—
HTTPS certificate
panel: one of the panel's certificates, renewed by the panel, on any port. acme: a free certificate; the port is 443. acme-http: the same on any port, the CA asking on port 80. self-signed: Shop's own; the panel shows it to trust. off: plain HTTP, for a proxy of yours.
NX_OPT_HTTPS
choice: panel | acme | acme-http | self-signed | offpanel
Telegram bot token
From @BotFather. Optional: the bot can be set later in Shop. Use a bot of its own, not the panel's.
NX_OPT_BOT_TOKEN
secret—

What it asks of your panel

PermissionWhy
users:readto read back the accounts it sold, and their usage
users:writeto create the accounts customers buy, and renew or top them up
backup:deliverto send Shop's own encrypted backup to the backup chat you chose on the panel

Events it hears

panel.addon_removeduser.deleteduser.bulkuser.expiringuser.expireduser.quota_warninguser.quota_reacheduser.renewedpanel.restore_applied