設定

構成シード、設定の保存場所、git と ytt

  1. 例
  2. config.yaml の読み込み元
  3. 変数

設定の取得元(構成シード、データベース、git、ytt テンプレート)を決めるには、これらを変更します。


例

マウントした構成シードを適用して 5 分ごとに確認し、 config.yaml をデータベースに保持します。 docker-compose.yml では次のようにします。

    environment:
      - CONFIG_SEED_PATH=/seed/seed.yaml
      - "CONFIG_SEED_RELOAD_CRON=*/5 * * * *"
      - ENABLE_CONFIG_IN_DATABASE=1
      - ALLOW_ENV_EDIT=0              # the environment is declared here, not on the settings pages
    volumes:
      - ./seed:/seed:ro

シードが無効な場合、サーバーは起動しません。ファイル形式については 構成シード を参照してください。


config.yaml の読み込み元

カテゴリ、ロール、定数は、ディスク上の config.yaml またはデータベース内のそのコピーから取得され、次の順で決まります。

  1. ENABLE_CONFIG_IN_DATABASE が環境または設定ページの 設定 タブで 設定されている場合はそれに従います。 1 はデータベースを、 0 はファイルを読み込みます。
  2. そうでない場合は、データベースに保存されている設定の取得元( file または database )。6.3.0 より前に構築したインスタンスが 設定ページで選んだものです。
  3. そうでない場合は、 CONFIG_PATH にあるファイルです。

7.8.0 以降、リポジトリが保持するキーはこの基本設定の上に重ねられます。用途の種類 ロール 、 カテゴリ 、 定数 を持つ リポジトリが、 controller_roles: 、 controller_categories: 、 controller_constants: を持つファイルからそのキーを提供し、 なければその config.yaml (非推奨)から提供します。 git での設定 を参照してください。

明示的に設定された ENABLE_CONFIG_IN_DATABASE は常に優先され、保存されている database よりも 0 が優先されます。設定を 読み込むたびに読まれるので、変更は再起動なしで反映されます。 ステータス ページの 情報 タブに、使われている取得元が表示されます。

データベース内のコピーは settings テーブルの config_yaml 列で、7.6.0 より前は forms_yaml という名前でした。アップグレードで名前が 変わり、内容はそのまま残ります。 GET /api/v2/settings/config はこれを config_yaml として返し、非推奨の forms_yaml としても返します。


変数

このグループのすべての変数と、その型、既定値、説明:

変数 選択肢/既定値 説明
CONFIG_SEED_PATH
string
added in version 6.3.0
既定値:

Config seed file
a valid file path

Path to a declarative config seed. When set, the yaml file it points to is applied at startup and the admin objects it declares become read-only in the interface, so a whole instance can be rebuilt from git on an empty database. Secrets are referenced as ${ENV_VAR} and resolved from the environment, so the file itself holds none. Unrelated to CONFIG_PATH, which holds the forms configuration. An invalid seed makes the server refuse to start, and so does a path whose file is missing (a mounted file may only be late). Leaving it empty turns the seed off: the next start releases every object an earlier seed made read-only, keeping its values, so it can be changed in the interface again. See the Config seed page in the documentation.

CONFIG_SEED_RELOAD_CRON
string
added in version 7.8.0
既定値:
* * * * *

Config seed reload schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Config seed reload system task runs: it checks the config seed file (CONFIG_SEED_PATH) and applies it again when its content has changed. This is what lets a seed edited in git take effect without restarting: on kubernetes a ConfigMap is remounted under the running pod within about a minute and the change is picked up from there. A reload that fails is never fatal, unlike the one at startup: the configuration already in force is kept and the Status page reports it. Without CONFIG_SEED_PATH the task is off. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only. Replaces CONFIG_SEED_RELOAD_SECONDS, still read when this one is not set.

CONFIG_SEED_RELOAD_SECONDS
integer
added in version 6.3.0

Config seed reload interval (seconds) (deprecated)
0 or a number of seconds

Deprecated: use CONFIG_SEED_RELOAD_CRON ; removed in 8.0. Still read when CONFIG_SEED_RELOAD_CRON is not set, as a cron, with a warning in the log at start ; when both are set, CONFIG_SEED_RELOAD_CRON wins. 60 reads as * * * * *, a multiple of 60 up to 3600 as */N * * * * in minutes (3600 as 0 * * * *), a number under 60 that divides 60 as */N * * * * * in seconds, and 0 still turns the reload off. Any other number reads as the nearest of these, which the log says. The task’s page shows the cron it reads as, read only until a cron is saved there, which writes CONFIG_SEED_RELOAD_CRON. Ignored when CONFIG_SEED_PATH is empty.

ALLOW_ENV_EDIT
boolean
added in version 6.3.0
既定値:
1

Allow editing these settings
0, 1

Whether the settings pages may write persistent/.env. Set it to 0 in a declarative deployment (kubernetes, docker-compose, ArgoCD): there the file is either ephemeral, so a save is silently lost at the next restart, or durable, so it drifts away from the manifest that is meant to be authoritative. With 0 every variable is shown with its value in force but cannot be changed, and the save endpoint refuses. The config seed’s own mcp: section and the language and Designer link of its defaults: and links: sections are still applied: the seed is the declaration this setting stands for.

ENABLE_CONFIG_IN_DATABASE
number
added in version 6.1.0
選択肢:
  • 0 (既定)
  • 1

Store the configuration in the database
0, 1

If you use git repositories to store the forms, you can choose to store the master config.yaml in git as well.
Or, you can choose to have the config.yaml in the database instead. Having a clean separation: master config.yaml in database, and the actual forms in git.

This gives the config.yaml in the database the highest priority in the loading order.

GIT_CLONE_COMMAND
string
added in version 6.0.2
既定値:
git clone

Git clone command
a valid git clone command

The command used to clone git repositories. Note that branch and repository will be auto added.

GIT_PULL_COMMAND
string
既定値:
git pull

Git pull command
a valid git pull command

The command used to pull git repositories. Note that branch and repository will be auto added.

GIT_PUSH_COMMAND
string
既定値:
git push

Git push command
a valid git push command

The command used to push git repositories (used by the designer’s sync to git feature). Note that -u origin HEAD will be auto added.

USE_YTT
number
added in version 5.0.2
選択肢:
  • 0 (既定)
  • 1

Enable the ytt interpreter
0, 1

https://github.com/carvel-dev/ytt is a tool for yaml templating. It can be activated by this variable.

YTT_ALLOW_SYMLINK_DESTINATIONS
string
added in version 5.0.8
既定値:

ytt allowed symlink destinations
valid paths

Ytt disables templating with symlinks by default. If you want to allow symlink use on specific directories, this variable can be set to the path(s) where the symlinks are allowed (multiple paths separated by Node’s path.delimiter). Note: enabling this may come with some risks, see ytt FAQ for more info.

YTT_DANGEROUS_ALLOW_ALL_SYMLINK_DESTINATIONS
number
added in version 5.0.8
選択肢:
  • 0 (既定)
  • 1

ytt dangerous allow-all symlink destinations
0, 1

Ytt disables templating with symlinks by default. If you want to allow all symlink use EVERYWHERE, you can set this variable to 1. Note: enabling this comes with some risks (hence the ‘DANGEROUS’ part), see ytt FAQ for more info.

YTT_VARS_PREFIX
string
added in version 5.0.8
既定値:

ytt vars prefix
a valid prefix

Environment variable prefix for ytt to get data values from. For example, when set to MY_PREFIX, MY_PREFIX_my_var=value results to the ytt data value my_var=value.

YTT_LIB_DATA_{dynamic}
string
added in version 5.0.8
既定値:

ytt lib data
a valid lib data value

This is not a single variable but rather an infinite amount of variables. You can set as many as you want. The dynamic part is the name of the lib data. For example YTT_LIB_DATA_MYLIB=values.yml results in the contents of values.yml to be used by ytt in the mylib library.