v3: added opengraph support to the app, wrote README instructions incl. a Docker image

This commit is contained in:
khannurien
2026-03-26 19:55:48 +00:00
parent 0cb5a798c7
commit ca70bdc14b
26 changed files with 551 additions and 120 deletions

View File

@@ -8,10 +8,10 @@ import {
isInvitePayload,
} from "../model/interfaces.ts";
const jwtSecret = Deno.env.get("JWT_SECRET");
const jwtSecret = Deno.env.get("GERBEUR_JWT_SECRET");
if (!jwtSecret) {
throw new Error(
"JWT_SECRET environment variable is required. Generate one with: openssl rand -hex 32",
"GERBEUR_JWT_SECRET environment variable is required. Generate one with: openssl rand -hex 32",
);
}
const JWT_KEY = new TextEncoder().encode(jwtSecret);

View File

@@ -1,10 +1,13 @@
import { Context, Next } from "@oak/oak";
import { Context, Next, send } from "@oak/oak";
export default function routeStaticFilesFrom(staticPaths: string[]) {
export function routeStaticFilesFrom(staticPaths: string[]) {
return async (context: Context<Record<string, object>>, next: Next) => {
for (const path of staticPaths) {
try {
await context.send({ root: path, index: "index.html" });
await send(context, context.request.url.pathname, {
root: path,
index: "index.html",
});
return;
} catch {
continue;