feat(federation): Store remote instance shared inbox and extensions as well

This commit is contained in:
Jesse Wierzbinski 2024-11-25 20:37:00 +01:00
parent 5fc6c4dcfa
commit 7a73a1a24e
No known key found for this signature in database
6 changed files with 2253 additions and 1 deletions

View file

@ -10,7 +10,7 @@ Versia Server `0.8.0` is fully backwards compatible with `0.7.0`.
- Added an administration UI for managing the queue. - Added an administration UI for managing the queue.
- Upgraded Bun to `1.1.36`. - Upgraded Bun to `1.1.36`.
- Implemented support for the [Instance Messaging Extension](https://versia.pub/extensions/instance-messaging) - Implemented support for the [Instance Messaging Extension](https://versia.pub/extensions/instance-messaging)
- Implement [Shared Inboxes](https://versia.pub/federation#inboxes) - Implement [Shared Inboxes](https://versia.pub/federation#inboxes) support.
- Allowed `<div>` and `<span>` tags in Markdown. - Allowed `<div>` and `<span>` tags in Markdown.
- Added `--password` flag to the user creation CLI. - Added `--password` flag to the user creation CLI.

View file

@ -359,6 +359,8 @@ export class Instance extends BaseInterface<typeof Instances> {
logo: metadata.logo, logo: metadata.logo,
protocol, protocol,
publicKey: metadata.public_key, publicKey: metadata.public_key,
inbox: metadata.shared_inbox ?? null,
extensions: metadata.extensions ?? null,
}); });
} }
@ -382,6 +384,8 @@ export class Instance extends BaseInterface<typeof Instances> {
logo: metadata.logo, logo: metadata.logo,
protocol, protocol,
publicKey: metadata.public_key, publicKey: metadata.public_key,
inbox: metadata.shared_inbox ?? null,
extensions: metadata.extensions ?? null,
}); });
return this; return this;

View file

@ -0,0 +1,2 @@
ALTER TABLE "Instances" ADD COLUMN "inbox" text;--> statement-breakpoint
ALTER TABLE "Instances" ADD COLUMN "extensions" jsonb;

File diff suppressed because it is too large Load diff

View file

@ -253,6 +253,13 @@
"when": 1732398961365, "when": 1732398961365,
"tag": "0035_pretty_whiplash", "tag": "0035_pretty_whiplash",
"breakpoints": true "breakpoints": true
},
{
"idx": 36,
"version": "7",
"when": 1732563077877,
"tag": "0036_cuddly_ironclad",
"breakpoints": true
} }
] ]
} }

View file

@ -351,7 +351,9 @@ export const Instances = pgTable("Instances", {
.notNull() .notNull()
.$type<"versia" | "activitypub">() .$type<"versia" | "activitypub">()
.default("versia"), .default("versia"),
inbox: text("inbox"),
publicKey: jsonb("public_key").$type<InstanceMetadata["public_key"]>(), publicKey: jsonb("public_key").$type<InstanceMetadata["public_key"]>(),
extensions: jsonb("extensions").$type<InstanceMetadata["extensions"]>(),
}); });
export const OpenIdAccounts = pgTable("OpenIdAccounts", { export const OpenIdAccounts = pgTable("OpenIdAccounts", {