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% %sveltekit.head%
</head> </head>
<body> <body data-sveltekit-preload-data="hover">
%sveltekit.body% <div style="display: contents">%sveltekit.body%</div>
</body> </body>
</html> </html>

View File

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

View File

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

View File

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

View File

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

View File

@ -2,5 +2,4 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
</script> </script>
<h1>{$page.status}: {$page.error?.message}</h1> <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(); updateMap();
setInterval(updateMap, 30000); setInterval(updateMap, 60000);
export const GET = (() => { export const GET = (() => {
const data = map.get("data"); const data = map.get("data");

View File

@ -1,7 +1,7 @@
import axios from "axios"; import axios from "axios";
const fetchStatus = (domain: string) => { const fetchStatus = (domain: string) => {
const req = axios("https://" + domain, { timeout: 10000 }) const req = axios("https://" + domain, { timeout: 5000 })
.then((res) => res.status) .then((res) => res.status)
.catch((error) => error.response ? error.response.status : 500); .catch((error) => error.response ? error.response.status : 500);
@ -18,6 +18,7 @@ const statusData = [
eu: "https://invidious.projectsegfau.lt/", eu: "https://invidious.projectsegfau.lt/",
us: "https://inv.us.projectsegfau.lt", us: "https://inv.us.projectsegfau.lt",
bp: "https://inv.bp.projectsegfau.lt", bp: "https://inv.bp.projectsegfau.lt",
torBp: "http://invbp.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/invidious.svg", icon: "/icons/invidious.svg",
statusEu: await fetchStatus("invidious.projectsegfau.lt"), statusEu: await fetchStatus("invidious.projectsegfau.lt"),
statusUs: await fetchStatus("inv.us.projectsegfau.lt"), statusUs: await fetchStatus("inv.us.projectsegfau.lt"),
@ -28,6 +29,7 @@ const statusData = [
description: "A frontend for Odysee.", description: "A frontend for Odysee.",
eu: "https://lbry.projectsegfau.lt/", eu: "https://lbry.projectsegfau.lt/",
geo: "https://lbry.g.projectsegfau.lt/", geo: "https://lbry.g.projectsegfau.lt/",
tor: "http://lbry.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/librarian.png", icon: "/icons/librarian.png",
statusEu: await fetchStatus("lbry.projectsegfau.lt"), statusEu: await fetchStatus("lbry.projectsegfau.lt"),
statusGeo: await fetchStatus("lbry.g.projectsegfau.lt") statusGeo: await fetchStatus("lbry.g.projectsegfau.lt")
@ -38,6 +40,7 @@ const statusData = [
eu: "https://libreddit.projectsegfau.lt/", eu: "https://libreddit.projectsegfau.lt/",
us: "https://libreddit.us.projectsegfau.lt", us: "https://libreddit.us.projectsegfau.lt",
geo: "https://libreddit.g.projectsegfau.lt/", geo: "https://libreddit.g.projectsegfau.lt/",
tor: "http://libreddit.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/libreddit.png", icon: "/icons/libreddit.png",
statusEu: await fetchStatus("libreddit.projectsegfau.lt"), statusEu: await fetchStatus("libreddit.projectsegfau.lt"),
statusUs: await fetchStatus("libreddit.us.projectsegfau.lt"), statusUs: await fetchStatus("libreddit.us.projectsegfau.lt"),
@ -49,6 +52,7 @@ const statusData = [
eu: "https://nitter.projectsegfau.lt/", eu: "https://nitter.projectsegfau.lt/",
us: "https://nitter.us.projectsegfau.lt", us: "https://nitter.us.projectsegfau.lt",
geo: "https://nitter.g.projectsegfau.lt/", geo: "https://nitter.g.projectsegfau.lt/",
tor: "http://nitter.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/nitter.png", icon: "/icons/nitter.png",
statusEu: await fetchStatus("nitter.projectsegfau.lt"), statusEu: await fetchStatus("nitter.projectsegfau.lt"),
statusUs: await fetchStatus("nitter.us.projectsegfau.lt"), statusUs: await fetchStatus("nitter.us.projectsegfau.lt"),
@ -69,6 +73,7 @@ const statusData = [
eu: "https://bb.eu.projectsegfau.lt/", eu: "https://bb.eu.projectsegfau.lt/",
us: "https://bb.us.projectsegfau.lt/", us: "https://bb.us.projectsegfau.lt/",
geo: "https://bb.g.projectsegfau.lt/", geo: "https://bb.g.projectsegfau.lt/",
tor: "http://beatbump.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/beatbump.svg", icon: "/icons/beatbump.svg",
statusEu: await fetchStatus("bb.eu.projectsegfau.lt"), statusEu: await fetchStatus("bb.eu.projectsegfau.lt"),
statusUs: await fetchStatus("bb.us.projectsegfau.lt"), statusUs: await fetchStatus("bb.us.projectsegfau.lt"),
@ -80,6 +85,7 @@ const statusData = [
eu: "https://bw.eu.projectsegfau.lt/", eu: "https://bw.eu.projectsegfau.lt/",
us: "https://bw.us.projectsegfau.lt/", us: "https://bw.us.projectsegfau.lt/",
geo: "https://bw.g.projectsegfau.lt/", geo: "https://bw.g.projectsegfau.lt/",
tor: "http://breezewiki.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
icon: "/icons/breezewiki.svg", icon: "/icons/breezewiki.svg",
statusEu: await fetchStatus("bw.eu.projectsegfau.lt"), statusEu: await fetchStatus("bw.eu.projectsegfau.lt"),
statusUs: await fetchStatus("bw.us.projectsegfau.lt"), statusUs: await fetchStatus("bw.us.projectsegfau.lt"),
@ -91,6 +97,7 @@ const statusData = [
eu: "https://scribe.eu.projectsegfau.lt/", eu: "https://scribe.eu.projectsegfau.lt/",
us: "https://scribe.us.projectsegfau.lt/", us: "https://scribe.us.projectsegfau.lt/",
geo: "https://scribe.g.projectsegfau.lt/", geo: "https://scribe.g.projectsegfau.lt/",
tor: "http://scribe.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion",
statusEu: await fetchStatus("scribe.eu.projectsegfau.lt"), statusEu: await fetchStatus("scribe.eu.projectsegfau.lt"),
statusUs: await fetchStatus("scribe.us.projectsegfau.lt"), statusUs: await fetchStatus("scribe.us.projectsegfau.lt"),
statusGeo: await fetchStatus("scribe.g.projectsegfau.lt") statusGeo: await fetchStatus("scribe.g.projectsegfau.lt")
@ -123,6 +130,20 @@ const statusData = [
eu: "https://git.projectsegfau.lt/", eu: "https://git.projectsegfau.lt/",
icon: "/icons/gitea.png", icon: "/icons/gitea.png",
statusEu: await fetchStatus("git.projectsegfau.lt") 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" title="Authors"
icon="i-fa6-solid:user" icon="i-fa6-solid:user"
/> />
<LinkButton
url="https://blog.projectsegfau.lt/rss/"
title="RSS"
icon="i-simple-icons:rss"
bg="#ee802f"
/>
</div> </div>
</Hero> </Hero>
<PostsContainer hasMt> <PostsContainer hasMt>
{#each data.posts as post} {#each data.posts as post}
<PostOuter> <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. 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 ## 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 ### Credit card

View File

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

View File

@ -2,35 +2,49 @@
import { Link } from "$lib/Card"; import { Link } from "$lib/Card";
export let url: string; export let url: string;
export let item: any; export let item: any = 200;
export let type: "geo" | "eu" | "us" | "backup"; export let type: "geo" | "eu" | "us" | "backup" | "tor" | "torBp" = "geo";
</script> </script>
<Link {#if type === "tor" || type === "torBp"}
{url} <Link
class="web {item === 200 {url}
? '' class="torcolored"
: 'pointer-events-none cursor-default opacity-50'}" >
> <div class="flex flex-row items-center gap-1">
<div class="flex items-center gap-2 text-base"> <div class="i-simple-icons:tor {type === "torBp" ? "" : "h-6 w-6"}" />
<div {#if type === "torBp"}
class={item === 200 <span class="text-base">Backup</span>
? "i-fa6-solid:arrow-up-right-from-square"
: "i-fa6-solid:xmark"}
/>
<span>
{#if item !== 200}
({item})
{/if} {/if}
{#if type === "geo"} </div>
GeoDNS </Link>
{:else if type === "eu"} {:else}
EU <Link
{:else if type === "us"} {url}
US class="web {item === 200
{:else if type === "backup"} ? ''
Backup : 'pointer-events-none cursor-default opacity-50'}"
{/if} >
</span> <div class="flex items-center gap-2 text-base">
</div> <div
</Link> class={item === 200
? "i-fa6-solid:arrow-up-right-from-square"
: "i-fa6-solid:xmark"}
/>
<span>
{#if item !== 200}
({item})
{/if}
{#if type === "geo"}
GeoDNS
{:else if type === "eu"}
EU
{:else if type === "us"}
US
{:else if type === "backup"}
Backup
{/if}
</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