SettingsModule · library/setting/src/repos/server-settings.ts:44

ServerSettingsRepo

component

No JSDoc comment in source yet.

API

@Component()
export class ServerSettingsRepo implements Settings {
  @Use() private readonly db!: Db;
  get(key: string): string | null;
  set(key: string, value: string): void;
  watch(listener: (key: string) => void): () => void;
  getProxyForApp(): boolean;
  setProxyForApp(value: boolean): void;
  getProxyForAgent(): boolean;
  setProxyForAgent(value: boolean): void;
  getProxyUrl(): string | null;
  setProxyUrl(value: string | null): void;
  getAttachmentMaxMb(): number;
  setAttachmentMaxMb(value: number): void;
  getAttachmentTotalMb(): number;
  setAttachmentTotalMb(value: number): void;
  getAttachmentLimitsMb(): { attachmentMaxMb: number; attachmentTotalMb: number };
  getCompanyMode(): boolean;
  setCompanyMode(value: boolean): void;
  getBrowserExtensionsEnabled(): boolean;
  setBrowserExtensionsEnabled(value: boolean): void;
  getAgentApiEnabled(): boolean;
  setAgentApiEnabled(value: boolean): void;
}

Dependencies & Wiring

Extracted from class decorators
implementsinterfaces
@Userequires (1)
db: Db

Methods (20)

get

get(key: string): string | null

Returns the raw JSON-encoded value; null if never set.

@paramkeystring
@returnsstring | null

set

set(key: string, value: string): void
@paramkeystring
@paramvaluestring
@returnsvoid

watch

watch(listener: (key: string) => void): () => void
@paramlistener(key: string) => void
@returns() => void

getProxyForApp

getProxyForApp(): boolean

The "application uses the proxy" switch (the server's own outbound dispatcher).

@returnsboolean

setProxyForApp

setProxyForApp(value: boolean): void
@paramvalueboolean
@returnsvoid

getProxyForAgent

getProxyForAgent(): boolean

The "agent environment uses the proxy" switch (command subprocess env policy).

@returnsboolean

setProxyForAgent

setProxyForAgent(value: boolean): void
@paramvalueboolean
@returnsvoid

getProxyUrl

getProxyUrl(): string | null

The explicit proxy address (normalized at write time by the settings route); null = follow the proxy environment variables. An absent or unreadable row reads as null (the safe default: behave as before the setting existed).

@returnsstring | null

setProxyUrl

setProxyUrl(value: string | null): void
@paramvaluestring | null
@returnsvoid

getAttachmentMaxMb

getAttachmentMaxMb(): number

Per-file composer attachment cap, in whole MB.

@returnsnumber

setAttachmentMaxMb

setAttachmentMaxMb(value: number): void
@paramvaluenumber
@returnsvoid

getAttachmentTotalMb

getAttachmentTotalMb(): number

Per-message total attachment cap (decoded bytes), in whole MB.

@returnsnumber

setAttachmentTotalMb

setAttachmentTotalMb(value: number): void
@paramvaluenumber
@returnsvoid

getAttachmentLimitsMb

getAttachmentLimitsMb(): { attachmentMaxMb: number; attachmentTotalMb: number }

The pair as one value — what the validators, the body cap and /api/me all read. Kept here so no caller has to remember that the two numbers are only meaningful together (the total is never below the per-file cap; the PUT enforces that against the effective post-write pair).

@returns{ attachmentMaxMb: number; attachmentTotalMb: number }

getCompanyMode

getCompanyMode(): boolean

Company mode master switch (default OFF): an absent row — and an unreadable one — means off, so the whole mode stays out of the way until an admin turns it on under System settings > Server > Company mode.

@returnsboolean

setCompanyMode

setCompanyMode(value: boolean): void
@paramvalueboolean
@returnsvoid

getBrowserExtensionsEnabled

getBrowserExtensionsEnabled(): boolean

Whether users may drive their own Chrome through the extension (default ON): only a stored false turns it off, so an unreadable row leaves the feature as it ships.

@returnsboolean

setBrowserExtensionsEnabled

setBrowserExtensionsEnabled(value: boolean): void
@paramvalueboolean
@returnsvoid

getAgentApiEnabled

getAgentApiEnabled(): boolean

Whether external programs may reach Agents through the Agent API (default ON): only a stored false turns it off, so an unreadable row leaves the feature as it ships. Read per request by the /api/amsp/v1 gate, so flipping it needs no restart.

@returnsboolean

setAgentApiEnabled

setAgentApiEnabled(value: boolean): void
@paramvalueboolean
@returnsvoid