nshou / elasticsearch-kibana

Simple and lightweight docker image for previewing Elasticsearch and Kibana.
https://hub.docker.com/r/nshou/elasticsearch-kibana
MIT License
46 stars 24 forks source link

support for passing a custom password #25

Closed dkezri closed 1 year ago

dkezri commented 1 year ago

is there any way to pass a custom password for elastic instead of running elastic_reset_password?

txj-xyz commented 1 year ago

Currently at the moment the elastic-reset-password tool will handle making the system user password at start up, you cannot pass a username/password into the main system user for Elasticsearch.

Once the elastic user password has been changed you can make multiple other users after its booted.

Alternatively See: https://www.elastic.co/guide/en/elasticsearch/reference/current/change-passwords-native-users.html

dkezri commented 1 year ago

Thank you @txj-xyz , i tested it by adding the following commands in entrypoint.sh line 137 and it worked fine to create another custom user:

  if [[ -n "${CUSTOM_USER}" ]] && [[ -n "${CUSTOM_PASS}"  ]]; then
            elasticsearch-${EK_VERSION}/bin/elasticsearch-users useradd $CUSTOM_USER -p $CUSTOM_PASS -r superuser
  fi
dkezri commented 1 year ago

Done !

txj-xyz commented 1 year ago

Awesome stuff!