Remove patrons

This commit is contained in:
Laura Hausmann 2023-07-21 19:44:41 +02:00
parent 3ac4e8d9a5
commit 3e182ebd96
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
4 changed files with 0 additions and 197 deletions

View file

@ -289,7 +289,6 @@ import * as ep___pinnedUsers from "./endpoints/pinned-users.js";
import * as ep___customMOTD from "./endpoints/custom-motd.js";
import * as ep___customSplashIcons from "./endpoints/custom-splash-icons.js";
import * as ep___latestVersion from "./endpoints/latest-version.js";
import * as ep___patrons from "./endpoints/patrons.js";
import * as ep___release from "./endpoints/release.js";
import * as ep___promo_read from "./endpoints/promo/read.js";
import * as ep___requestResetPassword from "./endpoints/request-reset-password.js";
@ -643,7 +642,6 @@ const eps = [
["custom-motd", ep___customMOTD],
["custom-splash-icons", ep___customSplashIcons],
["latest-version", ep___latestVersion],
["patrons", ep___patrons],
["release", ep___release],
["promo/read", ep___promo_read],
["request-reset-password", ep___requestResetPassword],

View file

@ -1,58 +0,0 @@
import define from "../define.js";
import { redisClient } from "@/db/redis.js";
import * as fs from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
export const meta = {
tags: ["meta"],
description: "Get Firefish patrons",
requireCredential: false,
requireCredentialPrivateMode: false,
} as const;
export const paramDef = {
type: "object",
properties: {
forceUpdate: { type: "boolean", default: false },
},
required: [],
} as const;
export default define(meta, paramDef, async (ps) => {
let patrons;
const cachedPatrons = await redisClient.get("patrons");
if (!ps.forceUpdate && cachedPatrons) {
patrons = JSON.parse(cachedPatrons);
} else {
AbortSignal.timeout ??= function timeout(ms) {
const ctrl = new AbortController();
setTimeout(() => ctrl.abort(), ms);
return ctrl.signal;
};
patrons = await fetch(
"https://codeberg.org/firefish/firefish/raw/branch/develop/patrons.json",
{ signal: AbortSignal.timeout(2000) },
)
.then((response) => response.json())
.catch(() => {
const staticPatrons = JSON.parse(
fs.readFileSync(
`${_dirname}/../../../../../../patrons.json`,
"utf-8",
),
);
patrons = cachedPatrons ? JSON.parse(cachedPatrons) : staticPatrons;
});
await redisClient.set("patrons", JSON.stringify(patrons), "EX", 3600);
}
return {
patrons: patrons["patrons"],
sponsors: patrons["sponsors"],
};
});

View file

@ -109,20 +109,6 @@
v-tooltip.noDelay="i18n.ts.isBot"
><i class="ph-robot ph-bold ph-lg"></i
></span>
<span
v-if="
patrons?.includes(
`@${user.username}@${
user.host || host
}`,
)
"
v-tooltip.noDelay="i18n.ts.isPatron"
style="color: var(--badge)"
><i
class="ph-hand-coins ph-bold ph-lg"
></i
></span>
</div>
</div>
</div>
@ -201,18 +187,6 @@
v-tooltip.noDelay="i18n.ts.isBot"
><i class="ph-robot ph-bold ph-lg"></i
></span>
<span
v-if="
patrons?.includes(
`@${user.username}@${
user.host || host
}`,
)
"
v-tooltip.noDelay="i18n.ts.isPatron"
style="color: var(--badge)"
><i class="ph-hand-coins ph-bold ph-lg"></i
></span>
</div>
</div>
<div class="follow-container">
@ -467,10 +441,6 @@ const timeForThem = $computed(() => {
return "";
});
let patrons = [];
const patronsResp = await os.api("patrons");
patrons = patronsResp.patrons;
function parallaxLoop() {
parallaxAnimationId = window.requestAnimationFrame(parallaxLoop);
parallax();

View file

@ -1,107 +0,0 @@
{
"patrons": [
"@atomicpoet@firefish.social",
"@shoq@mastodon.social",
"@pikadude@erisly.social",
"@sage@stop.voring.me",
"@sky@therian.club",
"@panos@electricrequiem.com",
"@redhunt07@www.foxyhole.io",
"@griff@stop.voring.me",
"@cafkafk@ck.cafkafk.com",
"@privateger@plasmatrap.com",
"@effye@toot.thoughtworks.com",
"@Kio@kitsunes.club",
"@twann@tech.lgbt",
"@surfbum@firefish.nz",
"@topher@mastodon.online",
"@hanicef@stop.voring.me",
"@nmkj@firefish.jp",
"@unattributed@firefish.social",
"@cody@misskey.codingneko.com",
"@kate@blahaj.zone",
"@emtk@mkkey.net",
"@jovikowi@firefish.social",
"@padraig@firefish.social",
"@pancakes@cats.city",
"@theresmiling@firefish.social",
"@AlderForrest@firefish.social",
"@kristian@firefish.social",
"@jo@blahaj.zone",
"@narF@firefish.social",
"@AlderForrest@firefish.social",
"@box464@firefish.social",
"@MariaTheMartian@firefish.social",
"@nisemikol@firefish.social",
"@smallpatatas@blahaj.zone",
"@bayra@stop.voring.me",
"@frost@wolfdo.gg",
"@joebiden@fuckgov.org",
"@nyaa@firefish.social",
"@Dan@firefish.social",
"@dana@firefish.social",
"@Jdreben@firefish.social",
"@natalie@prismst.one",
"@KelsonV@wandering.shop",
"@breakfastmtn@firefish.social",
"@richardazia@mastodon.social",
"@joestone@firefish.social",
"@aj@firefish.social",
"@zepfanman@ramblingreaders.org",
"@kimby@stop.voring.me",
"@fyrfli@bkgrdclrschm.link",
"@riversidebryan@firefish.lgbt",
"@aRubes@sloth.run",
"@andreasdotorg@firefish.social",
"@ozzy@firefish.online",
"@leni@windycity.style",
"@mhzmodels@firefish.art",
"@ReflexVE@firefish.social",
"@mark@firefish.social",
"@skyizwhite@himagine.club",
"@Uwu@firefish.social",
"@jGoose@firefish.social",
"@kunev@blewsky.social",
"@Simoto@electricrequiem.com",
"@Evoterra@firefish.social",
"@LauraLangdon@procial.tchncs.de",
"@mho@social.heise.de",
"@richardazia@firefish.social",
"@blues653@firefish.social",
"@rafale_blue@calc.04.si",
"@esm@lethallava.land",
"@vmstan@vmst.io",
"@jtbennett@noc.social",
"@renere@distance.blue",
"@theking@kitsunes.club",
"@toof@fedi.toofie.net",
"@Punko@firefish.social",
"@joesbrat67@firefish.social",
"@arth@firefish.social",
"@octofloofy@ck.octofloofy.ink",
"@pauliehedron@infosec.town",
"@soulthunk@lethallava.land",
"@bumble@ibe.social",
"@DarrenNevares@firefish.social",
"@irfan@firefish.social",
"@dvd@dvd.chat",
"@charlie2alpha@electricrequiem.com",
"@arndot@layer8.space",
"@ryan@c.ryanccn.dev",
"@lapastora_deprova@firefish.social",
"@rameez@firefish.social",
"@dracoling@firetribe.org",
"@Space6host@firefish.social",
"@zakalwe@plasmatrap.com",
"@seasicksailor@firefish.social",
"@geerue@firefish.social",
"@WXFanatic@m.ai6yr.org",
"@Hunkabilly@firefish.world"
],
"sponsors": [
"@atomicpoet@firefish.social",
"@unattributed@firefish.social",
"@jtbennett@noc.social",
"\nInterkosmos Link"
]
}