projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/license-attribution' into 'develop'
[akkoma]
/
lib
/
mix
/
tasks
/
pleroma
/
config.ex
diff --git
a/lib/mix/tasks/pleroma/config.ex
b/lib/mix/tasks/pleroma/config.ex
index 4ed2c978940fcac2c4fd844f2924c52a80a6124c..a71bcd447bb648a4e9b9649273811910f4a1459e 100644
(file)
--- a/
lib/mix/tasks/pleroma/config.ex
+++ b/
lib/mix/tasks/pleroma/config.ex
@@
-1,3
+1,7
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Mix.Tasks.Pleroma.Config do
use Mix.Task
import Mix.Pleroma
defmodule Mix.Tasks.Pleroma.Config do
use Mix.Task
import Mix.Pleroma
@@
-36,9
+40,11
@@
defmodule Mix.Tasks.Pleroma.Config do
end
end
end
end
- def run(["migrate_from_db", env]) do
+ def run(["migrate_from_db", env
, delete?
]) do
start_pleroma()
start_pleroma()
+ delete? = if delete? == "true", do: true, else: false
+
if Pleroma.Config.get([:instance, :dynamic_configuration]) do
config_path = "config/#{env}.exported_from_db.secret.exs"
if Pleroma.Config.get([:instance, :dynamic_configuration]) do
config_path = "config/#{env}.exported_from_db.secret.exs"
@@
-47,7
+53,11
@@
defmodule Mix.Tasks.Pleroma.Config do
Repo.all(Config)
|> Enum.each(fn config ->
Repo.all(Config)
|> Enum.each(fn config ->
- mark = if String.starts_with?(config.key, "Pleroma."), do: ",", else: ":"
+ mark =
+ if String.starts_with?(config.key, "Pleroma.") or
+ String.starts_with?(config.key, "Ueberauth"),
+ do: ",",
+ else: ":"
IO.write(
file,
IO.write(
file,
@@
-56,8
+66,10
@@
defmodule Mix.Tasks.Pleroma.Config do
}\r\n"
)
}\r\n"
)
- {:ok, _} = Repo.delete(config)
- Mix.shell().info("#{config.key} deleted from DB.")
+ if delete? do
+ {:ok, _} = Repo.delete(config)
+ Mix.shell().info("#{config.key} deleted from DB.")
+ end
end)
File.close(file)
end)
File.close(file)