1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-24 20:06:55 +01:00
unleash.unleash/src
Thomas Heartman b33abf036b
chore: configure the 'maintenanceMode' flag to accept variants (#10956)
Configure the `maintenanceMode` flag type to be `boolean | Variant` and
update the env parsing to allow passing strings from the env.

The [first
impl](3bbfc9e681)
required you to set a full, variant -- stringified as json -- in the
env, but this is both error-prone and not very user friendly.
Additionally, the name of the variant isn't really important, and if
you're passing a string, you probably want it to be true.

As such, the [second
impl](c38357baa4)
updates the env parsing to read the full string value into a
pre-formatted variant if it's not parseable as a boolean.

As such, to set a custom message, you can now do:

```sh
UNLEASH_EXPERIMENTAL_MAINTENANCE_MODE='Custom message from plain env var string' yarn dev
```

With the [updates to the
UI](https://github.com/Unleash/unleash/pull/10961), it'll look a little
something like this:

<img width="388" height="64" alt="image"
src="https://github.com/user-attachments/assets/6b8a174b-d75f-4748-8f1a-1ad4ebce2073"
/>

## Rationale

This allows locking down Unleash instances with a custom message.
Previously, you'd have to use both maintenance mode and a custom banner
for this, but that requires more work to set properly and it shows two
banners, when you really only want the one.
2025-11-11 12:52:49 +01:00
..
lib chore: configure the 'maintenanceMode' flag to accept variants (#10956) 2025-11-11 12:52:49 +01:00
mailtemplates fix: health-technical debt trends in emails (#10308) 2025-07-04 16:46:59 +02:00
migrations feat: add safeguards migration (#10928) 2025-11-06 11:03:40 +02:00
test chore: remove release plans from getFeature endpoint (#10955) 2025-11-10 15:06:21 +02:00
migrator.ts chore: remove AWS IAM DB auth prototype code (#10662) 2025-09-12 14:46:28 +01:00
server-dev.ts chore(AI): trafficBillingDisplay flag cleanup (#10949) 2025-11-10 10:35:33 +02:00
server.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
test-setup.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00