# Installation settings

> Settings an operator changes for the whole installation, on a single host and on Kubernetes, such as how long the audit log is kept and the storage budget.

Source: https://docs.corfedo.ai/operate/settings/

Installation settings apply to every workspace. Workspace administrators see their effect in the browser but cannot change them.

## Change a setting

**Single host**

1. In the installation directory, set a `.env` key, for example `CORFEDO_AUDIT_RETENTION=30.00:00:00`. Set a platform variable on the `platform` service in `compose.override.yaml`:

   ```yaml
   services:
     platform:
       environment:
         CORFEDO_Repositories__CredentialMasking: Always
   ```

2. Apply it to the installed release: `sh ~/corfedo/install.sh update --version "$(cat ~/corfedo/VERSION)"`. Changing a PostgreSQL setting stops Corfedo briefly. Other settings restart only the services they affect.
3. Check: `sh ~/corfedo/install.sh status` shows the installation as ready.

To go back to the default, remove the line, then run `update` again.

**Kubernetes**

1. Set the value in `values.yaml`. Platform variables go under `platform.env`:

   ```yaml
   platform:
     env:
       CORFEDO_Audit__Retention: "30.00:00:00"
       CORFEDO_Repositories__CredentialMasking: Always
   ```

2. Apply it with the chart version you run:

   ```sh
   helm upgrade corfedo oci://ghcr.io/corfedo/charts/corfedo --version CHART_VERSION \
     --namespace corfedo --values values.yaml
   ```

3. Check: every pod in `kubectl get pods --namespace corfedo` is ready.

To go back to the default, remove the value, then run `helm upgrade` again. A required value, such as `storage.budgetGiB` or `database.maxConnections`, has no default: set its previous value instead.

## Settings

| Setting | Single host | Kubernetes | What it does |
| --- | --- | --- | --- |
| Audit log retention | `.env`: `CORFEDO_AUDIT_RETENTION` | `platform.env`: `CORFEDO_Audit__Retention` | How long the audit log is kept, as `days.hh:mm:ss`, at least one day. Empty by default: no limit. Within an hour of an entry passing the limit, it is deleted, and the network address and browser stored with Corfedo AI answers of that age are cleared. The answers stay. Administrators see the limit in **Settings › Privacy**. |
| Storage budget | `.env`: `CORFEDO_STORAGE_BUDGET_GIB`, `32` or the answer given at install | `storage.budgetGiB`, required, at least `16` | How many GiB the indexes may take in artifact storage |
| Largest build | `.env`: `CORFEDO_MAXIMUM_BUILD_BYTES`, `2147483648` (2 GiB) | 16 GiB. The values file has no setting for it. | The largest index one build may write. A larger repository fails with **The repository exceeds the indexer’s limits**. |
| Credential masking | `compose.override.yaml`: `CORFEDO_Repositories__CredentialMasking` | `platform.env`: `CORFEDO_Repositories__CredentialMasking` | `WorkspaceChoice` by default. `Always` requires [credential masking](https://docs.corfedo.ai/workspace/privacy/credential-masking/) in every workspace. |
| Trace levels for administrators | `compose.override.yaml`: `CORFEDO_Ai__Traces__AdministratorLevels` | `platform.env`: `CORFEDO_Ai__Traces__AdministratorLevels` | The highest levels **All traces** may show on the [Privacy](https://docs.corfedo.ai/workspace/privacy/) page, `Structure, Content, Costs` by default. A comma-separated list of `Structure`, optionally with `Content` and `Costs`, or `None` to turn **All traces** off. |
| Connections Corfedo opens | `compose.override.yaml`: `CORFEDO_Database__MaxConnections`, `80` | `roles.<role>.maxConnections`, per pod of the role | The most PostgreSQL connections Corfedo opens. On a single host the bundled PostgreSQL's 120 also cover the bundled Keycloak's 20 and administration. |
| Connections PostgreSQL accepts | `.env`: `CORFEDO_POSTGRES_MAX_CONNECTIONS`, `120` | `database.maxConnections`, required: your server's `max_connections` | Raise it by as much as the connections Corfedo opens. On Kubernetes, `helm upgrade` stops when the replicas need more, see [PostgreSQL](https://docs.corfedo.ai/operate/kubernetes/prepare-the-cluster/#postgresql). |
| PostgreSQL shared buffers | `.env`: `CORFEDO_POSTGRES_SHARED_BUFFERS`, `512MB` | Your server's setting, or `postgresql.sharedBuffers` with `postgresql.enabled` | Raise it, for example to `2GB`, on a host with much more memory and many repositories |

## Related

- [Install on a single host](https://docs.corfedo.ai/operate/single-host/) and [Install on Kubernetes](https://docs.corfedo.ai/operate/kubernetes/)
