Configuration

Every Pratique setting can live in one file, pratique.yaml. Keep it in version control, check it in CI, and Pratique shows each setting from the file as read-only in the UI.

Configuration as code

Start the server with the file, or set PRATIQUE_CONFIG to its path:

bashuse, check and create a config file
pratique --config pratique.yaml            # or set PRATIQUE_CONFIG
pratique config check pratique.yaml        # validate it, for example in CI
pratique config export > pratique.yaml     # start from what's been set in the UI

--config must come first, before any subcommand, for example pratique --config pratique.yaml healthcheck.

Check a change

pratique config check FILE reads the file, fills in ${VAR} values, and runs the same validation as the server. It prints how many quarantine settings, rules, exceptions and custom feeds it found, or the first error. Run it in CI on every change to the file. Because it fills in variables, the CI job needs every variable the file uses, set to a valid value.

Export what the UI holds

pratique config export prints the settings made in the UI as YAML: the default and per-registry quarantine, quarantine for single packages, the metadata cache, storage cleanup, teams, rules, exceptions that haven't ended, and reserved names. It reads the server's database, so run it with the same PRATIQUE_DATA or PRATIQUE_DATABASE_URL as the server. In Docker, use docker exec pratique /pratique config export.

Secrets aren't exported. Teams are exported without their tokens, because tokens made in the UI are stored as hashes and keep their team through the database.

How the file and the UI work together

  • The file wins. Anything set in it shows as In code in the UI, which refuses to change it. Anything you leave out keeps its default and stays editable in the UI.
  • Changes need a restart. Each new version of the file is recorded in the audit log, with its SHA-256 hash.
  • Unknown keys are errors. An unknown key or rule stops the server from starting, so a typo can't quietly weaken a policy.
  • Secrets stay out of the file. Write ${VAR} to fill a value from the environment.
  • Environment variables win over the file for server settings, so one deployment can differ from a shared file. For example, PRATIQUE_PUBLIC_URL overrides server.public_url.
  • Replicas need the same file, or they apply different policy.

Variables in the file

Pratique replaces ${NAME} in a value with the environment variable of that name. It does this after it reads the YAML, so a variable's contents can't change the file's structure. A $ that isn't part of ${NAME} stays as it is, so passwords can contain one.

A variable that isn't set stops Pratique from starting, with a message that names it. So a missing secret can't quietly turn a token or a setting off.

For the full list of settings and their environment variables, see settings reference.

The sections of the file

These examples come from pratique.example.yaml in the repository. Remove any section you don't use.

server

Where Pratique listens, the address clients use, and the server's secrets.

yamlserver
server:
  listen: 0.0.0.0:8484
  public_url: https://pratique.example.com
  # mode: firewall                     # decide and deliver, but keep no package files
  # tls_cert: /etc/pratique/cert.pem    # serve HTTPS directly, instead of from a proxy
  # tls_key: /etc/pratique/key.pem
  data_dir: /data
  trust_proxy: true                     # only when a proxy is really in front
  admin_token: ${PRATIQUE_ADMIN_TOKEN}  # break-glass sign-in; leave out to allow SSO only
  audit_key: ${PRATIQUE_AUDIT_KEY}      # from: pratique audit-keygen
  metrics_token: ${PRATIQUE_METRICS_TOKEN}
  webhook_url: ${PRATIQUE_WEBHOOK_URL}

See install for HTTPS and the public URL, and firewall mode for mode.

sso

How people sign in to the web UI: OIDC at the top level, and saml, ldap and scim beside it.

yamlsso
sso:
  issuer: https://idp.example.com
  client_id: pratique
  client_secret: ${OIDC_CLIENT_SECRET}
  allowed: ["@example.com", contractor@partner.com]
  admins: [alice@example.com, bob@example.com]
  trust_email: false
  admin_groups: [pratique-admins]

See sign-in and roles.

storage

Where the database and package files live. Leave it out to use SQLite and local disk in the data directory.

yamlstorage
storage:
  database_url: ${DATABASE_URL}
  s3:
    bucket: acme-pratique
    region: eu-west-1
    # endpoint: minio.example.com:9000
    # prefix: pratique/
    # access_key: ${S3_ACCESS_KEY}      # leave out to use the AWS credential chain
    # secret_key: ${S3_SECRET_KEY}

See run more than one instance.

upstreams

The registries Pratique fetches from. The values below are the defaults. Change them to use an internal mirror. composer_dist_hosts lists the hosts Composer archives may come from.

yamlupstreams
upstreams:
  npm: https://registry.npmjs.org
  pypi: https://pypi.org
  pypi_files: https://files.pythonhosted.org
  packagist: https://repo.packagist.org
  packagist_api: https://packagist.org
  go: https://proxy.golang.org
  go_sumdb: https://sum.golang.org
  composer_dist_hosts: [codeload.github.com, api.github.com, gitlab.com, bitbucket.org]

access

Who can connect, which names are internal, and bots defined in the file.

yamlaccess
access:
  require_tokens: true                  # also require a token on a local address
  claim_needs_team: true                # someone with no team can't claim a new project or build name
  reserved: ["@acme/*", "acme-*", "acme/*"]
  client_tokens:                        # bots defined here instead of in the UI
    ci: ${PRATIQUE_CI_TOKEN}

Each client token needs at least 16 characters. Tokens from the file count as bots, and the audit log names them by their key, such as ci. See private packages for reserved names and who can report under a name for claim_needs_team.

metadata_cache

How long Pratique reuses a package's list of releases before it asks the registry again. Use a duration such as 30m or 6h, from 1 minute up to 24 hours. Policy is still checked on every request.

yamlmetadata_cache
metadata_cache: 30m

storage_cleanup

Removes package files that can be fetched again. It is off unless you enable it. Private packages, Composer archives and what a project or recent build uses are never removed. See storage.

yamlstorage_cleanup
storage_cleanup:
  enabled: true
  unused_days: 90
  keep_newest: 3
  undelivered_days: 30
  max_gb: 500
  build_days: 365

quarantine

How long new releases wait. Write durations as 7d, 36h or 0, up to 365d. 0 turns quarantine off for that scope. The most specific setting wins: a package, then its registry, then the default. PRATIQUE_QUARANTINE overrides default.

yamlquarantine
quarantine:
  default: 7d
  npm: 7d
  python: 3d
  composer: 7d
  go: 7d
  packages:
    - { registry: npm, name: typescript, hold: 1d }
    - { registry: python, name: some-risky-package, hold: 30d }

See quarantine.

rules

Risk rules, by name. The action is off, warn or block. The fast-track rule takes off or fast-track. Some rules take one more setting: severity (low, moderate, high or critical), value (a whole number from 1 to 120), or deny for the license list.

yamlrules
rules:
  security-fast-track: { action: fast-track, severity: high }
  dormant-release: { action: warn, value: 12 }        # months of silence
  remote-dependency: { action: block }
  cve: { action: warn, severity: critical }
  install-script-added: { action: block }
  typosquat: { action: block }
  license: { action: block, deny: [AGPL-3.0, unknown] }

An unknown rule name stops the server and lists the known names. See risk rules for every rule.

teams

A team gives a group of tokens its own quarantine and rules. Anything a team leaves out follows the settings above. tokens are names under access.client_tokens, and groups are identity provider groups whose people join the team.

yamlteams
teams:
  - name: production-ci
    quarantine: 14d
    rules:
      new-publisher: { action: block }
    tokens: [ci]
  - name: payments
    groups: [payments-devs]

See teams.

exceptions

Allows and blocks for a package or one version. Each needs a registry (npm, python, composer or go), a name, a version or "*" for all versions, an action of allow or block, and a reason for the audit log.

yamlexceptions
exceptions:
  - registry: npm
    name: urgent-fix
    version: 2.1.0
    action: allow
    reason: Needed for the 2026-11 security patch
    expires: 2026-12-31
  - registry: python
    name: banned-package
    version: "*"
    action: block
    reason: Not approved by legal

An allow can have expires, as a date such as 2026-12-31, and lasts through the end of that day. A block lasts until you remove it, so it can't have one. See blocked and allowed.

threat_feeds

OSV is on by default. Add your own sources under custom, in blocklist or osv format. A feed's url must be http or https, and can use ${VAR} for a key.

yamlthreat_feeds
threat_feeds:
  osv:
    enabled: true
  custom:
    - name: security-team
      url: https://intel.example.com/blocklist.txt
      format: blocklist                 # lines of: registry name version reason
    - name: vendor
      url: https://vendor.example.com/osv.json?key=${INTEL_KEY}
      format: osv

Everything a custom feed lists is refused, so only add sources you trust. See threat feeds.