mxst
How to add a config file to a livebook?
Hello everyone,
I’m trying to add a secret to my livebook. ( I need to have some credentials but I don’t want to save them in the livebook directy)
I tried the following in the ‘Notebook dependencies and setup’
Mix.install([
{:req, "~> 0.2.1"},
{:jason, "~> 1.3"},
{:kino, "~> 0.5.0"}
],
config_path: "<full_path>/config/config.exs"
)
but if I now try to access the config via Application.get_all_env(:apaleo_api) the return is empty.
config.exs:
import Config
config :apaleo_api, :basic_auth,
username: "username",
password: "password"
Maybe someone can tell me what I am doing wrong …
Most Liked
mxst
I think I found a solution with:
Mix.install([
{:req, "~> 0.2.1"},
{:jason, "~> 1.3"},
{:kino, "~> 0.5.0"}
],
config: Config.Reader.read!("#{__DIR__}/config/config.exs")
)
2
w0rd-driven
That’s the preferred approach according to the docs: Mix — Mix v1.14.0. There’s also a :config_path option as of the newest Elixir 1.14 that loads the file for you as well as a paired runtime.exs if it’s in the same directory.
1
Popular in Questions
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Hi all,
I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage.
I'm trying to use Postg...
New
I have a super simple question about elixir - how would I take a file like this
foo bar baz
and output a new file that enumerates th...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Other popular topics
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
can someone please explain to me how Enum.reduce works with maps
New
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
The Elixir Typespec docs show the following syntax for keyword lists in typespecs:
# ...
| [key: type] # keyword lis...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
Hi,
I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New







