NX 扩展

NX Notif

作者 NX · notif
官方

向用户通知其账户——到期、流量、续期以及您自己的消息——通过 Telegram、Bale、短信、电子邮件或任意 HTTP API,经由第一个能送达的渠道。

安装

手动

在扩展所在的服务器上以 root 运行:

作为服务(无需 Docker)

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

使用 Docker

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

然后在面板中打开「扩展 → 注册已签名扩展」,填写扩展的地址和它显示的认领码。

安装选项

选项类型默认值
端口
Notif 在此端口监听。启用 HTTPS 时只在此端口提供 HTTPS,不提供明文:公开地址需包含此端口(acme 为 443)。
NX_OPT_PORT
port8097
管理后台路径
Notif 的管理后台、API 和面板请求都在此路径下;根路径不应答。留空:根路径。
NX_OPT_BASE_PATH
path—
数据库
NX_OPT_DATABASE
choice: sqlite | postgressqlite
PostgreSQL 连接
NX_OPT_DATABASE_DSN
secret—必填 · 仅当 database = postgres
管理员用户名
NX_OPT_ADMIN_USERNAME
stringadmin
管理员密码
NX_OPT_ADMIN_PASSWORD
password—必填
Notif 的公开地址
您打开 Notif 的地址,只含协议、主机和端口,例如 https://notif.example.com:8097。启用 HTTPS 时现在就需要,并包含 Notif 的端口(不写即 443)。
NX_OPT_PUBLIC_URL
url—
HTTPS 证书
panel:面板证书,任意端口。acme:免费证书,端口 443。acme-http:同上,任意端口,80 端口验证。self-signed:自有证书,面板显示以供信任。off:明文 HTTP,用于您的代理。
NX_OPT_HTTPS
choice: panel | acme | acme-http | self-signed | offpanel
允许的机器人代理
机器人代理(任意位置),host:port,逗号分隔:127.0.0.1:10808;docker 中 host.docker.internal:10808(127.0.0.1 为容器自身);局域网地址。
NX_OPT_LOCAL_PROXIES
string—

它向面板请求的权限

权限用途
users:readto read the accounts it tells about: their contact details, expiry and traffic
users:writeto keep in an account's contact card the Telegram, Bale, Soroush Plus and Rubika chats its user links and the ntfy topic the admin turns on, and take them away when the user stops a bot

订阅的事件

panel.addon_removedpanel.restore_applieduser.createduser.activateduser.first_fetchuser.reneweduser.enableduser.disableduser.expireduser.quota_reacheduser.device_limit_reacheduser.deleteduser.bulkuser.generated