long2ice / meilisync

Realtime sync data from MySQL/PostgreSQL/MongoDB to Meilisearch
https://github.com/long2ice/meilisync
Apache License 2.0
260 stars 40 forks source link

Support env variables in config.yml file #82

Open matinone opened 8 months ago

matinone commented 8 months ago

With these changes, it would be possible to parse a YAML file with env variables with the format ${VARIABLE_NAME}, like the following one:

progress:
  type: file
meilisearch:
  api_url: ${MEILISEARCH_API_URL}
  api_key: ${MEILISEARCH_API_KEY}
source:
  type: mysql
  host: ${DB_HOST}
  port: ${DB_PORT}
  database: ${DB_DATABASE}
  user: ${DB_USER}
  password: ${DB_PASSWORD}
sync:
  - table: ${TABLE_NAME}
    index: ${INDEX_NAME}
    pk: id