Skip to content

MongocampSettings ​

Read-only viewer for the MongoCamp server's settings: the cluster members and a searchable, paged table of every configuration (key, value, type, whether a change needs a restart). Administrators only.

Usage ​

vue
<template>
  <MongocampSettings />
</template>

Props ​

All optional; every one defaults to false (show everything).

PropHides
hideHeadingthe "Server settings" heading
hideRefreshthe refresh button
hideClusterthe cluster card — the cluster request is skipped too
hideConfigurationsthe whole configuration section (search, masked note, table, pager) — the configuration request is skipped too
hideSearchthe configuration search box
hideMaskedNotethe "secret values are masked" note
hideGrantHintboolean
hideDefaultsHintboolean
vue
<MongocampSettings hide-heading hide-cluster hide-search />

Hiding never reveals anything: masked values stay masked, and non-admins still only see the notice.

In a page with its own header ​

Like the list components, it exposes refresh() (all parts again) and has a toolbar slot after its reload button, so a page can hide the heading and reload (hide-heading hide-refresh) and reload from its own header.

The configuration table is a named, keyboard-focusable region ("Server configuration"): long values make it scroll sideways, and a keyboard user can then scroll it too.

Behavior ​

  • Admins only — for anyone else (useMongocampRoles().isAdmin is false) the component shows a short notice and asks the server nothing. Like the other role checks it is UI-level gating; the server decides what a token may read.
  • Cluster — the members the server reports (name, coordinator / site master badges); on a single node that is one member. Optional context: if the request fails the card is simply absent, the rest of the page is unaffected.
  • Configurations — sorted by key; the grey line under a key is the server's own comment. Search matches key, comment, type and the visible value, client-side. The table is paged ten rows at a time with a pager that only appears when needed.
  • Source and default (server 2.8) — a Source badge says where the value comes from: env, option (an option of the server in the application), changed (an administrator's update), stored (stored without anybody changing it — yellow when it is not the default) or default. A value that differs from the default shows the default below it (never for a masked value). Only values that differ from the default narrows the list; search also matches the source and the default.
  • Stored old defaults (server 2.8) — a warning lists the keys whose stored value nobody set and that differ from the current default: written as the default by an older server at its first start, or set before 2.6. The server logs the same keys at its start. DELETE /system/configurations/<KEY> sets the default again — not from this page, which stays read-only.
  • Errors — a failed load shows MongocampErrorAlert with retry; the refresh button reloads both requests.
  • Read-only — there is no way to change a setting or stop the server from here. shutdown and updateConfiguration are not wrapped anywhere in this module.

Secrets are never shown ​

The server's configuration list contains real secrets — the auth secret, the database user name and password, and the database host. A value is masked (shown as a "••••••••" badge) when its key looks secret (pass, secret, token, api key, credential, private, username, host) and the value is text or a non-empty list. Switches and numbers stay visible even under such a key (AUTH_TOKEN is just a boolean, AUTH_APIKEYLENGTH just a number), and an unset secret shows "—". The default (server 2.8 defaultValue) of such a key is masked by the same rule.

Masking happens while the rows are built, before anything is rendered: the original value is never copied into a row, so it cannot reach the page, the search box or a copy/paste, and there is no reveal button. The key-based rule is a heuristic — a secret stored under an innocent-looking key would be shown, so treat the page as admin-only regardless. /system/settings is never asked: since server 2.2 it holds only the configuration map, secrets included.

Released under the MIT License.