mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6845] [CLOSED] feat(panel): add environment opt-out for sponsor banners #6477
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6477
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6845
Author: @ailinykh
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:feat/disable-sponsor📝 Commits (2)
6a08ebbfeat(panel): add environment opt-out for sponsor banners6389811test(panel): cover sponsor opt-out behavior📊 Changes
3 files changed (+63 additions, -0 deletions)
View changed files
📝
internal/config/config.go(+5 -0)📝
internal/web/service/panel/sponsor.go(+3 -0)📝
internal/web/service/panel/sponsor_test.go(+55 -0)📄 Description
Summary
Add
config.IsSponsorDisabled()backed byXUI_DISABLE_SPONSOR=true. When enabled,GetSponsorsreturns an empty sponsor array before consulting the cache or fetching remote data. Sponsor logo requests are also rejected through the existing active-sponsor check.No UI setting or documentation changes; the opt-out remains hidden as requested.
Why
Allow administrators to opt out of sponsor banners.
Closes #6844
Type of change
Areas affected
How was this tested?
go test -shuffle=on -count=1 ./internal/config ./internal/web/service/panel— passed.go test -race -shuffle=on -count=1 ./internal/config ./internal/web/service/panel— passed.{"sponsors":[]}, reject even cached logos, and make no additional outbound requests. TheTRUEcase verifies activation remains case-sensitive.0 issues), frontend lint, formatting, and TypeScript checks — passed.make test-go— passed (full Go suite).npm testinfrontend/— passed: 189 test files, 1,843 tests, including browser tests.make build— passed (frontend build andgo build ./...).make build-storybook— passed.make verifystops at the unrelatedmsw-worker-check: the tracked worker is MSW 2.15.0, while the locked dependency installs MSW 3.0.3. All subsequent test/build targets were run separately and passed; the worker mismatch is left outside this PR's scope.Breaking changes
None. Sponsors remain enabled unless
XUI_DISABLE_SPONSORis exactlytrue.Checklist
go build ./...and the test suite pass locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.