From d576b3ef7655a42128eafb0224be2d2219e5338f Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 4 Mar 2021 22:26:52 +1300 Subject: [PATCH] Remove unblocker It does not work. It was created for an older era when the user page was most heavily restricted, and graphql timeline was free. So the visitor would look up the username-userID relationship on the instance's behalf, and submit that for the instance to check, and then that profile would be unblocked forever because the user page is not needed after that point. Now, the user page is free, and graphql timeline can be impossible. (Still haven't worked that out yet.) So the unblocker would only be fetching information that the instance could already get. Even if the instance was somehow blocked from the user page, the unblocker would not help, since it only fetches the username-userID relationship for use with graphql timeline, and graphql timeline is currently blocked on the instance too. Keeping this in Bibliogram is misleading to visitors and the backing code is now useless. The correct way to view profiles is to run your own Bibliogram. --- src/site/api/feed.js | 6 ++---- src/site/api/routes.js | 18 +----------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/site/api/feed.js b/src/site/api/feed.js index 89f1902..0ec764c 100644 --- a/src/site/api/feed.js +++ b/src/site/api/feed.js @@ -71,7 +71,7 @@ module.exports = [ message: "This user doesn't exist.", withInstancesLink: false }) - } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN || error === constants.symbols.RATE_LIMITED) { + } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN || error === constants.symbols.RATE_LIMITED || error === constants.symbols.INSTAGRAM_BLOCK_TYPE_DECEMBER) { return { statusCode: 503, contentType: "text/html", @@ -79,10 +79,8 @@ module.exports = [ "Cache-Control": `public, max-age=${userRequestCache.getTtl("user/"+fill[0], 1000)}`, "Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000) }, - content: pugCache.get("pug/blocked.pug").web({ + content: pugCache.get("pug/blocked_december.pug").web({ website_origin: constants.website_origin, - username: fill[0], - expiresMinutes: userRequestCache.getTtl("user/"+fill[0], 1000*60), getStaticURL }) } diff --git a/src/site/api/routes.js b/src/site/api/routes.js index 8fb6dd0..b7fdda4 100644 --- a/src/site/api/routes.js +++ b/src/site/api/routes.js @@ -138,23 +138,7 @@ module.exports = [ withInstancesLink: false, settings }) - } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN) { - return { - statusCode: 503, - contentType: "text/html", - headers: { - "Retry-After": userRequestCache.getTtl("user/"+username, 1000) - }, - content: pugCache.get("pug/blocked.pug").web({ - website_origin: constants.website_origin, - username, - expiresMinutes: userRequestCache.getTtl("user/"+username, 1000*60), - getStaticURL, - settings, - lang - }) - } - } else if (error === constants.symbols.INSTAGRAM_BLOCK_TYPE_DECEMBER) { + } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN || error === constants.symbols.INSTAGRAM_BLOCK_TYPE_DECEMBER) { return render(503, "pug/blocked_december.pug") } else if (error === constants.symbols.RATE_LIMITED) { return render(503, "pug/blocked_graphql.pug")