Merge branch 'feature/restart-pleroma-from-outside-application' into 'develop'
authorrinpatch <rinpatch@sdf.org>
Wed, 5 Feb 2020 16:59:21 +0000 (16:59 +0000)
committerrinpatch <rinpatch@sdf.org>
Wed, 5 Feb 2020 16:59:21 +0000 (16:59 +0000)
Restarting pleroma from outside application

See merge request pleroma/pleroma!2144

1  2 
lib/pleroma/web/router.ex
mix.exs

index b5c1d85c700a4a4843cf358173d1c108b409f024,43fee8a0f67563647f847c335b2c3c6752859a3e..078bf138c6ff18ac9f923f97d0c1e2765081c915
@@@ -197,6 -197,7 +197,7 @@@ defmodule Pleroma.Web.Router d
      post("/config", AdminAPIController, :config_update)
      get("/config/descriptions", AdminAPIController, :config_descriptions)
      get("/config/migrate_from_db", AdminAPIController, :migrate_from_db)
+     get("/restart", AdminAPIController, :restart)
  
      get("/moderation_log", AdminAPIController, :list_log)
  
      get("/notice/:id", OStatus.OStatusController, :notice)
      get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
  
 -    get("/users/:nickname/feed", Feed.FeedController, :feed)
 -    get("/users/:nickname", Feed.FeedController, :feed_redirect)
 +    get("/users/:nickname/feed", Feed.UserController, :feed, as: :user_feed)
 +    get("/users/:nickname", Feed.UserController, :feed_redirect, as: :user_feed)
 +
 +    get("/tags/:tag", Feed.TagController, :feed, as: :tag_feed)
    end
  
    scope "/", Pleroma.Web do
diff --combined mix.exs
index ea6b29f57d1f9aa22513499add2efc4cee6c29a3,8cbea6f75adf01c9b34cfcef33caf5c9dcde7608..f6794f12671d38b85e98b5c1c06b5ddb3a08870a
+++ b/mix.exs
@@@ -8,7 -8,7 +8,7 @@@ defmodule Pleroma.Mixfile d
        elixir: "~> 1.8",
        elixirc_paths: elixirc_paths(Mix.env()),
        compilers: [:phoenix, :gettext] ++ Mix.compilers(),
-       elixirc_options: [warnings_as_errors: true],
+       elixirc_options: [warnings_as_errors: warnings_as_errors(Mix.env())],
        xref: [exclude: [:eldap]],
        start_permanent: Mix.env() == :prod,
        aliases: aliases(),
    defp elixirc_paths(:test), do: ["lib", "test/support"]
    defp elixirc_paths(_), do: ["lib"]
  
+   defp warnings_as_errors(:prod), do: false
+   # Uncomment this if you need testing configurable_from_database logic
+   # defp warnings_as_errors(:dev), do: false
+   defp warnings_as_errors(_), do: true
    # Specifies OAuth dependencies.
    defp oauth_deps do
      oauth_strategy_packages =
        {:phoenix_pubsub, "~> 1.1"},
        {:phoenix_ecto, "~> 4.0"},
        {:ecto_enum, "~> 1.4"},
 -      {:ecto_sql, "~> 3.2"},
 +      {:ecto_sql, "~> 3.3.2"},
        {:postgrex, ">= 0.13.5"},
        {:oban, "~> 0.12.0"},
        {:quantum, "~> 2.3"},
        {:captcha,
         git: "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git",
         ref: "e0f16822d578866e186a0974d65ad58cddc1e2ab"},
-       {:mox, "~> 0.5", only: :test}
+       {:mox, "~> 0.5", only: :test},
+       {:restarter, path: "./restarter"}
      ] ++ oauth_deps()
    end