diff --git a/.tool-versions b/.tool-versions index 4b93af6e..0098a60d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ erlang 23.3.4.18 -elixir 1.11.4 +elixir 1.12.3-otp-23 diff --git a/apps/cf/lib/accounts/invitations.ex b/apps/cf/lib/accounts/invitations.ex index a16a3f0c..14295617 100644 --- a/apps/cf/lib/accounts/invitations.ex +++ b/apps/cf/lib/accounts/invitations.ex @@ -163,9 +163,7 @@ defmodule CF.Accounts.Invitations do frontend_url = Application.fetch_env!(:cf, :frontend_url) Logger.info( - "Generated #{number} invites for token #{token}. Url: #{frontend_url}/signup?invitation_token=#{ - token - }" + "Generated #{number} invites for token #{token}. Url: #{frontend_url}/signup?invitation_token=#{token}" ) end diff --git a/apps/cf/lib/accounts/user_permissions.ex b/apps/cf/lib/accounts/user_permissions.ex index 1d5632c6..5eba5f73 100644 --- a/apps/cf/lib/accounts/user_permissions.ex +++ b/apps/cf/lib/accounts/user_permissions.ex @@ -66,9 +66,7 @@ defmodule CF.Accounts.UserPermissions do if action_count >= limit + @limit_warning_threshold, do: Logger.warn(fn -> - "User #{user.username} (#{user.id}) overthrown its limit for [#{action_type} #{ - entity - }] (#{action_count}/#{limit})" + "User #{user.username} (#{user.id}) overthrown its limit for [#{action_type} #{entity}] (#{action_count}/#{limit})" end) {:error, @error_limit_reached} diff --git a/apps/cf/mix.exs b/apps/cf/mix.exs index 60d0fcb1..bbe1aaa2 100644 --- a/apps/cf/mix.exs +++ b/apps/cf/mix.exs @@ -37,8 +37,8 @@ defmodule CF.Mixfile do # Type `mix help deps` for examples and options. defp deps do [ - {:phoenix, "~> 1.4.18", override: true}, - {:phoenix_html, "~> 2.6"}, + {:phoenix, "~> 1.5.14", override: true}, + {:phoenix_html, "~> 2.14.3"}, {:gettext, "~> 0.13.1"}, {:google_api_you_tube, "~> 0.42.0"}, {:kaur, "~> 1.1"}, diff --git a/apps/cf_atom_feed/test/comments_test.exs b/apps/cf_atom_feed/test/comments_test.exs index c5521fcc..5364bdf0 100644 --- a/apps/cf_atom_feed/test/comments_test.exs +++ b/apps/cf_atom_feed/test/comments_test.exs @@ -30,9 +30,7 @@ defmodule CF.AtomFeed.CommentsTest do # Check comment entries for comment <- comments do assert feed =~ - ~r(https://TEST_FRONTEND/videos/[a-zA-Z0-9]+\?statement=#{comment.statement_id}&c=#{ - comment.id - }"/>) + ~r(https://TEST_FRONTEND/videos/[a-zA-Z0-9]+\?statement=#{comment.statement_id}&c=#{comment.id}"/>) assert feed =~ ~r(New Comment from .+ on ##{comment.statement_id}) end diff --git a/apps/cf_graphql/config/config.exs b/apps/cf_graphql/config/config.exs index eabecc81..2ba311b6 100644 --- a/apps/cf_graphql/config/config.exs +++ b/apps/cf_graphql/config/config.exs @@ -15,7 +15,7 @@ config :cf_graphql, config :cf_graphql, CF.GraphQLWeb.Endpoint, url: [host: "localhost"], secret_key_base: "Nl5lfMlBMvQpY3n74G9iNTxH4okMpbMWArWst9Vhj75tl+m2PuV+KPwjX0fNMaa8", - pubsub: [name: CF.Graphql.PubSub, adapter: Phoenix.PubSub.PG2], + pubsub_server: CF.Graphql.PubSub, server: true # Configures Elixir's Logger diff --git a/apps/cf_graphql/lib/application.ex b/apps/cf_graphql/lib/application.ex index 7da91cb5..64ca65a6 100644 --- a/apps/cf_graphql/lib/application.ex +++ b/apps/cf_graphql/lib/application.ex @@ -8,6 +8,8 @@ defmodule CF.Graphql.Application do # Define workers and child supervisors to be supervised children = [ + # Start the PubSub system + {Phoenix.PubSub, name: CF.Graphql.PubSub}, # Start the endpoint when the application starts supervisor(CF.GraphQLWeb.Endpoint, []) ] diff --git a/apps/cf_graphql/mix.exs b/apps/cf_graphql/mix.exs index ad5002b5..2bbfc056 100644 --- a/apps/cf_graphql/mix.exs +++ b/apps/cf_graphql/mix.exs @@ -32,9 +32,9 @@ defmodule CF.Graphql.Mixfile do defp deps do [ - {:phoenix, "~> 1.4.18"}, + {:phoenix, "~> 1.5.14"}, {:plug, "~> 1.7"}, - {:phoenix_pubsub, "~> 1.0"}, + {:phoenix_pubsub, "~> 2.0"}, {:cowboy, "~> 2.0"}, {:corsica, "~> 2.1"}, {:absinthe_ecto, "~> 0.1.3"}, diff --git a/apps/cf_graphql/test/support/conn_case.ex b/apps/cf_graphql/test/support/conn_case.ex index 81aa43b9..89aa788d 100644 --- a/apps/cf_graphql/test/support/conn_case.ex +++ b/apps/cf_graphql/test/support/conn_case.ex @@ -3,10 +3,6 @@ defmodule CF.Graphql.ConnCase do This module defines the test case to be used by tests that require setting up a connection. - Such tests rely on `Phoenix.ConnTest` and also - import other functionality to make it easier - to build common datastructures and query the data layer. - Finally, if the test case interacts with the database, it cannot be async. For this reason, every test runs inside a transaction which is reset at the beginning @@ -18,7 +14,8 @@ defmodule CF.Graphql.ConnCase do using do quote do # Import conveniences for testing with connections - use Phoenix.ConnTest + import Plug.Conn + import Phoenix.ConnTest import CF.GraphQLWeb.Router.Helpers # The default endpoint for testing diff --git a/apps/cf_rest_api/config/config.exs b/apps/cf_rest_api/config/config.exs index 7967704a..a6e4b34c 100644 --- a/apps/cf_rest_api/config/config.exs +++ b/apps/cf_rest_api/config/config.exs @@ -7,7 +7,7 @@ config :cf_rest_api, config :cf_rest_api, CF.RestApi.Endpoint, url: [host: "localhost"], render_errors: [view: CF.RestApi.ErrorView, accepts: ~w(json), default_format: "json"], - pubsub: [name: CF.RestApi.PubSub, adapter: Phoenix.PubSub.PG2], + pubsub_server: CF.RestApi.PubSub, server: true # Configure Postgres pool size diff --git a/apps/cf_rest_api/lib/application.ex b/apps/cf_rest_api/lib/application.ex index 9e3dbde6..33368ed0 100644 --- a/apps/cf_rest_api/lib/application.ex +++ b/apps/cf_rest_api/lib/application.ex @@ -6,6 +6,8 @@ defmodule CF.RestApi.Application do # Define workers and child supervisors to be supervised children = [ + # Start the PubSub system + {Phoenix.PubSub, name: CF.RestApi.PubSub}, # Start the endpoint when the application starts supervisor(CF.RestApi.Endpoint, []), # Presence to track number of connected users to a channel diff --git a/apps/cf_rest_api/mix.exs b/apps/cf_rest_api/mix.exs index 05078a75..696876ed 100644 --- a/apps/cf_rest_api/mix.exs +++ b/apps/cf_rest_api/mix.exs @@ -39,12 +39,12 @@ defmodule CF.RestApi.Mixfile do {:cowboy, "~> 2.0"}, {:gettext, "~> 0.13.1"}, {:kaur, "~> 1.1"}, - {:phoenix, "~> 1.4.18", override: true}, - {:phoenix_html, "~> 2.6"}, - {:phoenix_pubsub, "~> 1.0"}, + {:phoenix, "~> 1.5.14", override: true}, + {:phoenix_html, "~> 2.14.3"}, + {:phoenix_pubsub, "~> 2.0"}, {:poison, "~> 3.1"}, {:scout_apm, "~> 1.0.6"}, - {:plug_cowboy, "~> 2.0"}, + {:plug_cowboy, "~> 2.1"}, # ---- Internal ---- {:cf, in_umbrella: true}, diff --git a/apps/cf_rest_api/test/support/conn_case.ex b/apps/cf_rest_api/test/support/conn_case.ex index 613c6ec5..5728ecb2 100644 --- a/apps/cf_rest_api/test/support/conn_case.ex +++ b/apps/cf_rest_api/test/support/conn_case.ex @@ -3,10 +3,6 @@ defmodule CF.RestApi.ConnCase do This module defines the test case to be used by tests that require setting up a connection. - Such tests rely on `Phoenix.ConnTest` and also - import other functionality to make it easier - to build and query models. - Finally, if the test case interacts with the database, it cannot be async. For this reason, every test runs inside a transaction which is reset at the beginning @@ -18,7 +14,8 @@ defmodule CF.RestApi.ConnCase do using do quote do # Import conveniences for testing with connections - use Phoenix.ConnTest + import Plug.Conn + import Phoenix.ConnTest import CF.RestApi.Router.Helpers # The default endpoint for testing diff --git a/apps/cf_reverse_proxy/mix.exs b/apps/cf_reverse_proxy/mix.exs index 157360f5..b03ff95e 100644 --- a/apps/cf_reverse_proxy/mix.exs +++ b/apps/cf_reverse_proxy/mix.exs @@ -37,7 +37,7 @@ defmodule CF.ReverseProxy.Mixfile do {:cf_rest_api, in_umbrella: true}, {:cf_graphql, in_umbrella: true}, {:cf_atom_feed, in_umbrella: true}, - {:phoenix, "~> 1.4.18"}, + {:phoenix, "~> 1.5.14"}, {:cowboy, "~> 2.0"}, {:corsica, "~> 2.1"} ] diff --git a/mix.lock b/mix.lock index 3d46c25d..afc5b65e 100644 --- a/mix.lock +++ b/mix.lock @@ -80,12 +80,12 @@ "oauth2": {:hex, :oauth2, "0.9.4", "632e8e8826a45e33ac2ea5ac66dcc019ba6bb5a0d2ba77e342d33e3b7b252c6e", [:mix], [{:hackney, "~> 1.7", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "407c6b9f60aa0d01b915e2347dc6be78adca706a37f0c530808942da3b62e7af"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, - "phoenix": {:hex, :phoenix, "1.4.18", "3f586505ae17bdcfd044572b59c9a3be2761bb67e1d7c97cc5046ff750e0831a", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "13844c7aeff41df88ca1313dafdc9603b2b2e689d8b72f77a3dcaef6c2b6463c"}, - "phoenix_html": {:hex, :phoenix_html, "2.11.2", "86ebd768258ba60a27f5578bec83095bdb93485d646fc4111db8844c316602d6", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "2fe8543036a9cb2103efe26c18874512dc0e005afba60dbfe90aa56e27c198a2"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm", "1f13f9f0f3e769a667a6b6828d29dec37497a082d195cc52dbef401a9b69bf38"}, - "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, + "phoenix": {:hex, :phoenix, "1.5.14", "2d5db884be496eefa5157505ec0134e66187cb416c072272420c5509d67bf808", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "207f1aa5520320cbb7940d7ff2dde2342162cf513875848f88249ea0ba02fef7"}, + "phoenix_html": {:hex, :phoenix_html, "2.14.3", "51f720d0d543e4e157ff06b65de38e13303d5778a7919bcc696599e5934271b8", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "efd697a7fff35a13eeeb6b43db884705cba353a1a41d127d118fda5f90c8e80f"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, + "plug": {:hex, :plug, "1.16.0", "1d07d50cb9bb05097fdf187b31cf087c7297aafc3fed8299aac79c128a707e47", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cbf53aa1f5c4d758a7559c0bd6d59e286c2be0c6a1fac8cc3eee2f638243b93e"}, "plug_cowboy": {:hex, :plug_cowboy, "2.6.2", "753611b23b29231fb916b0cdd96028084b12aff57bfd7b71781bd04b1dbeb5c9", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "951ed2433df22f4c97b85fdb145d4cee561f36b74854d64c06d896d7cd2921a7"}, - "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, + "plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"},