File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
lib/plausible/data_migration Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,15 @@ defmodule Plausible.DataMigration.BackfillTeams do
14
14
end
15
15
16
16
def run ( opts \\ [ ] ) do
17
- dry_run? = Keyword . get ( opts , :dry_run? , true )
18
- Repo . transaction ( fn -> backfill ( dry_run? ) end , timeout: :infinity )
17
+ Application . ensure_all_started ( :cloak )
18
+ Application . ensure_all_started ( :cloak_ecto )
19
+ Plausible.Auth.TOTP.Vault . start_link ( key: totp_vault_key ( ) )
20
+ rescue
21
+ _ ->
22
+ :ok
23
+
24
+ dry_run? = Keyword . get ( opts , :dry_run? , true )
25
+ Repo . transaction ( fn -> backfill ( dry_run? ) end , timeout: :infinity )
19
26
end
20
27
21
28
defp backfill ( dry_run? ) do
@@ -613,4 +620,10 @@ defmodule Plausible.DataMigration.BackfillTeams do
613
620
defp log ( msg ) do
614
621
IO . puts ( "[#{ DateTime . utc_now ( :second ) } ] #{ msg } " )
615
622
end
623
+
624
+ defp totp_vault_key ( ) do
625
+ :plausible
626
+ |> Application . fetch_env! ( Plausible.Auth.TOTP )
627
+ |> Keyword . fetch! ( :vault_key )
628
+ end
616
629
end
You can’t perform that action at this time.
0 commit comments