feat: Add new Migration extension

This commit is contained in:
Jesse Wierzbinski 2024-07-22 11:21:32 +02:00
parent 5f4d4e8a6d
commit 47ce9bd9f8
No known key found for this signature in database
2 changed files with 48 additions and 0 deletions

View file

@ -130,6 +130,7 @@ export default defineConfig({
},
{ text: "Events", link: "/extensions/events" },
{ text: "Reports", link: "/extensions/reports" },
{ text: "Migration", link: "/extensions/migration" },
{ text: "Vanity", link: "/extensions/vanity" },
{
text: "Interactivity",

View file

@ -0,0 +1,47 @@
# Migration
Sometimes, users may wish to move from one instance to another. This could be due to a change in administration, a desire to be closer to friends, or any other reason. This document outlines an extension to make the process of moving instances easier.
## User migrations
The following object is used to represent a user migration:
```json5
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "Extension",
"extension_type": "org.lysand:migration/Migration",
"author": "https://example.com/users/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"uri": "https://example.com/actions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"created_at": "2021-01-01T00:00:00.000Z",
"destination": "https://otherinstance.social/users/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
}
```
### Fields
#### Author
| Name | Type | Required |
| :----- | :--- | :------- |
| author | URI | Yes |
URI of the [Actor](../objects/actors) who initiated the action. This Actor will be the user migrating.
#### Destination
| Name | Type | Required |
| :---------- | :--- | :------- |
| destination | URI | Yes |
URI of the user's new account.
### Implementation
When an instance receives a `Migration` object, the client **SHOULD** display a notification to all followers of the migrating user. This notification **SHOULD** include a link to the user's new account.
Furthermore, all following relationships of the migrating user **SHOULD** be transferred to the new account. This includes followers, following, and any other relationship that may exist. The old account **SHOULD** be marked as inactive and display a message indicating that the user has migrated to a new account.
#### Server Actors
If the user in question is a server actor, then it should be considered that the entire instance is migrating to a new address. In this case, the above process should be applied to all users on the instance.