From 3b2c7a33a9fe151b65724f9076a4ef93ad1d6948 Mon Sep 17 00:00:00 2001
From: Yann Klis <yann.klis@gmail.com>
Date: Mon, 26 Mar 2018 12:47:34 +0200
Subject: [PATCH 1/2] Missing OTP_SECRET in scalingo.json (#6917)

---
 scalingo.json | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scalingo.json b/scalingo.json
index 426698b9cc..0cc648f02b 100644
--- a/scalingo.json
+++ b/scalingo.json
@@ -21,6 +21,10 @@
       "description": "The secret key base",
       "generator": "secret"
     },
+    "OTP_SECRET": {
+      "description": "One-time password secret",
+      "generator": "secret"
+    },
     "SINGLE_USER_MODE": {
       "description": "Should the instance run in single user mode? (Disable registrations, redirect to front page)",
       "value": "false",

From 605a92b4607589c64acf9c5cb58d2fcc68e2606a Mon Sep 17 00:00:00 2001
From: unarist <m.unarist@gmail.com>
Date: Mon, 26 Mar 2018 19:48:01 +0900
Subject: [PATCH 2/2] Fix moved account handling in IndexedDB feature (#6915)

* Fix stack overflow on importFetchedAccounts

  When the account has moved property, it should process destination
  account instead of source account itself.

* Set account id instead of account object for moved property

  This restores "foo has moved to" indication on account view, and
  fixes `reblog` index on `accounts` object store.
---
 app/javascript/mastodon/actions/importer/index.js      | 2 +-
 app/javascript/mastodon/actions/importer/normalizer.js | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/javascript/mastodon/actions/importer/index.js b/app/javascript/mastodon/actions/importer/index.js
index d1ea40c360..a97f4d173c 100644
--- a/app/javascript/mastodon/actions/importer/index.js
+++ b/app/javascript/mastodon/actions/importer/index.js
@@ -39,7 +39,7 @@ export function importFetchedAccounts(accounts) {
     pushUnique(normalAccounts, normalizeAccount(account));
 
     if (account.moved) {
-      processAccount(account);
+      processAccount(account.moved);
     }
   }
 
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index c88f6946fe..1b09f319ff 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -10,6 +10,10 @@ export function normalizeAccount(account) {
   account.display_name_html = emojify(escapeTextContentForBrowser(displayName));
   account.note_emojified = emojify(account.note);
 
+  if (account.moved) {
+    account.moved = account.moved.id;
+  }
+
   return account;
 }