When to use required packages
Use required packages when a forge must not serve without a particular extension, for example a package that enforces an account naming policy or controls other packages. Optional packages are the default: they can be enabled and disabled live, and a failing optional package is isolated without affecting the forge.
Configure required packages
Required packages always come from the verified catalog. List their IDs in REQUIRED_IDS, separated by commas, and mark the same entries "required": true in the catalog:
[extensions]
ENABLED = true
CATALOG_PATH = /etc/fountain/catalog.json
REQUIRED_IDS = policy,controller
The configuration must agree exactly:
REQUIRED_IDSneedsENABLED = true; otherwise the forge refuses to start.- The entries marked
requiredin the catalog must be exactly the IDs inREQUIRED_IDS, each listed once. - A required package must not have a disabled requested state.
How startup changes
Required packages are prepared and started before the forge serves any request:
- Fountain reuses an installed copy whose recorded archive checksum matches the catalog entry.
- Otherwise it unpacks the verified archive from
.cache/packages/if present. - Otherwise it downloads the archive from the catalog URL and verifies it.
- It starts each required package in the order of
REQUIRED_IDSand waits for each backend to report ready.
If any step fails, the forge logs the reason and stops; /api/healthz never answers without the required packages. Because cached archives are reused, a forge with its required archives in the cache restarts without network access.
After required packages are running, optional packages are restored in the background according to their requested state.
What administrators can and cannot change
extensions disableandextensions removerefuse a required package.- Site administration → Extensions labels required packages and offers no actions for them.
- To stop requiring a package, remove it from
REQUIRED_IDS, change its catalog entry to"required": falseand restart.
Account name policy
While REQUIRED_IDS is set, creating or renaming a personal account asks the required packages for a decision through the forgejo.username policy. Organizations and federated accounts are not checked.
- If a required package that declares the policy denies the name, the account change is refused.
- If no required package declares
forgejo.username, or the policy cannot answer, the account change is refused as well.
So every forge with required packages needs at least one required package that implements forgejo.username, or no personal accounts can be created or renamed. See Extension backend for how a package implements the policy.
Troubleshooting
| Startup error | Cause |
|---|---|
required extensions are configured but extensions are disabled |
REQUIRED_IDS is set while ENABLED is false. |
extension catalog does not match configuration |
The catalog's required entries differ from REQUIRED_IDS. |
required extension "ID" is disabled |
The package's requested state is disabled. Enable it with extensions enable ID while the forge is stopped. |
required extension bootstrap failed |
The archive could not be reused, unpacked or downloaded and verified. Check network access to the catalog URL or place the verified archive in the cache. |
start extension "ID" |
The backend did not start or complete its handshake. Read the preceding log lines for the package. |
Continue
Review the Extension trust model for what a required package can do once it runs.