forked from AkkomaGang/akkoma
Fixes for dynamic configuration
This commit is contained in:
parent
ba584364e9
commit
32320c1ee9
5 changed files with 8 additions and 7 deletions
|
@ -60,5 +60,5 @@
|
|||
)
|
||||
end
|
||||
|
||||
if File.exists?("./config/dev.migrated.secret.exs"),
|
||||
do: import_config("./config/dev.migrated.secret.exs")
|
||||
if File.exists?("./config/dev.exported_from_db.secret.exs"),
|
||||
do: import_config("dev.exported_from_db.secret.exs")
|
||||
|
|
|
@ -64,5 +64,5 @@
|
|||
# which should be versioned separately.
|
||||
import_config "prod.secret.exs"
|
||||
|
||||
if File.exists?("./config/prod.migrated.secret.exs"),
|
||||
do: import_config("./config/prod.migrated.secret.exs")
|
||||
if File.exists?("./config/prod.exported_from_db.secret.exs"),
|
||||
do: import_config("prod.exported_from_db.secret.exs")
|
||||
|
|
|
@ -40,9 +40,10 @@ def run(["migrate_from_db", env]) do
|
|||
Common.start_pleroma()
|
||||
|
||||
if Pleroma.Config.get([:instance, :dynamic_configuration]) do
|
||||
config_path = "config/#{env}.migrated.secret.exs"
|
||||
config_path = "config/#{env}.exported_from_db.secret.exs"
|
||||
|
||||
{:ok, file} = File.open(config_path, [:write])
|
||||
IO.write(file, "use Mix.Config\r\n")
|
||||
|
||||
Repo.all(Config)
|
||||
|> Enum.each(fn config ->
|
||||
|
|
|
@ -5,7 +5,7 @@ defmodule Mix.Tasks.Pleroma.ConfigTest do
|
|||
|
||||
setup_all do
|
||||
Mix.shell(Mix.Shell.Process)
|
||||
temp_file = "config/temp.migrated.secret.exs"
|
||||
temp_file = "config/temp.exported_from_db.secret.exs"
|
||||
|
||||
dynamic = Pleroma.Config.get([:instance, :dynamic_configuration])
|
||||
|
||||
|
|
|
@ -1334,7 +1334,7 @@ test "with settings in db", %{conn: conn} do
|
|||
setup %{conn: conn} do
|
||||
admin = insert(:user, info: %{is_admin: true})
|
||||
|
||||
temp_file = "config/test.migrated.secret.exs"
|
||||
temp_file = "config/test.exported_from_db.secret.exs"
|
||||
|
||||
on_exit(fn ->
|
||||
Application.delete_env(:pleroma, :key1)
|
||||
|
|
Loading…
Reference in a new issue