Skip to main content

Managing preferences

Infrahub stores per-user preferences that control aspects of the web interface and how it displays data. Preferences follow your account to any session or device, and โ€” with the manage_global_preferences permission โ€” an administrator can set organisation-wide defaults for users who haven't set their own.

Today that covers date format and timezone, controlling how Infrahub renders dates and times throughout the interface. Both use the same per-user and organisation-wide model, designed so Infrahub can add more personal settings later without changing how preferences resolve.

The organisation-wide settings also hold an instance label and color, which mark the instance in the browser tab, on the application pages and on the login page, so that users who work in several Infrahub instances can tell them apart. These two settings have no per-user value.

Set your preferencesโ€‹

  1. Open Account settings from the user menu in the left sidebar.
  2. On the Profile tab, find the Preferences card.
  3. Select a Date format and a Timezone.
  4. Click Save.

A field you leave on Automatic (inherited) takes the organisation default, or your browser default when no organisation default is set. The information icon next to each field shows where the current value comes from.

To clear an override and go back to the inherited value, re-select the value that is currently applied.

Set organisation defaultsโ€‹

Organisation defaults apply to every user who has not set their own value. Setting them requires the manage_global_preferences permission (super administrators have it implicitly). See the permissions reference for the full list of permissions.

  1. Open Global preferences from the user menu in the left sidebar. The menu item is visible only to users with the manage_global_preferences permission.
  2. Select a Date format and a Timezone.
  3. Click Save.

A field left on Automatic (browser default) sets no organisation default for that field, so users without their own value fall back to their browser default.

Instance label and colorโ€‹

Teams that run several Infrahub instances, one per stage or one per region, open them in several tabs of the same browser. The instance label and the instance color mark each instance, so that a user can tell which instance a page belongs to before they change data.

Both settings are organisation-wide only. There is no per-user value, and a write with scope: USER is rejected. Changing them requires the manage_global_preferences permission (super administrators have it implicitly). Anyone who can reach the instance can read the label and the color, including visitors who are not logged in, so the label must not contain internal information.

What every visitor viewsโ€‹

When a label is set:

  • A badge with the label is shown at the right of the top header on the application pages, next to the task and repository status indicators, and above the Infrahub logo on the login page. A label that is wider than the badge is truncated with an ellipsis, and hovering the badge shows the full label.
  • The browser tab title becomes <label> ยท <page title>, for example us-east-1 PROD ยท Schema. On a page without a title of its own, the tab title is <label> ยท Infrahub. A narrow tab shows only the start of the title, so choose a short label, such as PROD or QA-EU, to keep it readable.

When a color is set, a thin bar in that color spans the top of the application pages and of the login page, and the icon in the browser tab shows the Infrahub logo in that color.

The two settings are independent:

  • A label without a color shows a gray badge, no bar, and the standard tab icon.
  • A color without a label shows the bar and the colored tab icon only.
  • With neither set, the interface is the same as before these settings existed: no badge, no bar, and the tab title is the page title alone.

Allowed valuesโ€‹

  • Instance label: free text of at most 32 characters. Infrahub removes the spaces, tabs and line breaks at the start and at the end of the label before it checks it, so a label made of spaces only resets the label. A label is rejected when it contains, inside it, a line break, a tab or another control character, a Unicode line or paragraph separator (U+2028, U+2029), or a bidirectional control character such as U+202E. The label NULL is also rejected, because Infrahub stores that text to mark an unset value.
  • Instance color: one of Red, Amber, Green, Blue, Indigo, Purple, or Gray in the web interface. The GraphQL API takes the same colors as the uppercase enum values RED, AMBER, GREEN, BLUE, INDIGO, PURPLE, and GRAY.

Infrahub does not attach a meaning to any color. A convention that teams can adopt is red for production, amber for staging, and green for development; choose the one that fits your instances.

Set the instance label and colorโ€‹

  1. Open Global preferences from the user menu in the left sidebar. The menu item is visible only to users with the manage_global_preferences permission.
  2. In the Instance identity card, enter an Instance label and select an Instance color.
  3. Click Save instance identity.

The badge, the bar, and the tab title update in your own session as soon as the save completes. Tabs that other users already have open load the change the next time the tab regains focus, unless the tab loaded the settings less than two seconds before. No restart of Infrahub is needed.

To reset the label, clear the field and save. To reset the color, open the color picker, select the color that is already selected so that the picker clears it, and save. Each value can be changed or reset on its own; saving one leaves the other, and the date and time defaults, unchanged.

The values are stored with the other organisation-wide preferences, so they are kept across restarts and upgrades of Infrahub and are included in a backup of the database.

Set a default label and color for a deploymentโ€‹

Teams that deploy each Infrahub instance from its own configuration, such as one Docker Compose file or one set of Helm values per stage, can set the label and the color in that configuration. Two environment variables set the default values for the instance:

  • INFRAHUB_INSTANCE_LABEL: the default label. It follows the same rules as a label saved in the web interface.
  • INFRAHUB_INSTANCE_COLOR: the default color, one of RED, AMBER, GREEN, BLUE, INDIGO, PURPLE, or GRAY, in uppercase or lowercase.

The [instance] section of infrahub.toml accepts the same values as label and color. See the configuration reference.

Infrahub checks both values when it starts. An empty value counts as not set. A label that breaks the rules or a color outside the list stops Infrahub at startup with an error that names the environment variable. A change to either variable takes effect when Infrahub restarts.

Infrahub resolves the label and the color separately, in this order:

  1. The value saved in the web interface or with InfrahubSetPreferences using scope: GLOBAL.
  2. The deployment default, from the environment variable or the [instance] section of infrahub.toml.
  3. No value.

For example, with a saved label and no saved color, the badge shows the saved label in the default color of the deployment.

When the deployment sets a default label, an empty label field in the Instance identity card shows that label as its placeholder, with the line Leave empty to use the deployment default: <label>. When the deployment sets a default color and no color is saved, the color picker shows Deployment default: <color>; without a default color it shows the placeholder text No color. To return to the deployment default after you saved a value, reset the saved value: clear the label and save, or reset the color and save. While a deployment sets a default, the web interface can replace it with another value but cannot remove it; to show no label or no color, remove the environment variable or the [instance] setting and restart Infrahub.

InfrahubGlobalPreferences returns the saved values only, with null for a value that is not saved, even when the deployment sets a default.

Read the current values without authenticationโ€‹

Every client loads the public GET /api/config endpoint before it renders a page. Its response includes the label and the color in effect under instance, and the deployment defaults under instance_defaults, with null for a value that is not set:

{
"instance": { "label": "us-east-1 PROD", "color": "AMBER" },
"instance_defaults": { "label": "staging", "color": "AMBER" }
}

When Infrahub cannot read the saved values, for example during a database outage, instance returns null for the label and the color rather than the deployment defaults, because a default could name a different stage than the saved value. The pages then show no badge, no bar, no label in the tab title and the standard tab icon until the read succeeds.

This endpoint requires no authentication, which is how the login page shows the badge and the bar before a visitor signs in. Reading it never creates a stored preference.

Preference precedenceโ€‹

Infrahub resolves each preference field on its own, in this order:

  1. Your value โ€” the value you set for yourself.
  2. The organisation default โ€” the value an administrator set for everyone.
  3. The browser default โ€” your browser's locale for date formatting, and your browser's timezone.

Resolution is per field, so you can take the date format from your own value and the timezone from the organisation default at the same time. A field you never set falls through to the next layer; it is not stored until you set it.

Available preferencesโ€‹

Date formatโ€‹

The date format is a semantic key, not a rendering pattern. Each preset renders both a date and a time. The web interface renders the following presets:

KeyFormatExample
ISO_DATETIME (default)yyyy-MM-dd HH:mm2026-07-01 14:30
ISO_DATETIME_SECONDSyyyy-MM-dd HH:mm:ss2026-07-01 14:30:00
ISO_8601yyyy-MM-dd'T'HH:mm:ssXXX2026-07-01T14:30:00+02:00
EU_DATETIMEdd/MM/yyyy HH:mm01/07/2026 14:30
US_12HMM/dd/yyyy hh:mm a07/01/2026 02:30 PM

When you select a format, the interface shows a live example next to the field.

Timezoneโ€‹

The timezone is an IANA name, such as Europe/Paris or UTC. The picker lists the timezones your browser supports. A field left unset uses your browser's own timezone.

Best practicesโ€‹

  • Set an organisation default for the timezone when your teams work in one region. Everyone then reads timestamps in the same zone until they choose their own.
  • Leave the date format on the default (ISO_DATETIME) unless your organisation has a house style. The ISO presets sort and compare the same way in every locale.
  • Preferences affect display only. They change how the web interface renders timestamps; they never change the stored data. A timezone preference renders each timestamp in that zone without altering the underlying value.