fix(sub): randomize fresh panel subscription paths - #6375
Conversation
Seed distinct cryptographically random paths for base64, JSON, and Clash subscriptions when a panel database is first created. Persist them so restarts keep published URLs stable while upgrades preserve existing settings. Generated-by: OpenCode:gpt-5.6-sol
Code reviewNo blocking issues — The core change is sound. 🟡
|
Keep subscription paths unpredictable after a factory reset, close the test database on failure, and update the builder, OpenAPI, and localized docs to describe panel-specific paths instead of obsolete fixed defaults. Generated-by: OpenCode:gpt-5.6-sol
|
Addressed all three review notes in
Validation after the changes:
Generated-by: OpenCode:gpt-5.6-sol |
Summary
Why
3x-ui currently ships the well-known
/sub/and/json/subscription paths, and the Settings page itself reports both as security warnings. Although each subscription still has its own secretsubId, a fixed service path makes the public subscription endpoints immediately recognizable and leaves every new panel with a warning that requires manual remediation.Changing these paths after clients have been provisioned changes every subscription URL. Operators then have to rotate and redistribute those URLs just to remove an insecure default they did not choose. Generating panel-specific paths at database creation makes fresh installations safe by default and avoids that later operational churn.
The Clash path is randomized as well so all public subscription formats follow the same default. This is limited to fresh databases deliberately: silently changing paths during an upgrade would cause the exact URL rotation this change is intended to prevent.
The randomized prefix is defense-in-depth, not a replacement for the per-subscription
subId.Testing
make test-gomake lint-gogo build ./...