Some progress towards accepting and rejecting follows #3

Merged
steffo merged 22 commits from feature/follows into main 2024-10-23 05:47:18 +00:00
3 changed files with 8 additions and 5 deletions
Showing only changes of commit 4cb2e53ace - Show all commits

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...