Some progress towards accepting and rejecting follows #3
5 changed files with 23 additions and 20 deletions
15
.vscode/launch.json
vendored
15
.vscode/launch.json
vendored
|
@ -8,35 +8,32 @@
|
|||
"request": "launch",
|
||||
"name": "Reinitialize database",
|
||||
"type": "node",
|
||||
"program": "${workspaceFolder}/src/entry/dbInit.ts",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"envFile": "${workspaceFolder}/local.env",
|
||||
"runtimeExecutable": "/usr/bin/deno",
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"--watch",
|
||||
"--no-prompt",
|
||||
"--allow-all",
|
||||
"--inspect-wait"
|
||||
],
|
||||
"program": "${workspaceFolder}/src/entry/dbInit.ts",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"envFile": "${workspaceFolder}/local.env",
|
||||
"attachSimplePort": 9229
|
||||
},
|
||||
{
|
||||
"request": "launch",
|
||||
"name": "Dev Server",
|
||||
"type": "node",
|
||||
"program": "${workspaceFolder}/src/entry/server.ts",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"envFile": "${workspaceFolder}/local.env",
|
||||
"runtimeExecutable": "/usr/bin/deno",
|
||||
"restart": true,
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"--watch",
|
||||
"--no-prompt",
|
||||
"--allow-all",
|
||||
"--inspect-wait"
|
||||
],
|
||||
"program": "${workspaceFolder}/src/entry/server.ts",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"envFile": "${workspaceFolder}/local.env",
|
||||
"attachSimplePort": 9229
|
||||
}
|
||||
]
|
||||
|
|
|
@ -12,15 +12,14 @@ export function createRouter(ap: DotinoVeloce) {
|
|||
|
||||
l.debug`Determining request's User-Agent...`
|
||||
const agent = request.headers.get("User-Agent")
|
||||
l.debug`Request's User-Agent is: ${agent}`
|
||||
|
||||
l.debug`Determining request's URL...`
|
||||
const url = new URL(request.url)
|
||||
l.debug`Request's URL is: ${url}`
|
||||
|
||||
l.debug`Determining request's pathname...`
|
||||
const pathname = url.pathname
|
||||
l.debug`Request's pathname is: ${pathname}`
|
||||
|
||||
l.info`User-Agent: ${agent} | URL: ${url} | Pathname: ${pathname}`
|
||||
|
||||
if (url.pathname === "/favicon.ico") {
|
||||
l.debug`Delegating handling to favicon handler...`
|
||||
|
|
|
@ -34,7 +34,7 @@ export class DotinoVeloce {
|
|||
.setInboxListeners("/inbox/{identifier}", "/inbox")
|
||||
// Akkoma with Authorized Fetch requires this to be set
|
||||
// https://p.junimo.party/#/junimo.party/s/AnFW6s3OURPMY04LKq?view=full
|
||||
.setSharedKeyDispatcher((_ctx: Context<ContextData>) => ({ identifier: "service" }))
|
||||
.setSharedKeyDispatcher(this.#instanceKeys.bind(this))
|
||||
.on(Follow, this.#followHandler.bind(this))
|
||||
|
||||
this.federation
|
||||
|
@ -43,7 +43,7 @@ export class DotinoVeloce {
|
|||
// TODO: Setup a message queue
|
||||
}
|
||||
|
||||
async #nodeInfoHandler(ctx: Context<ContextData>): Promise<NodeInfo> {
|
||||
async #nodeInfoHandler(_ctx: Context<ContextData>): Promise<NodeInfo> {
|
||||
return {
|
||||
software: {
|
||||
name: "dotino-veloce",
|
||||
|
@ -282,6 +282,11 @@ export class DotinoVeloce {
|
|||
return result
|
||||
}
|
||||
|
||||
async #instanceKeys(_ctx: Context<ContextData>): Promise<{ identifier: string }> {
|
||||
l.debug`Getting instance keys...`
|
||||
return {"identifier": "garasauto"}
|
||||
}
|
||||
|
||||
async #authorizationHandler(_ctx: Context<ContextData>, _handle: string, _signedKey: unknown, _signedKeyOwner: unknown): Promise<boolean> {
|
||||
return true
|
||||
}
|
||||
|
@ -322,5 +327,7 @@ export class DotinoVeloce {
|
|||
l.debug`Attempting to determine target of the follow request...`
|
||||
const target = await follow.getTarget(ctx)
|
||||
l.debug`Target is: ${target}`
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ import { Database } from "../database/index.ts"
|
|||
import { initLogging } from "../deno/logging.ts"
|
||||
|
||||
|
||||
async function main() {
|
||||
async function entryDbInit() {
|
||||
await initLogging()
|
||||
const db = Database.fromEnv()
|
||||
await db.reinitializeDev()
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
entryDbInit()
|
||||
|
|
|
@ -7,7 +7,7 @@ import { DotinoVeloce } from "../dv/index.ts"
|
|||
import { Database } from "../database/index.ts"
|
||||
|
||||
|
||||
async function main() {
|
||||
async function entryServer() {
|
||||
await initLogging()
|
||||
const db = Database.fromEnv()
|
||||
const stratz = StratzAPI.fromEnv()
|
||||
|
@ -18,4 +18,4 @@ async function main() {
|
|||
}
|
||||
|
||||
|
||||
main()
|
||||
entryServer()
|
||||
|
|
Loading…
Reference in a new issue