diff --git a/apps/cf_http/README.md b/apps/cf_http/README.md index 69cd55b2e..14b22c931 100644 --- a/apps/cf_http/README.md +++ b/apps/cf_http/README.md @@ -1,3 +1,3 @@ -# CfPhx +# CfHttp diff --git a/apps/cf_http/lib/cf_http.ex b/apps/cf_http/lib/cf_http.ex index 827d6b084..5b09fce54 100644 --- a/apps/cf_http/lib/cf_http.ex +++ b/apps/cf_http/lib/cf_http.ex @@ -1,6 +1,6 @@ -defmodule CfPhx do +defmodule CfHttp do @moduledoc """ - CfPhx keeps the contexts that define your domain + CfHttp keeps the contexts that define your domain and business logic. Contexts are also responsible for managing your data, regardless diff --git a/apps/cf_http/lib/cf_http/application.ex b/apps/cf_http/lib/cf_http/application.ex index 82fa860cf..663a0b6c2 100644 --- a/apps/cf_http/lib/cf_http/application.ex +++ b/apps/cf_http/lib/cf_http/application.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.Application do +defmodule CfHttp.Application do # See https://hexdocs.pm/elixir/Application.html # for more information on OTP Applications @moduledoc false @@ -9,25 +9,25 @@ defmodule CfPhx.Application do # List all child processes to be supervised children = [ # Start the Ecto repository - CfPhx.Repo, + CfHttp.Repo, # Start the PubSub system - {Phoenix.PubSub, name: CfPhx.PubSub}, + {Phoenix.PubSub, name: CfHttp.PubSub}, # Start the endpoint when the application starts - CfPhxWeb.Endpoint - # Starts a worker by calling: CfPhx.Worker.start_link(arg) - # {CfPhx.Worker, arg}, + CfHttpWeb.Endpoint + # Starts a worker by calling: CfHttp.Worker.start_link(arg) + # {CfHttp.Worker, arg}, ] # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options - opts = [strategy: :one_for_one, name: CfPhx.Supervisor] + opts = [strategy: :one_for_one, name: CfHttp.Supervisor] Supervisor.start_link(children, opts) end # Tell Phoenix to update the endpoint configuration # whenever the application is updated. def config_change(changed, _new, removed) do - CfPhxWeb.Endpoint.config_change(changed, removed) + CfHttpWeb.Endpoint.config_change(changed, removed) :ok end end diff --git a/apps/cf_http/lib/cf_http/devices.ex b/apps/cf_http/lib/cf_http/devices.ex index e386a0b24..ea94bf1e4 100644 --- a/apps/cf_http/lib/cf_http/devices.ex +++ b/apps/cf_http/lib/cf_http/devices.ex @@ -1,12 +1,12 @@ -defmodule CfPhx.Devices do +defmodule CfHttp.Devices do @moduledoc """ The Devices context. """ import Ecto.Query, warn: false - alias CfPhx.Repo + alias CfHttp.Repo - alias CfPhx.Devices.Device + alias CfHttp.Devices.Device @doc """ Returns the list of devices. diff --git a/apps/cf_http/lib/cf_http/devices/device.ex b/apps/cf_http/lib/cf_http/devices/device.ex index efb007672..0857e7af7 100644 --- a/apps/cf_http/lib/cf_http/devices/device.ex +++ b/apps/cf_http/lib/cf_http/devices/device.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.Devices.Device do +defmodule CfHttp.Devices.Device do use Ecto.Schema import Ecto.Changeset @@ -8,7 +8,7 @@ defmodule CfPhx.Devices.Device do field :verified_at, :utc_datetime field :user_id, :id - has_many :firewall_rules, CfPhx.FirewallRules.FirewallRule + has_many :firewall_rules, CfHttp.FirewallRules.FirewallRule timestamps() end diff --git a/apps/cf_http/lib/cf_http/firewall_rules.ex b/apps/cf_http/lib/cf_http/firewall_rules.ex index 3856a575f..7be333dd1 100644 --- a/apps/cf_http/lib/cf_http/firewall_rules.ex +++ b/apps/cf_http/lib/cf_http/firewall_rules.ex @@ -1,12 +1,12 @@ -defmodule CfPhx.FirewallRules do +defmodule CfHttp.FirewallRules do @moduledoc """ The FirewallRules context. """ import Ecto.Query, warn: false - alias CfPhx.Repo + alias CfHttp.Repo - alias CfPhx.FirewallRules.FirewallRule + alias CfHttp.FirewallRules.FirewallRule @doc """ Returns the list of firewall_rules. diff --git a/apps/cf_http/lib/cf_http/firewall_rules/firewall_rule.ex b/apps/cf_http/lib/cf_http/firewall_rules/firewall_rule.ex index 6719a052b..c1cf3cf97 100644 --- a/apps/cf_http/lib/cf_http/firewall_rules/firewall_rule.ex +++ b/apps/cf_http/lib/cf_http/firewall_rules/firewall_rule.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.FirewallRules.FirewallRule do +defmodule CfHttp.FirewallRules.FirewallRule do use Ecto.Schema import Ecto.Changeset @@ -8,7 +8,7 @@ defmodule CfPhx.FirewallRules.FirewallRule do field :port, :string field :protocol, :string - belongs_to :device, CfPhx.Devices.Device + belongs_to :device, CfHttp.Devices.Device timestamps() end diff --git a/apps/cf_http/lib/cf_http/release.ex b/apps/cf_http/lib/cf_http/release.ex index c246d91cb..4b3e1eaac 100644 --- a/apps/cf_http/lib/cf_http/release.ex +++ b/apps/cf_http/lib/cf_http/release.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.Release do +defmodule CfHttp.Release do @app :cf_http def migrate do diff --git a/apps/cf_http/lib/cf_http/repo.ex b/apps/cf_http/lib/cf_http/repo.ex index a8e9dd43f..6a0a4ca9b 100644 --- a/apps/cf_http/lib/cf_http/repo.ex +++ b/apps/cf_http/lib/cf_http/repo.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.Repo do +defmodule CfHttp.Repo do use Ecto.Repo, otp_app: :cf_http, adapter: Ecto.Adapters.Postgres diff --git a/apps/cf_http/lib/cf_http/user.ex b/apps/cf_http/lib/cf_http/user.ex index 92e5ee014..87d9f87b1 100644 --- a/apps/cf_http/lib/cf_http/user.ex +++ b/apps/cf_http/lib/cf_http/user.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.User do +defmodule CfHttp.User do use Ecto.Schema import Ecto.Changeset diff --git a/apps/cf_http/lib/cf_http_web.ex b/apps/cf_http/lib/cf_http_web.ex index 352bee910..ee2f7295d 100644 --- a/apps/cf_http/lib/cf_http_web.ex +++ b/apps/cf_http/lib/cf_http_web.ex @@ -1,12 +1,12 @@ -defmodule CfPhxWeb do +defmodule CfHttpWeb do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: - use CfPhxWeb, :controller - use CfPhxWeb, :view + use CfHttpWeb, :controller + use CfHttpWeb, :view The definitions below will be executed for every view, controller, etc, so keep them short and clean, focused @@ -19,11 +19,11 @@ defmodule CfPhxWeb do def controller do quote do - use Phoenix.Controller, namespace: CfPhxWeb + use Phoenix.Controller, namespace: CfHttpWeb import Plug.Conn - import CfPhxWeb.Gettext - alias CfPhxWeb.Router.Helpers, as: Routes + import CfHttpWeb.Gettext + alias CfHttpWeb.Router.Helpers, as: Routes end end @@ -31,7 +31,7 @@ defmodule CfPhxWeb do quote do use Phoenix.View, root: "lib/cf_http_web/templates", - namespace: CfPhxWeb + namespace: CfHttpWeb # Import convenience functions from controllers import Phoenix.Controller, only: [get_flash: 1, get_flash: 2, view_module: 1] @@ -39,9 +39,9 @@ defmodule CfPhxWeb do # Use all HTML functionality (forms, tags, etc) use Phoenix.HTML - import CfPhxWeb.ErrorHelpers - import CfPhxWeb.Gettext - alias CfPhxWeb.Router.Helpers, as: Routes + import CfHttpWeb.ErrorHelpers + import CfHttpWeb.Gettext + alias CfHttpWeb.Router.Helpers, as: Routes end end @@ -56,7 +56,7 @@ defmodule CfPhxWeb do def channel do quote do use Phoenix.Channel - import CfPhxWeb.Gettext + import CfHttpWeb.Gettext end end diff --git a/apps/cf_http/lib/cf_http_web/channels/user_socket.ex b/apps/cf_http/lib/cf_http_web/channels/user_socket.ex index 3027d3ccb..b71ba25ed 100644 --- a/apps/cf_http/lib/cf_http_web/channels/user_socket.ex +++ b/apps/cf_http/lib/cf_http_web/channels/user_socket.ex @@ -1,8 +1,8 @@ -defmodule CfPhxWeb.UserSocket do +defmodule CfHttpWeb.UserSocket do use Phoenix.Socket ## Channels - # channel "room:*", CfPhxWeb.RoomChannel + # channel "room:*", CfHttpWeb.RoomChannel # Socket params are passed from the client and can # be used to verify and authenticate a user. After @@ -26,7 +26,7 @@ defmodule CfPhxWeb.UserSocket do # Would allow you to broadcast a "disconnect" event and terminate # all active sockets and channels for a given user: # - # CfPhxWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) + # CfHttpWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) # # Returning `nil` makes this socket anonymous. def id(_socket), do: nil diff --git a/apps/cf_http/lib/cf_http_web/controllers/device_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/device_controller.ex index d85e876de..69089af50 100644 --- a/apps/cf_http/lib/cf_http_web/controllers/device_controller.ex +++ b/apps/cf_http/lib/cf_http_web/controllers/device_controller.ex @@ -1,10 +1,10 @@ -defmodule CfPhxWeb.DeviceController do - use CfPhxWeb, :controller +defmodule CfHttpWeb.DeviceController do + use CfHttpWeb, :controller - alias CfPhx.Devices - alias CfPhx.Devices.Device + alias CfHttp.Devices + alias CfHttp.Devices.Device - plug CfPhxWeb.Plugs.Authenticator + plug CfHttpWeb.Plugs.Authenticator def index(conn, _params) do devices = Devices.list_devices() diff --git a/apps/cf_http/lib/cf_http_web/controllers/firewall_rule_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/firewall_rule_controller.ex index 9cd613492..6b8ed1206 100644 --- a/apps/cf_http/lib/cf_http_web/controllers/firewall_rule_controller.ex +++ b/apps/cf_http/lib/cf_http_web/controllers/firewall_rule_controller.ex @@ -1,11 +1,11 @@ -defmodule CfPhxWeb.FirewallRuleController do - use CfPhxWeb, :controller +defmodule CfHttpWeb.FirewallRuleController do + use CfHttpWeb, :controller - alias CfPhx.FirewallRules - alias CfPhx.FirewallRules.FirewallRule - alias CfPhx.Devices + alias CfHttp.FirewallRules + alias CfHttp.FirewallRules.FirewallRule + alias CfHttp.Devices - plug CfPhxWeb.Plugs.Authenticator + plug CfHttpWeb.Plugs.Authenticator def index(conn, %{"device_id" => device_id}) do device = Devices.get_device!(device_id) diff --git a/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex index 11e920f83..e122f634b 100644 --- a/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex +++ b/apps/cf_http/lib/cf_http_web/controllers/page_controller.ex @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.PageController do - use CfPhxWeb, :controller +defmodule CfHttpWeb.PageController do + use CfHttpWeb, :controller def index(conn, _params) do render(conn, "index.html") diff --git a/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex b/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex index 66190e654..0283715e9 100644 --- a/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex +++ b/apps/cf_http/lib/cf_http_web/controllers/user_controller.ex @@ -1,12 +1,12 @@ -defmodule CfPhxWeb.UserController do +defmodule CfHttpWeb.UserController do @moduledoc """ Implements the CRUD for a User """ - use CfPhxWeb, :controller - alias CfPhx.{Repo, User} + use CfHttpWeb, :controller + alias CfHttp.{Repo, User} - plug CfPhxWeb.Plugs.Authenticator when action in [:show, :edit, :update, :delete] + plug CfHttpWeb.Plugs.Authenticator when action in [:show, :edit, :update, :delete] # GET /users/new def new(conn, _params) do diff --git a/apps/cf_http/lib/cf_http_web/endpoint.ex b/apps/cf_http/lib/cf_http_web/endpoint.ex index a67b33790..5ca3abb51 100644 --- a/apps/cf_http/lib/cf_http_web/endpoint.ex +++ b/apps/cf_http/lib/cf_http_web/endpoint.ex @@ -1,4 +1,4 @@ -defmodule CfPhxWeb.Endpoint do +defmodule CfHttpWeb.Endpoint do use Phoenix.Endpoint, otp_app: :cf_http # The session will be stored in the cookie and signed, @@ -10,7 +10,7 @@ defmodule CfPhxWeb.Endpoint do signing_salt: "Z9eq8iof" ] - socket "/socket", CfPhxWeb.UserSocket, + socket "/socket", CfHttpWeb.UserSocket, websocket: true, longpoll: false @@ -43,5 +43,5 @@ defmodule CfPhxWeb.Endpoint do plug Plug.MethodOverride plug Plug.Head plug Plug.Session, @session_options - plug CfPhxWeb.Router + plug CfHttpWeb.Router end diff --git a/apps/cf_http/lib/cf_http_web/gettext.ex b/apps/cf_http/lib/cf_http_web/gettext.ex index c7c5b086b..dd22e2732 100644 --- a/apps/cf_http/lib/cf_http_web/gettext.ex +++ b/apps/cf_http/lib/cf_http_web/gettext.ex @@ -1,11 +1,11 @@ -defmodule CfPhxWeb.Gettext do +defmodule CfHttpWeb.Gettext do @moduledoc """ A module providing Internationalization with a gettext-based API. By using [Gettext](https://hexdocs.pm/gettext), your module gains a set of macros for translations, for example: - import CfPhxWeb.Gettext + import CfHttpWeb.Gettext # Simple translation gettext("Here is the string to translate") diff --git a/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex b/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex index 3366dafc8..dc0446e53 100644 --- a/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex +++ b/apps/cf_http/lib/cf_http_web/plugs/authenticator.ex @@ -1,10 +1,10 @@ -defmodule CfPhxWeb.Plugs.Authenticator do +defmodule CfHttpWeb.Plugs.Authenticator do @moduledoc """ Loads the user's session from cookie """ import Plug.Conn - alias CfPhx.User + alias CfHttp.User def init(default), do: default diff --git a/apps/cf_http/lib/cf_http_web/router.ex b/apps/cf_http/lib/cf_http_web/router.ex index 81b2dd114..fb903eb8b 100644 --- a/apps/cf_http/lib/cf_http_web/router.ex +++ b/apps/cf_http/lib/cf_http_web/router.ex @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.Router do - use CfPhxWeb, :router +defmodule CfHttpWeb.Router do + use CfHttpWeb, :router pipeline :browser do plug :accepts, ["html"] @@ -13,7 +13,7 @@ defmodule CfPhxWeb.Router do plug :accepts, ["json"] end - scope "/", CfPhxWeb do + scope "/", CfHttpWeb do pipe_through :browser get "/", PageController, :index @@ -27,7 +27,7 @@ defmodule CfPhxWeb.Router do end # Other scopes may use custom stacks. - # scope "/api", CfPhxWeb do + # scope "/api", CfHttpWeb do # pipe_through :api # end end diff --git a/apps/cf_http/lib/cf_http_web/templates/layout/app.html.eex b/apps/cf_http/lib/cf_http_web/templates/layout/app.html.eex index 358715569..ec77ce3f5 100644 --- a/apps/cf_http/lib/cf_http_web/templates/layout/app.html.eex +++ b/apps/cf_http/lib/cf_http_web/templates/layout/app.html.eex @@ -16,7 +16,7 @@
  • Devices
  • - diff --git a/apps/cf_http/lib/cf_http_web/views/device_view.ex b/apps/cf_http/lib/cf_http_web/views/device_view.ex index 9f9cad325..c490c4db7 100644 --- a/apps/cf_http/lib/cf_http_web/views/device_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/device_view.ex @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.DeviceView do - use CfPhxWeb, :view +defmodule CfHttpWeb.DeviceView do + use CfHttpWeb, :view end diff --git a/apps/cf_http/lib/cf_http_web/views/error_helpers.ex b/apps/cf_http/lib/cf_http_web/views/error_helpers.ex index 2aed26fde..f47a13670 100644 --- a/apps/cf_http/lib/cf_http_web/views/error_helpers.ex +++ b/apps/cf_http/lib/cf_http_web/views/error_helpers.ex @@ -1,4 +1,4 @@ -defmodule CfPhxWeb.ErrorHelpers do +defmodule CfHttpWeb.ErrorHelpers do @moduledoc """ Conveniences for translating and building error messages. """ @@ -36,9 +36,9 @@ defmodule CfPhxWeb.ErrorHelpers do # should be written to the errors.po file. The :count option is # set by Ecto and indicates we should also apply plural rules. if count = opts[:count] do - Gettext.dngettext(CfPhxWeb.Gettext, "errors", msg, msg, count, opts) + Gettext.dngettext(CfHttpWeb.Gettext, "errors", msg, msg, count, opts) else - Gettext.dgettext(CfPhxWeb.Gettext, "errors", msg, opts) + Gettext.dgettext(CfHttpWeb.Gettext, "errors", msg, opts) end end end diff --git a/apps/cf_http/lib/cf_http_web/views/error_view.ex b/apps/cf_http/lib/cf_http_web/views/error_view.ex index c6d0259e2..67df63712 100644 --- a/apps/cf_http/lib/cf_http_web/views/error_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/error_view.ex @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.ErrorView do - use CfPhxWeb, :view +defmodule CfHttpWeb.ErrorView do + use CfHttpWeb, :view # If you want to customize a particular status code # for a certain format, you may uncomment below. diff --git a/apps/cf_http/lib/cf_http_web/views/firewall_rule_view.ex b/apps/cf_http/lib/cf_http_web/views/firewall_rule_view.ex index fef21d094..e873be9b3 100644 --- a/apps/cf_http/lib/cf_http_web/views/firewall_rule_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/firewall_rule_view.ex @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.FirewallRuleView do - use CfPhxWeb, :view +defmodule CfHttpWeb.FirewallRuleView do + use CfHttpWeb, :view end diff --git a/apps/cf_http/lib/cf_http_web/views/layout_view.ex b/apps/cf_http/lib/cf_http_web/views/layout_view.ex index 20ce9d0c7..78cea4062 100644 --- a/apps/cf_http/lib/cf_http_web/views/layout_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/layout_view.ex @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.LayoutView do - use CfPhxWeb, :view +defmodule CfHttpWeb.LayoutView do + use CfHttpWeb, :view end diff --git a/apps/cf_http/lib/cf_http_web/views/page_view.ex b/apps/cf_http/lib/cf_http_web/views/page_view.ex index bbbc8f0b9..6e3a53c9d 100644 --- a/apps/cf_http/lib/cf_http_web/views/page_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/page_view.ex @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.PageView do - use CfPhxWeb, :view +defmodule CfHttpWeb.PageView do + use CfHttpWeb, :view end diff --git a/apps/cf_http/lib/cf_http_web/views/user_view.ex b/apps/cf_http/lib/cf_http_web/views/user_view.ex index 282c354a7..1dd8cd496 100644 --- a/apps/cf_http/lib/cf_http_web/views/user_view.ex +++ b/apps/cf_http/lib/cf_http_web/views/user_view.ex @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.UserView do - use CfPhxWeb, :view +defmodule CfHttpWeb.UserView do + use CfHttpWeb, :view end diff --git a/apps/cf_http/mix.exs b/apps/cf_http/mix.exs index 77a28bf90..4c588fd62 100644 --- a/apps/cf_http/mix.exs +++ b/apps/cf_http/mix.exs @@ -1,4 +1,4 @@ -defmodule CfPhx.MixProject do +defmodule CfHttp.MixProject do use Mix.Project def project do @@ -23,7 +23,7 @@ defmodule CfPhx.MixProject do # Type `mix help compile.app` for more information. def application do [ - mod: {CfPhx.Application, []}, + mod: {CfHttp.Application, []}, extra_applications: [:logger, :runtime_tools] ] end diff --git a/apps/cf_http/priv/repo/migrations/20200225005454_create_users.exs b/apps/cf_http/priv/repo/migrations/20200225005454_create_users.exs index 6001ea030..43fe8b574 100644 --- a/apps/cf_http/priv/repo/migrations/20200225005454_create_users.exs +++ b/apps/cf_http/priv/repo/migrations/20200225005454_create_users.exs @@ -1,4 +1,4 @@ -defmodule CfPhx.Repo.Migrations.CreateUsers do +defmodule CfHttp.Repo.Migrations.CreateUsers do use Ecto.Migration def change do diff --git a/apps/cf_http/priv/repo/migrations/20200228145810_create_devices.exs b/apps/cf_http/priv/repo/migrations/20200228145810_create_devices.exs index f9328521f..76c94a141 100644 --- a/apps/cf_http/priv/repo/migrations/20200228145810_create_devices.exs +++ b/apps/cf_http/priv/repo/migrations/20200228145810_create_devices.exs @@ -1,4 +1,4 @@ -defmodule CfPhx.Repo.Migrations.CreateDevices do +defmodule CfHttp.Repo.Migrations.CreateDevices do use Ecto.Migration def change do diff --git a/apps/cf_http/priv/repo/migrations/20200228154815_create_firewall_rules.exs b/apps/cf_http/priv/repo/migrations/20200228154815_create_firewall_rules.exs index c0159ee7c..db1a7f9b5 100644 --- a/apps/cf_http/priv/repo/migrations/20200228154815_create_firewall_rules.exs +++ b/apps/cf_http/priv/repo/migrations/20200228154815_create_firewall_rules.exs @@ -1,4 +1,4 @@ -defmodule CfPhx.Repo.Migrations.CreateFirewallRules do +defmodule CfHttp.Repo.Migrations.CreateFirewallRules do use Ecto.Migration def change do diff --git a/apps/cf_http/priv/repo/seeds.exs b/apps/cf_http/priv/repo/seeds.exs index ef6fef1b5..d7987195d 100644 --- a/apps/cf_http/priv/repo/seeds.exs +++ b/apps/cf_http/priv/repo/seeds.exs @@ -5,7 +5,7 @@ # Inside the script, you can read and write to any of your # repositories directly: # -# CfPhx.Repo.insert!(%CfPhx.SomeSchema{}) +# CfHttp.Repo.insert!(%CfHttp.SomeSchema{}) # # We recommend using the bang functions (`insert!`, `update!` # and so on) as they will fail if something goes wrong. diff --git a/apps/cf_http/test/cf_http/devices_test.exs b/apps/cf_http/test/cf_http/devices_test.exs index adf1fa0c4..e09a94998 100644 --- a/apps/cf_http/test/cf_http/devices_test.exs +++ b/apps/cf_http/test/cf_http/devices_test.exs @@ -1,5 +1,5 @@ -defmodule CfPhx.DevicesTest do - use CfPhx.DataCase +defmodule CfHttp.DevicesTest do + use CfHttp.DataCase describe "devices" do end diff --git a/apps/cf_http/test/cf_http/firewall_rules_test.exs b/apps/cf_http/test/cf_http/firewall_rules_test.exs index 9290afb82..0101d51c6 100644 --- a/apps/cf_http/test/cf_http/firewall_rules_test.exs +++ b/apps/cf_http/test/cf_http/firewall_rules_test.exs @@ -1,5 +1,5 @@ -defmodule CfPhx.FirewallRulesTest do - use CfPhx.DataCase +defmodule CfHttp.FirewallRulesTest do + use CfHttp.DataCase describe "firewall_rules" do end diff --git a/apps/cf_http/test/cf_http_web/controllers/device_controller_test.exs b/apps/cf_http/test/cf_http_web/controllers/device_controller_test.exs index 6cc786681..e129a505a 100644 --- a/apps/cf_http/test/cf_http_web/controllers/device_controller_test.exs +++ b/apps/cf_http/test/cf_http_web/controllers/device_controller_test.exs @@ -1,7 +1,7 @@ -defmodule CfPhxWeb.DeviceControllerTest do - use CfPhxWeb.ConnCase +defmodule CfHttpWeb.DeviceControllerTest do + use CfHttpWeb.ConnCase - alias CfPhx.Devices + alias CfHttp.Devices @create_attrs %{name: "some name"} @update_attrs %{name: "some updated name"} diff --git a/apps/cf_http/test/cf_http_web/controllers/firewall_rule_controller_test.exs b/apps/cf_http/test/cf_http_web/controllers/firewall_rule_controller_test.exs index 46993a1f1..fc836c691 100644 --- a/apps/cf_http/test/cf_http_web/controllers/firewall_rule_controller_test.exs +++ b/apps/cf_http/test/cf_http_web/controllers/firewall_rule_controller_test.exs @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.FirewallRuleControllerTest do - use CfPhxWeb.ConnCase +defmodule CfHttpWeb.FirewallRuleControllerTest do + use CfHttpWeb.ConnCase describe "index" do end diff --git a/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs b/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs index 7bb9f2f36..a42397504 100644 --- a/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs +++ b/apps/cf_http/test/cf_http_web/controllers/page_controller_test.exs @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.PageControllerTest do - use CfPhxWeb.ConnCase +defmodule CfHttpWeb.PageControllerTest do + use CfHttpWeb.ConnCase test "GET /", %{conn: conn} do conn = get(conn, "/") diff --git a/apps/cf_http/test/cf_http_web/views/error_view_test.exs b/apps/cf_http/test/cf_http_web/views/error_view_test.exs index d31108ed5..7d65916e7 100644 --- a/apps/cf_http/test/cf_http_web/views/error_view_test.exs +++ b/apps/cf_http/test/cf_http_web/views/error_view_test.exs @@ -1,14 +1,14 @@ -defmodule CfPhxWeb.ErrorViewTest do - use CfPhxWeb.ConnCase, async: true +defmodule CfHttpWeb.ErrorViewTest do + use CfHttpWeb.ConnCase, async: true # Bring render/3 and render_to_string/3 for testing custom views import Phoenix.View test "renders 404.html" do - assert render_to_string(CfPhxWeb.ErrorView, "404.html", []) == "Not Found" + assert render_to_string(CfHttpWeb.ErrorView, "404.html", []) == "Not Found" end test "renders 500.html" do - assert render_to_string(CfPhxWeb.ErrorView, "500.html", []) == "Internal Server Error" + assert render_to_string(CfHttpWeb.ErrorView, "500.html", []) == "Internal Server Error" end end diff --git a/apps/cf_http/test/cf_http_web/views/layout_view_test.exs b/apps/cf_http/test/cf_http_web/views/layout_view_test.exs index c1ed06e34..14e3b0e0d 100644 --- a/apps/cf_http/test/cf_http_web/views/layout_view_test.exs +++ b/apps/cf_http/test/cf_http_web/views/layout_view_test.exs @@ -1,5 +1,5 @@ -defmodule CfPhxWeb.LayoutViewTest do - use CfPhxWeb.ConnCase, async: true +defmodule CfHttpWeb.LayoutViewTest do + use CfHttpWeb.ConnCase, async: true # When testing helpers, you may want to import Phoenix.HTML and # use functions such as safe_to_string() to convert the helper diff --git a/apps/cf_http/test/cf_http_web/views/page_view_test.exs b/apps/cf_http/test/cf_http_web/views/page_view_test.exs index 7e81d5395..d3f100c9a 100644 --- a/apps/cf_http/test/cf_http_web/views/page_view_test.exs +++ b/apps/cf_http/test/cf_http_web/views/page_view_test.exs @@ -1,3 +1,3 @@ -defmodule CfPhxWeb.PageViewTest do - use CfPhxWeb.ConnCase, async: true +defmodule CfHttpWeb.PageViewTest do + use CfHttpWeb.ConnCase, async: true end diff --git a/apps/cf_http/test/support/channel_case.ex b/apps/cf_http/test/support/channel_case.ex index 6a4c1abf5..ebe2cbcf1 100644 --- a/apps/cf_http/test/support/channel_case.ex +++ b/apps/cf_http/test/support/channel_case.ex @@ -1,4 +1,4 @@ -defmodule CfPhxWeb.ChannelCase do +defmodule CfHttpWeb.ChannelCase do @moduledoc """ This module defines the test case to be used by channel tests. @@ -11,7 +11,7 @@ defmodule CfPhxWeb.ChannelCase do we enable the SQL sandbox, so changes done to the database are reverted at the end of every test. If you are using PostgreSQL, you can even run database tests asynchronously - by setting `use CfPhxWeb.ChannelCase, async: true`, although + by setting `use CfHttpWeb.ChannelCase, async: true`, although this option is not recommended for other databases. """ @@ -23,15 +23,15 @@ defmodule CfPhxWeb.ChannelCase do use Phoenix.ChannelTest # The default endpoint for testing - @endpoint CfPhxWeb.Endpoint + @endpoint CfHttpWeb.Endpoint end end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfPhx.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfHttp.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(CfPhx.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(CfHttp.Repo, {:shared, self()}) end :ok diff --git a/apps/cf_http/test/support/conn_case.ex b/apps/cf_http/test/support/conn_case.ex index 041ad7840..0ec47b376 100644 --- a/apps/cf_http/test/support/conn_case.ex +++ b/apps/cf_http/test/support/conn_case.ex @@ -1,4 +1,4 @@ -defmodule CfPhxWeb.ConnCase do +defmodule CfHttpWeb.ConnCase do @moduledoc """ This module defines the test case to be used by tests that require setting up a connection. @@ -11,7 +11,7 @@ defmodule CfPhxWeb.ConnCase do we enable the SQL sandbox, so changes done to the database are reverted at the end of every test. If you are using PostgreSQL, you can even run database tests asynchronously - by setting `use CfPhxWeb.ConnCase, async: true`, although + by setting `use CfHttpWeb.ConnCase, async: true`, although this option is not recommended for other databases. """ @@ -22,18 +22,18 @@ defmodule CfPhxWeb.ConnCase do # Import conveniences for testing with connections import Plug.Conn import Phoenix.ConnTest - alias CfPhxWeb.Router.Helpers, as: Routes + alias CfHttpWeb.Router.Helpers, as: Routes # The default endpoint for testing - @endpoint CfPhxWeb.Endpoint + @endpoint CfHttpWeb.Endpoint end end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfPhx.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfHttp.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(CfPhx.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(CfHttp.Repo, {:shared, self()}) end {:ok, conn: Phoenix.ConnTest.build_conn()} diff --git a/apps/cf_http/test/support/data_case.ex b/apps/cf_http/test/support/data_case.ex index d0ee0172f..24a7163f2 100644 --- a/apps/cf_http/test/support/data_case.ex +++ b/apps/cf_http/test/support/data_case.ex @@ -1,4 +1,4 @@ -defmodule CfPhx.DataCase do +defmodule CfHttp.DataCase do @moduledoc """ This module defines the setup for tests requiring access to the application's data layer. @@ -10,7 +10,7 @@ defmodule CfPhx.DataCase do we enable the SQL sandbox, so changes done to the database are reverted at the end of every test. If you are using PostgreSQL, you can even run database tests asynchronously - by setting `use CfPhx.DataCase, async: true`, although + by setting `use CfHttp.DataCase, async: true`, although this option is not recommended for other databases. """ @@ -18,20 +18,20 @@ defmodule CfPhx.DataCase do using do quote do - alias CfPhx.Repo + alias CfHttp.Repo import Ecto import Ecto.Changeset import Ecto.Query - import CfPhx.DataCase + import CfHttp.DataCase end end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfPhx.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(CfHttp.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(CfPhx.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(CfHttp.Repo, {:shared, self()}) end :ok diff --git a/apps/cf_http/test/test_helper.exs b/apps/cf_http/test/test_helper.exs index 01cf0f7d6..dec00ccea 100644 --- a/apps/cf_http/test/test_helper.exs +++ b/apps/cf_http/test/test_helper.exs @@ -1,2 +1,2 @@ ExUnit.start() -Ecto.Adapters.SQL.Sandbox.mode(CfPhx.Repo, :manual) +Ecto.Adapters.SQL.Sandbox.mode(CfHttp.Repo, :manual) diff --git a/bin/start_cf_http.sh b/bin/start_cf_http.sh index 34ede2c3c..7e9f43208 100755 --- a/bin/start_cf_http.sh +++ b/bin/start_cf_http.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh # migrate DB -cf_phx/bin/cf_phx eval "CfPhx.Release.migrate" +cf_http/bin/cf_http eval "CfHttp.Release.migrate" # start app -cf_phx/bin/cf_phx start +cf_http/bin/cf_http start diff --git a/config/config.exs b/config/config.exs index 770ecbdef..4b6613136 100644 --- a/config/config.exs +++ b/config/config.exs @@ -19,15 +19,15 @@ import Config # Use Jason for JSON parsing in Phoenix config :phoenix, :json_library, Jason -config :cf_phx, - ecto_repos: [CfPhx.Repo] +config :cf_http, + ecto_repos: [CfHttp.Repo] # Configures the endpoint -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, url: [host: "localhost"], secret_key_base: "5OVYJ83AcoQcPmdKNksuBhJFBhjHD1uUa9mDOHV/6EIdBQ6pXksIhkVeWIzFk5SD", - render_errors: [view: CfPhxWeb.ErrorView, accepts: ~w(html json)], - pubsub_server: [name: CfPhx.PubSub] + render_errors: [view: CfHttpWeb.ErrorView, accepts: ~w(html json)], + pubsub_server: [name: CfHttp.PubSub] # Configures Elixir's Logger config :logger, :console, diff --git a/config/dev.exs b/config/dev.exs index 855940fbc..3a6b25010 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,7 +1,7 @@ import Config # Configure your database -config :cf_phx, CfPhx.Repo, +config :cf_http, CfHttp.Repo, username: "cloudfire", password: "postgres", database: "cloudfire_dev", @@ -15,7 +15,7 @@ config :cf_phx, CfPhx.Repo, # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with webpack to recompile .js and .css sources. -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, http: [port: 4000], debug_errors: true, code_reloader: true, @@ -55,13 +55,13 @@ config :cf_phx, CfPhxWeb.Endpoint, # different ports. # Watch static and templates for browser reloading. -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, live_reload: [ patterns: [ ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$", ~r"priv/gettext/.*(po)$", - ~r"lib/cf_phx_web/(live|views)/.*(ex)$", - ~r"lib/cf_phx_web/templates/.*(eex)$" + ~r"lib/cf_http_web/(live|views)/.*(ex)$", + ~r"lib/cf_http_web/templates/.*(eex)$" ] ] diff --git a/config/prod.exs b/config/prod.exs index bd1cb47c5..d9abac8ef 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -9,7 +9,7 @@ import Config # manifest is generated by the `mix phx.digest` task, # which you should run after static files are built and # before starting your production server. -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/cache_manifest.json" @@ -21,7 +21,7 @@ config :logger, level: :info # To get SSL working, you will need to add the `https` key # to the previous section and set your `:url` port to 443: # -# config :cf_phx, CfPhxWeb.Endpoint, +# config :cf_http, CfHttpWeb.Endpoint, # ... # url: [host: "example.com", port: 443], # https: [ @@ -45,7 +45,7 @@ config :logger, level: :info # We also recommend setting `force_ssl` in your endpoint, ensuring # no data is ever sent via http, always redirecting to https: # -# config :cf_phx, CfPhxWeb.Endpoint, +# config :cf_http, CfHttpWeb.Endpoint, # force_ssl: [hsts: true] # # Check `Plug.SSL` for all available options in `force_ssl`. diff --git a/config/releases.exs b/config/releases.exs index 218fc9c17..663024260 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -18,12 +18,12 @@ secret_key_base = You can generate one by calling: mix phx.gen.secret """ -config :cf_phx, CfPhx.Repo, +config :cf_http, CfHttp.Repo, # ssl: true, url: database_url, pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10") -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, http: [ port: String.to_integer(System.get_env("PORT") || "4000"), transport_options: [socket_opts: [:inet6]] @@ -35,7 +35,7 @@ config :cf_phx, CfPhxWeb.Endpoint, # If you are doing OTP releases, you need to instruct Phoenix # to start each relevant endpoint: # -config :cf_phx, CfPhxWeb.Endpoint, server: true +config :cf_http, CfHttpWeb.Endpoint, server: true # # Then you can assemble a release by calling `mix release`. # See `mix help release` for more information. diff --git a/config/test.exs b/config/test.exs index fe0d4df0e..847eb99f1 100644 --- a/config/test.exs +++ b/config/test.exs @@ -20,11 +20,11 @@ end # Configure your database db_url = System.get_env("DATABASE_URL") -config :cf_phx, CfPhx.Repo, DBConfig.config(db_url) +config :cf_http, CfHttp.Repo, DBConfig.config(db_url) # We don't run a server during test. If one is required, # you can enable the server option below. -config :cf_phx, CfPhxWeb.Endpoint, +config :cf_http, CfHttpWeb.Endpoint, http: [port: 4002], server: false diff --git a/mix.exs b/mix.exs index 4f7c834f5..2b789029e 100644 --- a/mix.exs +++ b/mix.exs @@ -8,8 +8,8 @@ defmodule CloudfireUmbrella.MixProject do start_permanent: Mix.env() == :prod, deps: deps(), releases: [ - cf_phx: [ - applications: [cf_phx: :permanent], + cf_http: [ + applications: [cf_http: :permanent], include_executables_for: [:unix], cookie: System.get_env("ERL_COOKIE") ],