Skip to content

Commit

Permalink
Make server setting info component
Browse files Browse the repository at this point in the history
  • Loading branch information
MGibson1 committed Nov 12, 2024
1 parent 31528bf commit 4ce1570
Show file tree
Hide file tree
Showing 12 changed files with 1,180 additions and 155 deletions.
10 changes: 10 additions & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ patterns:
.*? # match any characters, lazily (so that we stop at the next tilde)
` # match the closing `
/gx
- name: single_word_anchors
pattern: |
/
\[ # match the opening [
[^\]]*? # match any characters except ], which closes the link
\]\( # match the closing ] and opening (
\#[a-z]* # match the anchor text
\) # match the closing )
/gx
languageSettings:
- languageId:
- markdown
- mdx
ignoreRegExpList:
- markdown_code_block
- markdown_code_inline
- single_word_anchors
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment variables.
Each heading level is a settings namespace or setting itself. For example
`iconSettings__cacheEnabled` corresponds to [Icon Settings -> CacheEnabled](#cacheenabled)

import TOCInline from '@theme/TOCInline';
import TOCInline from "@theme/TOCInline";

<TOCInline toc={toc} />

Expand All @@ -19,11 +19,12 @@ These are settings without a parent namespace

### DevelopSelfHosted

Relevant for all projects that use [global settings](#global-settings).

- **type**: `Boolean`
- **default**: `False`
- **full name**: `developSelfHosted`
<ServerSettingInfo
type="Boolean"
defaultValue="False"
fullName="developSelfHosted"
relevantProjects="Any using global settings"
/>

Turns on [self host override settings](#selfhostoverride).

Expand All @@ -33,192 +34,156 @@ Settings for the Core Bitwarden Project. Not all settings are relevant for all p

### SelfHosted

:::info[Relevant For]

All projects

:::

- **type**: `Boolean`
- **default**: `False`
- **full name**: `globalSettings__selfHosted`
<ServerSettingInfo
type="Boolean"
defaultValue="False"
fullName="globalSettings__selfHosted"
relevantProjects={[
"Admin",
"API",
"Billing",
"Core",
"Events",
"EventsProcessor",
"Icons",
"Identity",
"Notifications",
"SCIM",
"SharedWeb",
"SSO",
]}
/>

Indicates that a server instance is self hosted. This is used all over the place to swap out
services and set expectations.

### UnifiedDeployment

:::info[Relevant For]

- Shared web

:::

- **type**: `Boolean`
- **default**: `False`
- **full name**: `globalSettings__unifiedDeployment`
<ServerSettingInfo
type="Boolean"
defaultValue="False"
fullName="globalSettings__unifiedDeployment"
relevantProjects={["SharedWeb"]}
/>

Indicates that a server instance is hosted through the unified docker deployment method. Currently,
this is used only while setting up nginx trusted reverse proxies. See
[KnownProxies](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.forwardedheadersoptions.knownproxies?view=aspnetcore-8.0#microsoft-aspnetcore-builder-forwardedheadersoptions-knownproxies)

### KnownProxies

:::info[Relevant For]

- Shared Web

:::

- **type**: `String`
- **default**: `""`
- **full name**: `globalSettings__knownProxies`
<ServerSettingInfo
type="String"
defaultValue='""'
fullName="globalSettings__knownProxies"
relevantProjects={["SharedWeb"]}
/>

A `,` delineated list of reverse proxies to trust. See
[KnownProxies](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.forwardedheadersoptions.knownproxies?view=aspnetcore-8.0#microsoft-aspnetcore-builder-forwardedheadersoptions-knownproxies)

### SiteName

:::info[Relevant For]

All projects (Mail and Logging)

:::

- **type**: `String`
- **default**: `""`
- **full name**: `globalSettings__siteName`
<ServerSettingInfo
type="String"
defaultValue='""'
fullName="globalSettings__siteName"
relevantProjects="Any using Mail or Logging"
/>

Specifies the name of the hosted website in emails and logging.

### ProjectName

:::info[Relevant For]

All projects (Mail, Logging, Feature Flags, Service Bus)

:::

- **type**: `String`
- **default**: `""`
- **full name**: `globalSettings__projectName`
<ServerSettingInfo
type="String"
defaultValue='""'
fullName="globalSettings__projectName"
relevantProjects="Any using Mail, Logging, Feature Flags, or Service Bus"
/>

This value is used all over the place to specify the exact project being run. Useful for things like
providing context in feature flags, or getting default values for service bus subscriptions in our

### LogDirectory

:::info[Relevant For]

All projects

:::

- **type**: `String`
- **default**:
- **cloud**: `null`
- **selfhost**: `etc/bitwarden/logs`
- **full name**: `globalSettings__logDirectory`
<ServerSettingInfo
type="String"
defaultValue={[
["cloud", "null"],
["selfhost", "etc/bitwarden/logs"],
]}
fullName="globalSettings__logDirectory"
relevantProjects="Any using Logging"
/>

Sets local filesystem logging directory. This value is only used if [Sentry.Dsn](#sentry) and
[Syslog.Destination](#destination) are null.

### LogDirectoryByProject

:::info[Relevant For]

All projects

:::

- **type**: `Boolean`
- **default**: `True`
- **full name**: `globalSettings__logDirectoryByProject`
<ServerSettingInfo
type="Boolean"
defaultValue="True"
fullName="globalSettings__logDirectoryByProject"
relevantProjects="Any using Logging"
/>

Splits logs into multiple files per project. The name of the project's log file is given by
[project name](#projectname). This value is only relevant if [LogDirectory](#logdirectory) is being
used.

### LogRollBySizeLimit

:::info[Relevant For]

All projects

:::

- **type**: `nullable long`
- **default**: `null`
- **full name**: `globalSettings__logRollBySizeLimit`
<ServerSettingInfo
type="nullable long"
defaultValue="null"
fullName="globalSettings__logRollBySizeLimit"
relevantProjects="Any using Logging"
/>

Sets the size limit for log files. A new log file will be rolled into when the size limit is
reached. If null, rolls log files by date. This value is only relevant if
[LogDirectory](#logdirectory) is being used.

### EnableDevLogging

:::info[Relevant For]

All projects

:::

- **type**: `Boolean`
- **default**: `False`
- **full name**: `globalSettings__enableDevLogging`
<ServerSettingInfo
type="Boolean"
defaultValue="False"
fullName="globalSettings__enableDevLogging"
relevantProjects="Any using Logging"
/>

Bypasses log filters used to ensure secrets are not persisted in logs. Only respected if the hosting
environment is development.

### LicenseDirectory

:::note

self host only

:::

:::info[Relevant For]

All projects

:::

- **type**: `String`
- **default**: `/etc/bitwarden/core/licenses`
- **full name**: `globalSettings__licenseDirectory`
<ServerSettingInfo
type="String"
defaultValue="/etc/bitwarden/core/licenses"
fullName="globalSettings__licenseDirectory"
relevantProjects={["All"]}
environments={["selfhost"]}
/>

Sets the directory to look for organization licenses in for self hosted environments.

## Dev

- **type**: `Namespace`
- **default**: N/A
- **full name**: N/A

Settings for development environments.
Settings namespace for development environments.

### selfHostOverride

:::info[Relevant For]

All Projects

:::

- **type**: `Namespace`
- **default**: N/A
- **full name**: N/A
This namespace allows a single user secrets file to be used for developing both cloud and selfhosted
servers with differing configurations between the two server instances.

The [Global Settings](#global-settings) namespace is repeated here. Any value that is set there is
overridden by the corresponding value in `selfHostOverride` _iif_ in a dev environment _AND_
overridden by the corresponding value in `selfHostOverride` _iff_ in a dev environment _AND_
[develop self hosted](#developselfhosted) is `True` _AND_ the setting in question exists in the
`selfHostOverride` namespace.

This namespace is useful to allow for a single user secrets file to be used for developing both
cloud and selfhosted servers at the same time, while allowing for different configurations between
the two server instances.

## Billing Settings

:::note
Expand All @@ -229,12 +194,7 @@ TODO

## Ip Rate Limiting

:::info[Relevant For]

- Identity
- Api

:::
<ServerSettingInfo relevantProjects={["Identity", "Api"]} />

:::note

Expand All @@ -244,11 +204,7 @@ TODO

## Icons Settings

:::info[Relevant For]

- Icons

:::
<ServerSettingInfo relevantProjects={["Icons"]} />

Settings for the Icons service, which provides a proxy for downloading website favicons. These
settings are all related to caching icons.
Expand All @@ -261,25 +217,34 @@ Only favicons 50 kilobytes or less in size are cached. Failures to pull a favico

### CacheEnabled

- **type**: `Boolean`
- **default**: `False`
- **full name**: `iconSettings__cacheEnabled`
<ServerSettingInfo
type="Boolean"
defaultValue="False"
fullName="iconSettings__cacheEnabled"
relevantProjects={["Icons"]}
/>

Controls whether a cache will be used.

### CacheHours

- **type**: `int`
- **default**: `0`
- **full name**: `iconSettings__cacheHours`
<ServerSettingInfo
type="int"
defaultValue="0"
fullName="iconSettings__cacheHours"
relevantProjects={["Icons"]}
/>

Controls how long icons are cached for.

### CacheSizeLimit

- **type**: `nullable long`
- **default**: `null`
- **full name**: `iconSettings__cacheSizeLimit`
<ServerSettingInfo
type="nullable long"
defaultValue="null"
fullName="iconSettings__cacheSizeLimit"
relevantProjects={["Icons"]}
/>

Limits the total size of the
[`MemCache`](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.caching.memorycache?view=net-8.0)
Expand Down
Loading

0 comments on commit 4ce1570

Please sign in to comment.