diff --git a/config/config.exs b/config/config.exs index 1c5c431..3997642 100644 --- a/config/config.exs +++ b/config/config.exs @@ -7,12 +7,12 @@ # General application configuration import Config -config :JOL, +config :jol, ecto_repos: [JOL.Repo], generators: [timestamp_type: :utc_datetime] # Configures the endpoint -config :JOL, JOLWeb.Endpoint, +config :jol, JOLWeb.Endpoint, url: [host: "localhost"], adapter: Bandit.PhoenixAdapter, render_errors: [ @@ -29,7 +29,7 @@ config :JOL, JOLWeb.Endpoint, # # For production it's recommended to configure a different adapter # at the `config/runtime.exs`. -config :JOL, JOL.Mailer, adapter: Swoosh.Adapters.Local +config :jol, JOL.Mailer, adapter: Swoosh.Adapters.Local # Configure esbuild (the version is required) config :esbuild, diff --git a/config/dev.exs b/config/dev.exs index 87dcead..333e1b1 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,7 +1,7 @@ import Config # Configure your database -config :JOL, JOL.Repo, +config :jol, JOL.Repo, username: "postgres", password: "postgres", hostname: "localhost", @@ -16,7 +16,7 @@ config :JOL, JOL.Repo, # The watchers configuration can be used to run external # watchers to your application. For example, we can use it # to bundle .js and .css sources. -config :JOL, JOLWeb.Endpoint, +config :jol, JOLWeb.Endpoint, # Binding to loopback ipv4 address prevents access from other machines. # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. http: [ip: {127, 0, 0, 1}, port: 4000], @@ -25,8 +25,8 @@ config :JOL, JOLWeb.Endpoint, debug_errors: true, secret_key_base: "9rmK754o3RoBXorXcCf0PTZkCJbfAOdNGyXSQizgF5CYcd9iQTR2UhaNGw5v74DR", watchers: [ - esbuild: {Esbuild, :install_and_run, [:JOL, ~w(--sourcemap=inline --watch)]}, - tailwind: {Tailwind, :install_and_run, [:JOL, ~w(--watch)]} + esbuild: {Esbuild, :install_and_run, [:jol, ~w(--sourcemap=inline --watch)]}, + tailwind: {Tailwind, :install_and_run, [:jol, ~w(--watch)]} ] # ## SSL Support @@ -53,7 +53,7 @@ config :JOL, JOLWeb.Endpoint, # different ports. # Watch static and templates for browser reloading. -config :JOL, JOLWeb.Endpoint, +config :jol, JOLWeb.Endpoint, live_reload: [ patterns: [ ~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$", @@ -63,7 +63,7 @@ config :JOL, JOLWeb.Endpoint, ] # Enable dev routes for dashboard and mailbox -config :JOL, dev_routes: true +config :jol, dev_routes: true # Do not include metadata nor timestamps in development logs config :logger, :console, format: "[$level] $message\n" diff --git a/config/prod.exs b/config/prod.exs index 7084927..b1ba141 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -5,7 +5,7 @@ import Config # manifest is generated by the `mix assets.deploy` task, # which you should run after static files are built and # before starting your production server. -config :JOL, JOLWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" +config :jol, JOLWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" # Configures Swoosh API Client config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: JOL.Finch diff --git a/config/runtime.exs b/config/runtime.exs index 425f5f3..df90b09 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -17,7 +17,7 @@ import Config # Alternatively, you can use `mix phx.gen.release` to generate a `bin/server` # script that automatically sets the env var above. if System.get_env("PHX_SERVER") do - config :JOL, JOLWeb.Endpoint, server: true + config :jol, JOLWeb.Endpoint, server: true end if config_env() == :prod do @@ -30,7 +30,7 @@ if config_env() == :prod do maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: [] - config :JOL, JOL.Repo, + config :jol, JOL.Repo, # ssl: true, url: database_url, pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), @@ -51,9 +51,9 @@ if config_env() == :prod do host = System.get_env("PHX_HOST") || "example.com" port = String.to_integer(System.get_env("PORT") || "4000") - config :JOL, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY") + config :jol, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY") - config :JOL, JOLWeb.Endpoint, + config :jol, JOLWeb.Endpoint, url: [host: host, port: 443, scheme: "https"], http: [ # Enable IPv6 and bind on all interfaces. @@ -70,7 +70,7 @@ if config_env() == :prod do # To get SSL working, you will need to add the `https` key # to your endpoint configuration: # - # config :JOL, JOLWeb.Endpoint, + # config :jol, JOLWeb.Endpoint, # https: [ # ..., # port: 443, @@ -92,7 +92,7 @@ if config_env() == :prod do # We also recommend setting `force_ssl` in your config/prod.exs, # ensuring no data is ever sent via http, always redirecting to https: # - # config :JOL, JOLWeb.Endpoint, + # config :jol, JOLWeb.Endpoint, # force_ssl: [hsts: true] # # Check `Plug.SSL` for all available options in `force_ssl`. @@ -103,7 +103,7 @@ if config_env() == :prod do # Also, you may need to configure the Swoosh API client of your choice if you # are not using SMTP. Here is an example of the configuration: # - # config :JOL, JOL.Mailer, + # config :jol, JOL.Mailer, # adapter: Swoosh.Adapters.Mailgun, # api_key: System.get_env("MAILGUN_API_KEY"), # domain: System.get_env("MAILGUN_DOMAIN") diff --git a/config/test.exs b/config/test.exs index d252be3..e28474f 100644 --- a/config/test.exs +++ b/config/test.exs @@ -5,7 +5,7 @@ import Config # The MIX_TEST_PARTITION environment variable can be used # to provide built-in test partitioning in CI environment. # Run `mix help test` for more information. -config :JOL, JOL.Repo, +config :jol, JOL.Repo, username: "postgres", password: "postgres", hostname: "localhost", @@ -15,13 +15,13 @@ config :JOL, JOL.Repo, # We don't run a server during test. If one is required, # you can enable the server option below. -config :JOL, JOLWeb.Endpoint, +config :jol, JOLWeb.Endpoint, http: [ip: {127, 0, 0, 1}, port: 4002], secret_key_base: "TcmWd6GafOT64XVzHiK6e6Yub8o8jhoi4gMK5K4PlAXyD7nfwzjsutXiMDifprgw", server: false # In test we don't send emails. -config :JOL, JOL.Mailer, adapter: Swoosh.Adapters.Test +config :jol, JOL.Mailer, adapter: Swoosh.Adapters.Test # Disable swoosh api client as it is only required for production adapters. config :swoosh, :api_client, false diff --git a/lib/jol/application.ex b/lib/jol/application.ex index f53f863..4cc2155 100644 --- a/lib/jol/application.ex +++ b/lib/jol/application.ex @@ -10,7 +10,7 @@ defmodule JOL.Application do children = [ JOLWeb.Telemetry, JOL.Repo, - {DNSCluster, query: Application.get_env(:JOL, :dns_cluster_query) || :ignore}, + {DNSCluster, query: Application.get_env(:jol, :dns_cluster_query) || :ignore}, {Phoenix.PubSub, name: JOL.PubSub}, # Start the Finch HTTP client for sending emails {Finch, name: JOL.Finch}, diff --git a/lib/jol/blog.ex b/lib/jol/blog.ex index fb77cc8..64505b8 100644 --- a/lib/jol/blog.ex +++ b/lib/jol/blog.ex @@ -3,7 +3,7 @@ defmodule JOL.Blog do use NimblePublisher, build: Post, - from: Application.app_dir(:JOL, "priv/posts/**/*.md"), + from: Application.app_dir(:jol, "priv/posts/**/*.md"), as: :posts @posts Enum.sort_by(@posts, & &1.date, {:desc, Date}) diff --git a/lib/jol/mailer.ex b/lib/jol/mailer.ex index 2712799..5f0945b 100644 --- a/lib/jol/mailer.ex +++ b/lib/jol/mailer.ex @@ -1,3 +1,3 @@ defmodule JOL.Mailer do - use Swoosh.Mailer, otp_app: :JOL + use Swoosh.Mailer, otp_app: :jol end diff --git a/lib/jol/repo.ex b/lib/jol/repo.ex index b6001a9..81dc31a 100644 --- a/lib/jol/repo.ex +++ b/lib/jol/repo.ex @@ -1,5 +1,5 @@ defmodule JOL.Repo do use Ecto.Repo, - otp_app: :JOL, + otp_app: :jol, adapter: Ecto.Adapters.Postgres end diff --git a/lib/jol_web/endpoint.ex b/lib/jol_web/endpoint.ex index 26f37b3..14bd7f1 100644 --- a/lib/jol_web/endpoint.ex +++ b/lib/jol_web/endpoint.ex @@ -1,5 +1,5 @@ defmodule JOLWeb.Endpoint do - use Phoenix.Endpoint, otp_app: :JOL + use Phoenix.Endpoint, otp_app: :jol # The session will be stored in the cookie and signed, # this means its contents can be read but not tampered with. @@ -21,7 +21,7 @@ defmodule JOLWeb.Endpoint do # when deploying your static files in production. plug Plug.Static, at: "/", - from: :JOL, + from: :jol, gzip: false, only: JOLWeb.static_paths() @@ -31,7 +31,7 @@ defmodule JOLWeb.Endpoint do socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket plug Phoenix.LiveReloader plug Phoenix.CodeReloader - plug Phoenix.Ecto.CheckRepoStatus, otp_app: :JOL + plug Phoenix.Ecto.CheckRepoStatus, otp_app: :jol end plug Phoenix.LiveDashboard.RequestLogger, diff --git a/lib/jol_web/gettext.ex b/lib/jol_web/gettext.ex index 6b3d14f..eb5cd78 100644 --- a/lib/jol_web/gettext.ex +++ b/lib/jol_web/gettext.ex @@ -20,5 +20,5 @@ defmodule JOLWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :JOL + use Gettext, otp_app: :jol end diff --git a/lib/jol_web/router.ex b/lib/jol_web/router.ex index 4555eb4..b30e113 100644 --- a/lib/jol_web/router.ex +++ b/lib/jol_web/router.ex @@ -26,7 +26,7 @@ defmodule JOLWeb.Router do # end # Enable LiveDashboard and Swoosh mailbox preview in development - if Application.compile_env(:JOL, :dev_routes) do + if Application.compile_env(:jol, :dev_routes) do # If you want to use the LiveDashboard in production, you should put # it behind authentication and allow only admins to access it. # If your application does not have an admins-only section yet, diff --git a/mix.exs b/mix.exs index 83918be..12b5e2b 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule JOL.MixProject do def project do [ - app: :JOL, + app: :jol, version: "0.1.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()),