meilisearch / meilisearch-kubernetes

Meilisearch on Kubernetes Helm charts and manifests
https://www.meilisearch.com
MIT License
212 stars 59 forks source link

Generate secret key automatically for production environment if one is not provided #19

Closed deshetti closed 3 years ago

deshetti commented 4 years ago

When environment.MEILI_ENV is set to production it is documented that environment.MEILI_MASTER_KEY is required.

If one is not provided, it should generate the key automatically

eskombro commented 4 years ago

If it is automatically generated, how would the user have access to it?

We could also think on a flow where deployment would fail if you defined environment.MEILI_ENV to production without setting up a master key

deshetti commented 3 years ago

@eskombro sorry for the delayed response.

I was thinking we should create a kubernetes secret if a value is not provided and assign the value to environment.MEILI_MASTER_KEY. After the installation user will have to get the value from the secret file. In fact, most helm charts follow this process.

_We could also think on a flow where deployment would fail if you defined environment.MEILIENV to production without setting up a master key I thought about this as well and it should be easy to implement. This would be throwaway if the secret file could be generated automatically as I mentioned above and hence did not implement this.

I am a bit busy for the next couple of weeks, but I can give it a shot after if no one else takes this up meanwhile.

eskombro commented 3 years ago

I was thinking we should create a kubernetes secret if a value is not provided and assign the value to environment.MEILI_MASTER_KEY. After the installation user will have to get the value from the secret file. In fact, most helm charts follow this process.

In that case, wouldn't it be possible to run a MeiliSearch instance in development environment? Or this would apply only when a production environment is set?

I am a bit busy for the next couple of weeks, but I can give it a shot after if no one else takes this up meanwhile.

Amazing! That would be great, feel free to take it if you have some time and we haven't started working on it :)