Enable setting config securely in firmware/config/secrets.exs

This commit is contained in:
Pim Kunis 2019-07-14 23:54:06 +02:00
parent fe172f018a
commit 8f99154259
7 changed files with 17 additions and 15 deletions

1
morse/.gitignore vendored
View file

@ -21,4 +21,3 @@ erl_crash.dump
# Ignore package tarball (built via "mix hex.build").
morse-*.tar

View file

@ -21,12 +21,7 @@ defmodule Morse do
"""
def signal do
case System.get_env("MORSE_MESSAGE") do
nil ->
# Signal for SOS if the env variable wasn't found :)
signal("...---...")
message -> signal(message)
end
signal(Application.fetch_env!(:morse, :morse_message))
end
def signal(symbols) do

View file

@ -14,7 +14,8 @@ defmodule Morse.MixProject do
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
extra_applications: [:logger],
env: [morse_message: "...---..."]
]
end