733 Commits
Author SHA1 Message Date
admin c1f5344454 merge feat/ca-root-ye:镜像补装 ISRG Root YE
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-25 09:39:16 +08:00
admin 6658614db0 fix(tls): 镜像内补装 Let's Encrypt 新根证书 ISRG Root YE
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
背景:sale(waiguoyan.com)的证书由 LE 新版中间证书 YE2 签发,链的根是 2025 年新增的
ISRG Root YE。alpine 3.20 / debian 12 的 ca-certificates 里都没有这个根,实测:
  docker exec vupay wget https://waiguoyan.com/ → SSL_connect 失败
后果:客户付款后 VUPAY 的异步回调发不出去,sale 订单不会自动变已支付。

做法:把 ISRG Root YE(自签根 + by-X2 交叉签名版)放进镜像并 update-ca-certificates。
证书来自 https://letsencrypt.org/certs/gen-y/,是公开根,随仓库分发无风险。
2026-11-25 09:37:36 +08:00
admin 051e475b44 merge feat/full-rename:协议标识与表前缀改为 vupay
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-25 09:24:08 +08:00
admin 2ece12d44b rebrand: 收尾 —— 协议标识与表前缀一并换成 vupay
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 13s
之前刻意保留的三处,在没有订单数据的前提下一起改掉:
- 表前缀 bep_ → vupay_(6 张表 + gormigrate 的 vupay_migration)
- api_type 取值 "epusdt"/"epusdt_order" → "vupay"/"vupay_order"
- handler 包 app/handler/epusdt → app/handler/vupay、类型 Epusdt → Vupay、EpusdtSign → VupaySign

顺带清理:
- 删 docs/faq/vupay.md(整篇是「本项目和 EPusdt 的关系」的上游叙事)
- README 去掉「缘起于/原项目已转手」说明与上游致谢条目,联系邮箱不再指向 vupay.online
- 修 app/task/testenv_test.go 的 model.Init 调用(上一版加 MySQL 支持时漏了第三个参数,go build 不编译测试所以没暴露)

验证:go build ./... / go vet ./... / go test ./app/... 全通过;全仓 grep -i epusdt 归零
2026-11-25 09:22:48 +08:00
admin 79b6b914aa rebrand: 收银台 logo 图形换成 V 字标(原文件名 bepusdt.svg + 内容为 B 字标)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-25 09:13:42 +08:00
admin 38231b15cb merge feat/rebrand-vupay:品牌改为 VUPAY
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 11s
2026-11-25 09:08:26 +08:00
admin a950fd2ead rebrand: BEpusdt → VUPAY
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 47s
展示层与标识符全量改名:
- module github.com/v03413/bepusdt → git.viaeon.com/admin/vupay(含全部 import)
- 二进制/镜像/容器/DB 名 bepusdt → vupay(Dockerfile、workflow IMAGE、compose、docs)
- 显示名 BEpusdt → VUPAY(前端 title、后端 banner、version 命令、通知文案)
- 默认路径 /var/lib/bepusdt → /var/lib/vupay,/var/log/bepusdt → /var/log/vupay
- Telegram 通知的频道按钮原来指向上游 t.me 群,改成站点链接(否则改名后是死链)

刻意保留(运行语义,改了会坏):
- api_type 取值 "epusdt" / "epusdt_order"(库里存量数据按此匹配)
- 表前缀 bep_(bep_order / bep_conf / …,改需 RENAME TABLE 迁移)
- 签名函数 EpusdtSign 与 handler 包名 epusdt(对外协议语义,非品牌)
- 所有加密/会话派生的字面量原样不动

验证:gofmt 通过、go build ./... 通过、全仓 grep -i bepusdt 归零
2026-11-25 09:06:06 +08:00
admin 7421d8574b merge ci/mysql-perf:bep_order 复合索引
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 16s
2026-11-25 08:50:13 +08:00
admin 92cca8a420 perf(db): bep_order 加 (status,trade_type) 复合索引
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 13s
动机:转账/回调任务反复跑 WHERE status=? AND trade_type IN (...),原来只有单列索引。
10 万行实测(同机 mysql:8.0,1 核):
  IN 两个值:   21.5ms → 0.9ms
  IN 单值:     25.4ms → 16.0ms
  COUNT:       11.4ms → 1.6ms
空表/小表无感,订单积累后差距明显。AutoMigrate 会在新库上自动建同名索引。

顺带:示例 compose 的小机器参数注释更新(buffer pool 256M、慢日志 1s)
2026-11-25 08:49:06 +08:00
admin f94687788d merge ci/compose-shared:MySQL 示例改用共享服务名 mysql
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-25 08:26:50 +08:00
admin fee63db19e docs(compose): MySQL 示例改成通用服务名 mysql + 共享网络
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
- 服务名/容器名 db/bepusdt-db → mysql,DSN host 同步改成 mysql
- 挂 external 网络 shared-db(AcePanel 用 acepanel-network),同机其它容器可按 mysql:3306 复用
- 3306 只绑 127.0.0.1(宿主机/SSH 隧道用),不对外
- docs: 补「给同机其它容器共用」小节:建网络、其它项目怎么写、独立库+账号的 SQL、两个易错点
2026-11-25 08:24:45 +08:00
admin 4a866731f3 merge ci/build-cache:go build 缓存挂载 + 并行度限制 4(构建期 CPU 峰值 99%→35%,耗时 43s→9.4s)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-24 21:28:56 +08:00
admin bf686e6f08 chore: 缓存热 + 采样
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-24 21:25:54 +08:00
admin b5c330e311 chore: 缓存已热,测第二次构建
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 10s
2026-11-24 21:22:49 +08:00
admin eea05adea1 perf(docker): go build 加 cache mount 并把并行编译钉在 4
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 45s
动机:构建期 go build 按 nproc=8 开并行,7~8 个 compile 进程把 8 核打满(实测整机 96-99%),
而这台机器还跑着 verify 生产 MySQL 和 Gitea。
- --mount=type=cache 让 /go/pkg/mod 与 go-build 缓存持久化,后续提交只重编 main 包
- -p 4 限制并行编译进程数,峰值从 8 核降到 4 核
2026-11-24 21:19:41 +08:00
admin a3f4587d1e merge docs/mysql-compose:MySQL 文档与 compose 示例
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 42s
2026-11-24 20:09:35 +08:00
admin 4e01e9809e docs: MySQL 段改成「本仓库已支持」,并补三份 compose 示例
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 45s
- docs/docker/docker.md:上游不支持 MySQL 的事实写清楚;本仓库自 e7a8dd9 起
  支持(MYSQL_DSN),给建库 SQL、DSN 三个必带参数各自的后果、8.0 版本建议
- 新增 docker-compose{.postgres,.mysql}.example.yml 三份可直接用的示例
- .env.example 补 MYSQL_DSN 与优先级说明
- .gitignore 忽略 compose 运行时产生的 data/ logs/ mysqldata/ pgdata/
- README 补本仓库差异说明(CI 镜像地址 + compose 示例 + MySQL 支持)
2026-11-24 20:08:28 +08:00
admin e7a8dd9681 merge feat/mysql:支持 MySQL(MYSQL_DSN)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 42s
2026-11-24 20:02:21 +08:00
admin 0ae8a9be0f ci: latest tag 只在 main 分支打,特性分支不再顶掉 latest
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 42s
2026-11-24 20:01:22 +08:00
admin 647e1b96b1 feat(db): 支持 MySQL(MYSQL_DSN 环境变量 / --mysql 参数)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 46s
- app/cmd/flag.go: 新增 MysqlDSNFlag(env MYSQL_DSN)
- start/reset: 读取并传给 model.Init
- model.Init 改为三选一:MySQL > PostgreSQL > SQLite
- 新增 initMysql():连接池参数对齐 Postgres 那套(10/100、30m 生命周期)
- order.go: return_url / notify_url 从 TEXT 改 VARCHAR(1024)
  MySQL 8 不允许 TEXT 列带 DEFAULT(Error 1101),改 varchar 三库通用

实测(真 mysql:8.0 容器):6 张表全部建出,bep_order 列类型符合预期
2026-11-24 19:58:08 +08:00
admin ca239fbce4 ci: 合入 Gitea Actions Docker 构建流程
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 43s
2026-11-24 19:14:16 +08:00
admin 963c80aaa0 ci: 修正 docker tag(分支名 ci/xxx 里的斜杠换成短横线)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 1m40s
2026-11-24 19:10:04 +08:00
admin be344b97f7 ci: 触发重跑(已配好仓库级 TOKEN secret)
Docker Build (Gitea) / Build and Push Docker Image (push) Failing after 11s
2026-11-24 19:06:21 +08:00
admin 59d23a2dc7 ci: 加 Gitea Actions 构建并推送 Docker 镜像(git.viaeon.com/admin/bepusdt)
Docker Build (Gitea) / Build and Push Docker Image (push) Failing after 3s
2026-11-24 19:00:13 +08:00
v03413 8a91be6a15 chore: .gitignore update v1.24.4 2026-11-13 09:38:22 +08:00
v03413 8ff1bce889 docs: 更新安全问题反馈联系邮箱 2026-11-13 09:37:06 +08:00
v03413 5791328de4 refactor: 合并 TON 转账解析的入站消息处理并补充单元测试 2026-11-13 09:20:39 +08:00
v03413 566aa5a486 fix: 修正 stale issue 提示信息中的天数为 3 天 2026-11-10 14:37:55 +08:00
莫名 78db081b35 Merge pull request #248 from sylearn/feat/truncate-match-mode
fix: 前缀匹配按原子精度补齐后比较,并发订单不互相抢付款
2026-11-01 22:10:19 +08:00
sylearn c592d3fb7a fix: fold truncate matching into has_prefix
Per review, drop the separate truncate mode and use its logic for
has_prefix instead. Order amounts are stored without trailing zeros
(1.50 as "1.5"), so the plain string prefix check let the 1.5 order
claim a 1.51 payment meant for a concurrent order on the same address.
Truncate the received amount to the larger of the atom precision and
the order's own decimals, then compare exactly: overpayment below the
atom precision still matches, underpayment and overpayment of a full
atom no longer do.
2026-11-01 22:49:44 +09:00
sylearn 5cb1d6f099 feat: add truncate amount match mode
Truncate the received amount to the atom precision before an exact comparison, so overpayment below the atom precision still matches while concurrent orders on one address (1.50, 1.51, ...) never claim each other's payments.
2026-10-31 23:45:49 +09:00
莫名 ebff24a190 Merge pull request #246 from sylearn/fix/solana-forward-tolerates-slot-retries
fix(solana): keep scanning forward while a few slots retry
2026-10-29 17:33:31 +08:00
莫名 5a1f9def13 Merge pull request #244 from sylearn/fix/solana-pruned-slot-no-retry
fix(solana): give up on slots the node has cleaned up
2026-10-29 17:33:22 +08:00
莫名 448cda9022 Merge pull request #243 from sylearn/fix/solana-drop-stale-lookback
fix(solana): drop lookback ranges of finished orders
2026-10-29 17:33:12 +08:00
sylearn 6784a98c8e test(solana): cover backpressure threshold and recovery 2026-10-29 00:46:44 +08:00
sylearn d54669a8aa fix(solana): keep cleaned slots terminal under concurrency 2026-10-29 00:46:26 +08:00
sylearn 5b3a1ded6d fix(solana): keep lookback progress when the order query fails
lookbackOrdersPending ignored the query error, so a failed read counted
as "no order needs a lookback" and dropped the progress of a range that
was still needed. Return the error and keep the progress until the next
tick can check again.
2026-10-28 13:27:18 +08:00
sylearn 144cdb8c40 fix(solana): keep scanning forward while a few slots retry
syncSlotForward stops fetching the head slot as soon as any slot waits
for a retry. One slot that keeps failing with a timeout, 429 or -32004
therefore holds back every later payment until it succeeds or is given
up after about 7 minutes, although the following slots can be fetched
normally.

Pause forward scanning only when solanaForwardPauseRetries (10) slots
wait for a retry. That still stops new slots from piling into the retry
set during a node outage, while a single failing slot no longer delays
new payments.
2026-10-28 13:24:12 +08:00
sylearn 9131b9d5c4 fix(solana): give up on slots the node has cleaned up
getBlock returns -32001 (BlockCleanedUp) for a slot older than the
node's first available block. Retrying cannot succeed, yet the slot was
retried 10 times over about 7 minutes, and forward scanning stays paused
while any retry is pending.

In production a lookback range from a week earlier hit this for 627
slots at once: forward scanning stopped for about 10 minutes and the
node started to answer 429, which delayed a real payment by four
minutes.

Treat -32001 as final: log an ERROR with the slot number, clear any
retry left from an earlier failure of the same slot, and do not schedule
another one. Other errors keep the bounded retry. The existing retry
test now uses -32004 (block not available), a transient error.
2026-10-28 12:59:38 +08:00
sylearn 2fdb6e81d3 fix(solana): drop lookback ranges of finished orders
lookbackSlots keeps its progress (lookbackNext/lookbackEnd) across ticks,
but returns early through syncBreak once no order needs scanning. When an
order is paid, canceled or expires before its range is fully queued, the
remainder stays in memory. The next Solana order, possibly days later,
resumes that old range first.

In production the remainder was 627 slots from a week earlier. The RPC
node had already pruned them (-32001), every slot was retried, forward
scanning paused while retries were pending, and the node started to
answer 429. A payment made 90 seconds after the order was created was
seen four minutes late.

Before resuming, check that at least one order of the range still needs
a lookback (same condition as hasLookbackOrders); otherwise drop the
remaining range. The check runs before syncBreak so the state is also
cleared while scanning is idle.
2026-10-28 12:58:19 +08:00
莫名 07164853c3 Merge pull request #242 from sylearn/feat/solana-reconcile-expired-orders
feat(solana): reconcile expired orders against token account history
v1.24.3
2026-10-19 17:17:48 +08:00
莫名 3a1201e485 Merge branch 'main' into feat/solana-reconcile-expired-orders 2026-10-19 17:14:33 +08:00
莫名 a88d36918a Merge pull request #238 from sylearn/fix/solana-no-skip-while-lagging
fix(solana): keep catching up instead of skipping slots
2026-10-19 17:12:43 +08:00
莫名 46665ce060 Merge pull request #237 from sylearn/fix/solana-slot-retry-limit
fix(solana): stop retrying permanently failing slots
2026-10-19 17:12:28 +08:00
莫名 a4ed778a94 Merge pull request #241 from sylearn/refactor/solana-parse-transaction
refactor(solana): extract transaction parsing with mainnet fixtures
2026-10-19 17:11:38 +08:00
莫名 03980768c7 Merge pull request #239 from sylearn/fix/solana-confirm-offset-from-status
fix(solana): check confirmations from the signature status
2026-10-19 17:11:17 +08:00
莫名 79a67fa942 Merge pull request #240 from sylearn/fix/lookback-window-end
fix(task): cover every pending order window in lookback
2026-10-19 17:10:52 +08:00
莫名 6f1b1ef6f6 Merge pull request #235 from sylearn/fix/solana-lookback-range
fix(solana): validate and resume lookback ranges
2026-10-19 17:09:02 +08:00
莫名 08bb49ea78 Merge pull request #236 from sylearn/fix/solana-skip-failed-transactions
fix(solana): skip transactions that failed on chain
2026-10-19 17:08:10 +08:00
sylearnandClaude Opus 5.5 014bb8e12b feat(solana): reconcile expired orders against token account history
Block scanning gives every slot one chance. A skipped or abandoned slot,
a restart, or an incomplete lookback range loses a payment for good, and
nothing finds it again.

Once a Solana order has been expired for a minute (up to two hours), look
it up once in the receiving token accounts' own history:

- token accounts: the wallet's associated token account, derived locally,
  plus any other account from getTokenAccountsByOwner when the node
  supports it (publicnode's free tier rejects that method);
- getSignaturesForAddress back to the order's creation time, keeping
  successful signatures inside the order window that no order has used;
- getTransaction, parsed with parseTransaction and checked with the
  existing orderTransferMatch. A match is marked confirming and then
  follows the normal confirm and callback flow.

RPC errors leave the order for the next round. Cost: a few RPC calls per
expired Solana order plus one getTransaction per candidate payment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:41:36 +08:00