make status api faster, fix donate, add services

This commit is contained in:
Akis 2023-01-02 21:12:06 +02:00
parent d768ad1704
commit 76435cc3d2
Signed by untrusted user: akis
GPG Key ID: 267BF5C6677944ED
14 changed files with 97 additions and 41 deletions

View File

@ -12,7 +12,7 @@
/>
%sveltekit.head%
</head>
<body>
%sveltekit.body%
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@ -42,4 +42,8 @@
.githubcolored {
@apply bg-alt text-alt-text;
}
.torcolored {
@apply bg-[#7d4698] text-white;
}
</style>

View File

@ -1,3 +1,3 @@
<div class="flex flex-row gap-2">
<div class="flex flex-row flex-wrap gap-2">
<slot />
</div>

View File

@ -84,7 +84,6 @@
>
{#each menus as { url, name, external }}
<a
data-sveltekit-preload-data
class:active={url !== "/"
? currentPage.match(url)
: url === currentPage}

View File

@ -7,7 +7,7 @@
},
{
"name": "Arya",
"description": "Libre Software Enthusiast and ProjectSegfault SysAdmin",
"description": "Libre Software Enthusiast and Project Segfault Sysadmin",
"position": "Sysadmin",
"website": "https://aryak.vern.cc",
"matrix": "https://matrix.to/#/@aryak:projectsegfau.lt",

View File

@ -3,4 +3,3 @@
</script>
<h1>{$page.status}: {$page.error?.message}</h1>
<span class="italic">The fetch request to the API probably failed, please contact us on Matrix.</span>

View File

@ -12,7 +12,7 @@ const updateMap = () => {
updateMap();
setInterval(updateMap, 30000);
setInterval(updateMap, 60000);
export const GET = (() => {
const data = map.get("data");

View File

@ -1,7 +1,7 @@
import axios from "axios";
const fetchStatus = (domain: string) => {
const req = axios("https://" + domain, { timeout: 10000 })
const req = axios("https://" + domain, { timeout: 5000 })
.then((res) => res.status)
.catch((error) => error.response ? error.response.status : 500);
@ -18,6 +18,7 @@ const statusData = [
eu: "https://invidious.projectsegfau.lt/",
us: "https://inv.us.projectsegfau.lt",
bp: "https://inv.bp.projectsegfau.lt",
torBp: "http://invbp.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/invidious.svg",
statusEu: await fetchStatus("invidious.projectsegfau.lt"),
statusUs: await fetchStatus("inv.us.projectsegfau.lt"),
@ -28,6 +29,7 @@ const statusData = [
description: "A frontend for Odysee.",
eu: "https://lbry.projectsegfau.lt/",
geo: "https://lbry.g.projectsegfau.lt/",
tor: "http://lbry.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/librarian.png",
statusEu: await fetchStatus("lbry.projectsegfau.lt"),
statusGeo: await fetchStatus("lbry.g.projectsegfau.lt")
@ -38,6 +40,7 @@ const statusData = [
eu: "https://libreddit.projectsegfau.lt/",
us: "https://libreddit.us.projectsegfau.lt",
geo: "https://libreddit.g.projectsegfau.lt/",
tor: "http://libreddit.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/libreddit.png",
statusEu: await fetchStatus("libreddit.projectsegfau.lt"),
statusUs: await fetchStatus("libreddit.us.projectsegfau.lt"),
@ -49,6 +52,7 @@ const statusData = [
eu: "https://nitter.projectsegfau.lt/",
us: "https://nitter.us.projectsegfau.lt",
geo: "https://nitter.g.projectsegfau.lt/",
tor: "http://nitter.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/nitter.png",
statusEu: await fetchStatus("nitter.projectsegfau.lt"),
statusUs: await fetchStatus("nitter.us.projectsegfau.lt"),
@ -69,6 +73,7 @@ const statusData = [
eu: "https://bb.eu.projectsegfau.lt/",
us: "https://bb.us.projectsegfau.lt/",
geo: "https://bb.g.projectsegfau.lt/",
tor: "http://beatbump.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/beatbump.svg",
statusEu: await fetchStatus("bb.eu.projectsegfau.lt"),
statusUs: await fetchStatus("bb.us.projectsegfau.lt"),
@ -80,6 +85,7 @@ const statusData = [
eu: "https://bw.eu.projectsegfau.lt/",
us: "https://bw.us.projectsegfau.lt/",
geo: "https://bw.g.projectsegfau.lt/",
tor: "http://breezewiki.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/breezewiki.svg",
statusEu: await fetchStatus("bw.eu.projectsegfau.lt"),
statusUs: await fetchStatus("bw.us.projectsegfau.lt"),
@ -91,6 +97,7 @@ const statusData = [
eu: "https://scribe.eu.projectsegfau.lt/",
us: "https://scribe.us.projectsegfau.lt/",
geo: "https://scribe.g.projectsegfau.lt/",
tor: "http://scribe.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
statusEu: await fetchStatus("scribe.eu.projectsegfau.lt"),
statusUs: await fetchStatus("scribe.us.projectsegfau.lt"),
statusGeo: await fetchStatus("scribe.g.projectsegfau.lt")
@ -123,6 +130,20 @@ const statusData = [
eu: "https://git.projectsegfau.lt/",
icon: "/icons/gitea.png",
statusEu: await fetchStatus("git.projectsegfau.lt")
},
{
name: "Akkoma",
description: "Federated microblogging platform.",
eu: "https://social.projectsegfau.lt/",
icon: "/icons/akkoma.png",
statusEu: await fetchStatus("social.projectsegfau.lt")
},
{
name: "Vikunja",
description: "A task management platform.",
eu: "https://todo.projectsegfau.lt/",
icon: "/icons/vikunja.png",
statusEu: await fetchStatus("todo.projectsegfau.lt")
}
]
},

View File

@ -31,9 +31,14 @@
title="Authors"
icon="i-fa6-solid:user"
/>
<LinkButton
url="https://blog.projectsegfau.lt/rss/"
title="RSS"
icon="i-simple-icons:rss"
bg="#ee802f"
/>
</div>
</Hero>
<PostsContainer hasMt>
{#each data.posts as post}
<PostOuter>

View File

@ -16,7 +16,7 @@ title: Donate
These donations primarily help us pay for our VPSes, domain names and other expenses related to crucial infrastructure we have to maintain. We also sometimes donate to developers who maintain software we rely heavily on such as our authentication provider.
## Donation methods
You can currently donate by credit card through [Liberapay](https://liberaypay.com) and cryptocurrencies.
You can currently donate by credit card through [Liberapay](https://liberapay.com) and cryptocurrencies.
### Credit card

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { CardInner, CardOuter, LinksOuter } from "$lib/Card";
import { CardInner, CardOuter, LinksOuter, Link } from "$lib/Card";
import InstanceLink from "./InstanceLink.svelte";
import dayjs from "dayjs";
import type { PageData } from "./$types";
@ -61,6 +61,20 @@
type="backup"
/>
{/if}
{#if item.tor}
<InstanceLink
url={item.tor}
type="tor"
/>
{/if}
{#if item.torBp}
<InstanceLink
url={item.torBp}
type="torBp"
/>
{/if}
</LinksOuter>
</CardInner>
{/each}

View File

@ -2,10 +2,23 @@
import { Link } from "$lib/Card";
export let url: string;
export let item: any;
export let type: "geo" | "eu" | "us" | "backup";
export let item: any = 200;
export let type: "geo" | "eu" | "us" | "backup" | "tor" | "torBp" = "geo";
</script>
{#if type === "tor" || type === "torBp"}
<Link
{url}
class="torcolored"
>
<div class="flex flex-row items-center gap-1">
<div class="i-simple-icons:tor {type === "torBp" ? "" : "h-6 w-6"}" />
{#if type === "torBp"}
<span class="text-base">Backup</span>
{/if}
</div>
</Link>
{:else}
<Link
{url}
class="web {item === 200
@ -34,3 +47,4 @@
</span>
</div>
</Link>
{/if}

BIN
static/icons/akkoma.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/icons/vikunja.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB