Configurable readonlyrest.yml location

:bulb: Configurable readonlyrest.yml location

Would it be possible to introduce a feature that would allow the location of readonlyrest.yml to be somewhere different to the default location? Perhaps by having a location specificed in an environment variable, for example?

Main reason for this in my use case is to do with running ES in Docker and the way files/volumes are mapped into containers. If I could put ROR config into a separate location it would be easier to map in in such a way that I could easily push updates to containers. Appreciate this reason is very specific to my own setup, but others may also have different reasons for why they would want to be able explicitly specify config location.

Hello @aidofitz, at the moment readonlyrest.yml location is worked out by checking where the elasticsearch.yml lives.

Good news is that you canalter that path using an env var before running ES.

@sscarduzio what about com.readonlyrest.settings.file.path env?

The name you proposed looks like a java option, which beings me to the wuestion should we make it an ENV or java option? When should we have java options vs ENV vars in genral?

I see this JVM env in code, so it seems that we can set it when we start ES. For user it’s easier to set system env vars (eg. for docker containers), so IMO we should not use JVM env vars in general.

1 Like

I completely forgot about writing that code, good catch!

Thanks, I used the com.readonlyrest.settings.file.path setting and it worked perfectly.

2 Likes