Retention Rules Configuration
This page covers self-hosted configuration. To evaluate the feature, use it in the UI, or see supported rule JSON, start with the Retention Rules feature guide.
Default configuration
Retention rules are enabled by default. Package and version targets are available; file targets remain disabled until you explicitly enable them.
| Environment variable | Default | Purpose |
|---|---|---|
ENABLE_RETENTION_RULES | true | Enables retention rules for the server. |
RETENTION_RULES_ENABLE_FILE_RULES | false | Allows rules that delete individual files. |
RETENTION_RULES_CONCURRENCY_LIMIT | 2 | Limits how many rules can run in parallel. |
RETENTION_RULES_MAX_RULES_PER_REPOSITORY | 10 | Limits the number of rules in each repository. |
See Server Environment Variables for the authoritative variable reference.
Recommended rollout
- Keep file rules disabled unless you have a specific, tested use case.
- Create a package-version rule and run it manually as a dry run.
- Review server load while running rules before increasing concurrency.
- Add a schedule only after the dry-run results are consistently correct.
File rules
File retention rules can remove files that a package needs to work. Enabling the target does not make it safe for general cleanup; use it only when you understand the repository’s stored file layout.