Various changes to get the server to launch again

This commit is contained in:
Steffo 2024-10-21 03:47:04 +02:00
parent f490404fb6
commit 4cb2e53ace
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
3 changed files with 8 additions and 5 deletions

4
.vscode/launch.json vendored
View file

@ -19,7 +19,7 @@
"--allow-read='.,$HOME/.cache/deno,$HOME/.cache/node_modules'", "--allow-read='.,$HOME/.cache/deno,$HOME/.cache/node_modules'",
"--allow-env=DOTINO_POSTGRES_STRING,DOTINO_STRATZ_URL,DOTINO_STRATZ_KEY", "--allow-env=DOTINO_POSTGRES_STRING,DOTINO_STRATZ_URL,DOTINO_STRATZ_KEY",
"--allow-sys=uid,gid", "--allow-sys=uid,gid",
"--allow-net=0.0.0.0:8080", "--allow-net",
"--inspect-wait", "--inspect-wait",
"src/main.ts" "src/main.ts"
], ],
@ -40,7 +40,7 @@
"--allow-read='.'", "--allow-read='.'",
"--allow-env=DOTINO_POSTGRES_STRING", "--allow-env=DOTINO_POSTGRES_STRING",
"--allow-sys=uid,gid", "--allow-sys=uid,gid",
"--allow-net=0.0.0.0:8080", "--allow-net",
"--inspect-wait", "--inspect-wait",
"src/database/init/index.ts" "src/database/init/index.ts"
], ],

View file

@ -18,7 +18,7 @@ export function doServe(router: Deno.ServeHandler) {
async onError(error) { async onError(error) {
l.error`Error caught at the serve boundary: ${error}` l.error`Error caught at the serve boundary: ${error}`
return new Response( return new Response(
"An internal server error has occoured.", "An internal server error has occurred.",
{ {
status: 500, status: 500,
} }

View file

@ -1,5 +1,5 @@
// deno-lint-ignore-file require-await // deno-lint-ignore-file require-await
import { createFederation, Person, Application, Image, PropertyValue, Organization, Federation, KvStore, Context, Actor, Follow } from "@fedify/fedify" import { createFederation, Person, Application, Image, PropertyValue, Organization, Federation, KvStore, Context, Actor, Follow, Endpoints } from "@fedify/fedify"
import { getLogger } from "https://jsr.io/@logtape/logtape/0.6.3/logtape/logger.ts" import { getLogger } from "https://jsr.io/@logtape/logtape/0.6.3/logtape/logger.ts"
import { escapeHtml } from "@@x/escape" import { escapeHtml } from "@@x/escape"
import { StratzAPI } from "../stratz/api.ts" import { StratzAPI } from "../stratz/api.ts"
@ -23,7 +23,7 @@ export class DotinoVeloce {
this.federation this.federation
.setActorDispatcher("/users/{identifier}", this.#actorHandler.bind(this)) .setActorDispatcher("/users/{identifier}", this.#actorHandler.bind(this))
.mapHandle(this.#actorMapper.bind(this)) .mapHandle(this.#actorMapper.bind(this))
.setKeyPairsDispatcher(this.#actorKeys.bind(this)) // .setKeyPairsDispatcher(this.#actorKeys.bind(this))
this.federation this.federation
.setInboxListeners("/inbox/{identifier}", "/inbox") .setInboxListeners("/inbox/{identifier}", "/inbox")
@ -35,6 +35,9 @@ export class DotinoVeloce {
const properties = { const properties = {
id: ctx.getActorUri(handle), id: ctx.getActorUri(handle),
inbox: ctx.getInboxUri(handle), inbox: ctx.getInboxUri(handle),
endpoints: new Endpoints({
sharedInbox: ctx.getInboxUri(),
}),
preferredUsername: handle, preferredUsername: handle,
// Akkoma expects URL to be equal to ID // Akkoma expects URL to be equal to ID
// Or does it? This makes no sense to me... // Or does it? This makes no sense to me...