product:config
Table of contents
- Introduction
- Filtering the keys
- Where each key comes from
- Spotting overwritten keys
- Spotting drift
- Secrets
- Where it runs
- Reference
- See also
Introduction
product:config shows the configuration your product runs with, and where each key comes from. Use it when a value is not the one you expected. It needs a selected product (SPLENT_APP).
splent product:config
my_first_app [dev] 2 feature(s) injecting config
KEY VALUE SOURCE
──────────────────────────────────────────────────────────────────────────────────────────────────────────
REDIS_URL 'redis://splent_feature_cache:6379' feature (splent_feature_cache)
SESSION_PERMANENT False feature (splent_feature_sessions_in_cache)
SESSION_TYPE 'redis' feature (splent_feature_sessions_in_cache)
SQLALCHEMY_DATABASE_URI 'mysql+pymysql://user:****@db:3306/app_db' framework default
SQLALCHEMY_TRACK_MODIFICATIONS False framework default
TIMEZONE 'Europe/Madrid' framework default
UPLOAD_FOLDER 'uploads' framework default
Secret values are masked, use --show-secrets to reveal them.
Filtering the keys
splent product:config --feature cache
splent product:config --key session
--feature keeps the keys whose source names that feature. --key keeps the keys that contain the text, whatever its case.
--all adds Flask’s internal keys, such as SECRET_KEY (masked) and SESSION_COOKIE_NAME.
Where each key comes from
The framework records the source of every key as it builds the configuration. See Configuration for how the layers stack.
| Source | The key was set by |
|---|---|
framework default |
The framework’s default_config.py |
feature (<name>) |
The feature’s inject_config(app) |
feature (<name>) default |
The default of a parameter the feature declares in [tool.splent.config_schema] |
product (<name>) |
Your product’s config.py |
product pyproject ([tool.splent.config]) |
A parameter your product sets in its pyproject.toml. The menu and CSP tables show as [tool.splent.layout.menu] and [tool.splent.csp] |
operator environment |
The environment, against what the product and the defaults said |
flask default |
Flask itself. Only with --all |
Spotting overwritten keys
When a feature replaces a key another feature set, or brings the environment’s value for a key the product chose, an Overwritten keys section shows the old value with its source, then the new one.
A feature’s default never replaces what your product’s config.py chose. The product’s value is put back and keeps the product as its source.
Spotting drift
⚠ Drift, the environment overrides what the product decided:
NOTES_PAGE_SIZE: 50 (product pyproject ([tool.splent.config])) → 20 (operator environment)
A key the environment decided against your product’s choice, in its config.py or, for a derivation parameter, in its [tool.splent.config] or the feature’s default, is listed under Drift. The environment’s value stands.
It usually means the deployment’s .env forces something, or docker/.env was not merged again with product:env --merge after the product changed.
Secrets
A key whose name contains SECRET, PASS, PWD, TOKEN, KEY or CREDENTIAL is masked, and so is one a feature’s schema marks type = "secret", whatever its name. The password inside any URI becomes **** too.
A value shorter than 12 characters prints as ****. A longer one keeps at most its first and last four characters, and never more than a quarter of it.
splent product:config --show-secrets
--show-secrets prints everything in plain text.
Where it runs
The command builds your product’s app, in development unless SPLENT_ENV says otherwise.
It runs in the product’s web container, <product>_web, when that container is up and either you work on another product than the selected one (SPLENT_APP=<name> splent product:config) or the features need a package the CLI’s image lacks. Otherwise it runs in the CLI’s container.
Reference
| Option | Description |
|---|---|
--all |
Include Flask’s internal keys |
--feature NAME |
Only the keys this feature set |
--key TEXT |
Only the keys that contain TEXT |
--show-secrets, --no-mask |
Print secrets in plain text |
See also
product:paramsshows the declared parameters without building the app.product:routeslists the routes by feature.product:validatevalidates the product against its UVL model.