<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="82878" data-post-id="82878">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="86" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>I think I am missing the context here. How and where would the wiring of the system environment/external json/etc with the system happen?</p>
</blockquote>
</aside>
<p>It all depends on the stage, I alluded to it in a prior post among the noise but essentially there would be stages that could all be handled by the same module but different functions are allowed only at different times with appropriate fallbacks to prior stages if warranted, that module would perform lookups via whatever plugins, with perhaps pre-built ones for things like the current config style or static configurations or environment variables or whatever else makes sense for standard, and people could plug in things for things like database lookups and more.  In addition it could really use a registration callback/message functionality for when run-time configs change, if this is not build in then third-party libraries will continue not doing anything on updates.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82878" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/94">Post #93</a>
	                </div>
	            </div>
              <div id="likers-container-82878" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82878"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #93"></div>
  </section>
</div>
    <div class="postbit" id="82882" data-post-id="82882">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks everyone for your feedback! <img src="https://forum.elixirforum.com/images/emoji/apple/heart.png?v=15" title=":heart:" class="emoji" alt=":heart:" loading="lazy" width="20" height="20"></p>
<p>We have learned a couple things from this discussion:</p>
<ol>
<li>
<p>It is probably simpler to tackle the introduction of <code>Application.Config</code> as a separate proposal as <code>Application.Config</code> has in itself the goal of decoupling configuration Mix, regardless of features that may be added or remove from the configuration API in the process</p>
</li>
<li>
<p>The proposal, as originally written, is not enough. Most agree that we need a more explicit mechanism to separate runtime/compile-time configuration. Although we do not necessarily agree on how hard this separation has to be or its API</p>
</li>
</ol>
<p>There are also more operational concerns regarding the semantics of a chosen solution. What happens if the <code>on_boot</code> callback fails? Can we do something about it? This is important on Nerves devices as you usually don’t want failing to boot to bring the VM down.</p>
<p>For now, I have decided to hold on moving this proposal forward. The reason is that, before we have minimal releases in Elixir itself, we won’t be sure on how to answer some of those questions. It may also be that, by adding releases to Elixir itself may solve some of those problems. For example, what if, once we add releases to Elixir, it becomes impossible to run <code>MIX_ENV=prod mix run</code> by default and instead it points you to a release? If this happens, the distinction between Mix and Releases is completely gone, at least for the prod environment. We are speculating here but the point still stands: without releases in Elixir, we cannot be 100% sure the direction we choose is the best way to go. So we will proceed on adding releases to Elixir and then hopefully this discussion can be brought back to life.</p>
<p>Once again, thanks for all the feedback. It was a fantastic discussion, as always.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82882" data-batch-url="/posts/batch_likers">
                        29
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/95">Post #94</a>
	                </div>
	            </div>
              <div id="likers-container-82882" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82882"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="82894" data-post-id="82894">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Adding releases in Elixir is the perfect way to know where you stand before making important decisions which may make the future migration even harder.</p>
<p>Good call! <img src="https://forum.elixirforum.com/uploads/default/original/2X/a/a1c41c89c299189a3f85edfeb4973563d8bac781.gif?v=15" title=":023:" class="emoji emoji-custom" alt=":023:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="82894" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/96">Post #95</a>
	                </div>
	            </div>
              <div id="likers-container-82894" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="82894"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #95"></div>
  </section>
</div>
    <div class="postbit" id="83115" data-post-id="83115">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dch" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dch/120/2682_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dch
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just putting a couple of belated thoughts into this thread for when we eventually circle back to it.</p>
<ol>
<li>
<p>My perception is that newcomers to the BEAM often miss the important point that there are compile-time settings at all. In particular, I’ve seen people try to ship API tokens and rabbitmq queue names using module attributes, and I’ve seen similar errors propagated in Mix.config. These fail to work well in a multi-node deployment scenario, and also it often causes problems during compilation phase when mix configs are changed but the dependency module itself doesn’t get recompiled as expected. There needs to be a clear separation between compile time and runtime configs.</p>
</li>
<li>
<p>In practice I’ve found that I build releases via distillery, injecting a fake sys.config &amp; vm.args into a single deployable package (like a container), and then use ansible to set those config files as required for runtime. This split between safe code and unsafe credentials is nicely enforced, but its in erlang format and IMO a bit too high a burden for the general developer-sysadmin combo one usually works with.</p>
</li>
<li>
<p>Don’t under-estimate the value of being able to query and set <em>at runtime</em> via <code>Application.get|set...</code> parameters. I use this for tuning a cache + API server that processes 80k transactions/hour where I don’t want to restart the VM and lose all that cached goodness. This is used to tweak supervisor and worker restart values, runtime tunables like http connection longevity and load balancer connections.</p>
</li>
<li>
<p>Purely for me, I find there are too many places and files to configure. A typical application has 10+ dependencies, some internal, some external, each with its own expectations of what goes where, and what’s exposed to users. I expect this is very intimidating for newcomers just trying to get that first application up and running.</p>
</li>
<li>
<p>I’m now a huge fan of passing runtime configuration, such as secrets and endpoints, through via tools like <code>etcd</code> and <code>vault</code>. This, in practice, means having a configuration system in elixir, that allows delegation to some other external system for retrieving parameters, that is independent of whatever a given module defines - callbacks, if you will. Most of these values will have a lifetime or expiration associated with them, and I’d like to kill off my workers when their tokens have expired, or when the configuration changes during runtime. Most of these things will be inside my own apps, so its reasonable to expect I own configuration and dealing with changes, but I’d at least like the config system to be able to handle this use case with me.</p>
</li>
<li>
<p>I would like to see, in the BEAM runtime, not in elixir, a standard way of retrieving a value from the App Env if set, or failing that, a given <code>environment variable</code>, and failing that, the <code>sys.config</code> file. Many of us run into this problem: rebar, rebar3, mix, relx, erlang.mk, and even emake for dependencies. The whole community benefits from a consistent way of handling these. This would then slowly be used consistently throughout the BEAM ecosystem. Of course, I’d really like to be able to write native elixir syntax in this file though, so not sure if I can have my cake and eat it too.</p>
</li>
<li>
<p>The reasoning for the above ordering is that these should roughly fall into:</p>
<ul>
<li>App env: fast lookup inside the runtime – you deliberately set this, or its already been retrieved from a lower/slower level and cached in the App env ETS tables for speed. I generally can afford retrieving this value every time a new worker or significant function in a gen_* is called.</li>
<li>environment variable – secret data –  if you passed this through, you’re probably trying to inject a secret token into the app at runtime. So let’s keep it secret, and not actually write these out to an intermediate file when using <code>REPLACE_OS_VARS</code> which is a bit of a shock the first time you see it</li>
<li><code>sys.config</code>: file lookups, or whatever the individual module/app thinks is a reasonable default. If you’ve gotten this far, the value is not already configured at a higher layer, and nor is it a secret nor dynamic. So give whatever we have lying around on disk, and assume it is a sensible default, and let it be cached for later.</li>
</ul>
</li>
</ol>
<p>Many thanks to the noble discussion above, I’ll need a couple more days to digest all the ideas people have put forth!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="83115" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/97">Post #96</a>
	                </div>
	            </div>
              <div id="likers-container-83115" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="83115"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #96"></div>
  </section>
</div>
    <div class="postbit" id="83623" data-post-id="83623">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tomekowal" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tomekowal/120/2847_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tomekowal
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That was a lengthy discussion!</p>
<p>My 3 cents. I love the initial <code>Application.Config</code> proposal. I felt like there is a circular dependency. Mix produces config depending on env. Config uses mix to import files. It gently pushes towards not using Mix in configs which is excellent for releases.</p>
<p>I’m not sure about the <code>on_boot</code> proposal.<br>
When I was starting with Phoenix, I wanted to configure port using ENV, and run two copies of my project to check some Erlang distributed. I compiled it once, copied to another folder and changed the environment variable. Of course, the port number was in the compiled artefact so that I couldn’t run the second instance.</p>
<p>When consulting at Bleacher Report, they had a similar problem. They wanted to build the binary once and then configure it via env variables. I believe that was even before introducing <code>{:system, "ENV_VAR"}</code>.</p>
<p>My point is: users will still need to learn to put this stuff in right places, and <code>on_boot</code> isn’t much different for me from <code>runtime.prod.exs, runtime.dev.exs</code>. You still need to know where to put stuff, so it works as expected.</p>
<p>Newcomers need to learn how macros and compile-time evaluation work to configure the app. They also need to learn how library creator uses it. Is the setting read on each invocation or only during startup? If I modify port in the app env, will the app start accepting new connections on a different port or do I need to restart it?</p>
<p>My dream config would have three sections:</p>
<ul>
<li>stuff that lands in the binary with warnings in comments that reading from external sources might not work as expected</li>
<li>stuff that is evaluated when the application starts where you probably want to read from files or external sources</li>
<li>stuff that is evaluated on demand with a warning that costly operations are discouraged, so don’t read files here, read application environment.</li>
</ul>
<p>Then in the library code, one would invoke:</p>
<ul>
<li><code>Config.get_static_value</code></li>
<li><code>Config.get_startup_value</code></li>
<li><code>Config.get_on_demand_value</code></li>
</ul>
<p>With this approach, we could check at compile time how library uses the config and generate warnings like:<br>
“You are setting port value in on_demand section, but the library reads it only using <code>get_startup_value</code>. Consider putting the config in startup section”.</p>
<p>The downside is that it would encourage even more bloat in configs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="83623" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/98">Post #97</a>
	                </div>
	            </div>
              <div id="likers-container-83623" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="83623"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #97"></div>
  </section>
</div>
    <div class="postbit" id="84057" data-post-id="84057">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="JanStevens" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/JanStevens/120/3601_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  JanStevens
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In my current elixir applications I always resolve configuration at runtime with simpel function wrappers around <code>Application.get_env</code>. I mainly do this since I also use <a href="https://github.com/bitwalker/conform" rel="noopener nofollow ugc">conform</a> to have a human readable configuration file our Devops guy can provision and create using Chef / Ansible / … It also allows me to change my configuration file and dynamically apply it to my running application!</p>
<p>Another thing I would like to mention is that I always see two kinds of configuration:</p>
<ul>
<li>Glue configuration: This is configuration needed to stitch up your dependencies with your app (What is your phoenix endpoint), but also includes mocks and behaviour definition. This type of configuration is mostly done by the developer and never changed</li>
<li>Actual Configuration: DB passwords, http ports, secrets, keys, urls to other apps… this type of configuration is mostly done by devops teams</li>
</ul>
<p>I would love to see a seperation between Glue configuration / actual configuration, just my two cents on the matter</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="84057" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/99">Post #98</a>
	                </div>
	            </div>
              <div id="likers-container-84057" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="84057"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #98"></div>
  </section>
</div>
    <div class="postbit" id="94392" data-post-id="94392">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am going to resurrect this subject unless you mind as there are new things that just now popped up on my horizon.</p>
<p><a class="mention" href="/u/bitwalker" rel="nofollow">@bitwalker</a> released Distillery 2.0 (<a href="https://dockyard.com/blog/2018/08/23/announcing-distillery-2-0" class="inline-onebox" rel="noopener nofollow ugc">Announcing Distillery 2.0 - DockYard</a>) and it does tackle the issue of run-time configuration in rather elegant way.</p>
<p>They introduced concept of Config Providers (<a href="https://hexdocs.pm/distillery/2.0.8/config/runtime.html#config-providers" class="inline-onebox" rel="noopener nofollow ugc">Runtime Configuration - Distillery Documentation</a>) and you can actually write your own (<a href="https://hexdocs.pm/distillery/2.0.8/extensibility/config_providers.html" class="inline-onebox" rel="noopener nofollow ugc">Config Providers - Distillery Documentation</a>).</p>
<p>There is a Mix.Config provider that is dead easy to use. You just create rel/config/config.exs file with extracted all the runtime configuration that you want to take from say environment variables. You can execute Elixir code there safely, which means you can do <code>System.get_env("PORT") |&gt; String.to_integer()</code>, which was a pain to do with REPLACE_OS_VARS solution it used before.</p>
<p>Moreover, this config file does not have to be part of the release at all and you can just dump it on the server, having all the secrets directly inserted in it and it will never even sit in source code repository.</p>
<p>I like it very much. Not sure what your thoughts are <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> and the rest of Elixir team, but it does solve the runtime configuration issues for my use cases completely.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="94392" data-batch-url="/posts/batch_likers">
                        10
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/100">Post #99</a>
	                </div>
	            </div>
              <div id="likers-container-94392" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="94392"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #99"></div>
  </section>
</div>
    <div class="postbit" id="94524" data-post-id="94524">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hubertlepicki" data-post="100" data-topic="14302">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I like it very much. Not sure what your thoughts are <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> and the rest of Elixir team, but it does solve the runtime configuration issues for my use cases completely.</p>
</blockquote>
</aside>
<p>Thanks <a class="mention" href="/u/hubertlepicki" rel="nofollow">@hubertlepicki</a> for the follow-up.</p>
<p>One of the conclusions of this conversation was precisely “Most agree that we need a more explicit mechanism to separate runtime/compile-time configuration”. So I believe the direction Distillery 2.0 took of providing an explicit runtime configuration for releases is very much inline with the thoughts of the core team and of the community.</p>
<p>Excellent work from <a class="mention" href="/u/bitwalker" rel="nofollow">@bitwalker</a>!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="94524" data-batch-url="/posts/batch_likers">
                        11
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/101">Post #100</a>
	                </div>
	            </div>
              <div id="likers-container-94524" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="94524"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="95125" data-post-id="95125">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="edwildgoose" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  edwildgoose
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I hope I’m not repeating an existing idea, but this seems solvable by building a core component in the style of the Logger?</p>
<ul>
<li>
<p>Build a simple key-value database which is initially populated from a variety of configurable sources (ideally make this pluggable so people can dream up new things in the future)</p>
</li>
<li>
<p>Boot an instance of this config at the pre-boot point discussed above</p>
</li>
<li>
<p>API to access config is standardised, but the normal usage will be to access this global config instance</p>
</li>
<li>
<p>However, it should be possible to create additional config instances to pass to libraries if required. This makes it straightforward to standardise on a config standard, set defaults, etc, but for example if you need your favourite twitter library to access multiple user accounts you would simply instantiate multiple config instances and customise for each user.</p>
</li>
</ul>
<p>This would appear to solve the issue of both general default configurations, potentially merged from a variety of sources, plus the ability to generate customised config for particular instances of some module. There is also a standardised way to pass config to modules (either global or with the option for local override). In both cases of system default and customised instance you continue to have the ability to make runtime changes to the config.</p>
<p>This proposal clearly doesn’t touch compile time config, but I think that’s adequately covered already. I am not clear what language options would be sufficiently fast for putting such a system config option in a hot code path? Perhaps ETS tables?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="95125" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/102">Post #101</a>
	                </div>
	            </div>
              <div id="likers-container-95125" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="95125"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #101"></div>
  </section>
</div>
    <div class="postbit" id="199304" data-post-id="199304">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="WestKeys" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/WestKeys/120/21675_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  WestKeys
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just to get some closure, this is all solved with Mix Releases, correct?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="199304" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/103">Post #102</a>
	                </div>
	            </div>
              <div id="likers-container-199304" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="199304"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #102"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/14302/load_more?page=11">Load more posts (8 remaining)</a>
</div></template></turbo-stream>