Settings reference

Every server setting can come from an environment variable or from pratique.yaml. This page lists each variable with its default and its key in the file.

How settings combine

  • Environment variables win over the file for every setting on this page. A variable that is set and not empty replaces the same key in pratique.yaml, so one deployment can differ from a shared file. An empty variable does not replace the file's value.
  • Policy settings, such as quarantine per registry, rules, exceptions, teams, the cleanup policy and custom threat feeds, have no environment variable. Set them in the file or in the UI. See configuration as code.
  • An on or off setting is on only when the variable is exactly true.
  • A list setting in a variable is comma-separated. In the file, it is a YAML list.
  • In the file, ${VAR} fills in a value from the environment. If the variable is not set, Pratique does not start.
  • Settings are read at startup. A change needs a restart.

Point Pratique at the file with --config FILE or PRATIQUE_CONFIG. Check it with pratique config check FILE.

Server

Variablepratique.yamlDefaultPurpose
PRATIQUE_CONFIGNonePath to pratique.yaml, the same as --config.
PRATIQUE_LISTENserver.listen127.0.0.1:8484 (0.0.0.0:8484 in the Docker image)The address and port to listen on.
PRATIQUE_PUBLIC_URLserver.public_urlhttp:// or https:// and the listen addressThe URL clients use. Required when the listen address is not a loopback address. Must start with https:// when Pratique serves HTTPS.
PRATIQUE_MODEserver.modeartifactoryfirewall keeps no package files and hosts no private packages. See firewall mode.
PRATIQUE_TLS_CERTserver.tls_certNoneCertificate chain file. Pratique then serves HTTPS. A renewed file is picked up without a restart.
PRATIQUE_TLS_KEYserver.tls_keyNonePrivate key file. Set both TLS settings or neither.
PRATIQUE_DATAserver.data_dir./data (/data in the Docker image)The SQLite database, package files and temporary files.
PRATIQUE_TRUST_PROXYserver.trust_proxyfalseRead the client address from the last X-Forwarded-For entry. Set it only when a proxy is in front, or clients can forge addresses in the audit log.
PRATIQUE_DRAIN_DELAY0sOn shutdown, fail /readyz for this long before stopping, so a load balancer moves traffic first. Up to 5m. See upgrade without downtime.
PRATIQUE_CLIENTS_DIRNone (/clients in the Docker image)The folder of pratique-connect builds served at /connect/download/. See one-command setup.
PRATIQUE_QUARANTINEquarantine.default168hThe default quarantine. The variable takes a Go duration, such as 168h. The file also accepts days, such as 7d. From 0 to 365 days. The UI can set it per registry and per package.

Access

Variablepratique.yamlDefaultPurpose
PRATIQUE_ADMIN_TOKENserver.admin_tokenGenerated each run when no sign-in method is setBreak-glass sign-in and scripts. At least 16 characters, and Pratique warns below 32. With OIDC, SAML or LDAP set and this unset, no admin token exists.
PRATIQUE_CLIENT_TOKENSaccess.client_tokensNoneCI identities, as name:token pairs separated by commas. In the file, a map of name to token. Each token needs at least 16 characters.
PRATIQUE_REQUIRE_TOKENSaccess.require_tokensfalseRequire a client token on a local address too.
PRATIQUE_RESERVEDaccess.reservedNoneInternal name patterns, such as @acme/*,acme-*. Reserved names are never looked up upstream.
PRATIQUE_CLAIM_NEEDS_TEAMaccess.claim_needs_teamfalseStop someone with no team claiming a new project or build name.

Clients can connect without a token only when the server is entirely local: a loopback listen address, a local public URL, PRATIQUE_TRUST_PROXY off, no client tokens in the environment or file, and PRATIQUE_REQUIRE_TOKENS off. A wrong token is always refused.

Sign-in

Variablepratique.yamlDefaultPurpose
PRATIQUE_OIDC_ISSUERsso.issuerNoneTurns on OIDC single sign-on. Also needs the client ID, client secret and allow list.
PRATIQUE_OIDC_CLIENT_IDsso.client_idNoneOIDC client ID.
PRATIQUE_OIDC_CLIENT_SECRETsso.client_secretNoneOIDC client secret.
PRATIQUE_OIDC_ALLOWEDsso.allowedNoneEmails or @domains that may sign in. Required with OIDC.
PRATIQUE_OIDC_TRUST_EMAILsso.trust_emailfalseAccept an email without the email_verified claim, for providers such as Microsoft Entra ID that leave it out.
PRATIQUE_ADMINSsso.adminsNoneEmails with the admin role.
PRATIQUE_ADMIN_GROUPSsso.admin_groupsNoneIdentity provider groups, from SAML, LDAP or SCIM, with the admin role.
PRATIQUE_SAML_METADATAsso.saml.metadataNoneTurns on SAML sign-in. A URL or file with the identity provider's metadata.
PRATIQUE_SAML_ENTITY_IDsso.saml.entity_idThe public URL and /auth/saml/metadataPratique's SAML entity ID.
PRATIQUE_LDAP_URLsso.ldap.urlNoneTurns on LDAP sign-in, such as ldaps://ldap.example.com. Also needs the user base.
PRATIQUE_LDAP_BIND_DNsso.ldap.bind_dnNoneThe account Pratique binds as to search for users.
PRATIQUE_LDAP_BIND_PASSWORDsso.ldap.bind_passwordNoneThat account's password.
PRATIQUE_LDAP_USER_BASEsso.ldap.user_baseNoneWhere to search for users, such as ou=people,dc=example,dc=com.
PRATIQUE_LDAP_USER_FILTERsso.ldap.user_filter(|(mail={login})(uid={login}))The search filter. Must contain {login}.
PRATIQUE_LDAP_EMAIL_ATTRsso.ldap.email_attrmailThe attribute that holds the email address.
PRATIQUE_LDAP_CAsso.ldap.caNoneA CA certificate file for the LDAP server.
PRATIQUE_SCIM_TOKENsso.scim.tokenNoneTurns on SCIM provisioning at /scim/v2/. At least 32 characters.
PRATIQUE_SCIM_REQUIREDsso.scim.requiredfalseOnly people provisioned through SCIM may sign in. Needs the SCIM token.

See sign-in for setup steps and roles.

Storage

Variablepratique.yamlDefaultPurpose
PRATIQUE_DATABASE_URLstorage.database_urlSQLite in PRATIQUE_DATAA postgres:// or postgresql:// URL. Needed for more than one instance.
PRATIQUE_S3_BUCKETstorage.s3.bucketLocal diskStore package files in this S3 bucket. Needed for more than one instance. Refused in firewall mode.
PRATIQUE_S3_ENDPOINTstorage.s3.endpoints3.amazonaws.comHost of an S3-compatible service.
PRATIQUE_S3_REGIONstorage.s3.regionNoneBucket region.
PRATIQUE_S3_PREFIXstorage.s3.prefixNoneKey prefix inside the bucket.
PRATIQUE_S3_ACCESS_KEYstorage.s3.access_keyAWS credential chainStatic S3 access key.
PRATIQUE_S3_SECRET_KEYstorage.s3.secret_keyAWS credential chainStatic S3 secret key.
PRATIQUE_S3_INSECUREstorage.s3.insecurefalseConnect to S3 without TLS, for local testing only.

Upstreams

Change these to use an internal mirror.

Variablepratique.yamlDefaultPurpose
PRATIQUE_NPM_UPSTREAMupstreams.npmhttps://registry.npmjs.orgThe npm registry.
PRATIQUE_PYPI_UPSTREAMupstreams.pypihttps://pypi.orgThe Python package index.
PRATIQUE_PYPI_FILESupstreams.pypi_fileshttps://files.pythonhosted.orgWhere Python package files are downloaded from.
PRATIQUE_PACKAGIST_URLupstreams.packagisthttps://repo.packagist.orgThe Composer repository.
PRATIQUE_PACKAGIST_APIupstreams.packagist_apihttps://packagist.orgThe Packagist API.
PRATIQUE_COMPOSER_DIST_HOSTSupstreams.composer_dist_hostscodeload.github.com,api.github.com,gitlab.com,bitbucket.orgHosts that Composer archives may come from.
PRATIQUE_GO_UPSTREAMupstreams.gohttps://proxy.golang.orgThe Go module proxy.
PRATIQUE_GO_SUMDBupstreams.go_sumdbhttps://sum.golang.orgThe Go checksum database.

Threat data

Variablepratique.yamlDefaultPurpose
PRATIQUE_OSV_URLthreat_feeds.osv.urlhttps://api.osv.devThe OSV API, queried per package.
PRATIQUE_OSV_FEED_URLthreat_feeds.osv.feed_urlhttps://osv-vulnerabilities.storage.googleapis.comThe OSV change feed, read every 5 minutes.

To turn OSV off, or to add your own feeds, use threat_feeds.osv.enabled and threat_feeds.custom in the file. They have no environment variable. See threat feeds.

Alerts, metrics and audit

Variablepratique.yamlDefaultPurpose
PRATIQUE_WEBHOOK_URLserver.webhook_urlNoneAlerts for incidents, exception requests, AI assessments and holds, and the daily audit anchor.
PRATIQUE_METRICS_TOKENserver.metrics_tokenNoneTurns on /metrics, for requests that send this token.
PRATIQUE_EVENTS_DAYS0 (keep forever)Removes audit events older than this many days, once a day. verify-log still works. See keep events for a limited time.
PRATIQUE_AUDIT_KEYserver.audit_keyNoneSigns the audit log. Create it with pratique audit-keygen.

See monitoring and audit log.

Command-line tools

These variables are read by the CI subcommands, not by the server.

VariableUsed byPurpose
PRATIQUE_TOKENinventory, build recordThe access token, when --token is not given.
PRATIQUE_PUBLIC_URLlockcheck, inventory, build recordThe default for --registry.
PRATIQUE_BINThe pratique-connect install scriptWhere to install the tool. The default is ~/.local/bin.
NETRC, NPM_CONFIG_USERCONFIGpratique-connectOther paths for .netrc and .npmrc.

Startup errors

Pratique checks the settings at startup and stops with a message that names the problem. Common ones:

  • "PRATIQUE_PUBLIC_URL is required on a non-loopback address, because clients download from it"
  • "PRATIQUE_ADMIN_TOKEN must be at least 16 characters"
  • "PRATIQUE_OIDC_ISSUER also needs PRATIQUE_OIDC_ALLOWED, such as @example.com"
  • "PRATIQUE_QUARANTINE must be a duration from 0h to 8760h0m0s"
  • "firewall mode keeps no package files, so remove the S3 storage settings"
  • "the environment variable X isn't set. Set it, or remove the setting that uses it", for a ${VAR} in the file