Browse documentation
Fountain handbook

Required extension packages

Mark catalog packages as required so the forge starts only when they are installed, verified and running, and understand how required packages change startup and account rules.

On this page

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_IDS needs ENABLED = true; otherwise the forge refuses to start.
  • The entries marked required in the catalog must be exactly the IDs in REQUIRED_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:

  1. Fountain reuses an installed copy whose recorded archive checksum matches the catalog entry.
  2. Otherwise it unpacks the verified archive from .cache/packages/ if present.
  3. Otherwise it downloads the archive from the catalog URL and verifies it.
  4. It starts each required package in the order of REQUIRED_IDS and 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 disable and extensions remove refuse 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": false and 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.