Fix running w/o AP keys setup

This commit is contained in:
Shadowfacts 2022-03-20 14:28:38 -04:00
parent 30e1aa23e7
commit fc7d6d3642
1 changed files with 5 additions and 1 deletions

View File

@ -2,9 +2,13 @@ import express, { Router } from "express";
import { promises as fs } from "fs"; import { promises as fs } from "fs";
const domain = process.env.DOMAIN; const domain = process.env.DOMAIN;
const pubKeyPemPath = process.env.PUB_KEY_PEM;
export default async function actor(router: Router) { 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 = { const actorObj = {
"@context": [ "@context": [
"https://www.w3.org/ns/activitystreams", "https://www.w3.org/ns/activitystreams",