Skip to content

config.context: define cluster config parts in env/file #3954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Dec 20, 2023 · 0 comments · Fixed by #4035
Closed

config.context: define cluster config parts in env/file #3954

TarantoolBot opened this issue Dec 20, 2023 · 0 comments · Fixed by #4035
Assignees

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 20, 2023

Related dev. issue(s): tarantool/tarantool#9506
Parent doc issue: #3666

Product: Tarantool
Since: 3.0
Root document:

SME: @ Totktonada

Details

Example:

config:
  context:
    replicator_password:
      from: file
      file: secrets/replicator_password.txt
      rstrip: true
    client_password:
      from: file
      file: secrets/client_password.txt
      rstrip: true

credentials:
  users:
    replicator:
      password: '{{ context.replicator_password }}'
      roles: [replication]
    client:
      password: '{{ context.client_password }}'
      roles: [super]

The new config.context section allows a user to define its own
variables, whose content resides in an environment variable or a file.

The primary usage is to extract passwords from the configuration.

All the variables are defined in config.context section as keys. Each
key is a record with the following fields.

  • from: either env or file
  • file: a file path
  • env: an environment variable name
  • rstrip: whether to strip whitespace characters from the end of the
    data (it strips newlines too)

A relative file path is interpreted as relative to process.work_dir.

from is mandatory, file is mandatory when from is file, env is
mandatory when from is env, rstrip is optional.

If there is no given file or no given environment variable, an error of
a configuration applying is reported.

Requested by @ Totktonada in tarantool/tarantool@830578c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants