<div class="gmail_quote">On Wed, Aug 8, 2012 at 8:58 AM, Laurens Van Houtven <span dir="ltr">&lt;<a href="mailto:_@lvh.cc" target="_blank">_@lvh.cc</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have a bunch of configuration for my service. Things like endpoints, location of the root axiom store… Right now I grab these from the environment. That means that my twistd IServiceMaker plugin&#39;s options is pretty much by definition empty.<br>

<br>
I&#39;m wondering if more mature twistd users have already learned the hard way what the best way to manage this is. I see three possible solutions:<br>
<br>
1. environment variables as I use them now: portable, simple.<br>
2. command line options: still pretty portable and simple. additional benefit: easy discoverability of options<br>
3. axiom store: has the benefit that there&#39;s a single source of truth for everything, i.e. I copy a store and I can recreate the service based on that store exactly, using just the store<br>
<br></blockquote><div><br></div><div>Never, ever store config data and user data in the same place.  Likewise, if you&#39;re going to persist config data, it should be in some kind of plain text format.</div><div><br></div>
<div>1) and 2) are fine, though I prefer a simple text file format as well, and I like to have multiple levels of configuration which are overridable.</div><div><br></div><div>e.g.</div><div>one or more config files (maybe in /etc, in /home/&lt;user&gt;, the pwd) which override each other in a specified manner, which are in turn overridable by command line options and/or env vars</div>
<div><br></div><div>whether any of this is appropriate for your case, and how much complexity you need obviously depends on your application</div><div><br></div><div>Kevin Horn</div></div>