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
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_CONFIG | None | Path to pratique.yaml, the same as --config. | |
PRATIQUE_LISTEN | server.listen | 127.0.0.1:8484 (0.0.0.0:8484 in the Docker image) | The address and port to listen on. |
PRATIQUE_PUBLIC_URL | server.public_url | http:// or https:// and the listen address | The URL clients use. Required when the listen address is not a loopback address. Must start with https:// when Pratique serves HTTPS. |
PRATIQUE_MODE | server.mode | artifactory | firewall keeps no package files and hosts no private packages. See firewall mode. |
PRATIQUE_TLS_CERT | server.tls_cert | None | Certificate chain file. Pratique then serves HTTPS. A renewed file is picked up without a restart. |
PRATIQUE_TLS_KEY | server.tls_key | None | Private key file. Set both TLS settings or neither. |
PRATIQUE_DATA | server.data_dir | ./data (/data in the Docker image) | The SQLite database, package files and temporary files. |
PRATIQUE_TRUST_PROXY | server.trust_proxy | false | Read 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_DELAY | 0s | On shutdown, fail /readyz for this long before stopping, so a load balancer moves traffic first. Up to 5m. See upgrade without downtime. | |
PRATIQUE_CLIENTS_DIR | None (/clients in the Docker image) | The folder of pratique-connect builds served at /connect/download/. See one-command setup. | |
PRATIQUE_QUARANTINE | quarantine.default | 168h | The 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
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_ADMIN_TOKEN | server.admin_token | Generated each run when no sign-in method is set | Break-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_TOKENS | access.client_tokens | None | CI 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_TOKENS | access.require_tokens | false | Require a client token on a local address too. |
PRATIQUE_RESERVED | access.reserved | None | Internal name patterns, such as @acme/*,acme-*. Reserved names are never looked up upstream. |
PRATIQUE_CLAIM_NEEDS_TEAM | access.claim_needs_team | false | Stop 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
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_OIDC_ISSUER | sso.issuer | None | Turns on OIDC single sign-on. Also needs the client ID, client secret and allow list. |
PRATIQUE_OIDC_CLIENT_ID | sso.client_id | None | OIDC client ID. |
PRATIQUE_OIDC_CLIENT_SECRET | sso.client_secret | None | OIDC client secret. |
PRATIQUE_OIDC_ALLOWED | sso.allowed | None | Emails or @domains that may sign in. Required with OIDC. |
PRATIQUE_OIDC_TRUST_EMAIL | sso.trust_email | false | Accept an email without the email_verified claim, for providers such as Microsoft Entra ID that leave it out. |
PRATIQUE_ADMINS | sso.admins | None | Emails with the admin role. |
PRATIQUE_ADMIN_GROUPS | sso.admin_groups | None | Identity provider groups, from SAML, LDAP or SCIM, with the admin role. |
PRATIQUE_SAML_METADATA | sso.saml.metadata | None | Turns on SAML sign-in. A URL or file with the identity provider's metadata. |
PRATIQUE_SAML_ENTITY_ID | sso.saml.entity_id | The public URL and /auth/saml/metadata | Pratique's SAML entity ID. |
PRATIQUE_LDAP_URL | sso.ldap.url | None | Turns on LDAP sign-in, such as ldaps://ldap.example.com. Also needs the user base. |
PRATIQUE_LDAP_BIND_DN | sso.ldap.bind_dn | None | The account Pratique binds as to search for users. |
PRATIQUE_LDAP_BIND_PASSWORD | sso.ldap.bind_password | None | That account's password. |
PRATIQUE_LDAP_USER_BASE | sso.ldap.user_base | None | Where to search for users, such as ou=people,dc=example,dc=com. |
PRATIQUE_LDAP_USER_FILTER | sso.ldap.user_filter | (|(mail={login})(uid={login})) | The search filter. Must contain {login}. |
PRATIQUE_LDAP_EMAIL_ATTR | sso.ldap.email_attr | mail | The attribute that holds the email address. |
PRATIQUE_LDAP_CA | sso.ldap.ca | None | A CA certificate file for the LDAP server. |
PRATIQUE_SCIM_TOKEN | sso.scim.token | None | Turns on SCIM provisioning at /scim/v2/. At least 32 characters. |
PRATIQUE_SCIM_REQUIRED | sso.scim.required | false | Only people provisioned through SCIM may sign in. Needs the SCIM token. |
See sign-in for setup steps and roles.
Storage
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_DATABASE_URL | storage.database_url | SQLite in PRATIQUE_DATA | A postgres:// or postgresql:// URL. Needed for more than one instance. |
PRATIQUE_S3_BUCKET | storage.s3.bucket | Local disk | Store package files in this S3 bucket. Needed for more than one instance. Refused in firewall mode. |
PRATIQUE_S3_ENDPOINT | storage.s3.endpoint | s3.amazonaws.com | Host of an S3-compatible service. |
PRATIQUE_S3_REGION | storage.s3.region | None | Bucket region. |
PRATIQUE_S3_PREFIX | storage.s3.prefix | None | Key prefix inside the bucket. |
PRATIQUE_S3_ACCESS_KEY | storage.s3.access_key | AWS credential chain | Static S3 access key. |
PRATIQUE_S3_SECRET_KEY | storage.s3.secret_key | AWS credential chain | Static S3 secret key. |
PRATIQUE_S3_INSECURE | storage.s3.insecure | false | Connect to S3 without TLS, for local testing only. |
Upstreams
Change these to use an internal mirror.
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_NPM_UPSTREAM | upstreams.npm | https://registry.npmjs.org | The npm registry. |
PRATIQUE_PYPI_UPSTREAM | upstreams.pypi | https://pypi.org | The Python package index. |
PRATIQUE_PYPI_FILES | upstreams.pypi_files | https://files.pythonhosted.org | Where Python package files are downloaded from. |
PRATIQUE_PACKAGIST_URL | upstreams.packagist | https://repo.packagist.org | The Composer repository. |
PRATIQUE_PACKAGIST_API | upstreams.packagist_api | https://packagist.org | The Packagist API. |
PRATIQUE_COMPOSER_DIST_HOSTS | upstreams.composer_dist_hosts | codeload.github.com,api.github.com,gitlab.com,bitbucket.org | Hosts that Composer archives may come from. |
PRATIQUE_GO_UPSTREAM | upstreams.go | https://proxy.golang.org | The Go module proxy. |
PRATIQUE_GO_SUMDB | upstreams.go_sumdb | https://sum.golang.org | The Go checksum database. |
Threat data
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_OSV_URL | threat_feeds.osv.url | https://api.osv.dev | The OSV API, queried per package. |
PRATIQUE_OSV_FEED_URL | threat_feeds.osv.feed_url | https://osv-vulnerabilities.storage.googleapis.com | The 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
| Variable | pratique.yaml | Default | Purpose |
|---|---|---|---|
PRATIQUE_WEBHOOK_URL | server.webhook_url | None | Alerts for incidents, exception requests, AI assessments and holds, and the daily audit anchor. |
PRATIQUE_METRICS_TOKEN | server.metrics_token | None | Turns on /metrics, for requests that send this token. |
PRATIQUE_EVENTS_DAYS | 0 (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_KEY | server.audit_key | None | Signs the audit log. Create it with pratique audit-keygen. |
Command-line tools
These variables are read by the CI subcommands, not by the server.
| Variable | Used by | Purpose |
|---|---|---|
PRATIQUE_TOKEN | inventory, build record | The access token, when --token is not given. |
PRATIQUE_PUBLIC_URL | lockcheck, inventory, build record | The default for --registry. |
PRATIQUE_BIN | The pratique-connect install script | Where to install the tool. The default is ~/.local/bin. |
NETRC, NPM_CONFIG_USERCONFIG | pratique-connect | Other 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