From 510cdcbc9c51a28b0f4d54eba75ae3548c789380 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 31 Jul 2019 13:16:53 +0200 Subject: [PATCH] Revert to 56e05fced --- firmware/config/config.exs | 12 ++++++++++-- morse/lib/morse_server.ex | 2 +- ui/assets/webpack.config.js | 2 +- ui/config/config.exs | 1 + ui/config/prod.exs | 2 +- ui/config/prod.secret.exs | 1 + ui/lib/ui_web/channels/morse_progress_channel.ex | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/firmware/config/config.exs b/firmware/config/config.exs index ef11786..d8cb81f 100644 --- a/firmware/config/config.exs +++ b/firmware/config/config.exs @@ -5,8 +5,6 @@ # is restricted to this project. use Mix.Config -import_config "../../ui/config/config.exs" - config :firmware, target: Mix.target() # Customize non-Elixir parts of the firmware. See @@ -28,6 +26,16 @@ config :shoehorn, config :logger, backends: [RingLogger] +config :ui, UiWeb.Endpoint, + url: [host: "localhost"], + 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 diff --git a/morse/lib/morse_server.ex b/morse/lib/morse_server.ex index 8965cdf..af38117 100644 --- a/morse/lib/morse_server.ex +++ b/morse/lib/morse_server.ex @@ -37,7 +37,7 @@ defmodule MorseServer do end @impl true - def handle_cast({:progress, new_progress}, {pid, _progress}) do + def handle_cast({:progress, new_progress}, {pid, progress}) do broadcast_progress(new_progress) {:noreply, {pid, new_progress}} end diff --git a/ui/assets/webpack.config.js b/ui/assets/webpack.config.js index a233483..63c1d20 100644 --- a/ui/assets/webpack.config.js +++ b/ui/assets/webpack.config.js @@ -8,7 +8,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = (env, options) => ({ optimization: { minimizer: [ - // new UglifyJsPlugin({ cache: true, parallel: true, sourceMap: false }), + new UglifyJsPlugin({ cache: true, parallel: true, sourceMap: false }), new OptimizeCSSAssetsPlugin({}) ] }, diff --git a/ui/config/config.exs b/ui/config/config.exs index 95439ea..dc1d064 100644 --- a/ui/config/config.exs +++ b/ui/config/config.exs @@ -9,6 +9,7 @@ use Mix.Config # Configures the endpoint 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] diff --git a/ui/config/prod.exs b/ui/config/prod.exs index 753148a..1b6983b 100644 --- a/ui/config/prod.exs +++ b/ui/config/prod.exs @@ -10,7 +10,7 @@ use Mix.Config # which you should run after static files are built and # before starting your production server. config :ui, UiWeb.Endpoint, - url: [host: "www.geokunis2.nl", port: 80], + url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/cache_manifest.json" # Do not print debug messages in production diff --git a/ui/config/prod.secret.exs b/ui/config/prod.secret.exs index 8ee8fff..622dd97 100644 --- a/ui/config/prod.secret.exs +++ b/ui/config/prod.secret.exs @@ -12,6 +12,7 @@ secret_key_base = """ config :ui, UiWeb.Endpoint, + http: [:inet6, port: String.to_integer(System.get_env("PORT") || "4000")], secret_key_base: secret_key_base # ## Using releases (Elixir v1.9+) diff --git a/ui/lib/ui_web/channels/morse_progress_channel.ex b/ui/lib/ui_web/channels/morse_progress_channel.ex index 337a65e..80a6dcb 100644 --- a/ui/lib/ui_web/channels/morse_progress_channel.ex +++ b/ui/lib/ui_web/channels/morse_progress_channel.ex @@ -1,7 +1,7 @@ defmodule UiWeb.MorseProgressChannel do use UiWeb, :channel - def join(_channel_name, _params, socket) do + def join(channel_name, _params, socket) do {:ok, %{hi: :there}, socket} end end