diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 311a19618..d4bd4a2b1 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -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], diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts deleted file mode 100644 index cd93b5e3d..000000000 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ /dev/null @@ -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"], - }; -}); diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index a7fab507d..b1fc07443 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -109,20 +109,6 @@ v-tooltip.noDelay="i18n.ts.isBot" > - @@ -201,18 +187,6 @@ v-tooltip.noDelay="i18n.ts.isBot" > -
@@ -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(); diff --git a/patrons.json b/patrons.json deleted file mode 100644 index 6544466b9..000000000 --- a/patrons.json +++ /dev/null @@ -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" - ] -}