From fc7d6d3642dd5dab80e978d692db8f3964dd2ee0 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 20 Mar 2022 14:28:38 -0400 Subject: [PATCH] Fix running w/o AP keys setup --- lib/activitypub/actor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/activitypub/actor.ts b/lib/activitypub/actor.ts index 8f69787..61ce816 100644 --- a/lib/activitypub/actor.ts +++ b/lib/activitypub/actor.ts @@ -2,9 +2,13 @@ import express, { Router } from "express"; import { promises as fs } from "fs"; const domain = process.env.DOMAIN; +const pubKeyPemPath = process.env.PUB_KEY_PEM; export default async function actor(router: Router) { - const pubKeyPem = (await fs.readFile(process.env.PUB_KEY_PEM!)).toString(); + if (!pubKeyPemPath) { + return; + } + const pubKeyPem = (await fs.readFile(pubKeyPemPath)).toString(); const actorObj = { "@context": [ "https://www.w3.org/ns/activitystreams",