2019-07-13 18:16:46 +00:00
|
|
|
use Mix.Config
|
|
|
|
|
|
|
|
# Authorize the device to receive firmware using your public key.
|
|
|
|
# See https://hexdocs.pm/nerves_firmware_ssh/readme.html for more information
|
|
|
|
# on configuring nerves_firmware_ssh.
|
|
|
|
|
|
|
|
keys =
|
|
|
|
[
|
|
|
|
Path.join([System.user_home!(), ".ssh", "id_rsa.pub"]),
|
|
|
|
Path.join([System.user_home!(), ".ssh", "id_ecdsa.pub"]),
|
|
|
|
Path.join([System.user_home!(), ".ssh", "id_ed25519.pub"])
|
|
|
|
]
|
|
|
|
|> Enum.filter(&File.exists?/1)
|
|
|
|
|
|
|
|
if keys == [],
|
|
|
|
do:
|
|
|
|
Mix.raise("""
|
|
|
|
No SSH public keys found in ~/.ssh. An ssh authorized key is needed to
|
|
|
|
log into the Nerves device and update firmware on it using ssh.
|
|
|
|
See your project's config.exs for this error message.
|
|
|
|
""")
|
|
|
|
|
|
|
|
config :nerves_firmware_ssh,
|
|
|
|
authorized_keys: Enum.map(keys, &File.read!/1)
|
|
|
|
|
|
|
|
# Configure nerves_init_gadget.
|
|
|
|
# See https://hexdocs.pm/nerves_init_gadget/readme.html for more information.
|
|
|
|
|
|
|
|
# Setting the node_name will enable Erlang Distribution.
|
|
|
|
# Only enable this for prod if you understand the risks.
|
2019-08-24 13:19:11 +00:00
|
|
|
node_name = "esrom"
|
2019-07-13 18:16:46 +00:00
|
|
|
|
|
|
|
config :nerves_init_gadget,
|
2019-07-13 22:28:47 +00:00
|
|
|
ifname: "eth0",
|
|
|
|
address_method: :dhcp,
|
2019-08-24 15:45:27 +00:00
|
|
|
mdns_domain: "esrom.lan",
|
2019-07-13 18:16:46 +00:00
|
|
|
node_name: node_name,
|
|
|
|
node_host: :mdns_domain
|
|
|
|
|
2019-08-24 13:19:11 +00:00
|
|
|
config :ui, UiWeb.Endpoint,
|
|
|
|
url: [host: "www.geokunis2.nl"],
|
|
|
|
http: [port: 80],
|
|
|
|
secret_key_base: "HEY05EB1dFVSu6KykKHuS4rQPQzSHv4F7mGVB/gnDLrIu75wE/ytBXy2TaL3A6RA",
|
|
|
|
root: Path.dirname(__DIR__),
|
|
|
|
server: true,
|
|
|
|
render_errors: [view: UiWeb.ErrorView, accepts: ~w(html json)],
|
|
|
|
pubsub: [name: Nerves.PubSub, adapter: Phoenix.PubSub.PG2],
|
|
|
|
code_reloader: false
|
|
|
|
|
|
|
|
config :morse, :relay_pin, 17
|
|
|
|
|
2019-07-14 21:54:06 +00:00
|
|
|
if File.exists?("config/secrets.exs") do
|
|
|
|
import_config "secrets.exs"
|
|
|
|
end
|
|
|
|
|
2019-07-13 18:16:46 +00:00
|
|
|
# Import target specific config. This must remain at the bottom
|
|
|
|
# of this file so it overrides the configuration defined above.
|
|
|
|
# Uncomment to use target specific configurations
|
|
|
|
|
|
|
|
# import_config "#{Mix.target()}.exs"
|