telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Add docker secrets support for TELEGRAM_API_HASH and TELEGRAM_API_ID

Open jieggii opened this issue 1 year ago • 1 comments

Hi, Thank you for maintaining this useful Docker image!

I would like to propose adding TELEGRAM_API_HASH_FILE and TELEGRAM_API_ID_FILE environmental variables support to this image, so that users could provide a path to a docker secret file mounted to the running container instead of providing those sensitive values as environmental variables.

For example, instead of setting

  • TELEGRAM_API_HASH to the actual API hash and
  • TELEGRAM_API_ID to the actual API ID,

image users could create docker secrets for those sensitive values and set

  • TELEGRAM_API_HASH_FILE to /run/secrets/telegram_api_hash and
  • TELEGRAM_API_ID_FILE to /run/secrets/telegram_api_id.

This approach is pretty common in some database images: for example, Postgres and Mongo images enable users to use such environmental variables as POSTGRES_USER_FILE, POSTGRES_PASSWORD_FILE, MONGO_INITDB_ROOT_USERNAME_FILE and so on to handle sensitive data securely.

If the maintainer supports this proposal, I’m happy to contribute to implementing it.

jieggii avatar Aug 04 '24 14:08 jieggii

It would be nice to have this feature

JrooTJunior avatar Aug 04 '24 22:08 JrooTJunior