diff --git a/Dockerfile b/Dockerfile
index 8e271cd..2e531b1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -55,4 +55,4 @@ RUN chown -R app: ./prod
USER app
# Run the Phoenix app
-CMD ["./prod/rel/podcast_feed/bin/podcast_feed", "start"]
+CMD ["./prod/rel/openpod/bin/openpod", "start"]
diff --git a/config/config.exs b/config/config.exs
index 20534e3..066768d 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -7,18 +7,18 @@
# General application configuration
use Mix.Config
-config :podcast_feed,
- ecto_repos: [PodcastFeed.Repo]
+config :openpod,
+ ecto_repos: [Openpod.Repo]
# Configures the endpoint
-config :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "SWl0xVj8AVXoc2G0eUk6VfeOd/lppjkaKbiHWs4ucxAUJ8+wzAEa4bMo0ZVjtVVk",
- render_errors: [view: PodcastFeedWeb.ErrorView, accepts: ~w(html json), layout: false],
- pubsub_server: PodcastFeed.PubSub,
+ render_errors: [view: OpenpodWeb.ErrorView, accepts: ~w(html json), layout: false],
+ pubsub_server: Openpod.PubSub,
live_view: [signing_salt: "6jHv46Xw"]
-config :podcast_feed,
+config :openpod,
cache_duration: :timer.hours(24)
# Configures Elixir's Logger
diff --git a/config/dev.exs b/config/dev.exs
index 50c3ea2..2edae43 100644
--- a/config/dev.exs
+++ b/config/dev.exs
@@ -1,10 +1,10 @@
use Mix.Config
# Configure your database
-config :podcast_feed, PodcastFeed.Repo,
+config :openpod, Openpod.Repo,
username: "postgres",
password: "postgres",
- database: "podcast_feed_dev",
+ database: "openpod_dev",
hostname: "localhost",
show_sensitive_data_on_connection_error: true,
pool_size: 10
@@ -15,7 +15,7 @@ config :podcast_feed, PodcastFeed.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 :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
http: [port: 5000],
debug_errors: true,
code_reloader: true,
@@ -55,13 +55,13 @@ config :podcast_feed, PodcastFeedWeb.Endpoint,
# different ports.
# Watch static and templates for browser reloading.
-config :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
- ~r"lib/podcast_feed_web/(live|views)/.*(ex)$",
- ~r"lib/podcast_feed_web/templates/.*(eex)$"
+ ~r"lib/openpod_web/(live|views)/.*(ex)$",
+ ~r"lib/openpod_web/templates/.*(eex)$"
]
]
diff --git a/config/prod.exs b/config/prod.exs
index 0cf94b1..72ba60d 100644
--- a/config/prod.exs
+++ b/config/prod.exs
@@ -9,7 +9,7 @@ use Mix.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 :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
load_from_system_env: true,
url: [scheme: "https", host: "other-unwilling-barasinga.gigalixirapp.com", port: 443],
http: [port: {:system, "PORT"}],
@@ -19,7 +19,7 @@ config :podcast_feed, PodcastFeedWeb.Endpoint,
version: Application.spec(:phoenix_distillery, :vsn)
# force_ssl: [rewrite_on: [:x_forwarded_proto]]
-config :podcast_feed,
+config :openpod,
cache_duration: :timer.hours(24)
# Do not print debug messages in production
@@ -30,7 +30,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 :podcast_feed, PodcastFeedWeb.Endpoint,
+# config :openpod, OpenpodWeb.Endpoint,
# ...
# url: [host: "example.com", port: 443],
# https: [
@@ -54,7 +54,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 :podcast_feed, PodcastFeedWeb.Endpoint,
+# config :openpod, OpenpodWeb.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 56f2c8c..d060cae 100644
--- a/config/releases.exs
+++ b/config/releases.exs
@@ -4,7 +4,7 @@ secret_key_base = System.fetch_env!("SECRET_KEY_BASE")
application_port = System.fetch_env!("APP_PORT")
application_host = System.fetch_env!("APP_HOST")
-config :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
url: [scheme: "http", host: application_host, port: String.to_integer(application_port)],
http: [:inet6, port: String.to_integer(application_port)],
secret_key_base: secret_key_base
diff --git a/config/test.exs b/config/test.exs
index 2b65e42..5aaafcd 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -5,16 +5,16 @@ use Mix.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 :podcast_feed, PodcastFeed.Repo,
+# config :openpod, Openpod.Repo,
# username: "postgres",
# password: "postgres",
-# database: "podcast_feed_test#{System.get_env("MIX_TEST_PARTITION")}",
+# database: "openpod_test#{System.get_env("MIX_TEST_PARTITION")}",
# hostname: "localhost",
# pool: Ecto.Adapters.SQL.Sandbox
# We don't run a server during test. If one is required,
# you can enable the server option below.
-config :podcast_feed, PodcastFeedWeb.Endpoint,
+config :openpod, OpenpodWeb.Endpoint,
http: [port: 4002],
server: false
diff --git a/lib/podcast_feed.ex b/lib/openpod.ex
similarity index 68%
rename from lib/podcast_feed.ex
rename to lib/openpod.ex
index 3d2609b..c49b4b4 100644
--- a/lib/podcast_feed.ex
+++ b/lib/openpod.ex
@@ -1,12 +1,12 @@
-defmodule PodcastFeed do
+defmodule Openpod do
@moduledoc """
- PodcastFeed keeps the contexts that define your domain
+ Openpod keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""
- alias PodcastFeed.Provider.Archive
+ alias Openpod.Provider.Archive
def archive(identifier) do
Archive.Parser.by_identifier(identifier)
diff --git a/lib/podcast_feed/application.ex b/lib/openpod/application.ex
similarity index 70%
rename from lib/podcast_feed/application.ex
rename to lib/openpod/application.ex
index 28b1db7..0cc4bfa 100644
--- a/lib/podcast_feed/application.ex
+++ b/lib/openpod/application.ex
@@ -1,4 +1,4 @@
-defmodule PodcastFeed.Application do
+defmodule Openpod.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
@@ -15,25 +15,25 @@ defmodule PodcastFeed.Application do
# Start the dynamic supervisor in order to dynamically start podcast cache
{DynamicSupervisor, [name: @archive_supervisor, strategy: :one_for_one]},
# Start the Telemetry supervisor
- PodcastFeedWeb.Telemetry,
+ OpenpodWeb.Telemetry,
# Start the PubSub system
- {Phoenix.PubSub, name: PodcastFeed.PubSub},
+ {Phoenix.PubSub, name: Openpod.PubSub},
# Start the Endpoint (http/https)
- PodcastFeedWeb.Endpoint
- # Start a worker by calling: PodcastFeed.Worker.start_link(arg)
- # {PodcastFeed.Worker, arg}
+ OpenpodWeb.Endpoint
+ # Start a worker by calling: Openpod.Worker.start_link(arg)
+ # {Openpod.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
- opts = [strategy: :one_for_one, name: PodcastFeed.Supervisor]
+ opts = [strategy: :one_for_one, name: Openpod.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
- PodcastFeedWeb.Endpoint.config_change(changed, removed)
+ OpenpodWeb.Endpoint.config_change(changed, removed)
:ok
end
end
diff --git a/lib/podcast_feed/boundary/archive_server.ex b/lib/openpod/boundary/archive_server.ex
similarity index 89%
rename from lib/podcast_feed/boundary/archive_server.ex
rename to lib/openpod/boundary/archive_server.ex
index f4820ab..838a920 100644
--- a/lib/podcast_feed/boundary/archive_server.ex
+++ b/lib/openpod/boundary/archive_server.ex
@@ -1,10 +1,10 @@
-defmodule PodcastFeed.Boundary.ArchiveServer do
+defmodule Openpod.Boundary.ArchiveServer do
@moduledoc false
use GenServer, restart: :temporary
require Logger
- alias PodcastFeed
- alias PodcastFeed.Provider.Archive
+ alias Openpod
+ alias Openpod.Provider.Archive
@registry :podcast_registry
@archive_supervisor :archive_supervisor
@@ -44,7 +44,7 @@ defmodule PodcastFeed.Boundary.ArchiveServer do
def handle_call(:get_feed, _from, feed) do
Logger.debug "retrieve cached feed data for #{feed[:identifier]}..."
- {:reply, feed[:feed_data], feed, Application.fetch_env!(:podcast_feed, :cache_duration)}
+ {:reply, feed[:feed_data], feed, Application.fetch_env!(:openpod, :cache_duration)}
end
def handle_call(:reload, _from, feed) do
diff --git a/lib/podcast_feed/provider/archive/parser.ex b/lib/openpod/provider/archive/parser.ex
similarity index 96%
rename from lib/podcast_feed/provider/archive/parser.ex
rename to lib/openpod/provider/archive/parser.ex
index 8105472..6928b08 100644
--- a/lib/podcast_feed/provider/archive/parser.ex
+++ b/lib/openpod/provider/archive/parser.ex
@@ -1,10 +1,10 @@
-defmodule PodcastFeed.Provider.Archive.Parser do
+defmodule Openpod.Provider.Archive.Parser do
@moduledoc """
This module provides a public API for fetching data from archive.org and convert them
in a common podcast data structures.
"""
- alias PodcastFeed.Utility.Format
+ alias Openpod.Utility.Format
alias __MODULE__
@archive_metadata_url "http://archive.org/metadata/{identifier}"
@@ -29,10 +29,10 @@ defmodule PodcastFeed.Provider.Archive.Parser do
def by_identifier(identifier) do
%Parser{identifier: identifier}
|> enrich_with_archive_metadata()
- |> to_podcast_feed_data()
+ |> to_openpod_data()
end
- def to_podcast_feed_data(token) do
+ def to_openpod_data(token) do
%{
podcast: podcast_data(token),
items: items_data(token)
diff --git a/lib/podcast_feed/utility/format.ex b/lib/openpod/utility/format.ex
similarity index 87%
rename from lib/podcast_feed/utility/format.ex
rename to lib/openpod/utility/format.ex
index 84561e3..f493ab5 100644
--- a/lib/podcast_feed/utility/format.ex
+++ b/lib/openpod/utility/format.ex
@@ -1,4 +1,4 @@
-defmodule PodcastFeed.Utility.Format do
+defmodule Openpod.Utility.Format do
@moduledoc """
This module provides utility to format a string
"""
diff --git a/lib/podcast_feed_web.ex b/lib/openpod_web.ex
similarity index 74%
rename from lib/podcast_feed_web.ex
rename to lib/openpod_web.ex
index c57e851..f53a809 100644
--- a/lib/podcast_feed_web.ex
+++ b/lib/openpod_web.ex
@@ -1,12 +1,12 @@
-defmodule PodcastFeedWeb do
+defmodule OpenpodWeb 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 PodcastFeedWeb, :controller
- use PodcastFeedWeb, :view
+ use OpenpodWeb, :controller
+ use OpenpodWeb, :view
The definitions below will be executed for every view,
controller, etc, so keep them short and clean, focused
@@ -19,19 +19,19 @@ defmodule PodcastFeedWeb do
def controller do
quote do
- use Phoenix.Controller, namespace: PodcastFeedWeb
+ use Phoenix.Controller, namespace: OpenpodWeb
import Plug.Conn
- import PodcastFeedWeb.Gettext
- alias PodcastFeedWeb.Router.Helpers, as: Routes
+ import OpenpodWeb.Gettext
+ alias OpenpodWeb.Router.Helpers, as: Routes
end
end
def view do
quote do
use Phoenix.View,
- root: "lib/podcast_feed_web/templates",
- namespace: PodcastFeedWeb
+ root: "lib/openpod_web/templates",
+ namespace: OpenpodWeb
# Import convenience functions from controllers
import Phoenix.Controller,
@@ -54,7 +54,7 @@ defmodule PodcastFeedWeb do
def channel do
quote do
use Phoenix.Channel
- import PodcastFeedWeb.Gettext
+ import OpenpodWeb.Gettext
end
end
@@ -66,9 +66,9 @@ defmodule PodcastFeedWeb do
# Import basic rendering functionality (render, render_layout, etc)
import Phoenix.View
- import PodcastFeedWeb.ErrorHelpers
- import PodcastFeedWeb.Gettext
- alias PodcastFeedWeb.Router.Helpers, as: Routes
+ import OpenpodWeb.ErrorHelpers
+ import OpenpodWeb.Gettext
+ alias OpenpodWeb.Router.Helpers, as: Routes
end
end
diff --git a/lib/podcast_feed_web/channels/user_socket.ex b/lib/openpod_web/channels/user_socket.ex
similarity index 84%
rename from lib/podcast_feed_web/channels/user_socket.ex
rename to lib/openpod_web/channels/user_socket.ex
index fff1666..744a16b 100644
--- a/lib/podcast_feed_web/channels/user_socket.ex
+++ b/lib/openpod_web/channels/user_socket.ex
@@ -1,8 +1,8 @@
-defmodule PodcastFeedWeb.UserSocket do
+defmodule OpenpodWeb.UserSocket do
use Phoenix.Socket
## Channels
- # channel "room:*", PodcastFeedWeb.RoomChannel
+ # channel "room:*", OpenpodWeb.RoomChannel
# Socket params are passed from the client and can
# be used to verify and authenticate a user. After
@@ -27,7 +27,7 @@ defmodule PodcastFeedWeb.UserSocket do
# Would allow you to broadcast a "disconnect" event and terminate
# all active sockets and channels for a given user:
#
- # PodcastFeedWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{})
+ # OpenpodWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{})
#
# Returning `nil` makes this socket anonymous.
@impl true
diff --git a/lib/podcast_feed_web/controllers/feed_controller.ex b/lib/openpod_web/controllers/feed_controller.ex
similarity index 82%
rename from lib/podcast_feed_web/controllers/feed_controller.ex
rename to lib/openpod_web/controllers/feed_controller.ex
index 22ae924..156146c 100644
--- a/lib/podcast_feed_web/controllers/feed_controller.ex
+++ b/lib/openpod_web/controllers/feed_controller.ex
@@ -1,6 +1,6 @@
-defmodule PodcastFeedWeb.FeedController do
- use PodcastFeedWeb, :controller
- alias PodcastFeed.Boundary.ArchiveServer
+defmodule OpenpodWeb.FeedController do
+ use OpenpodWeb, :controller
+ alias Openpod.Boundary.ArchiveServer
def by_identifier(conn, %{"identifier" => identifier, "reload" => _}) do
do_by_identifier(conn, identifier, fn -> ArchiveServer.reload(identifier) end)
diff --git a/lib/openpod_web/controllers/page_controller.ex b/lib/openpod_web/controllers/page_controller.ex
new file mode 100644
index 0000000..4b827eb
--- /dev/null
+++ b/lib/openpod_web/controllers/page_controller.ex
@@ -0,0 +1,7 @@
+defmodule OpenpodWeb.PageController do
+ use OpenpodWeb, :controller
+
+ def index(conn, _params) do
+ render(conn, "index.html")
+ end
+end
diff --git a/lib/podcast_feed_web/endpoint.ex b/lib/openpod_web/endpoint.ex
similarity index 83%
rename from lib/podcast_feed_web/endpoint.ex
rename to lib/openpod_web/endpoint.ex
index 8601e3d..3e00537 100644
--- a/lib/podcast_feed_web/endpoint.ex
+++ b/lib/openpod_web/endpoint.ex
@@ -1,16 +1,16 @@
-defmodule PodcastFeedWeb.Endpoint do
- use Phoenix.Endpoint, otp_app: :podcast_feed
+defmodule OpenpodWeb.Endpoint do
+ use Phoenix.Endpoint, otp_app: :openpod
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
- key: "_podcast_feed_key",
+ key: "_openpod_key",
signing_salt: "kxzln5AX"
]
- socket "/socket", PodcastFeedWeb.UserSocket,
+ socket "/socket", OpenpodWeb.UserSocket,
websocket: true,
longpoll: false
@@ -22,7 +22,7 @@ defmodule PodcastFeedWeb.Endpoint do
# when deploying your static files in production.
plug Plug.Static,
at: "/",
- from: :podcast_feed,
+ from: :openpod,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
@@ -32,7 +32,7 @@ defmodule PodcastFeedWeb.Endpoint do
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
- # plug Phoenix.Ecto.CheckRepoStatus, otp_app: :podcast_feed
+ # plug Phoenix.Ecto.CheckRepoStatus, otp_app: :openpod
end
plug Phoenix.LiveDashboard.RequestLogger,
@@ -50,5 +50,5 @@ defmodule PodcastFeedWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
- plug PodcastFeedWeb.Router
+ plug OpenpodWeb.Router
end
diff --git a/lib/podcast_feed_web/gettext.ex b/lib/openpod_web/gettext.ex
similarity index 84%
rename from lib/podcast_feed_web/gettext.ex
rename to lib/openpod_web/gettext.ex
index 8c16e31..d2af122 100644
--- a/lib/podcast_feed_web/gettext.ex
+++ b/lib/openpod_web/gettext.ex
@@ -1,11 +1,11 @@
-defmodule PodcastFeedWeb.Gettext do
+defmodule OpenpodWeb.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 PodcastFeedWeb.Gettext
+ import OpenpodWeb.Gettext
# Simple translation
gettext("Here is the string to translate")
@@ -20,5 +20,5 @@ defmodule PodcastFeedWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
- use Gettext, otp_app: :podcast_feed
+ use Gettext, otp_app: :openpod
end
diff --git a/lib/podcast_feed_web/router.ex b/lib/openpod_web/router.ex
similarity index 81%
rename from lib/podcast_feed_web/router.ex
rename to lib/openpod_web/router.ex
index d9072a1..d9fa41f 100644
--- a/lib/podcast_feed_web/router.ex
+++ b/lib/openpod_web/router.ex
@@ -1,5 +1,5 @@
-defmodule PodcastFeedWeb.Router do
- use PodcastFeedWeb, :router
+defmodule OpenpodWeb.Router do
+ use OpenpodWeb, :router
pipeline :browser do
plug :accepts, ["html"]
@@ -13,14 +13,14 @@ defmodule PodcastFeedWeb.Router do
plug :accepts, ["json"]
end
- scope "/podcast", PodcastFeedWeb do
+ scope "/podcast", OpenpodWeb do
pipe_through :browser
get "/:identifier", FeedController, :by_identifier
end
# Other scopes may use custom stacks.
- # scope "/api", PodcastFeedWeb do
+ # scope "/api", OpenpodWeb do
# pipe_through :api
# end
@@ -36,7 +36,7 @@ defmodule PodcastFeedWeb.Router do
scope "/" do
pipe_through :browser
- live_dashboard "/dashboard", metrics: PodcastFeedWeb.Telemetry
+ live_dashboard "/dashboard", metrics: OpenpodWeb.Telemetry
end
end
end
diff --git a/lib/podcast_feed_web/telemetry.ex b/lib/openpod_web/telemetry.ex
similarity index 72%
rename from lib/podcast_feed_web/telemetry.ex
rename to lib/openpod_web/telemetry.ex
index e554f61..5ae6197 100644
--- a/lib/podcast_feed_web/telemetry.ex
+++ b/lib/openpod_web/telemetry.ex
@@ -1,4 +1,4 @@
-defmodule PodcastFeedWeb.Telemetry do
+defmodule OpenpodWeb.Telemetry do
use Supervisor
import Telemetry.Metrics
@@ -31,11 +31,11 @@ defmodule PodcastFeedWeb.Telemetry do
),
# Database Metrics
- summary("podcast_feed.repo.query.total_time", unit: {:native, :millisecond}),
- summary("podcast_feed.repo.query.decode_time", unit: {:native, :millisecond}),
- summary("podcast_feed.repo.query.query_time", unit: {:native, :millisecond}),
- summary("podcast_feed.repo.query.queue_time", unit: {:native, :millisecond}),
- summary("podcast_feed.repo.query.idle_time", unit: {:native, :millisecond}),
+ summary("openpod.repo.query.total_time", unit: {:native, :millisecond}),
+ summary("openpod.repo.query.decode_time", unit: {:native, :millisecond}),
+ summary("openpod.repo.query.query_time", unit: {:native, :millisecond}),
+ summary("openpod.repo.query.queue_time", unit: {:native, :millisecond}),
+ summary("openpod.repo.query.idle_time", unit: {:native, :millisecond}),
# VM Metrics
summary("vm.memory.total", unit: {:byte, :kilobyte}),
@@ -49,7 +49,7 @@ defmodule PodcastFeedWeb.Telemetry do
[
# A module, function and arguments to be invoked periodically.
# This function must call :telemetry.execute/3 and a metric must be added above.
- # {PodcastFeedWeb, :count_users, []}
+ # {OpenpodWeb, :count_users, []}
]
end
end
diff --git a/lib/podcast_feed_web/templates/feed/feed.xml.eex b/lib/openpod_web/templates/feed/feed.xml.eex
similarity index 94%
rename from lib/podcast_feed_web/templates/feed/feed.xml.eex
rename to lib/openpod_web/templates/feed/feed.xml.eex
index 50bc7a6..ca9dcef 100644
--- a/lib/podcast_feed_web/templates/feed/feed.xml.eex
+++ b/lib/openpod_web/templates/feed/feed.xml.eex
@@ -21,7 +21,7 @@