long2ice / meilisync

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

Support env variables in config.yml file #82

Open matinone opened 9 months ago

matinone commented 9 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