Remove config in UI.

Merge dev config in UI into firmware config.
This commit is contained in:
Pim Kunis 2019-08-24 15:19:11 +02:00
parent ba50a839d2
commit d6e877137f
8 changed files with 57 additions and 199 deletions

View file

@ -26,18 +26,11 @@ config :shoehorn,
config :logger, backends: [RingLogger]
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 :phoenix, :json_library, Jason
if Mix.target() != :host do
import_config "target.exs"
"target.exs"
else
"host.exs"
end
|> import_config()

40
firmware/config/host.exs Normal file
View file

@ -0,0 +1,40 @@
use Mix.Config
config :ui, UiWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "FkfuB09FEncz4aAi6hS6w5bsNast+D1P12MckXr5dlRdhtFJrKqgEhvhpTU3qzgh",
render_errors: [view: UiWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: Ui.PubSub, adapter: Phoenix.PubSub.PG2],
http: [port: 4000],
server: true,
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
node: [
"node_modules/webpack/bin/webpack.js",
"--mode",
"development",
"--watch-stdin",
cd: Path.expand("../assets", __DIR__)
]
]
config :ui, UiWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/ui_web/{live,views}/.*(ex)$",
~r"lib/ui_web/templates/.*(eex)$"
]
]
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime

View file

@ -28,7 +28,7 @@ config :nerves_firmware_ssh,
# Setting the node_name will enable Erlang Distribution.
# Only enable this for prod if you understand the risks.
node_name = if Mix.env() != :prod, do: "firmware"
node_name = "esrom"
config :nerves_init_gadget,
ifname: "eth0",
@ -37,6 +37,18 @@ config :nerves_init_gadget,
node_name: node_name,
node_host: :mdns_domain
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
if File.exists?("config/secrets.exs") do
import_config "secrets.exs"
end