feat: add HIDE_UPDATE_BANNER environment variable (#2051)

* feat: add HIDE_UPDATE_BANNER environment variable

Add a new HIDE_UPDATE_BANNER env var that allows platform operators
(e.g. Start9) to suppress the built-in version update banner when
they provide their own update notification mechanism.

When set to true, the "What's New" widget is hidden and the header
banner only shows for VSS migration notices. The version comparison
against the Alby API is skipped entirely.

Closes #2048

* chore: simplify

* chore: undo changes

---------

Co-authored-by: Joel Klabo <max@klabo.world>
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
This commit is contained in:
klabo 2026-02-10 09:00:08 -08:00 committed by GitHub
parent 801f517478
commit 4353aa4e57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 3 deletions

View file

@ -1217,6 +1217,7 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) {
info.OAuthRedirect = !api.cfg.GetEnv().IsDefaultClientId()
info.Version = version.Tag
info.EnableAdvancedSetup = api.cfg.GetEnv().EnableAdvancedSetup
info.HideUpdateBanner = api.cfg.GetEnv().HideUpdateBanner
info.LdkVssEnabled = ldkVssEnabled == "true"
info.VssSupported = backendType == config.LDKBackendType && api.cfg.GetEnv().LDKVssUrl != ""
info.AutoUnlockPasswordEnabled = autoUnlockPassword != ""

View file

@ -297,6 +297,7 @@ type InfoResponse struct {
Relays []InfoResponseRelay `json:"relays"`
NodeAlias string `json:"nodeAlias"`
MempoolUrl string `json:"mempoolUrl"`
HideUpdateBanner bool `json:"hideUpdateBanner"`
}
type UpdateSettingsRequest struct {

View file

@ -58,6 +58,7 @@ type AppConfig struct {
AutoUnlockPassword string `envconfig:"AUTO_UNLOCK_PASSWORD"`
LogDBQueries bool `envconfig:"LOG_DB_QUERIES" default:"false"`
BoltzApi string `envconfig:"BOLTZ_API" default:"https://api.boltz.exchange"`
HideUpdateBanner bool `envconfig:"HIDE_UPDATE_BANNER" default:"false"`
}
func (c *AppConfig) IsDefaultClientId() bool {

View file

@ -14,7 +14,12 @@ export function WhatsNewWidget() {
const { data: info } = useInfo();
const { data: albyInfo } = useAlbyInfo();
if (!info || !albyInfo || !albyInfo.hub.latestReleaseNotes) {
if (
!info ||
!albyInfo ||
!albyInfo.hub.latestReleaseNotes ||
info.hideUpdateBanner
) {
return null;
}

View file

@ -12,12 +12,12 @@ export function useBanner() {
const isDismissedRef = React.useRef(false);
React.useEffect(() => {
if (!info || !albyInfo || isDismissedRef.current) {
if (!info || !albyInfo || info.hideUpdateBanner || isDismissedRef.current) {
return;
}
// vss migration (alby cloud only)
// TODO: remove after 2026-01-01
// TODO: remove after 2026-08-01
const vssMigrationRequired =
info.oauthRedirect &&
!!albyMe?.subscription.plan_code.includes("buzz") &&

View file

@ -164,6 +164,7 @@ export interface InfoResponse {
nodeAlias: string;
mempoolUrl: string;
bitcoinDisplayFormat: BitcoinDisplayFormat;
hideUpdateBanner: boolean;
}
export type BitcoinDisplayFormat = "sats" | "bip177";