@rmdes/indiekit-endpoint-activitypub 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/controllers/migrate.js +3 -1
- package/locales/en.json +19 -14
- package/package.json +1 -1
- package/views/activitypub-migrate.njk +26 -3
package/index.js
CHANGED
|
@@ -178,7 +178,7 @@ export default class ActivityPubEndpoint {
|
|
|
178
178
|
router.get("/admin/followers", followersController(mp));
|
|
179
179
|
router.get("/admin/following", followingController(mp));
|
|
180
180
|
router.get("/admin/activities", activitiesController(mp));
|
|
181
|
-
router.get("/admin/migrate", migrateGetController(mp));
|
|
181
|
+
router.get("/admin/migrate", migrateGetController(mp, this.options));
|
|
182
182
|
router.post("/admin/migrate", migratePostController(mp, this.options));
|
|
183
183
|
|
|
184
184
|
return router;
|
|
@@ -12,12 +12,13 @@ import {
|
|
|
12
12
|
bulkImportFollowers,
|
|
13
13
|
} from "../migration.js";
|
|
14
14
|
|
|
15
|
-
export function migrateGetController(mountPath) {
|
|
15
|
+
export function migrateGetController(mountPath, pluginOptions) {
|
|
16
16
|
return async (request, response, next) => {
|
|
17
17
|
try {
|
|
18
18
|
response.render("activitypub-migrate", {
|
|
19
19
|
title: response.locals.__("activitypub.migrate.title"),
|
|
20
20
|
mountPath,
|
|
21
|
+
currentAlias: pluginOptions.alsoKnownAs || "",
|
|
21
22
|
result: null,
|
|
22
23
|
});
|
|
23
24
|
} catch (error) {
|
|
@@ -94,6 +95,7 @@ export function migratePostController(mountPath, pluginOptions) {
|
|
|
94
95
|
response.render("activitypub-migrate", {
|
|
95
96
|
title: response.locals.__("activitypub.migrate.title"),
|
|
96
97
|
mountPath,
|
|
98
|
+
currentAlias: pluginOptions.alsoKnownAs || "",
|
|
97
99
|
result,
|
|
98
100
|
});
|
|
99
101
|
} catch (error) {
|
package/locales/en.json
CHANGED
|
@@ -21,23 +21,28 @@
|
|
|
21
21
|
"directionOutbound": "Sent",
|
|
22
22
|
"migrate": {
|
|
23
23
|
"title": "Mastodon migration",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
"intro": "This guide walks you through moving your Mastodon identity to your IndieWeb site. Complete each step in order — your existing followers will be notified and can re-follow you automatically.",
|
|
25
|
+
"step1Title": "Step 1 — Link your old account",
|
|
26
|
+
"step1Desc": "Tell the fediverse that your old Mastodon account and this site belong to the same person. This sets the <code>alsoKnownAs</code> property on your ActivityPub actor, which Mastodon checks before allowing a Move.",
|
|
27
|
+
"aliasLabel": "Old Mastodon account URL",
|
|
28
|
+
"aliasHint": "The full URL of your Mastodon profile, e.g. https://mstdn.social/users/rmdes",
|
|
28
29
|
"aliasSave": "Save alias",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
30
|
+
"aliasCurrent": "Current alias",
|
|
31
|
+
"aliasNone": "No alias configured yet.",
|
|
32
|
+
"step2Title": "Step 2 — Import your social graph",
|
|
33
|
+
"step2Desc": "Upload the CSV files from your Mastodon data export to bring over your connections. Go to your Mastodon instance → Preferences → Import and export → Data export to download them.",
|
|
34
|
+
"importLegend": "What to import",
|
|
35
|
+
"fileLabel": "CSV file",
|
|
36
|
+
"fileHint": "Select a CSV file from your Mastodon data export (e.g. following_accounts.csv or followers.csv)",
|
|
34
37
|
"importButton": "Import",
|
|
35
|
-
"importFollowing": "
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
38
|
+
"importFollowing": "Following list",
|
|
39
|
+
"importFollowingHint": "Accounts you follow — they will appear in your Following list immediately",
|
|
40
|
+
"importFollowers": "Followers list",
|
|
41
|
+
"importFollowersHint": "Your current followers — they will be recorded as pending until they re-follow you after the Move in step 3",
|
|
42
|
+
"step3Title": "Step 3 — Move your account",
|
|
43
|
+
"step3Desc": "Once you have saved your alias and imported your data, go to your Mastodon instance → Preferences → Account → <strong>Move to a different account</strong>. Enter your new fediverse handle and confirm. Mastodon will notify all your followers, and those whose servers support it will automatically re-follow you here. This step is irreversible — your old account will become a redirect.",
|
|
39
44
|
"success": "Imported %d following, %d followers (%d failed).",
|
|
40
|
-
"aliasSuccess": "
|
|
45
|
+
"aliasSuccess": "Alias saved — your actor document now includes this account as alsoKnownAs."
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
{% from "button/macro.njk" import button with context %}
|
|
6
6
|
{% from "checkboxes/macro.njk" import checkboxes with context %}
|
|
7
7
|
{% from "file-input/macro.njk" import fileInput with context %}
|
|
8
|
-
{% from "details/macro.njk" import details with context %}
|
|
9
8
|
{% from "notification-banner/macro.njk" import notificationBanner with context %}
|
|
10
9
|
{% from "prose/macro.njk" import prose with context %}
|
|
10
|
+
{% from "badge/macro.njk" import badge with context %}
|
|
11
11
|
|
|
12
12
|
{% block content %}
|
|
13
13
|
{{ heading({ text: title, level: 1, parent: { text: __("activitypub.title"), href: mountPath } }) }}
|
|
@@ -16,16 +16,28 @@
|
|
|
16
16
|
{{ notificationBanner({ type: result.type, text: result.text }) }}
|
|
17
17
|
{% endif %}
|
|
18
18
|
|
|
19
|
+
{{ prose({ text: __("activitypub.migrate.intro") }) }}
|
|
20
|
+
|
|
19
21
|
{# Step 1 — Actor alias #}
|
|
20
22
|
{{ heading({ text: __("activitypub.migrate.step1Title"), level: 2 }) }}
|
|
21
23
|
{{ prose({ text: __("activitypub.migrate.step1Desc") }) }}
|
|
22
24
|
|
|
25
|
+
{% if currentAlias %}
|
|
26
|
+
<p>
|
|
27
|
+
<strong>{{ __("activitypub.migrate.aliasCurrent") }}:</strong>
|
|
28
|
+
<a href="{{ currentAlias }}">{{ currentAlias }}</a>
|
|
29
|
+
</p>
|
|
30
|
+
{% else %}
|
|
31
|
+
<p><em>{{ __("activitypub.migrate.aliasNone") }}</em></p>
|
|
32
|
+
{% endif %}
|
|
33
|
+
|
|
23
34
|
<form method="post" novalidate>
|
|
24
35
|
<input type="hidden" name="action" value="alias">
|
|
25
36
|
{{ input({
|
|
26
37
|
name: "aliasUrl",
|
|
27
38
|
label: __("activitypub.migrate.aliasLabel"),
|
|
28
39
|
hint: __("activitypub.migrate.aliasHint"),
|
|
40
|
+
value: currentAlias,
|
|
29
41
|
type: "url"
|
|
30
42
|
}) }}
|
|
31
43
|
{{ button({ text: __("activitypub.migrate.aliasSave") }) }}
|
|
@@ -42,9 +54,20 @@
|
|
|
42
54
|
|
|
43
55
|
{{ checkboxes({
|
|
44
56
|
name: "importTypes",
|
|
57
|
+
fieldset: {
|
|
58
|
+
legend: __("activitypub.migrate.importLegend")
|
|
59
|
+
},
|
|
45
60
|
items: [
|
|
46
|
-
{
|
|
47
|
-
|
|
61
|
+
{
|
|
62
|
+
label: __("activitypub.migrate.importFollowing"),
|
|
63
|
+
value: "following",
|
|
64
|
+
hint: __("activitypub.migrate.importFollowingHint")
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: __("activitypub.migrate.importFollowers"),
|
|
68
|
+
value: "followers",
|
|
69
|
+
hint: __("activitypub.migrate.importFollowersHint")
|
|
70
|
+
}
|
|
48
71
|
],
|
|
49
72
|
values: ["following"]
|
|
50
73
|
}) }}
|